media: i2c: Add hblank control to ov8865
Add a V4L2_CID_HBLANK control to the ov8865 driver. This is read only with timing control intended to be done via vblanking alone. Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Родитель
9293aafe37
Коммит
d84d4ceea9
|
@ -677,6 +677,7 @@ struct ov8865_state {
|
|||
struct ov8865_ctrls {
|
||||
struct v4l2_ctrl *link_freq;
|
||||
struct v4l2_ctrl *pixel_rate;
|
||||
struct v4l2_ctrl *hblank;
|
||||
struct v4l2_ctrl *vblank;
|
||||
|
||||
struct v4l2_ctrl_handler handler;
|
||||
|
@ -2513,6 +2514,7 @@ static int ov8865_ctrls_init(struct ov8865_sensor *sensor)
|
|||
const struct v4l2_ctrl_ops *ops = &ov8865_ctrl_ops;
|
||||
const struct ov8865_mode *mode = &ov8865_modes[0];
|
||||
unsigned int vblank_max, vblank_def;
|
||||
unsigned int hblank;
|
||||
int ret;
|
||||
|
||||
v4l2_ctrl_handler_init(handler, 32);
|
||||
|
@ -2550,6 +2552,13 @@ static int ov8865_ctrls_init(struct ov8865_sensor *sensor)
|
|||
0, 0, ov8865_test_pattern_menu);
|
||||
|
||||
/* Blanking */
|
||||
hblank = mode->hts - mode->output_size_x;
|
||||
ctrls->hblank = v4l2_ctrl_new_std(handler, ops, V4L2_CID_HBLANK, hblank,
|
||||
hblank, 1, hblank);
|
||||
|
||||
if (ctrls->hblank)
|
||||
ctrls->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY;
|
||||
|
||||
vblank_max = OV8865_TIMING_MAX_VTS - mode->output_size_y;
|
||||
vblank_def = mode->vts - mode->output_size_y;
|
||||
ctrls->vblank = v4l2_ctrl_new_std(handler, ops, V4L2_CID_VBLANK,
|
||||
|
@ -2696,6 +2705,7 @@ static int ov8865_set_fmt(struct v4l2_subdev *subdev,
|
|||
struct v4l2_mbus_framefmt *mbus_format = &format->format;
|
||||
const struct ov8865_mode *mode;
|
||||
u32 mbus_code = 0;
|
||||
unsigned int hblank;
|
||||
unsigned int index;
|
||||
int ret = 0;
|
||||
|
||||
|
@ -2740,6 +2750,10 @@ static int ov8865_set_fmt(struct v4l2_subdev *subdev,
|
|||
OV8865_TIMING_MAX_VTS - mode->output_size_y,
|
||||
1, mode->vts - mode->output_size_y);
|
||||
|
||||
hblank = mode->hts - mode->output_size_x;
|
||||
__v4l2_ctrl_modify_range(sensor->ctrls.hblank, hblank, hblank, 1,
|
||||
hblank);
|
||||
|
||||
complete:
|
||||
mutex_unlock(&sensor->mutex);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче