linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] ARM: dts: imx6dl-colibri: Unify with changes to Apalis iMX6 device trees.
@ 2022-05-13 10:26 Max Krummenacher
  2022-05-13 10:26 ` [PATCH v3 1/4] ARM: dts: imx6qdl-colibri: Fix capacitive touch reset polarity Max Krummenacher
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Max Krummenacher @ 2022-05-13 10:26 UTC (permalink / raw)
  To: max.krummenacher
  Cc: Fabio Estevam, Krzysztof Kozlowski, NXP Linux Team,
	Pengutronix Kernel Team, Rob Herring, Sascha Hauer, Shawn Guo,
	devicetree, linux-arm-kernel, linux-kernel

From: Max Krummenacher <max.krummenacher@toradex.com>


- Follows a change to the SGTL5000 MCLK handling fixed for Apalis iMX6 by
  Fabio.
- Simplify handling of inverted PWM backlight
- Fixes a regression for the capacitive touch introduced with
  https://lore.kernel.org/all/20220411152234.12678-1-max.oss.09@gmail.com/


Changes in v3:
- add reviewed-by tags
- Extend commit comment of "ARM: dts: imx6qdl-colibri: backlight pwm: Simplify inverted backlight"

Changes in v2:
- add reviewed-by tags
- Split the Backlight PWM patch into two patches, a) #pwm-cells 3, b) adapt brightness steps

Max Krummenacher (4):
  ARM: dts: imx6qdl-colibri: Fix capacitive touch reset polarity
  ARM: dts: imx6qdl-colibri: Mux mclk for sgtl5000 with the codec node
  ARM: dts: imx6qdl-colibri: backlight pwm: Simplify inverted backlight
  ARM: dts: imx6qdl-colibri: backlight pwm: Adapt brightness steps

 arch/arm/boot/dts/imx6qdl-colibri.dtsi | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

-- 
2.20.1


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

* [PATCH v3 1/4] ARM: dts: imx6qdl-colibri: Fix capacitive touch reset polarity
  2022-05-13 10:26 [PATCH v3 0/4] ARM: dts: imx6dl-colibri: Unify with changes to Apalis iMX6 device trees Max Krummenacher
@ 2022-05-13 10:26 ` Max Krummenacher
  2022-05-13 10:26 ` [PATCH v3 2/4] ARM: dts: imx6qdl-colibri: Mux mclk for sgtl5000 with the codec node Max Krummenacher
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Max Krummenacher @ 2022-05-13 10:26 UTC (permalink / raw)
  To: max.krummenacher
  Cc: Fabio Estevam, Krzysztof Kozlowski, NXP Linux Team,
	Pengutronix Kernel Team, Rob Herring, Sascha Hauer, Shawn Guo,
	devicetree, linux-arm-kernel, linux-kernel

From: Max Krummenacher <max.krummenacher@toradex.com>

The commit feedaacdadfc ("Input: atmel_mxt_ts - fix up inverted RESET
handler") requires the reset GPIO to have GPIO_ACTIVE_LOW.

Fixes: 1524b27c94a6 ("ARM: dts: imx6dl-colibri: Move common nodes to SoM dtsi")
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>

---

(no changes since v2)

Changes in v2:
- Added Fabio's 'Reviewed-by'
- Removed blank line in commit text

 arch/arm/boot/dts/imx6qdl-colibri.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx6qdl-colibri.dtsi b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
index c383e0e4110c..7df270cea292 100644
--- a/arch/arm/boot/dts/imx6qdl-colibri.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
@@ -593,7 +593,7 @@
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_atmel_conn>;
 		reg = <0x4a>;
-		reset-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;	/* SODIMM 106 */
+		reset-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;	/* SODIMM 106 */
 		status = "disabled";
 	};
 };
-- 
2.20.1


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

* [PATCH v3 2/4] ARM: dts: imx6qdl-colibri: Mux mclk for sgtl5000 with the codec node
  2022-05-13 10:26 [PATCH v3 0/4] ARM: dts: imx6dl-colibri: Unify with changes to Apalis iMX6 device trees Max Krummenacher
  2022-05-13 10:26 ` [PATCH v3 1/4] ARM: dts: imx6qdl-colibri: Fix capacitive touch reset polarity Max Krummenacher
@ 2022-05-13 10:26 ` Max Krummenacher
  2022-05-13 10:26 ` [PATCH v3 3/4] ARM: dts: imx6qdl-colibri: backlight pwm: Simplify inverted backlight Max Krummenacher
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Max Krummenacher @ 2022-05-13 10:26 UTC (permalink / raw)
  To: max.krummenacher
  Cc: Fabio Estevam, Krzysztof Kozlowski, NXP Linux Team,
	Pengutronix Kernel Team, Rob Herring, Sascha Hauer, Shawn Guo,
	devicetree, linux-arm-kernel, linux-kernel

From: Max Krummenacher <max.krummenacher@toradex.com>

Move the pin muxing for MCLK used by the codec to the codec node
instead of placing it inside the audmux pinctrl group.

While no negative effects have been observed this should make sure that
MCLK is provided when the codec driver is probed.

Follows commit fa51e1dc4b91 ("ARM: dts: imx6qdl-apalis: Fix sgtl5000
detection issue")

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>

---

(no changes since v2)

Changes in v2:
- Added Fabio's 'Reviewed-by'

 arch/arm/boot/dts/imx6qdl-colibri.dtsi | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-colibri.dtsi b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
index 7df270cea292..f0908b530f86 100644
--- a/arch/arm/boot/dts/imx6qdl-colibri.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
@@ -520,6 +520,8 @@
 		compatible = "fsl,sgtl5000";
 		clocks = <&clks IMX6QDL_CLK_CKO>;
 		lrclk-strength = <3>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_sgtl5000>;
 		reg = <0x0a>;
 		#sound-dai-cells = <0>;
 		VDDA-supply = <&reg_module_3v3_audio>;
@@ -739,8 +741,6 @@
 
 	pinctrl_audmux: audmuxgrp {
 		fsl,pins = <
-			/* SGTL5000 sys_mclk */
-			MX6QDL_PAD_GPIO_0__CCM_CLKO1	0x000b0
 			MX6QDL_PAD_KEY_COL0__AUD5_TXC	0x130b0
 			MX6QDL_PAD_KEY_ROW0__AUD5_TXD	0x130b0
 			MX6QDL_PAD_KEY_COL1__AUD5_TXFS	0x130b0
@@ -991,6 +991,13 @@
 		>;
 	};
 
+	pinctrl_sgtl5000: sgtl5000grp {
+		fsl,pins = <
+			/* SGTL5000 sys_mclk */
+			MX6QDL_PAD_GPIO_0__CCM_CLKO1	0x000b0
+		>;
+	};
+
 	pinctrl_spdif: spdifgrp {
 		fsl,pins = <
 			MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x1b0b0
-- 
2.20.1


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

* [PATCH v3 3/4] ARM: dts: imx6qdl-colibri: backlight pwm: Simplify inverted backlight
  2022-05-13 10:26 [PATCH v3 0/4] ARM: dts: imx6dl-colibri: Unify with changes to Apalis iMX6 device trees Max Krummenacher
  2022-05-13 10:26 ` [PATCH v3 1/4] ARM: dts: imx6qdl-colibri: Fix capacitive touch reset polarity Max Krummenacher
  2022-05-13 10:26 ` [PATCH v3 2/4] ARM: dts: imx6qdl-colibri: Mux mclk for sgtl5000 with the codec node Max Krummenacher
@ 2022-05-13 10:26 ` Max Krummenacher
  2022-05-13 10:53   ` Fabio Estevam
  2022-05-13 10:26 ` [PATCH v3 4/4] ARM: dts: imx6qdl-colibri: backlight pwm: Adapt brightness steps Max Krummenacher
  2022-06-11  8:51 ` [PATCH v3 0/4] ARM: dts: imx6dl-colibri: Unify with changes to Apalis iMX6 device trees Shawn Guo
  4 siblings, 1 reply; 7+ messages in thread
From: Max Krummenacher @ 2022-05-13 10:26 UTC (permalink / raw)
  To: max.krummenacher
  Cc: Fabio Estevam, Krzysztof Kozlowski, NXP Linux Team,
	Pengutronix Kernel Team, Rob Herring, Sascha Hauer, Shawn Guo,
	devicetree, linux-arm-kernel, linux-kernel

From: Max Krummenacher <max.krummenacher@toradex.com>

Set #pwm-cells to the default 3 to gain access to the parameter
which allows inverting the PWM signal. This is useful to specify
a backlight which has its highest brightness at 0.

With the change to use the PWM with inverted polarity the PWM signal
is inverted to how it was before this patch.
This changes the meaning of the values in the brightness-levels
property. I.e. the duty-cycle changes from x/255 to (255-x)/255.
Keeping the brightness-levels will then have a big brightness
jump from 0 to 127 duty cycle, the other 6 steps will then be
barely noticeable.

Change the brightness-levels to provide the same brightness-levels
as before.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>

---

Changes in v3:
- Add the reason why brightness-levels needs a change to commit
  comment as proposed by Fabio Estevam

Changes in v2:
- Split to two patches as proposed by Fabio Estevam

 arch/arm/boot/dts/imx6qdl-colibri.dtsi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-colibri.dtsi b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
index f0908b530f86..d91fae92c90a 100644
--- a/arch/arm/boot/dts/imx6qdl-colibri.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
@@ -6,6 +6,7 @@
  */
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pwm/pwm.h>
 
 / {
 	model = "Toradex Colibri iMX6DL/S Module";
@@ -13,13 +14,13 @@
 
 	backlight: backlight {
 		compatible = "pwm-backlight";
-		brightness-levels = <0 127 191 223 239 247 251 255>;
-		default-brightness-level = <1>;
+		brightness-levels = <0 4 8 16 32 64 128 255>;
+		default-brightness-level = <6>;
 		enable-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>; /* Colibri BL_ON */
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_gpio_bl_on>;
 		power-supply = <&reg_module_3v3>;
-		pwms = <&pwm3 0 5000000>;
+		pwms = <&pwm3 0 5000000 PWM_POLARITY_INVERTED>;
 		status = "disabled";
 	};
 
@@ -620,7 +621,6 @@
 
 /* Colibri PWM<A> */
 &pwm3 {
-	#pwm-cells = <2>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_pwm3>;
 	status = "disabled";
-- 
2.20.1


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

* [PATCH v3 4/4] ARM: dts: imx6qdl-colibri: backlight pwm: Adapt brightness steps
  2022-05-13 10:26 [PATCH v3 0/4] ARM: dts: imx6dl-colibri: Unify with changes to Apalis iMX6 device trees Max Krummenacher
                   ` (2 preceding siblings ...)
  2022-05-13 10:26 ` [PATCH v3 3/4] ARM: dts: imx6qdl-colibri: backlight pwm: Simplify inverted backlight Max Krummenacher
@ 2022-05-13 10:26 ` Max Krummenacher
  2022-06-11  8:51 ` [PATCH v3 0/4] ARM: dts: imx6dl-colibri: Unify with changes to Apalis iMX6 device trees Shawn Guo
  4 siblings, 0 replies; 7+ messages in thread
From: Max Krummenacher @ 2022-05-13 10:26 UTC (permalink / raw)
  To: max.krummenacher
  Cc: Fabio Estevam, Krzysztof Kozlowski, NXP Linux Team,
	Pengutronix Kernel Team, Rob Herring, Sascha Hauer, Shawn Guo,
	devicetree, linux-arm-kernel, linux-kernel

From: Max Krummenacher <max.krummenacher@toradex.com>

Adapt the brightness steps as the backlight doesn't light up
for very low duty cycles.

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>

---

(no changes since v2)

Changes in v2:
- add reviewed-by tags
- Split the Backlight PWM patch into two patches, a) #pwm-cells 3, b) adapt brightness steps
- Split to two patches as proposed by Fabio Estevam

 arch/arm/boot/dts/imx6qdl-colibri.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-colibri.dtsi b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
index d91fae92c90a..023e76215064 100644
--- a/arch/arm/boot/dts/imx6qdl-colibri.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
@@ -14,8 +14,8 @@
 
 	backlight: backlight {
 		compatible = "pwm-backlight";
-		brightness-levels = <0 4 8 16 32 64 128 255>;
-		default-brightness-level = <6>;
+		brightness-levels = <0 45 63 88 119 158 203 255>;
+		default-brightness-level = <4>;
 		enable-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>; /* Colibri BL_ON */
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_gpio_bl_on>;
-- 
2.20.1


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

* Re: [PATCH v3 3/4] ARM: dts: imx6qdl-colibri: backlight pwm: Simplify inverted backlight
  2022-05-13 10:26 ` [PATCH v3 3/4] ARM: dts: imx6qdl-colibri: backlight pwm: Simplify inverted backlight Max Krummenacher
@ 2022-05-13 10:53   ` Fabio Estevam
  0 siblings, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2022-05-13 10:53 UTC (permalink / raw)
  To: Max Krummenacher
  Cc: Max Krummenacher, Krzysztof Kozlowski, NXP Linux Team,
	Pengutronix Kernel Team, Rob Herring, Sascha Hauer, Shawn Guo,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-kernel

Hi Max,

On Fri, May 13, 2022 at 7:27 AM Max Krummenacher <max.oss.09@gmail.com> wrote:
>
> From: Max Krummenacher <max.krummenacher@toradex.com>
>
> Set #pwm-cells to the default 3 to gain access to the parameter
> which allows inverting the PWM signal. This is useful to specify
> a backlight which has its highest brightness at 0.
>
> With the change to use the PWM with inverted polarity the PWM signal
> is inverted to how it was before this patch.
> This changes the meaning of the values in the brightness-levels
> property. I.e. the duty-cycle changes from x/255 to (255-x)/255.
> Keeping the brightness-levels will then have a big brightness
> jump from 0 to 127 duty cycle, the other 6 steps will then be
> barely noticeable.
>
> Change the brightness-levels to provide the same brightness-levels
> as before.
>
> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>

Thanks for the rework:

Reviewed-by: Fabio Estevam <festevam@gmail.com>

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

* Re: [PATCH v3 0/4] ARM: dts: imx6dl-colibri: Unify with changes to Apalis iMX6 device trees.
  2022-05-13 10:26 [PATCH v3 0/4] ARM: dts: imx6dl-colibri: Unify with changes to Apalis iMX6 device trees Max Krummenacher
                   ` (3 preceding siblings ...)
  2022-05-13 10:26 ` [PATCH v3 4/4] ARM: dts: imx6qdl-colibri: backlight pwm: Adapt brightness steps Max Krummenacher
@ 2022-06-11  8:51 ` Shawn Guo
  4 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2022-06-11  8:51 UTC (permalink / raw)
  To: Max Krummenacher
  Cc: max.krummenacher, Fabio Estevam, Krzysztof Kozlowski,
	NXP Linux Team, Pengutronix Kernel Team, Rob Herring,
	Sascha Hauer, devicetree, linux-arm-kernel, linux-kernel

On Fri, May 13, 2022 at 12:26:11PM +0200, Max Krummenacher wrote:
> From: Max Krummenacher <max.krummenacher@toradex.com>
> 
> 
> - Follows a change to the SGTL5000 MCLK handling fixed for Apalis iMX6 by
>   Fabio.
> - Simplify handling of inverted PWM backlight
> - Fixes a regression for the capacitive touch introduced with
>   https://lore.kernel.org/all/20220411152234.12678-1-max.oss.09@gmail.com/
> 
> 
> Changes in v3:
> - add reviewed-by tags
> - Extend commit comment of "ARM: dts: imx6qdl-colibri: backlight pwm: Simplify inverted backlight"
> 
> Changes in v2:
> - add reviewed-by tags
> - Split the Backlight PWM patch into two patches, a) #pwm-cells 3, b) adapt brightness steps
> 
> Max Krummenacher (4):
>   ARM: dts: imx6qdl-colibri: Fix capacitive touch reset polarity
>   ARM: dts: imx6qdl-colibri: Mux mclk for sgtl5000 with the codec node
>   ARM: dts: imx6qdl-colibri: backlight pwm: Simplify inverted backlight
>   ARM: dts: imx6qdl-colibri: backlight pwm: Adapt brightness steps

Applied, thanks!

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 10:26 [PATCH v3 0/4] ARM: dts: imx6dl-colibri: Unify with changes to Apalis iMX6 device trees Max Krummenacher
2022-05-13 10:26 ` [PATCH v3 1/4] ARM: dts: imx6qdl-colibri: Fix capacitive touch reset polarity Max Krummenacher
2022-05-13 10:26 ` [PATCH v3 2/4] ARM: dts: imx6qdl-colibri: Mux mclk for sgtl5000 with the codec node Max Krummenacher
2022-05-13 10:26 ` [PATCH v3 3/4] ARM: dts: imx6qdl-colibri: backlight pwm: Simplify inverted backlight Max Krummenacher
2022-05-13 10:53   ` Fabio Estevam
2022-05-13 10:26 ` [PATCH v3 4/4] ARM: dts: imx6qdl-colibri: backlight pwm: Adapt brightness steps Max Krummenacher
2022-06-11  8:51 ` [PATCH v3 0/4] ARM: dts: imx6dl-colibri: Unify with changes to Apalis iMX6 device trees 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).