How to control pwm backlight on imx8mplus platform

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to control pwm backlight on imx8mplus platform

3,808件の閲覧回数
t2865k5
Contributor I

Dear NXP ,

SW version : 

repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-langdale -m imx-6.1.1-1.0.1.xml

HW : imx8mplus

 

The LVDS panel can display normally. I want to control pwm backlight .

GPIO1_IO11 : pwm backlight

Please refer to my imx8mp-evk.dts :

lvds_backlight: lvds_backlight {
compatible = "pwm-backlight";
pwms = <&pwm2 0 100000 0>;
status = "okay";
 
brightness-levels = < 0  1  2  3  4  5  6  7  8  9
     10 11 12 13 14 15 16 17 18 19
     20 21 22 23 24 25 26 27 28 29
     30 31 32 33 34 35 36 37 38 39
     40 41 42 43 44 45 46 47 48 49
     50 51 52 53 54 55 56 57 58 59
     60 61 62 63 64 65 66 67 68 69
     70 71 72 73 74 75 76 77 78 79
     80 81 82 83 84 85 86 87 88 89
     90 91 92 93 94 95 96 97 98 99
    100>;
default-brightness-level = <80>;
};
 
lvds0_panel {
compatible = "panel-lvds";
backlight = <&lvds_backlight>;
power-supply = <&reg_lvds_pwr>;
data-mapping = "jeida-18";
data-width = <18>;
height-mm = <135>; /* 135.6 */
width-mm = <216>; /* 216.96 */
panel-timing {
clock-frequency = <74250000>;
hactive = <1280>;
vactive = <800>;
hback-porch = <64>;
hfront-porch = <42>;
vback-porch = <49>;
vfront-porch = <20>;
hsync-len = <22>;
vsync-len = <20>;
};
port {
panel_lvds_in: endpoint {
remote-endpoint = <&lvds_out>;
};
};
};
 
 
&pwm2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm2>;
status = "okay";
};
 
pinctrl_pwm2: pwm2grp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO11__PWM2_OUT 0x116
>;
};
 
 
t2865k5_0-1703500813682.pngt2865k5_2-1703501371517.png 

 

t2865k5_3-1703501421744.png

 

 

t2865k5_1-1703501072048.png

cat max_brightness : This value is 100

cat brightness : This value is 80

echo 0 > brightness 

cat brightness : This value is 0 but the LVDS panel can still display normally.

I use an oscilloscope to measure the PWM voltage . It always keep 3.3 V .

I add some log in pwm_bl.c .Please refer the pwm_backlight.log and pwm_bl.c .

 

Please help to solve this problem .

 

 

 

 

 

 

 

  

 

 

 

 

ラベル(1)
0 件の賞賛
返信
5 返答(返信)

3,695件の閲覧回数
t2865k5
Contributor I

Dear Zhiming,

I use GPIO1_IO11 to config PWM .

set 

Brightness =10 

Brightness =1

Brightness =0

PWM voltage always keep 3.3V.

Plese help to check my device tree whether it needs to be modified .

 
/*
&pwm1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm1>;
status = "okay";
};
*/
 
&pwm2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm2>;
status = "okay";
};
/*
&pwm4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm4>;
status = "okay";
};
*/
 
/*
pinctrl_pwm1: pwm1grp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO01__PWM1_OUT 0x116
>;
};
*/
pinctrl_pwm2: pwm2grp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO11__PWM2_OUT 0x116
>;
};
/*
pinctrl_pwm4: pwm4grp {
fsl,pins = <
MX8MP_IOMUXC_SAI5_RXFS__PWM4_OUT 0x116
>;
};
*/
0 件の賞賛
返信

3,671件の閲覧回数
Zhiming_Liu
NXP TechSupport
NXP TechSupport

From the hardware desgin you attached, the PWM will be pull up with the VDDEXT_3V3, so this is normal. You can remove R2389 to get low value when brightness =0.

Zhiming_Liu_0-1704438830527.png

 

0 件の賞賛
返信

3,722件の閲覧回数
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Here is my test with same pwm node on EVK board.

 

Brightness=10

Zhiming_Liu_0-1704162347506.jpeg

Brightness=1

Zhiming_Liu_1-1704162364536.jpeg

Brightness =0

Zhiming_Liu_2-1704162387146.jpeg

You can see that the PWM voltage is zero when brightness=0.

 

0 件の賞賛
返信

3,746件の閲覧回数
t2865k5
Contributor I

Dear Zhiming ,

Please refer to the device tree I provided .

 

 

0 件の賞賛
返信

3,771件の閲覧回数
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Please verify this with Oscilloscope and provide full dts file.

0 件の賞賛
返信