1 From 2541eaca2c169ca90e017b5a3b014b41c0988909 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 0672/1085] overlays: mcp23017: allow specification of the i2c
7 Analogous to i2c-rtc-overlay.dts
9 See: https://github.com/raspberrypi/linux/pull/5650
11 arch/arm/boot/dts/overlays/README | 10 +++
12 .../boot/dts/overlays/mcp23017-overlay.dts | 68 ++++++++++++++-----
13 2 files changed, 61 insertions(+), 17 deletions(-)
15 --- a/arch/arm/boot/dts/overlays/README
16 +++ b/arch/arm/boot/dts/overlays/README
17 @@ -2810,6 +2810,16 @@ Params: gpiopin Gpio pin
19 mcp23008 Configure an MCP23008 instead.
20 noints Disable the interrupt GPIO line.
21 + i2c0 Choose the I2C0 bus on GPIOs 0&1
22 + i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
23 + i2c3 Choose the I2C3 bus (configure with the i2c3
24 + overlay - BCM2711 only)
25 + i2c4 Choose the I2C4 bus (configure with the i2c4
26 + overlay - BCM2711 only)
27 + i2c5 Choose the I2C5 bus (configure with the i2c5
28 + overlay - BCM2711 only)
29 + i2c6 Choose the I2C6 bus (configure with the i2c6
30 + overlay - BCM2711 only)
34 --- a/arch/arm/boot/dts/overlays/mcp23017-overlay.dts
35 +++ b/arch/arm/boot/dts/overlays/mcp23017-overlay.dts
37 compatible = "brcm,bcm2835";
50 + target = <&mcp23017>;
52 + compatible = "microchip,mcp23008";
57 + target = <&mcp23017>;
58 + mcp23017_irq: __overlay__ {
59 + #interrupt-cells=<2>;
60 + interrupt-parent = <&gpio>;
62 + interrupt-controller;
63 + microchip,irq-mirror;
74 compatible = "microchip,mcp23017";
75 + pinctrl-name = "default";
76 + pinctrl-0 = <&mcp23017_pins>;
85 - target = <&mcp23017>;
87 - compatible = "microchip,mcp23008";
88 + frag100: fragment@100 {
90 + i2cbus: __overlay__ {
96 - target = <&mcp23017>;
97 - mcp23017_irq: __overlay__ {
98 - #interrupt-cells=<2>;
99 - interrupt-parent = <&gpio>;
100 - interrupts = <4 2>;
101 - interrupt-controller;
102 - microchip,irq-mirror;
105 + target = <&i2c0if>;
112 + target = <&i2c0mux>;
119 gpiopin = <&mcp23017_pins>,"brcm,pins:0",
120 <&mcp23017_irq>,"interrupts:0";
121 addr = <&mcp23017>,"reg:0", <&mcp23017_pins>,"reg:0";
122 - mcp23008 = <0>,"=3";
123 - noints = <0>,"!1!4";
124 + mcp23008 = <0>,"=2";
125 + noints = <0>,"!1!3";
126 + i2c0 = <&frag100>, "target:0=",<&i2c0>;
127 + i2c_csi_dsi = <&frag100>, "target:0=",<&i2c_csi_dsi>,
129 + i2c3 = <&frag100>, "target?=0",
130 + <&frag100>, "target-path=i2c3";
131 + i2c4 = <&frag100>, "target?=0",
132 + <&frag100>, "target-path=i2c4";
133 + i2c5 = <&frag100>, "target?=0",
134 + <&frag100>, "target-path=i2c5";
135 + i2c6 = <&frag100>, "target?=0",
136 + <&frag100>, "target-path=i2c6";