1 From 55ed8cded4af6530276b26f567601bed868ae8f5 Mon Sep 17 00:00:00 2001
2 From: Lee Jackson <lee.jackson@arducam.com>
3 Date: Wed, 10 Jan 2024 08:52:54 +0800
4 Subject: [PATCH] drivers: media: imx519: Add V4L2_CID_LINK_FREQ control
6 Add V4L2_CID_LINK_FREQ as a read-only control with a value of 408 Mhz.
7 This will be used by the CFE driver to corretly setup the DPHY timing
8 parameters in the CSI-2 block.
10 Signed-off-by: Lee Jackson <lee.jackson@arducam.com>
12 drivers/media/i2c/imx519.c | 14 ++++++++++++++
13 1 file changed, 14 insertions(+)
15 --- a/drivers/media/i2c/imx519.c
16 +++ b/drivers/media/i2c/imx519.c
17 @@ -145,6 +145,10 @@ struct imx519_mode {
18 struct imx519_reg_list reg_list;
21 +static const s64 imx519_link_freq_menu[] = {
22 + IMX519_DEFAULT_LINK_FREQ,
25 static const struct imx519_reg mode_common_regs[] = {
28 @@ -1819,6 +1823,7 @@ static int imx519_init_controls(struct i
29 struct v4l2_ctrl_handler *ctrl_hdlr;
30 struct i2c_client *client = v4l2_get_subdevdata(&imx519->sd);
31 struct v4l2_fwnode_device_properties props;
32 + struct v4l2_ctrl *link_freq;
36 @@ -1837,6 +1842,15 @@ static int imx519_init_controls(struct i
40 + /* LINK_FREQ is also read only */
42 + v4l2_ctrl_new_int_menu(ctrl_hdlr, &imx519_ctrl_ops,
44 + ARRAY_SIZE(imx519_link_freq_menu) - 1, 0,
45 + imx519_link_freq_menu);
47 + link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
50 * Create the controls here, but mode specific limits are setup
51 * in the imx519_set_framing_limits() call below.