Add pwm1/backlight support nodes for imx8mm_evk board.
Align with u-boot dts
References:
- https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
Signed-off-by: Tommaso Merciai <[email protected]>
---
Changes since v1:
- Fix commit body
- Enable pwm, backlight
arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
index 6d67df7692f1..4c18f8fcd377 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
@@ -59,6 +59,15 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
enable-active-high;
};
+ backlight: backlight {
+ status = "okay";
+ 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>;
@@ -395,6 +404,12 @@ &wdog1 {
status = "okay";
};
+&pwm1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_backlight>;
+ status = "okay";
+};
+
&iomuxc {
pinctrl_fec1: fec1grp {
fsl,pins = <
@@ -549,4 +564,10 @@ pinctrl_wdog: wdoggrp {
MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B 0x166
>;
};
+
+ pinctrl_backlight: backlightgrp {
+ fsl,pins = <
+ MX8MM_IOMUXC_GPIO1_IO01_PWM1_OUT 0x06
+ >;
+ };
};
--
2.25.1
On 13/04/2022 14:56, Tommaso Merciai wrote:
> Add pwm1/backlight support nodes for imx8mm_evk board.
> Align with u-boot dts
>
Thank you for your patch. There is something to discuss/improve.
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
> index 6d67df7692f1..4c18f8fcd377 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
> @@ -59,6 +59,15 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
> enable-active-high;
> };
>
> + backlight: backlight {
> + status = "okay";
All nodes have status=okay by default, so no need for this.
> + 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>;
> @@ -395,6 +404,12 @@ &wdog1 {
> status = "okay";
> };
>
> +&pwm1 {
> + pinctrl-names = "default";
> + pinctrl-0 = <&pinctrl_backlight>;
> + status = "okay";
This is needed if the node was disabled in DTSI (I did not check it).
Best regards,
Krzysztof
On Wed, Apr 13, 2022 at 03:45:44PM +0200, Krzysztof Kozlowski wrote:
> On 13/04/2022 14:56, Tommaso Merciai wrote:
> > Add pwm1/backlight support nodes for imx8mm_evk board.
> > Align with u-boot dts
> >
>
> Thank you for your patch. There is something to discuss/improve.
>
> >
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
> > index 6d67df7692f1..4c18f8fcd377 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
> > @@ -59,6 +59,15 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
> > enable-active-high;
> > };
> >
> > + backlight: backlight {
> > + status = "okay";
>
> All nodes have status=okay by default, so no need for this.
>
> > + 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>;
> > @@ -395,6 +404,12 @@ &wdog1 {
> > status = "okay";
> > };
> >
> > +&pwm1 {
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&pinctrl_backlight>;
> > + status = "okay";
>
> This is needed if the node was disabled in DTSI (I did not check it).
>
>
> Best regards,
> Krzysztof
Hi Krzysztof,
Thanks for review, I'll update in v3.
Regards,
Tommaso
--
Tommaso Merciai
Embedded Linux Engineer
[email protected]
__________________________________
Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
[email protected]
http://www.amarulasolutions.com