82a5fb11bb01bb1965efe41b153a4f4a2c30df89
[openwrt/staging/ansuel.git] /
1 From 3018f1ad77f6943665d5300490cff3c1ee1e4f17 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 12 May 2022 17:42:08 +0100
4 Subject: [PATCH] media: i2c: arducam-pivariety: Fixup for mainline API
5 changes
6
7 Mainline APIs have changed the way in which the bus flags and
8 number of active CSI2 data lanes is signalled, so fix the driver
9 up accordingly.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 ---
13 drivers/media/i2c/arducam-pivariety.c | 6 +++---
14 1 file changed, 3 insertions(+), 3 deletions(-)
15
16 --- a/drivers/media/i2c/arducam-pivariety.c
17 +++ b/drivers/media/i2c/arducam-pivariety.c
18 @@ -66,7 +66,7 @@ struct pivariety {
19 struct v4l2_subdev sd;
20 struct media_pad pad;
21
22 - struct v4l2_fwnode_bus_mipi_csi2 bus;
23 + struct v4l2_mbus_config_mipi_csi2 bus;
24 struct clk *xclk;
25 u32 xclk_freq;
26
27 @@ -946,13 +946,13 @@ static int pivariety_get_mbus_config(str
28 struct v4l2_mbus_config *cfg)
29 {
30 struct pivariety *pivariety = to_pivariety(sd);
31 - const u32 mask = V4L2_MBUS_CSI2_LANE_MASK;
32
33 if (pivariety->lanes > pivariety->bus.num_data_lanes)
34 return -EINVAL;
35
36 cfg->type = V4L2_MBUS_CSI2_DPHY;
37 - cfg->flags = (pivariety->lanes << __ffs(mask)) & mask;
38 + cfg->bus.mipi_csi2.flags = pivariety->bus.flags;
39 + cfg->bus.mipi_csi2.num_data_lanes = pivariety->lanes;
40
41 return 0;
42 }