Skip to content

Commit

Permalink
overlays: Force IRQ pins to inputs
Browse files Browse the repository at this point in the history
commit 4ff654e437ab356b86fc0df4665997886b94e6ec from
https://github.com/raspberrypi/linux.git rpi-6.6.y

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: raspberrypi/linux#6106

Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: Rajeshkumar Ramasamy <[email protected]>
  • Loading branch information
pelwell authored and rajeshkumarwr committed Jul 21, 2024
1 parent 0b0b8d1 commit e5418d8
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 9 deletions.
27 changes: 23 additions & 4 deletions arch/arm/boot/dts/overlays/i2c-sensor-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@
maxim,ir-led-current-microamp = <7000>;
interrupt-parent = <&gpio>;
interrupts = <4 2>;
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};
Expand Down Expand Up @@ -436,6 +438,8 @@
reg = <0x68>;
interrupt-parent = <&gpio>;
interrupts = <4 2>;
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};
Expand All @@ -453,6 +457,8 @@
reg = <0x68>;
interrupt-parent = <&gpio>;
interrupts = <4 2>;
pinctrl-0 = <&int_pins>;
pinctrl-names = "default";
};
};
};
Expand Down Expand Up @@ -523,6 +529,17 @@
};
};

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";
bmp085 = <0>,"+1";
Expand All @@ -545,7 +562,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 @@ -554,8 +571,8 @@
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";
Expand All @@ -569,7 +586,9 @@
<&mpu6050>,"reg:0", <&mpu9250>,"reg:0",
<&bno055>,"reg:0", <&sht4x>,"reg:0",
<&bmp380>,"reg:0", <&adt7410>,"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";
no_timeout = <&jc42>, "smbus-timeout-disable?";
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";
};
};
13 changes: 11 additions & 2 deletions 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 @@ -25,7 +31,7 @@
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&spi1_pins &spi1_cs_pins>;
pinctrl-0 = <&spi1_pins &spi1_cs_pins &int_pins>;
cs-gpios = <&gpio 18 1>;
status = "okay";

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 e5418d8

Please sign in to comment.