1 From 3269627852346852f99244b2650daaa79056b29d Mon Sep 17 00:00:00 2001
2 From: Jacopo Mondi <jacopo+renesas@jmondi.org>
3 Date: Tue, 16 Jun 2020 16:12:43 +0200
4 Subject: [PATCH] media: i2c: adv748x: Implement get_mbus_config
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Upstream https://patchwork.linuxtv.org/patch/64676/
11 Implement the newly introduced get_mbus_config operation to report the
12 number of currently used data lanes on the MIPI CSI-2 interface.
14 Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
15 Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
16 Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
18 drivers/media/i2c/adv748x/adv748x-csi2.c | 31 ++++++++++++++++++++++++
19 1 file changed, 31 insertions(+)
21 --- a/drivers/media/i2c/adv748x/adv748x-csi2.c
22 +++ b/drivers/media/i2c/adv748x/adv748x-csi2.c
23 @@ -214,9 +214,40 @@ unlock:
27 +static int adv748x_csi2_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
28 + struct v4l2_mbus_config *config)
30 + struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
32 + if (pad != ADV748X_CSI2_SOURCE)
35 + config->type = V4L2_MBUS_CSI2_DPHY;
36 + switch (tx->active_lanes) {
38 + config->flags = V4L2_MBUS_CSI2_1_LANE;
42 + config->flags = V4L2_MBUS_CSI2_2_LANE;
46 + config->flags = V4L2_MBUS_CSI2_3_LANE;
50 + config->flags = V4L2_MBUS_CSI2_4_LANE;
57 static const struct v4l2_subdev_pad_ops adv748x_csi2_pad_ops = {
58 .get_fmt = adv748x_csi2_get_format,
59 .set_fmt = adv748x_csi2_set_format,
60 + .get_mbus_config = adv748x_csi2_get_mbus_config,
63 /* -----------------------------------------------------------------------------