All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] imx8mm: add pwm-imx backlight support
@ 2022-03-16  9:00 Tommaso Merciai
  2022-03-16  9:00 ` [PATCH 1/9] arch: mach-imx: imx8m: add pwm1/pwm2 base address Tommaso Merciai
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16  9:00 UTC (permalink / raw)
  Cc: tommaso.merciai, Peng Fan, Alice Guo, Andrey Zhizhikin, Ye Li, u-boot

Hi,
This series add support for pwm/backlight on i.MX8MM evk:

1. Add pwm1/pwm2 base address registers defines
2. Add defines for pwm control register field
3. Add struct pwm_regs
4. Add enable_pwm_clk function, configure and enable pwm clock control register
5. Add enable_pwm_clk function in clock.h
6. Add CONFIG_IMX6_PWM_PER_CLK in imx8mm_evk.h
7. Add backlight/pwm1 dts nodes support for iMX8MM evk
8. Enable pwm clk into spl
9. Enable support for pwm-imx/backlight for iMX8MM evk

Regards,
Tommaso

Tommaso Merciai (9):
  arch: mach-imx: imx8m: add pwm1/pwm2 base address
  arch: mach-imx: imx8m: add pwm ctrl registers fields defines
  arch: mach-imx: imx8m: add pwm_regs struct into imx-regs.h
  arm: imx: imx8mm: add enable_pwm_clk function
  imx8m: clock: add enable_pwm_clk function
  configs: imx8mm_evk: add CONFIG_IMX6_PWM_PER_CLK config
  imx8mm_evk: spl: enable pwm clock
  arm: dts: imx8mm_evk: add pwm1 backlight support
  configs: imx8mm_evk: add pwm backlight support

 arch/arm/dts/imx8mm-evk.dtsi               | 21 +++++++++++++++++++++
 arch/arm/include/asm/arch-imx8m/clock.h    |  1 +
 arch/arm/include/asm/arch-imx8m/imx-regs.h | 19 +++++++++++++++++++
 arch/arm/mach-imx/imx8m/clock_imx8mm.c     | 11 +++++++++++
 board/freescale/imx8mm_evk/spl.c           |  4 ++++
 configs/imx8mm_evk_defconfig               |  5 +++++
 include/configs/imx8mm_evk.h               |  3 +++
 7 files changed, 64 insertions(+)

-- 
2.25.1


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

* [PATCH 1/9] arch: mach-imx: imx8m: add pwm1/pwm2 base address
  2022-03-16  9:00 [PATCH 0/9] imx8mm: add pwm-imx backlight support Tommaso Merciai
@ 2022-03-16  9:00 ` Tommaso Merciai
  2022-03-16  9:00 ` [PATCH 2/9] arch: mach-imx: imx8m: add pwm ctrl registers fields defines Tommaso Merciai
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16  9:00 UTC (permalink / raw)
  Cc: tommaso.merciai, Peng Fan, Alice Guo, Andrey Zhizhikin, Ye Li, u-boot

Add pwm1/pwm2 base address defines into imx-regs file

References:
 - IMX8MMRM.pdf p 3882

Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
---
 arch/arm/include/asm/arch-imx8m/imx-regs.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/include/asm/arch-imx8m/imx-regs.h b/arch/arm/include/asm/arch-imx8m/imx-regs.h
index 11389a0f4d..38f8ba41c3 100644
--- a/arch/arm/include/asm/arch-imx8m/imx-regs.h
+++ b/arch/arm/include/asm/arch-imx8m/imx-regs.h
@@ -31,6 +31,8 @@
 #define SRC_BASE_ADDR		0x30390000
 #define GPC_BASE_ADDR		0x303A0000
 
+#define PWM1_BASE_ADDR		0x30660000
+#define PWM2_BASE_ADDR		0x30670000
 #define SYSCNT_RD_BASE_ADDR	0x306A0000
 #define SYSCNT_CMP_BASE_ADDR	0x306B0000
 #define SYSCNT_CTRL_BASE_ADDR	0x306C0000
-- 
2.25.1


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

* [PATCH 2/9] arch: mach-imx: imx8m: add pwm ctrl registers fields defines
  2022-03-16  9:00 [PATCH 0/9] imx8mm: add pwm-imx backlight support Tommaso Merciai
  2022-03-16  9:00 ` [PATCH 1/9] arch: mach-imx: imx8m: add pwm1/pwm2 base address Tommaso Merciai
@ 2022-03-16  9:00 ` Tommaso Merciai
  2022-03-16  9:00 ` [PATCH 3/9] arch: mach-imx: imx8m: add pwm_regs struct in imx-regs Tommaso Merciai
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16  9:00 UTC (permalink / raw)
  Cc: tommaso.merciai, Peng Fan, Ye Li, Andrey Zhizhikin, Alice Guo, u-boot

Add pwm control registers fields defines into imx-regs.h:

 - prescaler
 - dozeen
 - waiten
 - dbgen
 - clksrc_ipg_high
 - clksrc_ipg, en field

References:
 - iMX8MMRM.pdf p 3884

Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
---
 arch/arm/include/asm/arch-imx8m/imx-regs.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/include/asm/arch-imx8m/imx-regs.h b/arch/arm/include/asm/arch-imx8m/imx-regs.h
index 38f8ba41c3..13538ba5f6 100644
--- a/arch/arm/include/asm/arch-imx8m/imx-regs.h
+++ b/arch/arm/include/asm/arch-imx8m/imx-regs.h
@@ -353,6 +353,14 @@ struct src {
 	u32 ddr2_rcr;
 };
 
+#define PWMCR_PRESCALER(x)	(((x - 1) & 0xFFF) << 4)
+#define PWMCR_DOZEEN		(1 << 24)
+#define PWMCR_WAITEN		(1 << 23)
+#define PWMCR_DBGEN		(1 << 22)
+#define PWMCR_CLKSRC_IPG_HIGH	(2 << 16)
+#define PWMCR_CLKSRC_IPG	(1 << 16)
+#define PWMCR_EN		(1 << 0)
+
 #define WDOG_WDT_MASK	BIT(3)
 #define WDOG_WDZST_MASK	BIT(0)
 struct wdog_regs {
-- 
2.25.1


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

* [PATCH 3/9] arch: mach-imx: imx8m: add pwm_regs struct in imx-regs
  2022-03-16  9:00 [PATCH 0/9] imx8mm: add pwm-imx backlight support Tommaso Merciai
  2022-03-16  9:00 ` [PATCH 1/9] arch: mach-imx: imx8m: add pwm1/pwm2 base address Tommaso Merciai
  2022-03-16  9:00 ` [PATCH 2/9] arch: mach-imx: imx8m: add pwm ctrl registers fields defines Tommaso Merciai
@ 2022-03-16  9:00 ` Tommaso Merciai
  2022-03-16  9:00 ` [PATCH 4/9] arm: imx: imx8mm: add enable_pwm_clk function Tommaso Merciai
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16  9:00 UTC (permalink / raw)
  Cc: tommaso.merciai, Peng Fan, Andrey Zhizhikin, Ye Li, Alice Guo, u-boot

Add pwm_regs struct for i.MX8MM SOC

Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
---
 arch/arm/include/asm/arch-imx8m/imx-regs.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/include/asm/arch-imx8m/imx-regs.h b/arch/arm/include/asm/arch-imx8m/imx-regs.h
index 13538ba5f6..9217f93a50 100644
--- a/arch/arm/include/asm/arch-imx8m/imx-regs.h
+++ b/arch/arm/include/asm/arch-imx8m/imx-regs.h
@@ -361,6 +361,15 @@ struct src {
 #define PWMCR_CLKSRC_IPG	(1 << 16)
 #define PWMCR_EN		(1 << 0)
 
+struct pwm_regs {
+	u32	cr;
+	u32	sr;
+	u32	ir;
+	u32	sar;
+	u32	pr;
+	u32	cnr;
+};
+
 #define WDOG_WDT_MASK	BIT(3)
 #define WDOG_WDZST_MASK	BIT(0)
 struct wdog_regs {
-- 
2.25.1


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

* [PATCH 4/9] arm: imx: imx8mm: add enable_pwm_clk function
  2022-03-16  9:00 [PATCH 0/9] imx8mm: add pwm-imx backlight support Tommaso Merciai
                   ` (2 preceding siblings ...)
  2022-03-16  9:00 ` [PATCH 3/9] arch: mach-imx: imx8m: add pwm_regs struct in imx-regs Tommaso Merciai
@ 2022-03-16  9:00 ` Tommaso Merciai
  2022-03-16  9:05   ` Michael Nazzareno Trimarchi
  2022-03-16  9:00 ` [PATCH 5/9] imx8m: clock: " Tommaso Merciai
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16  9:00 UTC (permalink / raw)
  Cc: tommaso.merciai, Stefano Babic, Fabio Estevam,
	NXP i.MX U-Boot Team, Peng Fan, Andrey Zhizhikin, Alice Guo,
	Ye Li, Marek Vasut, Marek Behún, u-boot

Add function to enable_pwm_clck function into clock_imx8mm.c. This
function first configure, then enable pwm1 clock from clock control
register. The following configuration is used:

source(0) -> 24 MHz ref clock
div(0)    -> no division for this clock

References:
 - iMX8MMRM.pdf p 303

Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
---
 arch/arm/mach-imx/imx8m/clock_imx8mm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
index 49945faf2c..5f2eddf715 100644
--- a/arch/arm/mach-imx/imx8m/clock_imx8mm.c
+++ b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
@@ -313,6 +313,17 @@ void enable_usboh3_clk(unsigned int enable)
 	}
 }
 
+void enable_pwm_clk(unsigned char enable)
+{
+	if (enable) {
+		clock_enable(CCGR_PWM1, false);
+		clock_set_target_val(PWM1_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(0) |CLK_ROOT_PRE_DIV(CLK_ROOT_PRE_DIV1));
+		clock_enable(CCGR_PWM1, true);
+	} else {
+		clock_enable(CCGR_PWM1, false);
+	}
+}
+
 void init_uart_clk(u32 index)
 {
 	/*
-- 
2.25.1


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

* [PATCH 5/9] imx8m: clock: add enable_pwm_clk function
  2022-03-16  9:00 [PATCH 0/9] imx8mm: add pwm-imx backlight support Tommaso Merciai
                   ` (3 preceding siblings ...)
  2022-03-16  9:00 ` [PATCH 4/9] arm: imx: imx8mm: add enable_pwm_clk function Tommaso Merciai
@ 2022-03-16  9:00 ` Tommaso Merciai
  2022-03-16  9:00 ` [PATCH 6/9] configs: imx8mm_evk: add CONFIG_IMX6_PWM_PER_CLK config Tommaso Merciai
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16  9:00 UTC (permalink / raw)
  Cc: tommaso.merciai, Peng Fan, Ye Li, Patrick Wildt, Alice Guo,
	Andrey Zhizhikin, u-boot

Add enable_pwm_clk function in clock.h

Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
---
 arch/arm/include/asm/arch-imx8m/clock.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/arch-imx8m/clock.h b/arch/arm/include/asm/arch-imx8m/clock.h
index 50359d8e46..5692bafcea 100644
--- a/arch/arm/include/asm/arch-imx8m/clock.h
+++ b/arch/arm/include/asm/arch-imx8m/clock.h
@@ -278,3 +278,4 @@ int set_clk_enet(enum enet_freq type);
 int set_clk_eqos(enum enet_freq type);
 void hab_caam_clock_enable(unsigned char enable);
 void enable_usboh3_clk(unsigned int enable);
+void enable_pwm_clk(unsigned char enable);
-- 
2.25.1


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

* [PATCH 6/9] configs: imx8mm_evk: add CONFIG_IMX6_PWM_PER_CLK config
  2022-03-16  9:00 [PATCH 0/9] imx8mm: add pwm-imx backlight support Tommaso Merciai
                   ` (4 preceding siblings ...)
  2022-03-16  9:00 ` [PATCH 5/9] imx8m: clock: " Tommaso Merciai
@ 2022-03-16  9:00 ` Tommaso Merciai
  2022-03-16  9:00 ` [PATCH 7/9] imx8mm_evk: spl: enable pwm clock Tommaso Merciai
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16  9:00 UTC (permalink / raw)
  Cc: tommaso.merciai, Peng Fan, Alice Guo, Andrey Zhizhikin, Ye Li, u-boot

In order to support pwm-imx-util CONFIG_IMX6_PWM_PER_CLK is needed.
At the moment driver don't support clock framework

Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
---
 include/configs/imx8mm_evk.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/configs/imx8mm_evk.h b/include/configs/imx8mm_evk.h
index c7022ef0f7..3c17dd3773 100644
--- a/include/configs/imx8mm_evk.h
+++ b/include/configs/imx8mm_evk.h
@@ -91,4 +91,7 @@
 
 #define IMX_FEC_BASE			0x30BE0000
 
+#ifdef CONFIG_PWM_IMX
+	#define CONFIG_IMX6_PWM_PER_CLK	66000000
+#endif
 #endif
-- 
2.25.1


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

* [PATCH 7/9] imx8mm_evk: spl: enable pwm clock
  2022-03-16  9:00 [PATCH 0/9] imx8mm: add pwm-imx backlight support Tommaso Merciai
                   ` (5 preceding siblings ...)
  2022-03-16  9:00 ` [PATCH 6/9] configs: imx8mm_evk: add CONFIG_IMX6_PWM_PER_CLK config Tommaso Merciai
@ 2022-03-16  9:00 ` Tommaso Merciai
  2022-03-16  9:00 ` [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support Tommaso Merciai
  2022-03-16  9:00 ` [PATCH 9/9] configs: imx8mm_evk: add pwm backlight support Tommaso Merciai
  8 siblings, 0 replies; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16  9:00 UTC (permalink / raw)
  Cc: tommaso.merciai, Peng Fan, Stefano Babic, Fabio Estevam,
	NXP i.MX U-Boot Team, Ye Li, Andrey Zhizhikin, Alice Guo, u-boot

Enable pwm clock into spl

Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
---
 board/freescale/imx8mm_evk/spl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/board/freescale/imx8mm_evk/spl.c b/board/freescale/imx8mm_evk/spl.c
index 4ef7f6f180..5aabdba0b0 100644
--- a/board/freescale/imx8mm_evk/spl.c
+++ b/board/freescale/imx8mm_evk/spl.c
@@ -135,6 +135,10 @@ void board_init_f(ulong dummy)
 
 	init_uart_clk(1);
 
+#ifdef CONFIG_PWM_IMX
+	enable_pwm_clk(1);
+#endif
+
 	board_early_init_f();
 
 	timer_init();
-- 
2.25.1


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

* [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support
  2022-03-16  9:00 [PATCH 0/9] imx8mm: add pwm-imx backlight support Tommaso Merciai
                   ` (6 preceding siblings ...)
  2022-03-16  9:00 ` [PATCH 7/9] imx8mm_evk: spl: enable pwm clock Tommaso Merciai
@ 2022-03-16  9:00 ` Tommaso Merciai
  2022-03-16 10:30   ` Michael Walle
  2022-03-16 23:57   ` Fabio Estevam
  2022-03-16  9:00 ` [PATCH 9/9] configs: imx8mm_evk: add pwm backlight support Tommaso Merciai
  8 siblings, 2 replies; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16  9:00 UTC (permalink / raw)
  Cc: tommaso.merciai, Stefano Babic, Fabio Estevam,
	NXP i.MX U-Boot Team, Peng Fan, Andrey Zhizhikin, Alice Guo,
	Ye Li, u-boot

Add pwm1/backlight support nodes for imx8mm_evk board

Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
---
 arch/arm/dts/imx8mm-evk.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dtsi
index 60179e006d..e7a2bd8a64 100644
--- a/arch/arm/dts/imx8mm-evk.dtsi
+++ b/arch/arm/dts/imx8mm-evk.dtsi
@@ -41,6 +41,15 @@
 		enable-active-high;
 	};
 
+	backlight: backlight {
+		status = "disabled";
+		compatible = "pwm-backlight";
+		pwms = <&pwm1 0 5000000>;
+		brightness-levels = <0 255>;
+		num-interpolated-steps = <255>;
+		default-brightness-level = <250>;
+	};
+
 	ir-receiver {
 		compatible = "gpio-ir-receiver";
 		gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
@@ -350,6 +359,12 @@
 	status = "okay";
 };
 
+&pwm1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_backlight>;
+	status = "disabled";
+};
+
 &iomuxc {
 	pinctrl_fec1: fec1grp {
 		fsl,pins = <
@@ -491,4 +506,10 @@
 			MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x166
 		>;
 	};
+
+	pinctrl_backlight: backlightgrp {
+		fsl,pins = <
+			MX8MM_IOMUXC_GPIO1_IO01_PWM1_OUT	0x06
+		>;
+	};
 };
-- 
2.25.1


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

* [PATCH 9/9] configs: imx8mm_evk: add pwm backlight support
  2022-03-16  9:00 [PATCH 0/9] imx8mm: add pwm-imx backlight support Tommaso Merciai
                   ` (7 preceding siblings ...)
  2022-03-16  9:00 ` [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support Tommaso Merciai
@ 2022-03-16  9:00 ` Tommaso Merciai
  8 siblings, 0 replies; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16  9:00 UTC (permalink / raw)
  Cc: tommaso.merciai, Peng Fan, Andrey Zhizhikin, Alice Guo, Ye Li, u-boot

Enable support for backlight/pwm-imx driver

Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
---
 configs/imx8mm_evk_defconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
index 01395fc7eb..cfba6cc673 100644
--- a/configs/imx8mm_evk_defconfig
+++ b/configs/imx8mm_evk_defconfig
@@ -84,3 +84,8 @@ CONFIG_SYSRESET_PSCI=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_WATCHDOG=y
+CONFIG_DM_VIDEO=y
+CONFIG_BACKLIGHT=y
+CONFIG_BACKLIGHT_PWM=y
+CONFIG_DM_PWM=y
+CONFIG_PWM_IMX=y
\ No newline at end of file
-- 
2.25.1


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

* Re: [PATCH 4/9] arm: imx: imx8mm: add enable_pwm_clk function
  2022-03-16  9:00 ` [PATCH 4/9] arm: imx: imx8mm: add enable_pwm_clk function Tommaso Merciai
@ 2022-03-16  9:05   ` Michael Nazzareno Trimarchi
  2022-03-16  9:29     ` Tommaso Merciai
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Nazzareno Trimarchi @ 2022-03-16  9:05 UTC (permalink / raw)
  To: Tommaso Merciai
  Cc: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Peng Fan,
	Andrey Zhizhikin, Alice Guo, Ye Li, Marek Vasut,
	Marek Behún, u-boot

Hi

On Wed, Mar 16, 2022 at 10:02 AM Tommaso Merciai
<tommaso.merciai@amarulasolutions.com> wrote:
>
> Add function to enable_pwm_clck function into clock_imx8mm.c. This
> function first configure, then enable pwm1 clock from clock control
> register. The following configuration is used:
>
> source(0) -> 24 MHz ref clock
> div(0)    -> no division for this clock
>
> References:
>  - iMX8MMRM.pdf p 303
>
> Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
> ---
>  arch/arm/mach-imx/imx8m/clock_imx8mm.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
> index 49945faf2c..5f2eddf715 100644
> --- a/arch/arm/mach-imx/imx8m/clock_imx8mm.c
> +++ b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
> @@ -313,6 +313,17 @@ void enable_usboh3_clk(unsigned int enable)
>         }
>  }
>
> +void enable_pwm_clk(unsigned char enable)
> +{
> +       if (enable) {
> +               clock_enable(CCGR_PWM1, false);
> +               clock_set_target_val(PWM1_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(0) |CLK_ROOT_PRE_DIV(CLK_ROOT_PRE_DIV1));
> +               clock_enable(CCGR_PWM1, true);
> +       } else {
> +               clock_enable(CCGR_PWM1, false);
> +       }
> +}
> +

Show not be somenthing like
enable_pwm_clk(enum pwm_id, bool enable)

?

>  void init_uart_clk(u32 index)
>  {
>         /*
> --
> 2.25.1
>


-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

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

* Re: [PATCH 4/9] arm: imx: imx8mm: add enable_pwm_clk function
  2022-03-16  9:05   ` Michael Nazzareno Trimarchi
@ 2022-03-16  9:29     ` Tommaso Merciai
  0 siblings, 0 replies; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16  9:29 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi
  Cc: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Peng Fan,
	Andrey Zhizhikin, Alice Guo, Ye Li, Marek Vasut,
	Marek Behún, u-boot

On Wed, Mar 16, 2022 at 10:05:47AM +0100, Michael Nazzareno Trimarchi wrote:
> Hi
> 
> On Wed, Mar 16, 2022 at 10:02 AM Tommaso Merciai
> <tommaso.merciai@amarulasolutions.com> wrote:
> >
> > Add function to enable_pwm_clck function into clock_imx8mm.c. This
> > function first configure, then enable pwm1 clock from clock control
> > register. The following configuration is used:
> >
> > source(0) -> 24 MHz ref clock
> > div(0)    -> no division for this clock
> >
> > References:
> >  - iMX8MMRM.pdf p 303
> >
> > Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
> > ---
> >  arch/arm/mach-imx/imx8m/clock_imx8mm.c | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
> > index 49945faf2c..5f2eddf715 100644
> > --- a/arch/arm/mach-imx/imx8m/clock_imx8mm.c
> > +++ b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
> > @@ -313,6 +313,17 @@ void enable_usboh3_clk(unsigned int enable)
> >         }
> >  }
> >
> > +void enable_pwm_clk(unsigned char enable)
> > +{
> > +       if (enable) {
> > +               clock_enable(CCGR_PWM1, false);
> > +               clock_set_target_val(PWM1_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(0) |CLK_ROOT_PRE_DIV(CLK_ROOT_PRE_DIV1));
> > +               clock_enable(CCGR_PWM1, true);
> > +       } else {
> > +               clock_enable(CCGR_PWM1, false);
> > +       }
> > +}
> > +
> 
> Show not be somenthing like
> enable_pwm_clk(enum pwm_id, bool enable)
> 
> ?

Hi,
Like init_clk_usdhc(u32 index) function in clock_imx8mm.c?
Ack, I'll send v2.

Thanks,
Tommaso

> 
> >  void init_uart_clk(u32 index)
> >  {
> >         /*
> > --
> > 2.25.1
> >
> 
> 
> -- 
> Michael Nazzareno Trimarchi
> Co-Founder & Chief Executive Officer
> M. +39 347 913 2170
> michael@amarulasolutions.com
> __________________________________
> 
> Amarula Solutions BV
> Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
> T. +31 (0)85 111 9172
> info@amarulasolutions.com
> www.amarulasolutions.com

-- 
Tommaso Merciai
Embedded Linux Engineer
tommaso.merciai@amarulasolutions.com
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com

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

* Re: [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support
  2022-03-16  9:00 ` [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support Tommaso Merciai
@ 2022-03-16 10:30   ` Michael Walle
  2022-03-16 11:36     ` Tommaso Merciai
  2022-03-16 11:42     ` Tommaso Merciai
  2022-03-16 23:57   ` Fabio Estevam
  1 sibling, 2 replies; 20+ messages in thread
From: Michael Walle @ 2022-03-16 10:30 UTC (permalink / raw)
  To: tommaso.merciai
  Cc: alice.guo, andrey.zhizhikin, festevam, peng.fan, sbabic, u-boot,
	uboot-imx, ye.li, Michael Walle

> Add pwm1/backlight support nodes for imx8mm_evk board
> 
> Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
> ---
>  arch/arm/dts/imx8mm-evk.dtsi | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dtsi
> index 60179e006d..e7a2bd8a64 100644
> --- a/arch/arm/dts/imx8mm-evk.dtsi
> +++ b/arch/arm/dts/imx8mm-evk.dtsi
> @@ -41,6 +41,15 @@
>  		enable-active-high;
>  	};
>  
> +	backlight: backlight {
> +		status = "disabled";
> +		compatible = "pwm-backlight";
> +		pwms = <&pwm1 0 5000000>;
> +		brightness-levels = <0 255>;
> +		num-interpolated-steps = <255>;
> +		default-brightness-level = <250>;
> +	};
> +
>  	ir-receiver {
>  		compatible = "gpio-ir-receiver";
>  		gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
> @@ -350,6 +359,12 @@
>  	status = "okay";
>  };
>  
> +&pwm1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_backlight>;
> +	status = "disabled";
> +};
> +
>  &iomuxc {
>  	pinctrl_fec1: fec1grp {
>  		fsl,pins = <
> @@ -491,4 +506,10 @@
>  			MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x166
>  		>;
>  	};
> +
> +	pinctrl_backlight: backlightgrp {
> +		fsl,pins = <
> +			MX8MM_IOMUXC_GPIO1_IO01_PWM1_OUT	0x06
> +		>;
> +	};

Will this also be submitted to upstream linux? Otherwise, the device
trees will diverge.

-michael

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

* Re: [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support
  2022-03-16 10:30   ` Michael Walle
@ 2022-03-16 11:36     ` Tommaso Merciai
  2022-03-16 11:42     ` Tommaso Merciai
  1 sibling, 0 replies; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16 11:36 UTC (permalink / raw)
  To: Michael Walle
  Cc: alice.guo, andrey.zhizhikin, festevam, peng.fan, sbabic, u-boot,
	uboot-imx, ye.li

On Wed, Mar 16, 2022 at 11:30:19AM +0100, Michael Walle wrote:
> > Add pwm1/backlight support nodes for imx8mm_evk board
> > 
> > Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
> > ---
> >  arch/arm/dts/imx8mm-evk.dtsi | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> > 
> > diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dtsi
> > index 60179e006d..e7a2bd8a64 100644
> > --- a/arch/arm/dts/imx8mm-evk.dtsi
> > +++ b/arch/arm/dts/imx8mm-evk.dtsi
> > @@ -41,6 +41,15 @@
> >  		enable-active-high;
> >  	};
> >  
> > +	backlight: backlight {
> > +		status = "disabled";
> > +		compatible = "pwm-backlight";
> > +		pwms = <&pwm1 0 5000000>;
> > +		brightness-levels = <0 255>;
> > +		num-interpolated-steps = <255>;
> > +		default-brightness-level = <250>;
> > +	};
> > +
> >  	ir-receiver {
> >  		compatible = "gpio-ir-receiver";
> >  		gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
> > @@ -350,6 +359,12 @@
> >  	status = "okay";
> >  };
> >  
> > +&pwm1 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_backlight>;
> > +	status = "disabled";
> > +};
> > +
> >  &iomuxc {
> >  	pinctrl_fec1: fec1grp {
> >  		fsl,pins = <
> > @@ -491,4 +506,10 @@
> >  			MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x166
> >  		>;
> >  	};
> > +
> > +	pinctrl_backlight: backlightgrp {
> > +		fsl,pins = <
> > +			MX8MM_IOMUXC_GPIO1_IO01_PWM1_OUT	0x06
> > +		>;
> > +	};
> 
> Will this also be submitted to upstream linux? Otherwise, the device
> trees will diverge.
> 
> -michael

Hi Michael,
Thanks for review, I'll check and update in v2.

Tommaso

-- 
Tommaso Merciai
Embedded Linux Engineer
tommaso.merciai@amarulasolutions.com
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com

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

* Re: [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support
  2022-03-16 10:30   ` Michael Walle
  2022-03-16 11:36     ` Tommaso Merciai
@ 2022-03-16 11:42     ` Tommaso Merciai
  2022-03-16 11:45       ` Michael Walle
  1 sibling, 1 reply; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16 11:42 UTC (permalink / raw)
  To: Michael Walle
  Cc: alice.guo, andrey.zhizhikin, festevam, peng.fan, sbabic, u-boot,
	uboot-imx, ye.li

On Wed, Mar 16, 2022 at 11:30:19AM +0100, Michael Walle wrote:
> > Add pwm1/backlight support nodes for imx8mm_evk board
> > 
> > Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
> > ---
> >  arch/arm/dts/imx8mm-evk.dtsi | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> > 
> > diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dtsi
> > index 60179e006d..e7a2bd8a64 100644
> > --- a/arch/arm/dts/imx8mm-evk.dtsi
> > +++ b/arch/arm/dts/imx8mm-evk.dtsi
> > @@ -41,6 +41,15 @@
> >  		enable-active-high;
> >  	};
> >  
> > +	backlight: backlight {
> > +		status = "disabled";
> > +		compatible = "pwm-backlight";
> > +		pwms = <&pwm1 0 5000000>;
> > +		brightness-levels = <0 255>;
> > +		num-interpolated-steps = <255>;
> > +		default-brightness-level = <250>;
> > +	};
> > +
> >  	ir-receiver {
> >  		compatible = "gpio-ir-receiver";
> >  		gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
> > @@ -350,6 +359,12 @@
> >  	status = "okay";
> >  };
> >  
> > +&pwm1 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_backlight>;
> > +	status = "disabled";
> > +};
> > +
> >  &iomuxc {
> >  	pinctrl_fec1: fec1grp {
> >  		fsl,pins = <
> > @@ -491,4 +506,10 @@
> >  			MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x166
> >  		>;
> >  	};
> > +
> > +	pinctrl_backlight: backlightgrp {
> > +		fsl,pins = <
> > +			MX8MM_IOMUXC_GPIO1_IO01_PWM1_OUT	0x06
> > +		>;
> > +	};
> 
> Will this also be submitted to upstream linux? Otherwise, the device
> trees will diverge.
> 
> -michael

Hi,
At the moment on upstream linux, backlight on pwm1 is not handle. This
will also be submitted on upstream Linux once will merged on U-Boot.

Regards,
Tommaso

-- 
Tommaso Merciai
Embedded Linux Engineer
tommaso.merciai@amarulasolutions.com
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com

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

* Re: [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support
  2022-03-16 11:42     ` Tommaso Merciai
@ 2022-03-16 11:45       ` Michael Walle
  2022-03-16 11:51         ` Tommaso Merciai
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Walle @ 2022-03-16 11:45 UTC (permalink / raw)
  To: Tommaso Merciai
  Cc: alice.guo, andrey.zhizhikin, festevam, peng.fan, sbabic, u-boot,
	uboot-imx, ye.li

Am 2022-03-16 12:42, schrieb Tommaso Merciai:
> On Wed, Mar 16, 2022 at 11:30:19AM +0100, Michael Walle wrote:
>> > Add pwm1/backlight support nodes for imx8mm_evk board
>> >
>> > Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
>> > ---
>> >  arch/arm/dts/imx8mm-evk.dtsi | 21 +++++++++++++++++++++
>> >  1 file changed, 21 insertions(+)
>> >
>> > diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dtsi
>> > index 60179e006d..e7a2bd8a64 100644
>> > --- a/arch/arm/dts/imx8mm-evk.dtsi
>> > +++ b/arch/arm/dts/imx8mm-evk.dtsi
>> > @@ -41,6 +41,15 @@
>> >  		enable-active-high;
>> >  	};
>> >
>> > +	backlight: backlight {
>> > +		status = "disabled";
>> > +		compatible = "pwm-backlight";
>> > +		pwms = <&pwm1 0 5000000>;
>> > +		brightness-levels = <0 255>;
>> > +		num-interpolated-steps = <255>;
>> > +		default-brightness-level = <250>;
>> > +	};
>> > +
>> >  	ir-receiver {
>> >  		compatible = "gpio-ir-receiver";
>> >  		gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
>> > @@ -350,6 +359,12 @@
>> >  	status = "okay";
>> >  };
>> >
>> > +&pwm1 {
>> > +	pinctrl-names = "default";
>> > +	pinctrl-0 = <&pinctrl_backlight>;
>> > +	status = "disabled";
>> > +};
>> > +
>> >  &iomuxc {
>> >  	pinctrl_fec1: fec1grp {
>> >  		fsl,pins = <
>> > @@ -491,4 +506,10 @@
>> >  			MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x166
>> >  		>;
>> >  	};
>> > +
>> > +	pinctrl_backlight: backlightgrp {
>> > +		fsl,pins = <
>> > +			MX8MM_IOMUXC_GPIO1_IO01_PWM1_OUT	0x06
>> > +		>;
>> > +	};
>> 
>> Will this also be submitted to upstream linux? Otherwise, the device
>> trees will diverge.
>> 
>> -michael
> 
> Hi,
> At the moment on upstream linux, backlight on pwm1 is not handle. This
> will also be submitted on upstream Linux once will merged on U-Boot.

Actually, it should be the other way around, because the device trees
should be synced with linux once in a while. So while I don't oppose
to do it this way, your changes might eventually be overwritten if
this won't be merged with linux.

-michael

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

* Re: [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support
  2022-03-16 11:45       ` Michael Walle
@ 2022-03-16 11:51         ` Tommaso Merciai
  2022-03-16 11:54           ` Michael Walle
  0 siblings, 1 reply; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16 11:51 UTC (permalink / raw)
  To: Michael Walle
  Cc: alice.guo, andrey.zhizhikin, festevam, peng.fan, sbabic, u-boot,
	uboot-imx, ye.li

On Wed, Mar 16, 2022 at 12:45:22PM +0100, Michael Walle wrote:
> Am 2022-03-16 12:42, schrieb Tommaso Merciai:
> > On Wed, Mar 16, 2022 at 11:30:19AM +0100, Michael Walle wrote:
> > > > Add pwm1/backlight support nodes for imx8mm_evk board
> > > >
> > > > Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
> > > > ---
> > > >  arch/arm/dts/imx8mm-evk.dtsi | 21 +++++++++++++++++++++
> > > >  1 file changed, 21 insertions(+)
> > > >
> > > > diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dtsi
> > > > index 60179e006d..e7a2bd8a64 100644
> > > > --- a/arch/arm/dts/imx8mm-evk.dtsi
> > > > +++ b/arch/arm/dts/imx8mm-evk.dtsi
> > > > @@ -41,6 +41,15 @@
> > > >  		enable-active-high;
> > > >  	};
> > > >
> > > > +	backlight: backlight {
> > > > +		status = "disabled";
> > > > +		compatible = "pwm-backlight";
> > > > +		pwms = <&pwm1 0 5000000>;
> > > > +		brightness-levels = <0 255>;
> > > > +		num-interpolated-steps = <255>;
> > > > +		default-brightness-level = <250>;
> > > > +	};
> > > > +
> > > >  	ir-receiver {
> > > >  		compatible = "gpio-ir-receiver";
> > > >  		gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
> > > > @@ -350,6 +359,12 @@
> > > >  	status = "okay";
> > > >  };
> > > >
> > > > +&pwm1 {
> > > > +	pinctrl-names = "default";
> > > > +	pinctrl-0 = <&pinctrl_backlight>;
> > > > +	status = "disabled";
> > > > +};
> > > > +
> > > >  &iomuxc {
> > > >  	pinctrl_fec1: fec1grp {
> > > >  		fsl,pins = <
> > > > @@ -491,4 +506,10 @@
> > > >  			MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x166
> > > >  		>;
> > > >  	};
> > > > +
> > > > +	pinctrl_backlight: backlightgrp {
> > > > +		fsl,pins = <
> > > > +			MX8MM_IOMUXC_GPIO1_IO01_PWM1_OUT	0x06
> > > > +		>;
> > > > +	};
> > > 
> > > Will this also be submitted to upstream linux? Otherwise, the device
> > > trees will diverge.
> > > 
> > > -michael
> > 
> > Hi,
> > At the moment on upstream linux, backlight on pwm1 is not handle. This
> > will also be submitted on upstream Linux once will merged on U-Boot.
> 
> Actually, it should be the other way around, because the device trees
> should be synced with linux once in a while. So while I don't oppose
> to do it this way, your changes might eventually be overwritten if
> this won't be merged with linux.
> 
> -michael

Hi Michael,
Then you suggest to submit to the Kernel also?

Thanks,
Tommaso
-- 
Tommaso Merciai
Embedded Linux Engineer
tommaso.merciai@amarulasolutions.com
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com

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

* Re: [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support
  2022-03-16 11:51         ` Tommaso Merciai
@ 2022-03-16 11:54           ` Michael Walle
  2022-03-16 12:10             ` Tommaso Merciai
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Walle @ 2022-03-16 11:54 UTC (permalink / raw)
  To: Tommaso Merciai
  Cc: alice.guo, andrey.zhizhikin, festevam, peng.fan, sbabic, u-boot,
	uboot-imx, ye.li

Am 2022-03-16 12:51, schrieb Tommaso Merciai:
> On Wed, Mar 16, 2022 at 12:45:22PM +0100, Michael Walle wrote:
>> Am 2022-03-16 12:42, schrieb Tommaso Merciai:
>> > On Wed, Mar 16, 2022 at 11:30:19AM +0100, Michael Walle wrote:
>> > > > Add pwm1/backlight support nodes for imx8mm_evk board
>> > > >
>> > > > Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
>> > > > ---
>> > > >  arch/arm/dts/imx8mm-evk.dtsi | 21 +++++++++++++++++++++
>> > > >  1 file changed, 21 insertions(+)
>> > > >
>> > > > diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dtsi
>> > > > index 60179e006d..e7a2bd8a64 100644
>> > > > --- a/arch/arm/dts/imx8mm-evk.dtsi
>> > > > +++ b/arch/arm/dts/imx8mm-evk.dtsi
>> > > > @@ -41,6 +41,15 @@
>> > > >  		enable-active-high;
>> > > >  	};
>> > > >
>> > > > +	backlight: backlight {
>> > > > +		status = "disabled";
>> > > > +		compatible = "pwm-backlight";
>> > > > +		pwms = <&pwm1 0 5000000>;
>> > > > +		brightness-levels = <0 255>;
>> > > > +		num-interpolated-steps = <255>;
>> > > > +		default-brightness-level = <250>;
>> > > > +	};
>> > > > +
>> > > >  	ir-receiver {
>> > > >  		compatible = "gpio-ir-receiver";
>> > > >  		gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
>> > > > @@ -350,6 +359,12 @@
>> > > >  	status = "okay";
>> > > >  };
>> > > >
>> > > > +&pwm1 {
>> > > > +	pinctrl-names = "default";
>> > > > +	pinctrl-0 = <&pinctrl_backlight>;
>> > > > +	status = "disabled";
>> > > > +};
>> > > > +
>> > > >  &iomuxc {
>> > > >  	pinctrl_fec1: fec1grp {
>> > > >  		fsl,pins = <
>> > > > @@ -491,4 +506,10 @@
>> > > >  			MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x166
>> > > >  		>;
>> > > >  	};
>> > > > +
>> > > > +	pinctrl_backlight: backlightgrp {
>> > > > +		fsl,pins = <
>> > > > +			MX8MM_IOMUXC_GPIO1_IO01_PWM1_OUT	0x06
>> > > > +		>;
>> > > > +	};
>> > >
>> > > Will this also be submitted to upstream linux? Otherwise, the device
>> > > trees will diverge.
>> > >
>> > > -michael
>> >
>> > Hi,
>> > At the moment on upstream linux, backlight on pwm1 is not handle. This
>> > will also be submitted on upstream Linux once will merged on U-Boot.
>> 
>> Actually, it should be the other way around, because the device trees
>> should be synced with linux once in a while. So while I don't oppose
>> to do it this way, your changes might eventually be overwritten if
>> this won't be merged with linux.
>> 
>> -michael
> 
> Hi Michael,
> Then you suggest to submit to the Kernel also?

The goal should be to have the kernel device trees in sync with
the kernel. So yes, it should also be submitted to the kernel
device tree.

-michael

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

* Re: [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support
  2022-03-16 11:54           ` Michael Walle
@ 2022-03-16 12:10             ` Tommaso Merciai
  0 siblings, 0 replies; 20+ messages in thread
From: Tommaso Merciai @ 2022-03-16 12:10 UTC (permalink / raw)
  To: Michael Walle
  Cc: alice.guo, andrey.zhizhikin, festevam, peng.fan, sbabic, u-boot,
	uboot-imx, ye.li

On Wed, Mar 16, 2022 at 12:54:06PM +0100, Michael Walle wrote:
> Am 2022-03-16 12:51, schrieb Tommaso Merciai:
> > On Wed, Mar 16, 2022 at 12:45:22PM +0100, Michael Walle wrote:
> > > Am 2022-03-16 12:42, schrieb Tommaso Merciai:
> > > > On Wed, Mar 16, 2022 at 11:30:19AM +0100, Michael Walle wrote:
> > > > > > Add pwm1/backlight support nodes for imx8mm_evk board
> > > > > >
> > > > > > Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
> > > > > > ---
> > > > > >  arch/arm/dts/imx8mm-evk.dtsi | 21 +++++++++++++++++++++
> > > > > >  1 file changed, 21 insertions(+)
> > > > > >
> > > > > > diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dtsi
> > > > > > index 60179e006d..e7a2bd8a64 100644
> > > > > > --- a/arch/arm/dts/imx8mm-evk.dtsi
> > > > > > +++ b/arch/arm/dts/imx8mm-evk.dtsi
> > > > > > @@ -41,6 +41,15 @@
> > > > > >  		enable-active-high;
> > > > > >  	};
> > > > > >
> > > > > > +	backlight: backlight {
> > > > > > +		status = "disabled";
> > > > > > +		compatible = "pwm-backlight";
> > > > > > +		pwms = <&pwm1 0 5000000>;
> > > > > > +		brightness-levels = <0 255>;
> > > > > > +		num-interpolated-steps = <255>;
> > > > > > +		default-brightness-level = <250>;
> > > > > > +	};
> > > > > > +
> > > > > >  	ir-receiver {
> > > > > >  		compatible = "gpio-ir-receiver";
> > > > > >  		gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
> > > > > > @@ -350,6 +359,12 @@
> > > > > >  	status = "okay";
> > > > > >  };
> > > > > >
> > > > > > +&pwm1 {
> > > > > > +	pinctrl-names = "default";
> > > > > > +	pinctrl-0 = <&pinctrl_backlight>;
> > > > > > +	status = "disabled";
> > > > > > +};
> > > > > > +
> > > > > >  &iomuxc {
> > > > > >  	pinctrl_fec1: fec1grp {
> > > > > >  		fsl,pins = <
> > > > > > @@ -491,4 +506,10 @@
> > > > > >  			MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x166
> > > > > >  		>;
> > > > > >  	};
> > > > > > +
> > > > > > +	pinctrl_backlight: backlightgrp {
> > > > > > +		fsl,pins = <
> > > > > > +			MX8MM_IOMUXC_GPIO1_IO01_PWM1_OUT	0x06
> > > > > > +		>;
> > > > > > +	};
> > > > >
> > > > > Will this also be submitted to upstream linux? Otherwise, the device
> > > > > trees will diverge.
> > > > >
> > > > > -michael
> > > >
> > > > Hi,
> > > > At the moment on upstream linux, backlight on pwm1 is not handle. This
> > > > will also be submitted on upstream Linux once will merged on U-Boot.
> > > 
> > > Actually, it should be the other way around, because the device trees
> > > should be synced with linux once in a while. So while I don't oppose
> > > to do it this way, your changes might eventually be overwritten if
> > > this won't be merged with linux.
> > > 
> > > -michael
> > 
> > Hi Michael,
> > Then you suggest to submit to the Kernel also?
> 
> The goal should be to have the kernel device trees in sync with
> the kernel. So yes, it should also be submitted to the kernel
> device tree.
> 
> -michael

Hi Michael,
Thanks for your suggestion, then I will also send this on the Kernel :)

Tommaso
-- 
Tommaso Merciai
Embedded Linux Engineer
tommaso.merciai@amarulasolutions.com
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com

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

* Re: [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support
  2022-03-16  9:00 ` [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support Tommaso Merciai
  2022-03-16 10:30   ` Michael Walle
@ 2022-03-16 23:57   ` Fabio Estevam
  1 sibling, 0 replies; 20+ messages in thread
From: Fabio Estevam @ 2022-03-16 23:57 UTC (permalink / raw)
  To: Tommaso Merciai
  Cc: Stefano Babic, NXP i.MX U-Boot Team, Peng Fan, Andrey Zhizhikin,
	Alice Guo, Ye Li, U-Boot-Denx

On Wed, Mar 16, 2022 at 6:00 AM Tommaso Merciai
<tommaso.merciai@amarulasolutions.com> wrote:
>
> Add pwm1/backlight support nodes for imx8mm_evk board

Why do you enable backlight given that the board does not support splash screen?

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

end of thread, other threads:[~2022-03-16 23:58 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16  9:00 [PATCH 0/9] imx8mm: add pwm-imx backlight support Tommaso Merciai
2022-03-16  9:00 ` [PATCH 1/9] arch: mach-imx: imx8m: add pwm1/pwm2 base address Tommaso Merciai
2022-03-16  9:00 ` [PATCH 2/9] arch: mach-imx: imx8m: add pwm ctrl registers fields defines Tommaso Merciai
2022-03-16  9:00 ` [PATCH 3/9] arch: mach-imx: imx8m: add pwm_regs struct in imx-regs Tommaso Merciai
2022-03-16  9:00 ` [PATCH 4/9] arm: imx: imx8mm: add enable_pwm_clk function Tommaso Merciai
2022-03-16  9:05   ` Michael Nazzareno Trimarchi
2022-03-16  9:29     ` Tommaso Merciai
2022-03-16  9:00 ` [PATCH 5/9] imx8m: clock: " Tommaso Merciai
2022-03-16  9:00 ` [PATCH 6/9] configs: imx8mm_evk: add CONFIG_IMX6_PWM_PER_CLK config Tommaso Merciai
2022-03-16  9:00 ` [PATCH 7/9] imx8mm_evk: spl: enable pwm clock Tommaso Merciai
2022-03-16  9:00 ` [PATCH 8/9] arm: dts: imx8mm_evk: add pwm1/backlight support Tommaso Merciai
2022-03-16 10:30   ` Michael Walle
2022-03-16 11:36     ` Tommaso Merciai
2022-03-16 11:42     ` Tommaso Merciai
2022-03-16 11:45       ` Michael Walle
2022-03-16 11:51         ` Tommaso Merciai
2022-03-16 11:54           ` Michael Walle
2022-03-16 12:10             ` Tommaso Merciai
2022-03-16 23:57   ` Fabio Estevam
2022-03-16  9:00 ` [PATCH 9/9] configs: imx8mm_evk: add pwm backlight support Tommaso Merciai

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.