aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.10/950-0074-i2c-gpio-Also-set-bus-numbers-from-reg-property.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-0074-i2c-gpio-Also-set-bus-numbers-from-reg-property.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-0074-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.10/950-0074-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.10/950-0074-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch b/target/linux/bcm27xx/patches-5.10/950-0074-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch
new file mode 100644
index 0000000000..a922328339
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.10/950-0074-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch
@@ -0,0 +1,35 @@
+From 798407c217fee8f4869bf76d9cd2cda16f93e24f Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Tue, 20 Feb 2018 10:07:27 +0000
+Subject: [PATCH] i2c-gpio: Also set bus numbers from reg property
+
+I2C busses can be assigned specific bus numbers using aliases in
+Device Tree - string properties where the name is the alias and the
+value is the path to the node. The current DT parameter mechanism
+does not allow property names to be derived from a parameter value
+in any way, so it isn't possible to generate unique or matching
+aliases for nodes from an overlay that can generate multiple
+instances, e.g. i2c-gpio.
+
+Work around this limitation (at least temporarily) by allowing
+the i2c adapter number to be initialised from the "reg" property
+if present.
+
+Signed-off-by: Phil Elwell <phil@raspberrypi.org>
+---
+ drivers/i2c/busses/i2c-gpio.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/i2c/busses/i2c-gpio.c
++++ b/drivers/i2c/busses/i2c-gpio.c
+@@ -445,7 +445,9 @@ static int i2c_gpio_probe(struct platfor
+ adap->dev.parent = dev;
+ adap->dev.of_node = np;
+
+- adap->nr = pdev->id;
++ if (pdev->id != PLATFORM_DEVID_NONE || !pdev->dev.of_node ||
++ of_property_read_u32(pdev->dev.of_node, "reg", &adap->nr))
++ adap->nr = pdev->id;
+ ret = i2c_bit_add_numbered_bus(adap);
+ if (ret)
+ return ret;