linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: dts: stm32: add mcp23017 pinctrl entry for stm32mp13
@ 2022-10-24  9:46 Amelie Delaunay
  2022-10-24  9:46 ` [PATCH 2/2] ARM: dts: stm32: add mcp23017 IO expander on I2C1 on stm32mp135f-dk Amelie Delaunay
  0 siblings, 1 reply; 3+ messages in thread
From: Amelie Delaunay @ 2022-10-24  9:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Maxime Coquelin,
	Alexandre Torgue
  Cc: Amelie Delaunay, devicetree, linux-stm32, linux-arm-kernel,
	linux-kernel

MCP23017 interrupt line (routed on PG12) requires to be pulled-up.

Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
---
 arch/arm/boot/dts/stm32mp13-pinctrl.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp13-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp13-pinctrl.dtsi
index 50daf5509193..9889f9fe99a6 100644
--- a/arch/arm/boot/dts/stm32mp13-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stm32mp13-pinctrl.dtsi
@@ -47,6 +47,13 @@ pins {
 		};
 	};
 
+	mcp23017_pins_a: mcp23017-0 {
+		pins {
+			pinmux = <STM32_PINMUX('G', 12, GPIO)>;
+			bias-pull-up;
+		};
+	};
+
 	sdmmc1_b4_pins_a: sdmmc1-b4-0 {
 		pins {
 			pinmux = <STM32_PINMUX('C', 8, AF12)>, /* SDMMC1_D0 */
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ARM: dts: stm32: add mcp23017 IO expander on I2C1 on stm32mp135f-dk
  2022-10-24  9:46 [PATCH 1/2] ARM: dts: stm32: add mcp23017 pinctrl entry for stm32mp13 Amelie Delaunay
@ 2022-10-24  9:46 ` Amelie Delaunay
  2022-11-17  8:39   ` Alexandre TORGUE
  0 siblings, 1 reply; 3+ messages in thread
From: Amelie Delaunay @ 2022-10-24  9:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Maxime Coquelin,
	Alexandre Torgue
  Cc: Amelie Delaunay, devicetree, linux-stm32, linux-arm-kernel,
	linux-kernel

MCP23017 is an IO expander offering 16 input/output port expander with
interrupt output.
On stm32mp135f-dk, only INTA is routed (on PG12), but MCP23017 can mirror
the bank B interrupts on INTA, that's why the property microchip,irq-mirror
is used.

Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
---
 arch/arm/boot/dts/stm32mp135f-dk.dts | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/stm32mp135f-dk.dts b/arch/arm/boot/dts/stm32mp135f-dk.dts
index a87ab067c955..d5fc6462ba33 100644
--- a/arch/arm/boot/dts/stm32mp135f-dk.dts
+++ b/arch/arm/boot/dts/stm32mp135f-dk.dts
@@ -112,6 +112,20 @@ &i2c1 {
 	/* spare dmas for other usage */
 	/delete-property/dmas;
 	/delete-property/dma-names;
+
+	mcp23017: pinctrl@21 {
+		compatible = "microchip,mcp23017";
+		reg = <0x21>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&gpiog>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&mcp23017_pins_a>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		microchip,irq-mirror;
+	};
 };
 
 &i2c5 {
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] ARM: dts: stm32: add mcp23017 IO expander on I2C1 on stm32mp135f-dk
  2022-10-24  9:46 ` [PATCH 2/2] ARM: dts: stm32: add mcp23017 IO expander on I2C1 on stm32mp135f-dk Amelie Delaunay
@ 2022-11-17  8:39   ` Alexandre TORGUE
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre TORGUE @ 2022-11-17  8:39 UTC (permalink / raw)
  To: Amelie Delaunay, Rob Herring, Krzysztof Kozlowski,
	Maxime Coquelin
  Cc: devicetree, linux-stm32, linux-arm-kernel, linux-kernel

Hi Amélie

On 10/24/22 11:46, Amelie Delaunay wrote:
> MCP23017 is an IO expander offering 16 input/output port expander with
> interrupt output.
> On stm32mp135f-dk, only INTA is routed (on PG12), but MCP23017 can mirror
> the bank B interrupts on INTA, that's why the property microchip,irq-mirror
> is used.
> 
> Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
> ---
>   arch/arm/boot/dts/stm32mp135f-dk.dts | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/stm32mp135f-dk.dts b/arch/arm/boot/dts/stm32mp135f-dk.dts
> index a87ab067c955..d5fc6462ba33 100644
> --- a/arch/arm/boot/dts/stm32mp135f-dk.dts
> +++ b/arch/arm/boot/dts/stm32mp135f-dk.dts
> @@ -112,6 +112,20 @@ &i2c1 {
>   	/* spare dmas for other usage */
>   	/delete-property/dmas;
>   	/delete-property/dma-names;
> +
> +	mcp23017: pinctrl@21 {
> +		compatible = "microchip,mcp23017";
> +		reg = <0x21>;
> +		gpio-controller;
> +		#gpio-cells = <2>;
> +		interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
> +		interrupt-parent = <&gpiog>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&mcp23017_pins_a>;
> +		interrupt-controller;
> +		#interrupt-cells = <2>;
> +		microchip,irq-mirror;
> +	};
>   };
>   
>   &i2c5 {

Both patches applied on stm32-next.

thanks
Alex

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-17  8:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-24  9:46 [PATCH 1/2] ARM: dts: stm32: add mcp23017 pinctrl entry for stm32mp13 Amelie Delaunay
2022-10-24  9:46 ` [PATCH 2/2] ARM: dts: stm32: add mcp23017 IO expander on I2C1 on stm32mp135f-dk Amelie Delaunay
2022-11-17  8:39   ` Alexandre TORGUE

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).