From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB
---
kernel/drivers/media/i2c/imx464.c | 33 ++++++++++-----------------------
1 files changed, 10 insertions(+), 23 deletions(-)
diff --git a/kernel/drivers/media/i2c/imx464.c b/kernel/drivers/media/i2c/imx464.c
index 8d6c04b..142550a 100644
--- a/kernel/drivers/media/i2c/imx464.c
+++ b/kernel/drivers/media/i2c/imx464.c
@@ -10,7 +10,6 @@
* V0.0X01.0X03 support enum sensor fmt
*/
-//#define DEBUG
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/delay.h>
@@ -165,14 +164,6 @@
struct regval {
u16 addr;
u8 val;
-};
-
-enum IMX464_max_pad {
- PAD0, /* link to isp */
- PAD1, /* link to csi wr0 | hdr x2:L x3:M */
- PAD2, /* link to csi wr1 | hdr x3:L */
- PAD3, /* link to csi wr2 | hdr x2:M x3:S */
- PAD_MAX,
};
struct IMX464_mode {
@@ -1695,14 +1686,12 @@
struct IMX464 *IMX464 = to_IMX464(sd);
const struct IMX464_mode *mode = IMX464->cur_mode;
- mutex_lock(&IMX464->mutex);
fi->interval = mode->max_fps;
- mutex_unlock(&IMX464->mutex);
return 0;
}
-static int IMX464_g_mbus_config(struct v4l2_subdev *sd,
+static int IMX464_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad_id,
struct v4l2_mbus_config *config)
{
struct IMX464 *IMX464 = to_IMX464(sd);
@@ -1727,7 +1716,7 @@
V4L2_MBUS_CSI2_CHANNEL_1 |
V4L2_MBUS_CSI2_CHANNEL_2;
- config->type = V4L2_MBUS_CSI2;
+ config->type = V4L2_MBUS_CSI2_DPHY;
config->flags = val;
return 0;
@@ -1865,7 +1854,7 @@
__LINE__, rhs1, s_exp_time, rhs1_old,
(rhs1_old + 2 * BRL - fsc + 2));
- rhs1 = (rhs1 >> 2) * 4 + 1;
+ rhs1 = ((rhs1 + 3) >> 2) * 4 + 1;
rhs1_old = rhs1;
if (rhs1 - s_exp_time <= SHR1_MIN) {
@@ -2287,7 +2276,7 @@
static int IMX464_get_channel_info(struct IMX464 *IMX464, struct rkmodule_channel_info *ch_info)
{
- if (ch_info->index >= PAD_MAX)
+ if (ch_info->index < PAD0 || ch_info->index >= PAD_MAX)
return -EINVAL;
ch_info->vc = IMX464->cur_mode->vc[ch_info->index];
ch_info->width = IMX464->cur_mode->width;
@@ -2346,8 +2335,7 @@
IMX464_VTS_MAX - IMX464->cur_mode->height,
1, h);
IMX464->cur_vts = IMX464->cur_mode->vts_def;
- pixel_rate = (u32)link_freq_menu_items[IMX464->cur_mode->mipi_freq_idx] /
- IMX464->cur_mode->bpp * 2 *
+ pixel_rate = (u32)link_freq_menu_items[IMX464->cur_mode->mipi_freq_idx] / IMX464->cur_mode->bpp * 2 *
IMX464->bus_cfg.bus.mipi_csi2.num_data_lanes;
__v4l2_ctrl_s_ctrl_int64(IMX464->pixel_rate,
pixel_rate);
@@ -2875,7 +2863,6 @@
static const struct v4l2_subdev_video_ops IMX464_video_ops = {
.s_stream = IMX464_s_stream,
.g_frame_interval = IMX464_g_frame_interval,
- .g_mbus_config = IMX464_g_mbus_config,
};
static const struct v4l2_subdev_pad_ops IMX464_pad_ops = {
@@ -2885,6 +2872,7 @@
.get_fmt = IMX464_get_fmt,
.set_fmt = IMX464_set_fmt,
.get_selection = IMX464_get_selection,
+ .get_mbus_config = IMX464_g_mbus_config,
};
static const struct v4l2_subdev_ops IMX464_subdev_ops = {
@@ -2935,7 +2923,7 @@
ret |= imx464_write_reg(IMX464->client, IMX464_LF_EXPO_REG_H,
IMX464_REG_VALUE_08BIT,
IMX464_FETCH_EXP_H(shr0));
- dev_dbg(&client->dev, "set exposure 0x%x\n",
+ dev_err(&client->dev, "set exposure 0x%x\n",
ctrl->val);
}
break;
@@ -2947,7 +2935,7 @@
ret |= imx464_write_reg(IMX464->client, IMX464_LF_GAIN_REG_L,
IMX464_REG_VALUE_08BIT,
IMX464_FETCH_GAIN_L(ctrl->val));
- dev_dbg(&client->dev, "set analog gain 0x%x\n",
+ dev_err(&client->dev, "set analog gain 0x%x\n",
ctrl->val);
}
break;
@@ -2975,7 +2963,8 @@
IMX464_REG_VALUE_08BIT,
IMX464_FETCH_VTS_H(vts));
- dev_dbg(&client->dev, "set vts 0x%x\n", vts);
+ dev_err(&client->dev, "set vts 0x%x\n",
+ vts);
break;
case V4L2_CID_HFLIP:
ret = imx464_write_reg(client,
@@ -3366,7 +3355,6 @@
#if IS_ENABLED(CONFIG_OF)
static const struct of_device_id IMX464_of_match[] = {
- { .compatible = "sony,IMX464" },
{ .compatible = "sony,imx464" },
{},
};
@@ -3374,7 +3362,6 @@
#endif
static const struct i2c_device_id IMX464_match_id[] = {
- { "sony,IMX464", 0 },
{ "sony,imx464", 0 },
{ },
};
--
Gitblit v1.6.2