All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/4]  arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio
@ 2025-04-29 11:31 Francesco Dolcini
  2025-04-29 11:31 ` [PATCH v1 1/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration Francesco Dolcini
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Francesco Dolcini @ 2025-04-29 11:31 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 (2):
  arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration
  arm64: defconfig: Add Toradex Embedded Controller config

 .../freescale/imx8mp-toradex-smarc-dev.dts    |  9 +++++-
 .../dts/freescale/imx8mp-toradex-smarc.dtsi   | 30 +++++++++++++++++++
 arch/arm64/configs/defconfig                  |  1 +
 3 files changed, 39 insertions(+), 1 deletion(-)

-- 
2.39.5


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

* [PATCH v1 1/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration
  2025-04-29 11:31 [PATCH v1 0/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
@ 2025-04-29 11:31 ` Francesco Dolcini
  2025-04-29 11:31 ` [PATCH v1 2/4] arm64: dts: freescale: imx8mp-toradex-smarc: add embedded controller Francesco Dolcini
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Francesco Dolcini @ 2025-04-29 11:31 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>

Configure correctly the FAN pwm output (inverted).

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 .../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 v1 2/4] arm64: dts: freescale: imx8mp-toradex-smarc: add embedded controller
  2025-04-29 11:31 [PATCH v1 0/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
  2025-04-29 11:31 ` [PATCH v1 1/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration Francesco Dolcini
@ 2025-04-29 11:31 ` Francesco Dolcini
  2025-04-29 11:31 ` [PATCH v1 3/4] arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander Francesco Dolcini
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Francesco Dolcini @ 2025-04-29 11:31 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,
	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.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 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 v1 3/4] arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander
  2025-04-29 11:31 [PATCH v1 0/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
  2025-04-29 11:31 ` [PATCH v1 1/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration Francesco Dolcini
  2025-04-29 11:31 ` [PATCH v1 2/4] arm64: dts: freescale: imx8mp-toradex-smarc: add embedded controller Francesco Dolcini
@ 2025-04-29 11:31 ` Francesco Dolcini
  2025-04-30  8:44   ` Peng Fan
  2025-04-29 11:31 ` [PATCH v1 4/4] arm64: defconfig: Add Toradex Embedded Controller config Francesco Dolcini
  2025-04-30  8:45 ` [PATCH v1 0/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Peng Fan
  4 siblings, 1 reply; 7+ messages in thread
From: Francesco Dolcini @ 2025-04-29 11:31 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,
	Francesco Dolcini

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

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

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 .../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..de84e7e52efd 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-expander@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 v1 4/4] arm64: defconfig: Add Toradex Embedded Controller config
  2025-04-29 11:31 [PATCH v1 0/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
                   ` (2 preceding siblings ...)
  2025-04-29 11:31 ` [PATCH v1 3/4] arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander Francesco Dolcini
@ 2025-04-29 11:31 ` Francesco Dolcini
  2025-04-30  8:45 ` [PATCH v1 0/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Peng Fan
  4 siblings, 0 replies; 7+ messages in thread
From: Francesco Dolcini @ 2025-04-29 11:31 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>

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

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 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 v1 3/4] arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander
  2025-04-29 11:31 ` [PATCH v1 3/4] arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander Francesco Dolcini
@ 2025-04-30  8:44   ` Peng Fan
  0 siblings, 0 replies; 7+ messages in thread
From: Peng Fan @ 2025-04-30  8:44 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, Emanuele Ghidoli, devicetree, imx,
	linux-arm-kernel, linux-kernel, Francesco Dolcini

On Tue, Apr 29, 2025 at 01:31:18PM +0200, Francesco Dolcini wrote:
>From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
>
>Add gpio expander node to the device tree and the related nodes.
>
>Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
>Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
>---
> .../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..de84e7e52efd 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-expander@29 {

Use "gpio@29" ?

Regards,
Peng

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

* Re: [PATCH v1 0/4]  arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio
  2025-04-29 11:31 [PATCH v1 0/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
                   ` (3 preceding siblings ...)
  2025-04-29 11:31 ` [PATCH v1 4/4] arm64: defconfig: Add Toradex Embedded Controller config Francesco Dolcini
@ 2025-04-30  8:45 ` Peng Fan
  4 siblings, 0 replies; 7+ messages in thread
From: Peng Fan @ 2025-04-30  8:45 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 Tue, Apr 29, 2025 at 01:31:15PM +0200, Francesco Dolcini wrote:
>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 (2):
>  arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration
>  arm64: defconfig: Add Toradex Embedded Controller config
>

Except the nit in patch 3, all LGTM:

Reviewed-by: Peng Fan <peng.fan@nxp.com>

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

end of thread, other threads:[~2025-04-30  7:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-29 11:31 [PATCH v1 0/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Francesco Dolcini
2025-04-29 11:31 ` [PATCH v1 1/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration Francesco Dolcini
2025-04-29 11:31 ` [PATCH v1 2/4] arm64: dts: freescale: imx8mp-toradex-smarc: add embedded controller Francesco Dolcini
2025-04-29 11:31 ` [PATCH v1 3/4] arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander Francesco Dolcini
2025-04-30  8:44   ` Peng Fan
2025-04-29 11:31 ` [PATCH v1 4/4] arm64: defconfig: Add Toradex Embedded Controller config Francesco Dolcini
2025-04-30  8:45 ` [PATCH v1 0/4] arm64: dts: freescale: imx8mp-toradex-smarc: add fan, ec, gpio Peng Fan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.