media: sunxi-vin: adapt IMX415 mbus config ops
This commit is contained in:
parent
5f15c55f5a
commit
c9866aeb9b
@ -1133,16 +1133,25 @@ static struct sensor_win_size sensor_win_sizes[] = {
|
||||
|
||||
#define N_WIN_SIZES (ARRAY_SIZE(sensor_win_sizes))
|
||||
|
||||
static int sensor_g_mbus_config(struct v4l2_subdev *sd,
|
||||
static int sensor_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
|
||||
struct v4l2_mbus_config *cfg)
|
||||
{
|
||||
struct sensor_info *info = to_state(sd);
|
||||
|
||||
cfg->type = V4L2_MBUS_CSI2_DPHY;
|
||||
if (info->isp_wdr_mode == ISP_DOL_WDR_MODE)
|
||||
if (info->isp_wdr_mode == ISP_DOL_WDR_MODE) {
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
|
||||
cfg->bus.mipi_csi2.num_data_lanes = 0 | V4L2_MBUS_CSI2_4_LANE | V4L2_MBUS_CSI2_CHANNEL_0 | V4L2_MBUS_CSI2_CHANNEL_1;
|
||||
#else
|
||||
cfg->flags = 0 | V4L2_MBUS_CSI2_4_LANE | V4L2_MBUS_CSI2_CHANNEL_0 | V4L2_MBUS_CSI2_CHANNEL_1;
|
||||
else
|
||||
#endif
|
||||
} else {
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
|
||||
cfg->bus.mipi_csi2.num_data_lanes = 0 | V4L2_MBUS_CSI2_4_LANE | V4L2_MBUS_CSI2_CHANNEL_0;
|
||||
#else
|
||||
cfg->flags = 0 | V4L2_MBUS_CSI2_4_LANE | V4L2_MBUS_CSI2_CHANNEL_0;
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1255,7 +1264,6 @@ static const struct v4l2_subdev_core_ops sensor_core_ops = {
|
||||
|
||||
static const struct v4l2_subdev_video_ops sensor_video_ops = {
|
||||
.s_stream = sensor_s_stream,
|
||||
.g_mbus_config = sensor_g_mbus_config,
|
||||
};
|
||||
|
||||
static const struct v4l2_subdev_pad_ops sensor_pad_ops = {
|
||||
@ -1264,6 +1272,7 @@ static const struct v4l2_subdev_pad_ops sensor_pad_ops = {
|
||||
.enum_frame_interval = sensor_enum_frame_interval,
|
||||
.get_fmt = sensor_get_fmt,
|
||||
.set_fmt = sensor_set_fmt,
|
||||
.get_mbus_config = sensor_g_mbus_config,
|
||||
};
|
||||
|
||||
static const struct v4l2_subdev_ops sensor_ops = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user