Skip to content

Commit

Permalink
overlays: Force IRQ pins to inputs
Browse files Browse the repository at this point in the history
Requesting a GPIO as an interrupt source does not automatically make it
an input (or even a GPIO pin). Add the necessary pinctrl nodes to the
overlays that don't already do this.

See: #6106

Signed-off-by: Phil Elwell <[email protected]>
  • Loading branch information
pelwell authored and popcornmix committed Jul 11, 2024
1 parent f5f41ce commit 1ed13ab
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 15 deletions.
45 changes: 34 additions & 11 deletions arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@
maxim,ir-led-current-microamp = <7000>;
interrupt-parent = <&gpio>;
interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};
Expand Down Expand Up @@ -437,6 +439,8 @@
reg = <0x68>;
interrupt-parent = <&gpio>;
interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};
Expand All @@ -454,6 +458,8 @@
reg = <0x68>;
interrupt-parent = <&gpio>;
interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};
Expand Down Expand Up @@ -536,6 +542,8 @@
reg = <0x5f>;
interrupt-parent = <&gpio>;
interrupts = <4 IRQ_TYPE_EDGE_RISING>;
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};
Expand Down Expand Up @@ -567,7 +575,8 @@
reg = <0x44>;
interrupt-parent = <&gpio>;
interrupts = <4 IRQ_TYPE_EDGE_RISING>;
status = "okay";
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};
Expand All @@ -584,7 +593,8 @@
reg = <0x74>;
interrupt-parent = <&gpio>;
interrupts = <4 IRQ_TYPE_EDGE_RISING>;
status = "okay";
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};
Expand All @@ -601,11 +611,22 @@
reg = <0x74>;
interrupt-parent = <&gpio>;
interrupts = <4 IRQ_TYPE_EDGE_RISING>;
status = "okay";
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};

fragment@99 {
target = <&gpio>;
__dormant__ {
int_pins: int_pins@4 {
brcm,pins = <4>;
brcm,function = <0>; /* in */
brcm,pull = <0>; /* none */
};
};
};

__overrides__ {
bme280 = <0>,"+0";
Expand All @@ -629,7 +650,7 @@
sgp30 = <0>,"+16";
ccs811 = <0>, "+17";
bh1750 = <0>, "+18";
max30102 = <0>,"+19";
max30102 = <0>,"+19+99";
aht10 = <0>,"+20";
mcp980x = <0>,"+21";
jc42 = <0>,"+22";
Expand All @@ -638,16 +659,16 @@
ms5805 = <0>,"+25";
ms5837 = <0>,"+26";
ms8607 = <0>,"+27";
mpu6050 = <0>,"+28";
mpu9250 = <0>,"+29";
mpu6050 = <0>,"+28+99";
mpu9250 = <0>,"+29+99";
bno055 = <0>,"+31";
sht4x = <0>,"+32";
adt7410 = <0>,"+34";
hts221 = <0>,"+35";
hts221 = <0>,"+35+99";
veml6075 = <0>,"+36";
hdc3020 = <0>,"+37";
as73211 = <0>,"+38";
as7331 = <0>,"+39";
hdc3020 = <0>,"+37+99";
as73211 = <0>,"+38+99";
as7331 = <0>,"+39+99";

addr = <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0",
<&lm75>,"reg:0", <&hdc100x>,"reg:0", <&sht3x>,"reg:0",
Expand All @@ -660,7 +681,9 @@
<&bmp380>,"reg:0", <&adt7410>,"reg:0",
<&hdc3020>,"reg:0", <&as73211>,"reg:0",
<&as7331>,"reg:0";
int_pin = <&max30102>, "interrupts:0",
int_pin = <&int_pins>, "brcm,pins:0",
<&int_pins>, "reg:0",
<&max30102>, "interrupts:0",
<&mpu6050>, "interrupts:0",
<&mpu9250>, "interrupts:0",
<&hts221>, "interrupts:0",
Expand Down
16 changes: 15 additions & 1 deletion arch/arm/boot/dts/overlays/sc16is750-i2c-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
clocks = <&sc16is750_clk>;
interrupt-parent = <&gpio>;
interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
gpio-controller;
#gpio-cells = <2>;
i2c-max-frequency = <400000>;
Expand All @@ -35,8 +37,20 @@
};
};

fragment@2 {
target = <&gpio>;
__overlay__ {
int_pins: int_pins@18 {
brcm,pins = <24>;
brcm,function = <0>; /* in */
brcm,pull = <0>; /* none */
};
};
};

__overrides__ {
int_pin = <&sc16is750>,"interrupts:0";
int_pin = <&sc16is750>,"interrupts:0", <&int_pins>,"brcm,pins:0",
<&int_pins>,"reg:0";
addr = <&sc16is750>,"reg:0", <&sc16is750_clk>,"name";
xtal = <&sc16is750_clk>,"clock-frequency:0";
};
Expand Down
16 changes: 15 additions & 1 deletion arch/arm/boot/dts/overlays/sc16is752-i2c-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
clocks = <&sc16is752_clk>;
interrupt-parent = <&gpio>;
interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
gpio-controller;
#gpio-cells = <2>;
i2c-max-frequency = <400000>;
Expand All @@ -35,8 +37,20 @@
};
};

fragment@2 {
target = <&gpio>;
__overlay__ {
int_pins: int_pins@18 {
brcm,pins = <24>;
brcm,function = <0>; /* in */
brcm,pull = <0>; /* none */
};
};
};

__overrides__ {
int_pin = <&sc16is752>,"interrupts:0";
int_pin = <&sc16is752>,"interrupts:0", <&int_pins>,"brcm,pins:0",
<&int_pins>,"reg:0";
addr = <&sc16is752>,"reg:0",<&sc16is752_clk>,"name";
xtal = <&sc16is752_clk>,"clock-frequency:0";
};
Expand Down
16 changes: 15 additions & 1 deletion arch/arm/boot/dts/overlays/sc16is752-spi0-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
clocks = <&sc16is752_clk>;
interrupt-parent = <&gpio>;
interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
gpio-controller;
#gpio-cells = <2>;
spi-max-frequency = <4000000>;
Expand All @@ -42,8 +44,20 @@
};
};

fragment@3 {
target = <&gpio>;
__overlay__ {
int_pins: int_pins@18 {
brcm,pins = <24>;
brcm,function = <0>; /* in */
brcm,pull = <0>; /* none */
};
};
};

__overrides__ {
int_pin = <&sc16is752>,"interrupts:0";
int_pin = <&sc16is752>,"interrupts:0", <&int_pins>,"brcm,pins:0",
<&int_pins>,"reg:0";
xtal = <&sc16is752_clk>,"clock-frequency:0";
};
};
11 changes: 10 additions & 1 deletion arch/arm/boot/dts/overlays/sc16is752-spi1-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
brcm,pins = <18>;
brcm,function = <1>; /* output */
};

int_pins: int_pins@18 {
brcm,pins = <24>;
brcm,function = <0>; /* in */
brcm,pull = <0>; /* none */
};
};
};

Expand All @@ -35,6 +41,8 @@
clocks = <&sc16is752_clk>;
interrupt-parent = <&gpio>;
interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
gpio-controller;
#gpio-cells = <2>;
spi-max-frequency = <4000000>;
Expand All @@ -61,7 +69,8 @@
};

__overrides__ {
int_pin = <&sc16is752>,"interrupts:0";
int_pin = <&sc16is752>,"interrupts:0", <&int_pins>,"brcm,pins:0",
<&int_pins>,"reg:0";
xtal = <&sc16is752_clk>,"clock-frequency:0";
};
};

0 comments on commit 1ed13ab

Please sign in to comment.