media: ov2740: Fix LINK_FREQ and PIXEL_RATE control value reporting
Sakari Ailus
maintainerPATCH 1/1 media: ov2740: Fix LINK_FREQ and PIXEL_RATE control value reporting
The driver dug the supported link frequency up from the V4L2 fwnode endpoint and used it internally, but failed to report this in the LINK_FREQ and PIXEL_RATE controls. Fix this.
--- drivers/media/i2c/ov2740.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/media/i2c/ov2740.c +6 -5
@@ -768,14 +768,15 @@ static int ov2740_init_controls(struct ov2740 *ov2740) cur_mode = ov2740->cur_mode; size =ARRAY_SIZE (link_freq_menu_items); - ov2740->link_freq =v4l2_ctrl_new_int_menu (ctrl_hdlr, &ov2740_ctrl_ops, -V4L2_CID_LINK_FREQ , - size -1 ,0 , - link_freq_menu_items); + ov2740->link_freq = +v4l2_ctrl_new_int_menu (ctrl_hdlr, &ov2740_ctrl_ops, +V4L2_CID_LINK_FREQ , size -1 , + ov2740->supported_modes->link_freq_index, + link_freq_menu_items);if (ov2740->link_freq) ov2740->link_freq->flags |=V4L2_CTRL_FLAG_READ_ONLY ; - pixel_rate =to_pixel_rate (OV2740_LINK_FREQ_360MHZ_INDEX ); + pixel_rate =to_pixel_rate (ov2740->supported_modes->link_freq_index); ov2740->pixel_rate =v4l2_ctrl_new_std (ctrl_hdlr, &ov2740_ctrl_ops,V4L2_CID_PIXEL_RATE ,0 , pixel_rate,1 , pixel_rate);
Signature · 1 line
2.39.2
Hi,
Quoted 7 lines · Sakari Ailus
The driver dug the supported link frequency up from the V4L2 fwnode endpoint and used it internally, but failed to report this in the
LINK_FREQandPIXEL_RATEcontrols. Fix this.Fixes 0677a2d9b735 ("media: ov2740: Add support for 180 MHz link frequency")Cc [email protected] # for v6.8 and laterSigned-off-by Sakari Ailus <[email protected]>
Thanks, patch looks good to me:
Regards,
Hans
Quoted 29 lines
--- drivers/media/i2c/ov2740.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)drivers/media/i2c/ov2740.c +6
-5@@ -768,14 +768,15 @@ static int ov2740_init_controls(struct ov2740 *ov2740) cur_mode = ov2740->cur_mode; size =ARRAY_SIZE (link_freq_menu_items); - ov2740->link_freq =v4l2_ctrl_new_int_menu (ctrl_hdlr, &ov2740_ctrl_ops, -V4L2_CID_LINK_FREQ , - size -1 ,0 , - link_freq_menu_items); + ov2740->link_freq = +v4l2_ctrl_new_int_menu (ctrl_hdlr, &ov2740_ctrl_ops, +V4L2_CID_LINK_FREQ , size -1 , + ov2740->supported_modes->link_freq_index, + link_freq_menu_items);if (ov2740->link_freq) ov2740->link_freq->flags |=V4L2_CTRL_FLAG_READ_ONLY ; - pixel_rate =to_pixel_rate (OV2740_LINK_FREQ_360MHZ_INDEX ); + pixel_rate =to_pixel_rate (ov2740->supported_modes->link_freq_index); ov2740->pixel_rate =v4l2_ctrl_new_std (ctrl_hdlr, &ov2740_ctrl_ops,V4L2_CID_PIXEL_RATE ,0 , pixel_rate,1 , pixel_rate);
Sakari,
Thank you for the fix patch.
Quoted 27 lines · Sakari Ailus
The driver dug the supported link frequency up from the V4L2 fwnode endpoint and used it internally, but failed to report this in the
LINK_FREQandPIXEL_RATEcontrols. Fix this.Fixes 0677a2d9b735 ("media: ov2740: Add support for 180 MHz link frequency")Cc [email protected] # for v6.8 and laterSigned-off-by Sakari Ailus <[email protected]>--- drivers/media/i2c/ov2740.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)drivers/media/i2c/ov2740.c +3
-4@@ -768,14 +768,15 @@ static int ov2740_init_controls(struct ov2740 *ov2740) cur_mode = ov2740->cur_mode; size =ARRAY_SIZE (link_freq_menu_items); - ov2740->link_freq =v4l2_ctrl_new_int_menu (ctrl_hdlr, &ov2740_ctrl_ops, -V4L2_CID_LINK_FREQ , - size -1 ,0 , - link_freq_menu_items); + ov2740->link_freq = + v4l2_ctrl_new_int_menu(ctrl_hdlr, &ov2740_ctrl_ops, + V4L2_CID_LINK_FREQ, size - 1,
drivers/media/i2c/ov2740.c static int ov2740_init_controls(struct ov2740 *ov2740) · line 782
Quoted 10 lines
drivers/media/i2c/ov2740.c +3
-1+ ov2740->supported_modes->link_freq_index, + link_freq_menu_items);if (ov2740->link_freq) ov2740->link_freq->flags |=V4L2_CTRL_FLAG_READ_ONLY ; - pixel_rate =to_pixel_rate (OV2740_LINK_FREQ_360MHZ_INDEX ); + pixel_rate =to_pixel_rate (ov2740->supported_modes->link_freq_index); ov2740->pixel_rate =v4l2_ctrl_new_std (ctrl_hdlr, &ov2740_ctrl_ops,V4L2_CID_PIXEL_RATE ,0 , pixel_rate,1 , pixel_rate);
Signature · 2 lines
Best regards, Bingbu Cao