aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.4/950-0802-media-i2c-adv748x-Implement-get_mbus_config.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2021-02-18 18:04:33 +0100
committerÁlvaro Fernández Rojas <noltari@gmail.com>2021-02-19 07:17:21 +0100
commit62b7f5931c54e96fca56dd8761b0e466d355c881 (patch)
tree1258b392752379833a075df006c2f6d7ac4be51d /target/linux/bcm27xx/patches-5.4/950-0802-media-i2c-adv748x-Implement-get_mbus_config.patch
parent76d1168d0d4b9d76e2ad78c0fc6b255561deb284 (diff)
downloadupstream-62b7f5931c54e96fca56dd8761b0e466d355c881.tar.gz
upstream-62b7f5931c54e96fca56dd8761b0e466d355c881.tar.bz2
upstream-62b7f5931c54e96fca56dd8761b0e466d355c881.zip
bcm27xx: import latest patches from the RPi foundation
bcm2708: boot tested on RPi B+ v1.2 bcm2709: boot tested on RPi 3B v1.2 and RPi 4B v1.1 4G bcm2710: boot tested on RPi 3B v1.2 bcm2711: boot tested on RPi 4B v1.1 4G Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> (cherry-picked from commit f07e572f64)
Diffstat (limited to 'target/linux/bcm27xx/patches-5.4/950-0802-media-i2c-adv748x-Implement-get_mbus_config.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.4/950-0802-media-i2c-adv748x-Implement-get_mbus_config.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.4/950-0802-media-i2c-adv748x-Implement-get_mbus_config.patch b/target/linux/bcm27xx/patches-5.4/950-0802-media-i2c-adv748x-Implement-get_mbus_config.patch
new file mode 100644
index 0000000000..19c4d4c29d
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.4/950-0802-media-i2c-adv748x-Implement-get_mbus_config.patch
@@ -0,0 +1,63 @@
+From 3269627852346852f99244b2650daaa79056b29d Mon Sep 17 00:00:00 2001
+From: Jacopo Mondi <jacopo+renesas@jmondi.org>
+Date: Tue, 16 Jun 2020 16:12:43 +0200
+Subject: [PATCH] media: i2c: adv748x: Implement get_mbus_config
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream https://patchwork.linuxtv.org/patch/64676/
+
+Implement the newly introduced get_mbus_config operation to report the
+number of currently used data lanes on the MIPI CSI-2 interface.
+
+Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
+Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
+Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
+---
+ drivers/media/i2c/adv748x/adv748x-csi2.c | 31 ++++++++++++++++++++++++
+ 1 file changed, 31 insertions(+)
+
+--- a/drivers/media/i2c/adv748x/adv748x-csi2.c
++++ b/drivers/media/i2c/adv748x/adv748x-csi2.c
+@@ -214,9 +214,40 @@ unlock:
+ return ret;
+ }
+
++static int adv748x_csi2_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
++ struct v4l2_mbus_config *config)
++{
++ struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
++
++ if (pad != ADV748X_CSI2_SOURCE)
++ return -EINVAL;
++
++ config->type = V4L2_MBUS_CSI2_DPHY;
++ switch (tx->active_lanes) {
++ case 1:
++ config->flags = V4L2_MBUS_CSI2_1_LANE;
++ break;
++
++ case 2:
++ config->flags = V4L2_MBUS_CSI2_2_LANE;
++ break;
++
++ case 3:
++ config->flags = V4L2_MBUS_CSI2_3_LANE;
++ break;
++
++ case 4:
++ config->flags = V4L2_MBUS_CSI2_4_LANE;
++ break;
++ }
++
++ return 0;
++}
++
+ static const struct v4l2_subdev_pad_ops adv748x_csi2_pad_ops = {
+ .get_fmt = adv748x_csi2_get_format,
+ .set_fmt = adv748x_csi2_set_format,
++ .get_mbus_config = adv748x_csi2_get_mbus_config,
+ };
+
+ /* -----------------------------------------------------------------------------