Hi Jacopo On Sat, 22 Oct 2022 at 11:38, Jacopo Mondi <jacopo@xxxxxxxxxx> wrote: > > Add support for V4L2_CID_LINK_FREQ which currently reports a single > hard-coded frequency which depends on the fixed pixel clock. > > Signed-off-by: Jacopo Mondi <jacopo@xxxxxxxxxx> > --- > drivers/media/i2c/ar0521.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/media/i2c/ar0521.c b/drivers/media/i2c/ar0521.c > index fcd852760750..2310346f11d5 100644 > --- a/drivers/media/i2c/ar0521.c > +++ b/drivers/media/i2c/ar0521.c > @@ -89,6 +89,10 @@ static const char * const ar0521_supply_names[] = { > "vaa", /* Analog (2.7V) supply */ > }; > > +static const s64 ar0521_link_frequencies[] = { > + 184000000, > +}; > + > struct ar0521_ctrls { > struct v4l2_ctrl_handler handler; > struct { > @@ -547,6 +551,13 @@ static int ar0521_s_ctrl(struct v4l2_ctrl *ctrl) > ret = ar0521_write_reg(sensor, AR0521_REG_TEST_PATTERN_MODE, > ctrl->val); > break; > + case V4L2_CID_LINK_FREQ: > + /* > + * Link frequency index is used at PLL configuration time, > + * nothing to do here. > + */ > + ret = 0; > + break; Defining as read only removes the need for this, but it depends on whether you expect to have userspace changing it in the future. As it stands it works, so: Reviewed-by: Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx> > default: > dev_err(&sensor->i2c_client->dev, > "Unsupported control %x\n", ctrl->id); > @@ -611,6 +622,10 @@ static int ar0521_init_controls(struct ar0521_dev *sensor) > ctrls->exposure = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_EXPOSURE, 0, > 65535, 1, 360); > > + v4l2_ctrl_new_int_menu(hdl, ops, V4L2_CID_LINK_FREQ, > + ARRAY_SIZE(ar0521_link_frequencies) - 1, > + 0, ar0521_link_frequencies); > + > ctrls->test_pattern = v4l2_ctrl_new_std_menu_items(hdl, ops, > V4L2_CID_TEST_PATTERN, > ARRAY_SIZE(test_pattern_menu) - 1, > -- > 2.37.3 >