diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2022-05-16 23:40:32 +0200 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2022-05-17 15:11:22 +0200 |
commit | 20ea6adbf199097c4f5f591ffee088340630dae4 (patch) | |
tree | d6719d95e136611a1c25bbf7789652d6d402779d /target/linux/bcm27xx/patches-5.15/950-0096-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch | |
parent | bca05bd072180dc38ef740b37ded9572a6db1981 (diff) | |
download | upstream-20ea6adbf199097c4f5f591ffee088340630dae4.tar.gz upstream-20ea6adbf199097c4f5f591ffee088340630dae4.tar.bz2 upstream-20ea6adbf199097c4f5f591ffee088340630dae4.zip |
bcm27xx: add support for linux v5.15
Build system: x86_64
Build-tested: bcm2708, bcm2709, bcm2710, bcm2711
Run-tested: bcm2708/RPiB+, bcm2709/RPi3B, bcm2710/RPi3B, bcm2711/RPi4B
Signed-off-by: Marty Jones <mj8263788@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.15/950-0096-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch')
-rw-r--r-- | target/linux/bcm27xx/patches-5.15/950-0096-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.15/950-0096-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch b/target/linux/bcm27xx/patches-5.15/950-0096-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch new file mode 100644 index 0000000000..cd1616fe85 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.15/950-0096-i2c-gpio-Also-set-bus-numbers-from-reg-property.patch @@ -0,0 +1,35 @@ +From 82b910794d378403d6a9a82487bf89ecc1fc13e1 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; |