bcm27xx: 6.1: add kernel patches
[openwrt/staging/stintel.git] / target / linux / bcm27xx / patches-6.1 / 950-0674-drivers-media-imx708-Remove-unused-control-fields.patch
1 From efeb651a86570eae98d98c7d8a57560caf51d55c Mon Sep 17 00:00:00 2001
2 From: Naushir Patuck <naush@raspberrypi.com>
3 Date: Fri, 31 Mar 2023 10:07:26 +0100
4 Subject: [PATCH] drivers: media: imx708: Remove unused control fields
5
6 Remove unused and redundant control fields from the state structure.
7
8 Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
9 ---
10 drivers/media/i2c/imx708.c | 10 +++-------
11 1 file changed, 3 insertions(+), 7 deletions(-)
12
13 --- a/drivers/media/i2c/imx708.c
14 +++ b/drivers/media/i2c/imx708.c
15 @@ -825,9 +825,6 @@ struct imx708 {
16 struct v4l2_ctrl *hflip;
17 struct v4l2_ctrl *vblank;
18 struct v4l2_ctrl *hblank;
19 - struct v4l2_ctrl *red_balance;
20 - struct v4l2_ctrl *blue_balance;
21 - struct v4l2_ctrl *notify_gains;
22 struct v4l2_ctrl *hdr_mode;
23 struct v4l2_ctrl *link_freq;
24
25 @@ -1205,12 +1202,12 @@ static int imx708_set_ctrl(struct v4l2_c
26 case V4L2_CID_NOTIFY_GAINS:
27 ret = imx708_write_reg(imx708, IMX708_REG_COLOUR_BALANCE_BLUE,
28 IMX708_REG_VALUE_16BIT,
29 - imx708->notify_gains->p_new.p_u32[0]);
30 + ctrl->p_new.p_u32[0]);
31 if (ret)
32 break;
33 ret = imx708_write_reg(imx708, IMX708_REG_COLOUR_BALANCE_RED,
34 IMX708_REG_VALUE_16BIT,
35 - imx708->notify_gains->p_new.p_u32[3]);
36 + ctrl->p_new.p_u32[3]);
37 break;
38 case V4L2_CID_WIDE_DYNAMIC_RANGE:
39 /* Already handled above. */
40 @@ -1842,8 +1839,7 @@ static int imx708_init_controls(struct i
41 /* The "Solid color" pattern is white by default */
42 }
43
44 - imx708->notify_gains = v4l2_ctrl_new_custom(ctrl_hdlr,
45 - &imx708_notify_gains_ctrl, NULL);
46 + v4l2_ctrl_new_custom(ctrl_hdlr, &imx708_notify_gains_ctrl, NULL);
47
48 imx708->hdr_mode = v4l2_ctrl_new_std(ctrl_hdlr, &imx708_ctrl_ops,
49 V4L2_CID_WIDE_DYNAMIC_RANGE,