devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] i.MX8M PWM polarity support
@ 2022-05-02  9:48 Alexander Stein
  2022-05-02  9:48 ` [PATCH 1/4] arm64: dt: imx8mq: support pwm polarity inversion Alexander Stein
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Alexander Stein @ 2022-05-02  9:48 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer,
	Fabio Estevam
  Cc: Alexander Stein, Pengutronix Kernel Team, NXP Linux Team,
	devicetree, linux-arm-kernel

Hello,

this patchset adds the possibility to specify a PWM polarity inversion for
i.MX8M. The pwm-imx27 driver already supports this in the 3rd pwm-cells, but
the DT for imx8m so far only set #pwm-cells=<2>.
Add support by setting #pwm-cells=<3> and adding the (default) normal (0)
polarity to all boards.
make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/pwm/imx-pwm.yaml
was used to get all boards.

Best regards,
Alexander

Markus Niebel (4):
  arm64: dt: imx8mq: support pwm polarity inversion
  arm64: dt: imx8mm: support pwm polarity inversion
  arm64: dt: imx8mn: support pwm polarity inversion
  arm64: dt: imx8mp: support pwm polarity inversion

 .../boot/dts/freescale/imx8mm-data-modul-edm-sbc.dts      | 2 +-
 arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi             | 2 +-
 arch/arm64/boot/dts/freescale/imx8mm.dtsi                 | 8 ++++----
 arch/arm64/boot/dts/freescale/imx8mn.dtsi                 | 8 ++++----
 arch/arm64/boot/dts/freescale/imx8mp.dtsi                 | 8 ++++----
 arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts   | 2 +-
 arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts      | 2 +-
 arch/arm64/boot/dts/freescale/imx8mq.dtsi                 | 8 ++++----
 8 files changed, 20 insertions(+), 20 deletions(-)

-- 
2.25.1


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

* [PATCH 1/4] arm64: dt: imx8mq: support pwm polarity inversion
  2022-05-02  9:48 [PATCH 0/4] i.MX8M PWM polarity support Alexander Stein
@ 2022-05-02  9:48 ` Alexander Stein
  2022-05-02  9:48 ` [PATCH 2/4] arm64: dt: imx8mm: " Alexander Stein
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Alexander Stein @ 2022-05-02  9:48 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer,
	Fabio Estevam
  Cc: Markus Niebel, Pengutronix Kernel Team, NXP Linux Team,
	devicetree, linux-arm-kernel, Alexander Stein

From: Markus Niebel <Markus.Niebel@ew.tq-group.com>

The i.MX8MQ has the same PWM IP as i.MX6 / i.MX7. This IP and the driver
supporting pwm polarity inversion. Switch CPU device tree fragment to
use 3 pwm-cells and correct board device trees.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 2 +-
 arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts    | 2 +-
 arch/arm64/boot/dts/freescale/imx8mq.dtsi               | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
index 622f3787a186..b86f188a440d 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
@@ -18,7 +18,7 @@ / {
 	backlight_dsi: backlight-dsi {
 		compatible = "pwm-backlight";
 		/* 200 Hz for the PAM2841 */
-		pwms = <&pwm1 0 5000000>;
+		pwms = <&pwm1 0 5000000 0>;
 		brightness-levels = <0 100>;
 		num-interpolated-steps = <100>;
 		/* Default brightness level (index into the array defined by */
diff --git a/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts b/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts
index 94a13cb500e6..8956a46788fa 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts
@@ -18,7 +18,7 @@ backlight: backlight {
 		compatible = "pwm-backlight";
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_backlight>;
-		pwms = <&pwm2 0 10000>;
+		pwms = <&pwm2 0 10000 0>;
 		power-supply = <&reg_main_usb>;
 		enable-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
 		brightness-levels = <0 32 64 128 160 200 255>;
diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
index 1eca2b431467..49eadb081b19 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
@@ -798,7 +798,7 @@ pwm1: pwm@30660000 {
 				clocks = <&clk IMX8MQ_CLK_PWM1_ROOT>,
 				         <&clk IMX8MQ_CLK_PWM1_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
@@ -809,7 +809,7 @@ pwm2: pwm@30670000 {
 				clocks = <&clk IMX8MQ_CLK_PWM2_ROOT>,
 				         <&clk IMX8MQ_CLK_PWM2_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
@@ -820,7 +820,7 @@ pwm3: pwm@30680000 {
 				clocks = <&clk IMX8MQ_CLK_PWM3_ROOT>,
 				         <&clk IMX8MQ_CLK_PWM3_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
@@ -831,7 +831,7 @@ pwm4: pwm@30690000 {
 				clocks = <&clk IMX8MQ_CLK_PWM4_ROOT>,
 				         <&clk IMX8MQ_CLK_PWM4_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
-- 
2.25.1


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

* [PATCH 2/4] arm64: dt: imx8mm: support pwm polarity inversion
  2022-05-02  9:48 [PATCH 0/4] i.MX8M PWM polarity support Alexander Stein
  2022-05-02  9:48 ` [PATCH 1/4] arm64: dt: imx8mq: support pwm polarity inversion Alexander Stein
@ 2022-05-02  9:48 ` Alexander Stein
  2022-05-02  9:49 ` [PATCH 3/4] arm64: dt: imx8mn: " Alexander Stein
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Alexander Stein @ 2022-05-02  9:48 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer,
	Fabio Estevam
  Cc: Markus Niebel, Pengutronix Kernel Team, NXP Linux Team,
	devicetree, linux-arm-kernel, Alexander Stein

From: Markus Niebel <Markus.Niebel@ew.tq-group.com>

The i.MX8M Mini has the same PWM IP as i.MX6 / i.MX7. This IP
and the driver supporting pwm polarity inversion. Switch CPU
device tree fragment to use 3 pwm-cells and correct board
device trees.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 .../boot/dts/freescale/imx8mm-data-modul-edm-sbc.dts      | 2 +-
 arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi             | 2 +-
 arch/arm64/boot/dts/freescale/imx8mm.dtsi                 | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-data-modul-edm-sbc.dts b/arch/arm64/boot/dts/freescale/imx8mm-data-modul-edm-sbc.dts
index 154116d01c94..fbc9cc23700a 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-data-modul-edm-sbc.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mm-data-modul-edm-sbc.dts
@@ -35,7 +35,7 @@ backlight: backlight {
 		brightness-levels = <0 1 10 20 30 40 50 60 70 75 80 90 100>;
 		default-brightness-level = <7>;
 		enable-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
-		pwms = <&pwm1 0 5000000>;
+		pwms = <&pwm1 0 5000000 0>;
 		/* Disabled by default, unless display board plugged in. */
 		status = "disabled";
 	};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
index 6a209395452a..c42b966f7a64 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
@@ -61,7 +61,7 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
 
 	backlight: backlight {
 		compatible = "pwm-backlight";
-		pwms = <&pwm1 0 5000000>;
+		pwms = <&pwm1 0 5000000 0>;
 		brightness-levels = <0 255>;
 		num-interpolated-steps = <255>;
 		default-brightness-level = <250>;
diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index 1ee05677c2dd..1bf070473829 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -758,7 +758,7 @@ pwm1: pwm@30660000 {
 				clocks = <&clk IMX8MM_CLK_PWM1_ROOT>,
 					<&clk IMX8MM_CLK_PWM1_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
@@ -769,7 +769,7 @@ pwm2: pwm@30670000 {
 				clocks = <&clk IMX8MM_CLK_PWM2_ROOT>,
 					 <&clk IMX8MM_CLK_PWM2_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
@@ -780,7 +780,7 @@ pwm3: pwm@30680000 {
 				clocks = <&clk IMX8MM_CLK_PWM3_ROOT>,
 					 <&clk IMX8MM_CLK_PWM3_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
@@ -791,7 +791,7 @@ pwm4: pwm@30690000 {
 				clocks = <&clk IMX8MM_CLK_PWM4_ROOT>,
 					 <&clk IMX8MM_CLK_PWM4_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
-- 
2.25.1


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

* [PATCH 3/4] arm64: dt: imx8mn: support pwm polarity inversion
  2022-05-02  9:48 [PATCH 0/4] i.MX8M PWM polarity support Alexander Stein
  2022-05-02  9:48 ` [PATCH 1/4] arm64: dt: imx8mq: support pwm polarity inversion Alexander Stein
  2022-05-02  9:48 ` [PATCH 2/4] arm64: dt: imx8mm: " Alexander Stein
@ 2022-05-02  9:49 ` Alexander Stein
  2022-05-02  9:49 ` [PATCH 4/4] arm64: dt: imx8mp: " Alexander Stein
  2022-05-05  7:47 ` [PATCH 0/4] i.MX8M PWM polarity support Shawn Guo
  4 siblings, 0 replies; 6+ messages in thread
From: Alexander Stein @ 2022-05-02  9:49 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer,
	Fabio Estevam
  Cc: Markus Niebel, Pengutronix Kernel Team, NXP Linux Team,
	devicetree, linux-arm-kernel, Alexander Stein

From: Markus Niebel <Markus.Niebel@ew.tq-group.com>

The i.MX8M Nano has the same PWM IP as i.MX6 / i.MX7. This IP
and the driver supporting pwm polarity inversion. Switch CPU
device tree fragment to use 3 pwm-cells.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 arch/arm64/boot/dts/freescale/imx8mn.dtsi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
index 8def5d679e7e..e41e1d56f980 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
@@ -705,7 +705,7 @@ pwm1: pwm@30660000 {
 				clocks = <&clk IMX8MN_CLK_PWM1_ROOT>,
 					<&clk IMX8MN_CLK_PWM1_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
@@ -716,7 +716,7 @@ pwm2: pwm@30670000 {
 				clocks = <&clk IMX8MN_CLK_PWM2_ROOT>,
 					 <&clk IMX8MN_CLK_PWM2_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
@@ -727,7 +727,7 @@ pwm3: pwm@30680000 {
 				clocks = <&clk IMX8MN_CLK_PWM3_ROOT>,
 					 <&clk IMX8MN_CLK_PWM3_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
@@ -738,7 +738,7 @@ pwm4: pwm@30690000 {
 				clocks = <&clk IMX8MN_CLK_PWM4_ROOT>,
 					 <&clk IMX8MN_CLK_PWM4_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
-- 
2.25.1


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

* [PATCH 4/4] arm64: dt: imx8mp: support pwm polarity inversion
  2022-05-02  9:48 [PATCH 0/4] i.MX8M PWM polarity support Alexander Stein
                   ` (2 preceding siblings ...)
  2022-05-02  9:49 ` [PATCH 3/4] arm64: dt: imx8mn: " Alexander Stein
@ 2022-05-02  9:49 ` Alexander Stein
  2022-05-05  7:47 ` [PATCH 0/4] i.MX8M PWM polarity support Shawn Guo
  4 siblings, 0 replies; 6+ messages in thread
From: Alexander Stein @ 2022-05-02  9:49 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer,
	Fabio Estevam
  Cc: Markus Niebel, Pengutronix Kernel Team, NXP Linux Team,
	devicetree, linux-arm-kernel, Alexander Stein

From: Markus Niebel <Markus.Niebel@ew.tq-group.com>

The i.MX8M Plus has the same PWM IP as i.MX6 / i.MX7. This IP
and the driver supporting pwm polarity inversion. Switch CPU
device tree fragment to use 3 pwm-cells.

Tested on MBa8MPxL mainboard.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index 7ad824e6b820..89ef26399bfa 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -567,7 +567,7 @@ pwm1: pwm@30660000 {
 				clocks = <&clk IMX8MP_CLK_PWM1_ROOT>,
 					 <&clk IMX8MP_CLK_PWM1_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
@@ -578,7 +578,7 @@ pwm2: pwm@30670000 {
 				clocks = <&clk IMX8MP_CLK_PWM2_ROOT>,
 					 <&clk IMX8MP_CLK_PWM2_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
@@ -589,7 +589,7 @@ pwm3: pwm@30680000 {
 				clocks = <&clk IMX8MP_CLK_PWM3_ROOT>,
 					 <&clk IMX8MP_CLK_PWM3_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
@@ -600,7 +600,7 @@ pwm4: pwm@30690000 {
 				clocks = <&clk IMX8MP_CLK_PWM4_ROOT>,
 					 <&clk IMX8MP_CLK_PWM4_ROOT>;
 				clock-names = "ipg", "per";
-				#pwm-cells = <2>;
+				#pwm-cells = <3>;
 				status = "disabled";
 			};
 
-- 
2.25.1


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

* Re: [PATCH 0/4] i.MX8M PWM polarity support
  2022-05-02  9:48 [PATCH 0/4] i.MX8M PWM polarity support Alexander Stein
                   ` (3 preceding siblings ...)
  2022-05-02  9:49 ` [PATCH 4/4] arm64: dt: imx8mp: " Alexander Stein
@ 2022-05-05  7:47 ` Shawn Guo
  4 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2022-05-05  7:47 UTC (permalink / raw)
  To: Alexander Stein
  Cc: Rob Herring, Krzysztof Kozlowski, Sascha Hauer, Fabio Estevam,
	Pengutronix Kernel Team, NXP Linux Team, devicetree,
	linux-arm-kernel

On Mon, May 02, 2022 at 11:48:57AM +0200, Alexander Stein wrote:
> Hello,
> 
> this patchset adds the possibility to specify a PWM polarity inversion for
> i.MX8M. The pwm-imx27 driver already supports this in the 3rd pwm-cells, but
> the DT for imx8m so far only set #pwm-cells=<2>.
> Add support by setting #pwm-cells=<3> and adding the (default) normal (0)
> polarity to all boards.
> make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/pwm/imx-pwm.yaml
> was used to get all boards.
> 
> Best regards,
> Alexander
> 
> Markus Niebel (4):
>   arm64: dt: imx8mq: support pwm polarity inversion
>   arm64: dt: imx8mm: support pwm polarity inversion
>   arm64: dt: imx8mn: support pwm polarity inversion
>   arm64: dt: imx8mp: support pwm polarity inversion

Applied all, thanks!

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

end of thread, other threads:[~2022-05-05  7:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-02  9:48 [PATCH 0/4] i.MX8M PWM polarity support Alexander Stein
2022-05-02  9:48 ` [PATCH 1/4] arm64: dt: imx8mq: support pwm polarity inversion Alexander Stein
2022-05-02  9:48 ` [PATCH 2/4] arm64: dt: imx8mm: " Alexander Stein
2022-05-02  9:49 ` [PATCH 3/4] arm64: dt: imx8mn: " Alexander Stein
2022-05-02  9:49 ` [PATCH 4/4] arm64: dt: imx8mp: " Alexander Stein
2022-05-05  7:47 ` [PATCH 0/4] i.MX8M PWM polarity support 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).