aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.19/950-0124-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2019-07-09 20:32:28 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2019-07-14 12:44:14 +0200
commit42954857190b9df16d9d873ecc7f6cc38e013e44 (patch)
tree98c588f629ff534d458eb0884782ea99672d7634 /target/linux/brcm2708/patches-4.19/950-0124-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch
parentf1875e902d0afb7d9b9e5285b4fd8da7f6c5e30a (diff)
downloadupstream-42954857190b9df16d9d873ecc7f6cc38e013e44.tar.gz
upstream-42954857190b9df16d9d873ecc7f6cc38e013e44.tar.bz2
upstream-42954857190b9df16d9d873ecc7f6cc38e013e44.zip
brcm2708: add linux 4.19 support
Boot tested on Raspberry Pi B+ (BCM2708) and Raspberry Pi 2 (BCM2709) Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/brcm2708/patches-4.19/950-0124-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch')
-rw-r--r--target/linux/brcm2708/patches-4.19/950-0124-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-4.19/950-0124-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch b/target/linux/brcm2708/patches-4.19/950-0124-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch
new file mode 100644
index 0000000000..67dfd8fadf
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.19/950-0124-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch
@@ -0,0 +1,35 @@
+From ec510c1562ff8326e032a9f0d9ae26ff0e54dd1c Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Tue, 20 Feb 2018 10:07:27 +0000
+Subject: [PATCH 124/703] 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
+@@ -350,7 +350,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;