Skip to content

Commit 3ed6d34

Browse files
committed
fixup! overlays: mcp23017: allow specification of the i2c bus
The incorrect fragment order (*) caused broke the interrupt usage, and while it was being fixed the lack of a reference to the pinctrl declaration was noticed. See: raspberrypi#5677 Signed-off-by: Phil Elwell <[email protected]> (*) Ideally all fragments would appear in the file in the order in which they should be merged, but that is easy to forget and can be awkward, so the firmware merges all "intra" fragments (those that target other fragments in the overlay) before "inter" fragments (those that target the base DTB). However, intra fragments that target other intra fragments is a level of nesting too far for this logic to cope, so they must appear before the fragments they target.
1 parent eccaa85 commit 3ed6d34

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

arch/arm/boot/dts/overlays/mcp23017-overlay.dts

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,13 @@
2424
};
2525

2626
fragment@2 {
27-
target = <&i2cbus>;
28-
__overlay__ {
29-
#address-cells = <1>;
30-
#size-cells = <0>;
31-
32-
mcp23017: mcp@20 {
33-
compatible = "microchip,mcp23017";
34-
reg = <0x20>;
35-
gpio-controller;
36-
#gpio-cells = <2>;
37-
38-
status = "okay";
39-
};
40-
};
41-
};
42-
43-
fragment@3 {
4427
target = <&mcp23017>;
4528
__dormant__ {
4629
compatible = "microchip,mcp23008";
4730
};
4831
};
4932

50-
fragment@4 {
33+
fragment@3 {
5134
target = <&mcp23017>;
5235
mcp23017_irq: __overlay__ {
5336
#interrupt-cells=<2>;
@@ -58,6 +41,25 @@
5841
};
5942
};
6043

44+
fragment@4 {
45+
target = <&i2cbus>;
46+
__overlay__ {
47+
#address-cells = <1>;
48+
#size-cells = <0>;
49+
50+
mcp23017: mcp@20 {
51+
compatible = "microchip,mcp23017";
52+
pinctrl-name = "default";
53+
pinctrl-0 = <&mcp23017_pins>;
54+
reg = <0x20>;
55+
gpio-controller;
56+
#gpio-cells = <2>;
57+
58+
status = "okay";
59+
};
60+
};
61+
};
62+
6163
frag100: fragment@100 {
6264
target = <&i2c1>;
6365
i2cbus: __overlay__ {
@@ -83,8 +85,8 @@
8385
gpiopin = <&mcp23017_pins>,"brcm,pins:0",
8486
<&mcp23017_irq>,"interrupts:0";
8587
addr = <&mcp23017>,"reg:0", <&mcp23017_pins>,"reg:0";
86-
mcp23008 = <0>,"=3";
87-
noints = <0>,"!1!4";
88+
mcp23008 = <0>,"=2";
89+
noints = <0>,"!1!3";
8890
i2c0 = <&frag100>, "target:0=",<&i2c0>;
8991
i2c_csi_dsi = <&frag100>, "target:0=",<&i2c_csi_dsi>,
9092
<0>,"+101+102";

0 commit comments

Comments
 (0)