tT2-4g R32.3.1 LCD0_BKLT_PWM

PWM is not working, what is required in the device tree and such to get it to work.

did the echo 0 > export
cd pwm0
echo 1000000 > period
echo 500000 > duty_cycle
echo 1 > enable

but saw no change on the display.

Help, Thanks,
Terry

hello terrysu50z,

may I know which display monitor you’re using, what’s the connection you’d setup to connect a display.
thanks

​mipi dsi monitor.

Remember that r32.3.1 src code is missing some device tree files, from when I got the display working.

Terry

Please paste your schematic for dsi part and dts files.

attaching the deviceTree, schematic is being generated by the hardware guy, this is done and attached. below.

Terry
deviceTree (252.3 KB)

what type of things should I be looking at in the device tree to make the pwm work. From the forum posts it looks like the pwm is only working in one device tree, that is not in the r32.3.1 source code. So can you attach the working pwm device tree?

tx2_dsi.pdf (82.3 KB)

You do understand that my mipi dsi display and the backlight are working. The hardware guy has asked me to see if the pwm can be used to dim the display, and that is what I am trying to do.

I have not found anything other than the #1 post to do anything with the backlight level. Is there other command/services that will change the backlight level?

Thanks,
Terry

Anybody there? Is this still being worked on?

Thanks,

xset dpms force off works, but none of the backlight/dimming commands work.

Any more Nvidia input?
Thanks,

Is there any node under /sys/class/backlight?

What is the component “007-7872-00” in your schematic?
Do you want to use LCD0_BKLT_PWM or LCD1_BKLT_PWM?

07-7872-00, IC, 1.2MHZ PWM WHITE LED DRIVER Micrel MIC2287C-34YML

LCD0 is the one to be used.

Thanks,

nothing in the/sys/class/backlight dir.

is the pwm_bl.c probe used? What in the device tree causes the backlight to be probed?

Hello,

Do you mean this LED DRIVER Micrel MIC2287C-34YML is not in use?

Could you try to add a backlight node similar to below one to trigger the pwm_bl.c?

For the “pwms”, please write &tegra_pwm1.

ERROR (phandle_references): Reference to non-existent node or label “vdd_bl_reg”

ERROR (phandle_references): Reference to non-existent node or label “gpio”

More information please

commented out the previous errors got.

No compatible prop in backlight node
[ 1.086395] ------------[ cut here ]------------
[ 1.086406] WARNING: CPU: 0 PID: 1 at /home/tbuckley/tmp/seattle_tx2_kernel/sources/kernel/nvidia/drivers/video/tegra/dc/panel/board-panel.c:222 tegra_pwm_bl_ops_register+0x3d4/0x5b0
[ 1.086408] Modules linked in:

[ 1.086418] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.140-tegra #135
[ 1.086420] Hardware name: lightning (DT)
[ 1.086423] task: ffffffc0f1310000 task.stack: ffffffc0f1318000
[ 1.086427] PC is at tegra_pwm_bl_ops_register+0x3d4/0x5b0
[ 1.086430] LR is at tegra_pwm_bl_ops_register+0x3d4/0x5b0
[ 1.086433] pc : [] lr : [] pstate: 40400045
[ 1.086435] sp : ffffffc0f131bb10
[ 1.086438] x29: ffffffc0f131bb10 x28: ffffff80097f38e0
[ 1.086444] x27: ffffff8009638e78 x26: ffffff80095c5280
[ 1.086449] x25: ffffffc0ef9d5400 x24: ffffffc0f71b24a8
[ 1.086454] x23: 0000000000000000 x22: ffffffc0ef9d5410
[ 1.086459] x21: ffffffc0f71b24a8 x20: ffffffc0f71b27e0
[ 1.086464] x19: ffffffc0ef9d5410 x18: 0000000000000001
[ 1.086469] x17: 0000000000000002 x16: 0000000000000000
[ 1.086474] x15: 0000000000000000 x14: ffffffffffff0000
[ 1.086478] x13: 0000000000000000 x12: 0000000000000004
[ 1.086483] x11: 0000000000000002 x10: 000000000000015c
[ 1.086488] x9 : 0000000000000001 x8 : ffffffc0f7015480
[ 1.086493] x7 : 0000000000000000 x6 : 0000000011f62b90
[ 1.086498] x5 : 0000000000000000 x4 : 0000000000000000
[ 1.086503] x3 : ffffffffffffffff x2 : ffffff8009e542c8
[ 1.086508] x1 : ffffffc0f1310000 x0 : 0000000000000024

[ 1.086517] —[ end trace 3ce3d71fbdcd240d ]—
1.086519] Call trace:
[ 1.086524] [] tegra_pwm_bl_ops_register+0x3d4/0x5b0
[ 1.086531] [] pwm_backlight_probe+0x3c/0x898
[ 1.086537] [] platform_drv_probe+0x60/0xc0
[ 1.086541] [] driver_probe_device+0xd8/0x408
[ 1.086544] [] __driver_attach+0xdc/0x128
[ 1.086549] [] bus_for_each_dev+0x5c/0xa8
[ 1.086551] [] driver_attach+0x30/0x40
[ 1.086554] [] bus_add_driver+0x20c/0x2a8
[ 1.086557] [] driver_register+0x6c/0x110
[ 1.086561] [] __platform_driver_register+0x5c/0x68
[ 1.086567] [] pwm_backlight_driver_init+0x18/0x20
[ 1.086572] [] do_one_initcall+0x44/0x130
[ 1.086577] [] kernel_init_freeable+0x1a0/0x244
[ 1.086582] [] kernel_init+0x18/0x108
[ 1.086586] [] ret_from_fork+0x10/0x40
[ 1.086716] tegra-pcie 10003000.pcie-controller: probing port 0, using 4 lanes
[ 1.086726] Node path /chosen/display-board not found
[ 1.086743] pwm_bl_ops are not required

Looks like Nvidia has lost files for the r32.3.1 release board-panel.c looks for /backlight in the device tree, and I can’t find any /backlight in any device tree files.

sources/kernel/nvidia/drivers/video/tegra/dc/panel/board-panel.c: np_parent = of_find_node_by_path("/backlight");

Please provide the files to make this work.
Thanks,

Hi,

I am not sure why you asked “I can’t find any /backlight in any device tree files.”
What we are doing now is adding a backlight node in device tree…

Please follow the guidance as the linux page. And since it is a public documentation, you need to modify the regulator and gpio to match your custom board… Direclty copy & paste will surely not work…

And the function in board-panel.c should not be called, unless you modify something in driver.

After adding below in dts, I can see backlight node in /sys/class/backlight/.

backlight {
                status = "okay";
                compatible = "pwm-backlight";
                pwms = <0x27 0x0 0x9ce1>;
                max-brightness = <0xff>;
                default-brightness = <0xbf>;
                default-charge-brightness = <0x70>;
                bl-measured = <0x0 0x1 0x2 0x3 0x4 0x5 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xb 0xc 0xd 0xe 0xf 0xf 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x1f 0x20 0x21 0x22 0x23 0x24 0x25 0x25 0x26 0x27 0x28 0x29 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f 0x30 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x36 0x37 0x38 0x39 0x3a 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f 0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5e 0x5f 0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7d 0x7e 0x7f 0x80 0x81 0x82 0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e 0x9f 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad 0xae 0xaf 0xb0 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc7 0xc8 0xc9 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7 0xd8 0xd9 0xdb 0xdc 0xdd 0xde 0xdf 0xe1 0xe2 0xe3 0xe4 0xe5 0xe6 0xe7 0xe9 0xea 0xeb 0xec 0xed 0xee 0xef 0xf0 0xf1 0xf2 0xf4 0xf5 0xf6 0xf7 0xf8 0xf9 0xfa 0xfb 0xfd 0xfe 0xff>;
                power-supply = <0x26>;

root@tegra-ubuntu:/sys/class/backlight# ll
total 0
drwxr-xr-x 2 root root 0 Dec 30 05:06 ./
drwxr-xr-x 92 root root 0 Dec 30 05:06 …/
lrwxrwxrwx 1 root root 0 Dec 30 05:06 backlight -> …/…/devices/backlight/backlight/backlight/

I get the same error, No compatible prop in backlight node.

it appears to come from the line sources/kernel/nvidia/drivers/video/tegra/dc/panel/board-panel.c: np_parent = of_find_node_by_path("/backlight");

Thus I am asking why board-panel.c is failing! and looking for /backlight.

There is no node in /sys/class/backlight,

What code builds the /sys/class/backlight directory?

Please provide the files to make this work.
Thanks,