bcm27xx: update 6.1 patches to latest version
[openwrt/staging/svanheule.git] / target / linux / bcm27xx / patches-6.1 / 950-0999-media-rp1-csi2-Fix-missing-reg-writes.patch
1 From 62e8ab88d2c230dad122aabe2ad0e227d7ceba40 Mon Sep 17 00:00:00 2001
2 From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
3 Date: Thu, 28 Sep 2023 10:42:22 +0300
4 Subject: [PATCH] media: rp1: csi2: Fix missing reg writes
5
6 The driver has two places where it writes a register based on a
7 condition, and when that condition is false, the driver presumes that
8 the register has the reset value. This is not a good idea, so fix those
9 places to always write the register.
10
11 Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
12 ---
13 drivers/media/platform/raspberrypi/rp1_cfe/csi2.c | 5 +++--
14 1 file changed, 3 insertions(+), 2 deletions(-)
15
16 --- a/drivers/media/platform/raspberrypi/rp1_cfe/csi2.c
17 +++ b/drivers/media/platform/raspberrypi/rp1_cfe/csi2.c
18 @@ -253,6 +253,7 @@ void csi2_start_channel(struct csi2_devi
19 */
20 set_field(&ctrl, 0x3ff, LC_MASK);
21 set_field(&ctrl, 0x00, CH_MODE_MASK);
22 + csi2_reg_write(csi2, CSI2_CH_FRAME_SIZE(channel), 0);
23 }
24
25 set_field(&ctrl, dt, DT_MASK);
26 @@ -277,8 +278,8 @@ void csi2_open_rx(struct csi2_device *cs
27 {
28 dphy_start(&csi2->dphy);
29
30 - if (!csi2->multipacket_line)
31 - csi2_reg_write(csi2, CSI2_CTRL, EOP_IS_EOL);
32 + csi2_reg_write(csi2, CSI2_CTRL,
33 + csi2->multipacket_line ? 0 : EOP_IS_EOL);
34 }
35
36 void csi2_close_rx(struct csi2_device *csi2)