Re: [PATCH v8 2/7] arm64: dts: imx8mm: imx8mp: Add LVDS DTOs for Data Modul i.MX8M Mini and Plus eDM SBC

Frank Li <[email protected]> Fri, 31 Jul 2026 11:36:14 -0500
Newsgroups dev.linux.lists.imx,dev.linux.lists.sashiko-reviews,org.kernel.vger.linux-devicetree
Message-ID <amzO_vv2wjOWgZXg@SMW015318>
On Thu, Jul 30, 2026 at 10:58:02PM +0000, [email protected] wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> - [Medium] The G215HVN011 panel overlay hardcodes the adapter-specific backlight enable pin, breaking the backlight on the i.MX8MP native LVDS adapter.
> - [Low] The documented MP2328 voltage divider formulas and resistor values mathematically contradict the claimed output voltages, risking hardware damage if copied.
> --
>
> --- Patch [2]: [PATCH v8 2/7] arm64: dts: imx8mm: imx8mp: Add LVDS DTOs for Data Modul i.MX8M Mini and Plus eDM SBC ---
> commit 7f9fe59083c08b9930a9101dbccb23e4a6fbf244
> Author: Marek Vasut <[email protected]>
>
> arm64: dts: imx8mm: imx8mp: Add LVDS DTOs for Data Modul i.MX8M Mini and Plus eDM SBC
>
> Add DT overlay for the DSI-to-LVDS adapter eDM-MOD-iMX8Mm-LVDS populated
> with Lontium LT9211 bridge. This adapter can be optionally populated onto
> the eDM SBC. This adapter can be extended with multiple panels.
>
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mm-data-modul-edm-sbc-overlay-lvds-g215hvn011.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-data-modul-edm-sbc-overlay-lvds-g215hvn011.dtsi
> > new file mode 100644
> > index 0000000000000..3585170bd59dd
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/freescale/imx8mm-data-modul-edm-sbc-overlay-lvds-g215hvn011.dtsi
> > @@ -0,0 +1,30 @@
> [ ... ]
> > +&backlight {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_panel_backlight>;
> > +	enable-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
> > +	/* 6.5 POWER ON/OFF SEQUENCE, T6 >= 10 ms */
> [ ... ]
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc-overlay-edm-sbc-imx8mp-lvds-g215hvn011.dtso b/arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc-overlay-edm-sbc-imx8mp-lvds-g215hvn011.dtso
> > new file mode 100644
> > index 0000000000000..a6d13c3609796
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc-overlay-edm-sbc-imx8mp-lvds-g215hvn011.dtso
> > @@ -0,0 +1,36 @@
> [ ... ]
> > +#include "imx8mp-data-modul-edm-sbc-overlay-edm-sbc-imx8mp-lvds.dtsi"
> > +#include "imx8mm-data-modul-edm-sbc-overlay-lvds-g215hvn011.dtsi"
> > +
> > +&backlight {
> > +	power-supply = <&reg_panel_bl_supply>;
> > +};
>
> [Severity: Medium]
> Will this hardcoded adapter-specific backlight enable pin break the backlight
> on the i.MX8MP native LVDS adapter?
>
> By setting enable-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>; in
> imx8mm-data-modul-edm-sbc-overlay-lvds-g215hvn011.dtsi, the adapter-specific
> gpio3 0 pin configuration leaks into the generic panel configuration.
>
> Because the native adapter overlay
> (imx8mp-data-modul-edm-sbc-overlay-edm-sbc-imx8mp-lvds-g215hvn011.dtso)
> includes this generic panel file but fails to override enable-gpios
> (to <&gpiowifi 0 GPIO_ACTIVE_HIGH>) and remove pinctrl-0, the native adapter
> inherits the incorrect gpio3 0 pin, which may leave the backlight off.


This finial dtb

backlight {
                power-supply = <0x120>;
                pwm-off-delay-ms = <0x0a>;
                post-pwm-on-delay-ms = <0x0a>;
                enable-gpios = <0x54 0x00 0x00>;
		^^^
                pinctrl-0 = <0xbc>;
                pinctrl-names = "default";
                compatible = "pwm-backlight";
                brightness-levels = <0x00 0x01 0x0a 0x14 0x1e 0x28 0x32 0x3c 0x46 0x4b 0x50 0x5a 0x64>;
                default-brightness-level = <0x07>;
                pwms = <0x9e 0x00 0x1046a 0x00>;
                status = "okay";
                phandle = <0xa1>;
        };

At drivers/video/backlight/pwm_bl.c

get optional gpio "enable-gpios", which toggle this gpio
 <&gpiowifi 0 GPIO_ACTIVE_HIGH>, which may not impact function, but it
is potentially impact other funciton, if there pin conflict, need disable
related module.

>
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc-overlay-edm-sbc-imx8mp-lvds.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc-overlay-edm-sbc-imx8mp-lvds.dtsi
> > new file mode 100644
> > index 0000000000000..b06af369a9245
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc-overlay-edm-sbc-imx8mp-lvds.dtsi
> > @@ -0,0 +1,79 @@
> [ ... ]
> > +	reg_panel_bl_supply: regulator-panel-bl-supply {
> [ ... ]
> > +		/*
> > +		 * MP2328 voltage divider settings:
> > +		 *   R1=51k1
> > +		 *   R2=5k62 with optional series Rs=2k21 (12V)
> > +		 *
> > +		 * 1 / Rx = (1 / R2) [ + (1 / Rs)][ + (1 / Rt)]
> > +		 * Vout = 0.5 + ((R1 / Rx) * 0.5)
> > +		 */
>
> [Severity: Low]
> Is this mathematical formula for the MP2328 correct?
>
> For the 12V backlight supply, calculating Rx in parallel (1/Rx = 1/R2 + 1/Rs)
> using R1=51.1k, R2=5.62k, and Rs=2.21k yields Rx=1.586k.

I calc it,   1/(1/5.62 + 1/2.21) = 1.586

>
> Applying that to Vout = 0.5 + ((51.1k / 1.586k) * 0.5) gives approximately
> 16.6V, not 12V.

It is correct, it is 16.6v.

According to gpios settings,

GPIO 0 1 to choose coonnect R2 and Rs

only choose Rs, it is 12v
only choose R2, it is 5v.

Not sure how to generate 3.3v and 40v,

Frank

>
> To achieve 12V, Rx needs to be exactly 2.21k, which means Rs would have to
> replace R2 rather than run in parallel with it. Is it possible the formula
> was copied from the AP63300 comment without updating the calculation method?
>
> --
> Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=2