aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.10/950-0285-media-i2c-ov9281-fix-mclk-issue-when-probe-multiple-.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2021-08-21 10:54:34 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2021-08-21 19:07:07 +0200
commit8299d1f057439f94c6a4412e2e5c5082b82a30c9 (patch)
tree1bf678d61f11f7394493be464c7876e496f7faed /target/linux/bcm27xx/patches-5.10/950-0285-media-i2c-ov9281-fix-mclk-issue-when-probe-multiple-.patch
parent33b6885975ce376ff075362b7f0890326043111b (diff)
downloadupstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.gz
upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.bz2
upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.zip
bcm27xx: add kernel 5.10 support
Rebased RPi foundation patches on linux 5.10.59, removed applied and reverted patches, wireless patches and defconfig patches. bcm2708: boot tested on RPi B+ v1.2 bcm2709: boot tested on RPi 4B v1.1 4G bcm2711: boot tested on RPi 4B v1.1 4G Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.10/950-0285-media-i2c-ov9281-fix-mclk-issue-when-probe-multiple-.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.10/950-0285-media-i2c-ov9281-fix-mclk-issue-when-probe-multiple-.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.10/950-0285-media-i2c-ov9281-fix-mclk-issue-when-probe-multiple-.patch b/target/linux/bcm27xx/patches-5.10/950-0285-media-i2c-ov9281-fix-mclk-issue-when-probe-multiple-.patch
new file mode 100644
index 0000000000..b444221198
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.10/950-0285-media-i2c-ov9281-fix-mclk-issue-when-probe-multiple-.patch
@@ -0,0 +1,60 @@
+From ecaf713a6535e49f1eb4374f6241421e8e61d407 Mon Sep 17 00:00:00 2001
+From: Dave Stevenson <dave.stevenson@raspberrypi.com>
+Date: Tue, 14 Apr 2020 15:47:09 +0100
+Subject: [PATCH] media: i2c: ov9281: fix mclk issue when probe
+ multiple camera.
+
+Takes the ov9281 part only from the Rockchip's patch.
+
+Change-Id: I30e833baf2c1bb07d6d87ddb3b00759ab45a90e4
+Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
+---
+ drivers/media/i2c/ov9281.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+--- a/drivers/media/i2c/ov9281.c
++++ b/drivers/media/i2c/ov9281.c
+@@ -3,6 +3,7 @@
+ * ov9281 driver
+ *
+ * Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd.
++ * V0.0X01.0X02 fix mclk issue when probe multiple camera.
+ */
+
+ #include <linux/clk.h>
+@@ -22,7 +23,7 @@
+ #include <media/v4l2-subdev.h>
+ #include <linux/pinctrl/consumer.h>
+
+-#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x0)
++#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x2)
+
+ #ifndef V4L2_CID_DIGITAL_GAIN
+ #define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
+@@ -676,6 +677,12 @@ static int __ov9281_power_on(struct ov92
+ dev_err(dev, "could not set pins\n");
+ }
+
++ ret = clk_set_rate(ov9281->xvclk, OV9281_XVCLK_FREQ);
++ if (ret < 0)
++ dev_warn(dev, "Failed to set xvclk rate (24MHz)\n");
++ if (clk_get_rate(ov9281->xvclk) != OV9281_XVCLK_FREQ)
++ dev_warn(dev, "xvclk mismatched, modes are based on 24MHz\n");
++
+ ret = clk_prepare_enable(ov9281->xvclk);
+ if (ret < 0) {
+ dev_err(dev, "Failed to enable xvclk\n");
+@@ -1008,13 +1015,6 @@ static int ov9281_probe(struct i2c_clien
+ dev_err(dev, "Failed to get xvclk\n");
+ return -EINVAL;
+ }
+- ret = clk_set_rate(ov9281->xvclk, OV9281_XVCLK_FREQ);
+- if (ret < 0) {
+- dev_err(dev, "Failed to set xvclk rate (24MHz)\n");
+- return ret;
+- }
+- if (clk_get_rate(ov9281->xvclk) != OV9281_XVCLK_FREQ)
+- dev_warn(dev, "xvclk mismatched, modes are based on 24MHz\n");
+
+ ov9281->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
+ if (IS_ERR(ov9281->reset_gpio))