linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio
@ 2025-04-30  9:41 Francesco Dolcini
  2025-04-30  9:41 ` [PATCH v2 1/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration Francesco Dolcini
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Francesco Dolcini @ 2025-04-30  9:41 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Catalin Marinas, Will Deacon
  Cc: Francesco Dolcini, devicetree, imx, linux-arm-kernel,
	linux-kernel

From: Francesco Dolcini <francesco.dolcini@toradex.com>

Add fan, gpio expander and embedded-controller to the Toradex SMARC iMX8MP
device tree file.

All the required DT bindings and drivers are now in next:
 - https://lore.kernel.org/all/20250331072644.17921-1-francesco@dolcini.it/
 - https://lore.kernel.org/all/20250414171455.155155-1-francesco@dolcini.it/
 - https://lore.kernel.org/all/20250402102146.65406-1-francesco@dolcini.it/

Emanuele Ghidoli (2):
  arm64: dts: freescale: imx8mp-toradex-smarc: add embedded controller
  arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander

Francesco Dolcini (3):
  arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration
  arm64: dts: freescale: imx8mp-toradex-smarc: use generic gpio node
    name
  arm64: defconfig: Add Toradex Embedded Controller config

 .../freescale/imx8mp-toradex-smarc-dev.dts    |  9 +++++-
 .../dts/freescale/imx8mp-toradex-smarc.dtsi   | 32 ++++++++++++++++++-
 arch/arm64/configs/defconfig                  |  1 +
 3 files changed, 40 insertions(+), 2 deletions(-)

-- 
2.39.5



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

* [PATCH v2 1/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration
  2025-04-30  9:41 [PATCH v2 0/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
@ 2025-04-30  9:41 ` Francesco Dolcini
  2025-04-30  9:41 ` [PATCH v2 2/5] arm64: dts: freescale: imx8mp-toradex-smarc: add embedded controller Francesco Dolcini
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Francesco Dolcini @ 2025-04-30  9:41 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Catalin Marinas, Will Deacon
  Cc: Francesco Dolcini, devicetree, imx, linux-arm-kernel,
	linux-kernel, Peng Fan

From: Francesco Dolcini <francesco.dolcini@toradex.com>

Configure correctly the FAN pwm output (inverted).

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v2: add r-b peng
---
 .../boot/dts/freescale/imx8mp-toradex-smarc-dev.dts      | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc-dev.dts b/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc-dev.dts
index 581f221323b7..55b8c5c14fb4 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc-dev.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc-dev.dts
@@ -3,6 +3,8 @@
 
 /dts-v1/;
 
+#include <dt-bindings/pwm/pwm.h>
+
 #include "imx8mp-toradex-smarc.dtsi"
 
 / {
@@ -205,9 +207,14 @@ &i2c6 {
 	status = "okay";
 
 	/* Fan controller */
-	fan@18 {
+	fan_controller: fan@18 {
 		compatible = "ti,amc6821";
 		reg = <0x18>;
+		#pwm-cells = <2>;
+
+		fan {
+			pwms = <&fan_controller 40000 PWM_POLARITY_INVERTED>;
+		};
 	};
 
 	/* Current measurement into module VDD */
-- 
2.39.5



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

* [PATCH v2 2/5] arm64: dts: freescale: imx8mp-toradex-smarc: add embedded controller
  2025-04-30  9:41 [PATCH v2 0/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
  2025-04-30  9:41 ` [PATCH v2 1/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration Francesco Dolcini
@ 2025-04-30  9:41 ` Francesco Dolcini
  2025-04-30  9:41 ` [PATCH v2 3/5] arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander Francesco Dolcini
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Francesco Dolcini @ 2025-04-30  9:41 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Catalin Marinas, Will Deacon
  Cc: Emanuele Ghidoli, devicetree, imx, linux-arm-kernel, linux-kernel,
	Peng Fan, Francesco Dolcini

From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>

Add the embedded controller node to the device tree, this is required
for reset and power-off functionalities.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v2: add r-b peng
---
 arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi
index 0a8b9eee5ed9..c4ca01ce60d0 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi
@@ -534,6 +534,11 @@ reg_sd_3v3_1v8: LDO5 {
 		};
 	};
 
+	embedded-controller@28 {
+		compatible = "toradex,smarc-imx8mp-ec", "toradex,smarc-ec";
+		reg = <0x28>;
+	};
+
 	rtc_i2c: rtc@32 {
 		compatible = "epson,rx8130";
 		reg = <0x32>;
-- 
2.39.5



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

* [PATCH v2 3/5] arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander
  2025-04-30  9:41 [PATCH v2 0/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
  2025-04-30  9:41 ` [PATCH v2 1/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration Francesco Dolcini
  2025-04-30  9:41 ` [PATCH v2 2/5] arm64: dts: freescale: imx8mp-toradex-smarc: add embedded controller Francesco Dolcini
@ 2025-04-30  9:41 ` Francesco Dolcini
  2025-04-30  9:41 ` [PATCH v2 4/5] arm64: dts: freescale: imx8mp-toradex-smarc: use generic gpio node name Francesco Dolcini
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Francesco Dolcini @ 2025-04-30  9:41 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Catalin Marinas, Will Deacon
  Cc: Emanuele Ghidoli, devicetree, imx, linux-arm-kernel, linux-kernel,
	Peng Fan, Francesco Dolcini

From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>

Add gpio expander node to the device tree and the related nodes.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v2: add r-b peng, use generic gpio node name
---
 .../dts/freescale/imx8mp-toradex-smarc.dtsi   | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi
index c4ca01ce60d0..0cd04c3c96bb 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi
@@ -54,6 +54,13 @@ smarc_key_sleep: key-sleep {
 			wakeup-source;
 			linux,code = <KEY_SLEEP>;
 		};
+
+		smarc_switch_lid: switch-lid {
+			gpios = <&som_ec_gpio_expander 2 GPIO_ACTIVE_LOW>;
+			label = "SMARC_LID#";
+			linux,code = <SW_LID>;
+			linux,input-type = <EV_SW>;
+		};
 	};
 
 	reg_usb0_vbus: regulator-usb0-vbus {
@@ -539,6 +546,24 @@ embedded-controller@28 {
 		reg = <0x28>;
 	};
 
+	som_ec_gpio_expander: gpio@29 {
+		compatible = "toradex,ecgpiol16", "nxp,pcal6416";
+		reg = <0x29>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_mcu_int>;
+		#interrupt-cells = <2>;
+		interrupt-controller;
+		interrupt-parent = <&gpio3>;
+		interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
+		#gpio-cells = <2>;
+		gpio-controller;
+		gpio-line-names =
+			"SMARC_CHARGER_PRSNT#",
+			"SMARC_CHARGING#",
+			"SMARC_LID#",
+			"SMARC_BATLOW#";
+	};
+
 	rtc_i2c: rtc@32 {
 		compatible = "epson,rx8130";
 		reg = <0x32>;
-- 
2.39.5



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

* [PATCH v2 4/5] arm64: dts: freescale: imx8mp-toradex-smarc: use generic gpio node name
  2025-04-30  9:41 [PATCH v2 0/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
                   ` (2 preceding siblings ...)
  2025-04-30  9:41 ` [PATCH v2 3/5] arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander Francesco Dolcini
@ 2025-04-30  9:41 ` Francesco Dolcini
  2025-04-30  9:41 ` [PATCH v2 5/5] arm64: defconfig: Add Toradex Embedded Controller config Francesco Dolcini
  2025-05-09 14:42 ` [PATCH v2 0/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Shawn Guo
  5 siblings, 0 replies; 7+ messages in thread
From: Francesco Dolcini @ 2025-04-30  9:41 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Catalin Marinas, Will Deacon
  Cc: Francesco Dolcini, devicetree, imx, linux-arm-kernel,
	linux-kernel

From: Francesco Dolcini <francesco.dolcini@toradex.com>

Use generic node name for the SoM GPIO expander, following the
Devicetree Specification generic node names recommendation.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v2: new patch
---
 arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi
index 0cd04c3c96bb..22f6daabdb90 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp-toradex-smarc.dtsi
@@ -434,7 +434,7 @@ &i2c1 {
 	single-master;
 	status = "okay";
 
-	som_gpio_expander: gpio-expander@21 {
+	som_gpio_expander: gpio@21 {
 		compatible = "nxp,pcal6408";
 		reg = <0x21>;
 		pinctrl-names = "default";
-- 
2.39.5



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

* [PATCH v2 5/5] arm64: defconfig: Add Toradex Embedded Controller config
  2025-04-30  9:41 [PATCH v2 0/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
                   ` (3 preceding siblings ...)
  2025-04-30  9:41 ` [PATCH v2 4/5] arm64: dts: freescale: imx8mp-toradex-smarc: use generic gpio node name Francesco Dolcini
@ 2025-04-30  9:41 ` Francesco Dolcini
  2025-05-09 14:42 ` [PATCH v2 0/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Shawn Guo
  5 siblings, 0 replies; 7+ messages in thread
From: Francesco Dolcini @ 2025-04-30  9:41 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Catalin Marinas, Will Deacon
  Cc: Francesco Dolcini, devicetree, imx, linux-arm-kernel,
	linux-kernel, Peng Fan

From: Francesco Dolcini <francesco.dolcini@toradex.com>

Enable config for Toradex SMARC Embedded Controller, this is required
for proper reset and power-off functionalities on Toradex SMARC iMX8M
Plus.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v2: add r-b peng
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index a92c4122a8b9..d4f1230250fa 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -680,6 +680,7 @@ CONFIG_GPIO_SL28CPLD=m
 CONFIG_GPIO_AGGREGATOR=m
 CONFIG_POWER_RESET_MSM=y
 CONFIG_POWER_RESET_QCOM_PON=m
+CONFIG_POWER_RESET_TORADEX_EC=m
 CONFIG_POWER_RESET_XGENE=y
 CONFIG_POWER_RESET_SYSCON=y
 CONFIG_POWER_RESET_SYSCON_POWEROFF=y
-- 
2.39.5



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

* Re: [PATCH v2 0/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio
  2025-04-30  9:41 [PATCH v2 0/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
                   ` (4 preceding siblings ...)
  2025-04-30  9:41 ` [PATCH v2 5/5] arm64: defconfig: Add Toradex Embedded Controller config Francesco Dolcini
@ 2025-05-09 14:42 ` Shawn Guo
  5 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2025-05-09 14:42 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Catalin Marinas, Will Deacon, Francesco Dolcini, devicetree, imx,
	linux-arm-kernel, linux-kernel

On Wed, Apr 30, 2025 at 11:41:46AM +0200, Francesco Dolcini wrote:
> Emanuele Ghidoli (2):
>   arm64: dts: freescale: imx8mp-toradex-smarc: add embedded controller
>   arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander
> 
> Francesco Dolcini (3):
>   arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration
>   arm64: dts: freescale: imx8mp-toradex-smarc: use generic gpio node
>     name
>   arm64: defconfig: Add Toradex Embedded Controller config

Applied all, thanks!



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

end of thread, other threads:[~2025-05-09 20:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-30  9:41 [PATCH v2 0/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
2025-04-30  9:41 ` [PATCH v2 1/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration Francesco Dolcini
2025-04-30  9:41 ` [PATCH v2 2/5] arm64: dts: freescale: imx8mp-toradex-smarc: add embedded controller Francesco Dolcini
2025-04-30  9:41 ` [PATCH v2 3/5] arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander Francesco Dolcini
2025-04-30  9:41 ` [PATCH v2 4/5] arm64: dts: freescale: imx8mp-toradex-smarc: use generic gpio node name Francesco Dolcini
2025-04-30  9:41 ` [PATCH v2 5/5] arm64: defconfig: Add Toradex Embedded Controller config Francesco Dolcini
2025-05-09 14:42 ` [PATCH v2 0/5] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Shawn Guo

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).