[2/2] ARM: dts: stm32: add mcp23017 IO expander on I2C1 on stm32mp135f-dk

Message ID 20221024094648.145251-3-amelie.delaunay@foss.st.com
State New
Headers
Series [1/2] ARM: dts: stm32: add mcp23017 pinctrl entry for stm32mp13 |

Commit Message

Amelie Delaunay Oct. 24, 2022, 9:46 a.m. UTC
  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(+)
  

Comments

Alexandre TORGUE Nov. 17, 2022, 8:39 a.m. UTC | #1
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
  

Patch

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 {