tT2-4g R32.3.1 LCD0_BKLT_PWM

how to fix that pwm_bl.c is being called before nvdisp is being set?

I disabled the auto link done by forum.
Please check my previous comment and see if you can access those links now.

how to fix that pwm_bl.c is being called before nvdisp is being set?

As for this issue, I think this is a bug in driver. The order of built-in driver initialization will cause error if it loads pwm_bl earlier than nvdisplay driver.

You can also comment out “tegra_pwm_bl_ops_register(&pdev->dev);” in pwm_bl.c
This may not be necessary. Using generic pwm driver should be sufficient.

You pointed at panel_s_wuxga_7_0 but I used panel_s_wuxga_8_0 for my base mipi dsi so I guess I need you to point at the panel_s_wuxga_7_0 source code so I can merge panel_s_wuxga_7_0 into my panel_s_wuxga_8_0 source code.

did a diff between the two sources I have and nothing is standing out for diffs. I guess I need new source code for the wuxga_7_0, the smartdimmer is not used in any of the source I have, I am assuming this needs to be used?

Terry

changed my device tree to match the wuxga_7_0.dtsi, changed _7_0 to _8_0 and backlight does not call anything in my wuxga driver, or pwm-bl is not called either,

changed status=‘okay’ and still nothing.

Help.
Terry

Hey Terry

I didn’t ask you to check wuxga_7_0.dtsi… why are you checking that…?? Which comment leads you to that file?

Do you understand what I was trying to say in last comment? If you don’t, please ask.

used wuxga_8_0.dtsi as the template, and it did not work.

What do you want me to do next?

Thanks,

is my panel-wuxga_8_0.c missing code to bring up backlight?

Can you give me a link to the base code?

Thanks,

Please check if you understand this comment. The code in panel-s-wugxa_8_0.c may not bring the backlight. Just let the probe function in pwm_bl.c finish and you shall see the pwm-backlight node generated under /sys/class/backlight.

Other method

method 1: change pwm-bl module init to late init call

method 2: moving pwm-backlight device-tree node to a location after nvdisplay node in DTS.

continuing to debug pwm_bl.c and this is failing.

    pb->power_supply = devm_regulator_get(&pdev->dev, "power");
    if (IS_ERR(pb->power_supply)) {
            ret = PTR_ERR(pb->power_supply);
            printk("%s(%d) ret %d\n", __FUNCTION__, __LINE__, ret);
            goto err_alloc;
    }

Any pointers to fix my device tree?

how do I make pwm-bl module a late init call.

Tried method 2, and nothing seemed to work, more details please.

Terry

Hi Terry,

All we are trying to do is let pwm_bl probe get finishes.

method 1 -> remove tegra_pwm_bl_ops_register
method 2 ->change pwm-bl module init to late init call
method 3. ->moving pwm-backlight device-tree node to a location after nvdisplay node in DTS.

They are all doing the same things. If you pick method (1), then don’t need to do (2),(3) anymore.

pb->power_supply = devm_regulator_get(&pdev->dev, “power”);
if (IS_ERR(pb->power_supply)) {
ret = PTR_ERR(pb->power_supply);
printk("%s(%d) ret %d\n", FUNCTION, LINE, ret);
goto err_alloc;
}

If it gets error here, please add “power-supply” and assign battery_reg to it in your dts.

now getting

[ 1.096648] pwm-backlight 13e10000.host1x:backlight: unable to request PWM

any pointers please.

Do you assign the correct “pwms” in your device tree?

fgrep pwms /tmp/deviceTree
pwms = <0x93 0x0 0xf4240>;
pwms = <0xcc 0x0 0xb116>;
pwms = <0x75 0x1 0x9ce1>;
pwms = <0x75 0x0 0x9ce1>;
pwms = <0x75 0x0 0xf4240>;
pwms = <0x75 0x0 0xf4240>;
pwms = <0xd0 0x0 0x4c4b40>;

will go thru the device tree and remove pwms for other things, should I remove pwms = <&tegra_tachometer 0 1000000>;
pwms = <&tegra_pwm3 0 5000000>;
and
pwms = <&tegra_pwm1 0 1000000>
pwms = <&tegra_pwm4 0 45334>;

because they do not match the my " pwms = <&tegra_pwm1 1 40161>;" that I put in.

Remove those duplicated pwm.

For example, if you want to use tegra_pwm1, then remove other nodes that are using tegra_pwm1.

            pb->pwm = of_pwm_get(target_bl_node, NULL);

is returning an error, target_bl_node is good, so what is missing in the device tree.

Terry

Maybe you should debug that by looking into the code by yourself.

so I now have /sys/class/backlight now has the link in it, what do I need to do next

Try to control the brightness node in it and see if the signal is changing as your expectation.
Maybe you should read some post from other linux kernel website to get more familiar with the generic kernel.