1 From 27f0e0e195568c06f21ce380f0736bdd219baf3c Mon Sep 17 00:00:00 2001
2 From: Janis Streib <janis+github@dogcraft.de>
3 Date: Sun, 15 Oct 2023 21:08:40 +0200
4 Subject: [PATCH] overlays: mcp23017: allow specification of the i2c bus
6 Analogous to i2c-rtc-overlay.dts
8 See: https://github.com/raspberrypi/linux/pull/5650
10 arch/arm/boot/dts/overlays/README | 10 ++++++
11 .../boot/dts/overlays/mcp23017-overlay.dts | 36 +++++++++++++++++--
12 2 files changed, 44 insertions(+), 2 deletions(-)
14 --- a/arch/arm/boot/dts/overlays/README
15 +++ b/arch/arm/boot/dts/overlays/README
16 @@ -2810,6 +2810,16 @@ Params: gpiopin Gpio pin
18 mcp23008 Configure an MCP23008 instead.
19 noints Disable the interrupt GPIO line.
20 + i2c0 Choose the I2C0 bus on GPIOs 0&1
21 + i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
22 + i2c3 Choose the I2C3 bus (configure with the i2c3
23 + overlay - BCM2711 only)
24 + i2c4 Choose the I2C4 bus (configure with the i2c4
25 + overlay - BCM2711 only)
26 + i2c5 Choose the I2C5 bus (configure with the i2c5
27 + overlay - BCM2711 only)
28 + i2c6 Choose the I2C6 bus (configure with the i2c6
29 + overlay - BCM2711 only)
33 --- a/arch/arm/boot/dts/overlays/mcp23017-overlay.dts
34 +++ b/arch/arm/boot/dts/overlays/mcp23017-overlay.dts
36 compatible = "brcm,bcm2835";
57 + frag100: fragment@100 {
59 + i2cbus: __overlay__ {
72 + target = <&i2c0mux>;
79 gpiopin = <&mcp23017_pins>,"brcm,pins:0",
80 <&mcp23017_irq>,"interrupts:0";
81 addr = <&mcp23017>,"reg:0", <&mcp23017_pins>,"reg:0";
84 + i2c0 = <&frag100>, "target:0=",<&i2c0>;
85 + i2c_csi_dsi = <&frag100>, "target:0=",<&i2c_csi_dsi>,
87 + i2c3 = <&frag100>, "target?=0",
88 + <&frag100>, "target-path=i2c3";
89 + i2c4 = <&frag100>, "target?=0",
90 + <&frag100>, "target-path=i2c4";
91 + i2c5 = <&frag100>, "target?=0",
92 + <&frag100>, "target-path=i2c5";
93 + i2c6 = <&frag100>, "target?=0",
94 + <&frag100>, "target-path=i2c6";