i.mx6 pwm-backlight

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.mx6 pwm-backlight

Jump to solution
7,574 Views
lawrencehuang
Contributor I

how can i add pwm-backlight in my kernel? i use RIoTboard and linux L3.10.17_1.0.0 but can't find where can add it.

thanks!

Labels (1)
0 Kudos
1 Solution
2,542 Views
csotoalonso
Contributor III

Ooops! Totally forgot about it.

If you want to change the PWM device, you don't have to change any source code, just the DTS file for your board. Pretty much as I did for my board:

  1. In the backlight section, change <&pwm4 0 5000000>;to pwm3
  2. Enable pwm3:  you need to modify the phandle for pwm3 and change the status to "okay"
  3. In pincontrol, add a group for your pwm and set the correct PAD assignments for your output pin (SD1_DATA1, I presume)

And that's all. As Artur Petukhov pointed out, you'll have your backlight control exported to sysfs, so you can change its brightness value.

View solution in original post

0 Kudos
4 Replies
2,542 Views
art
NXP Employee
NXP Employee

Please refer to the Section 6.2.2 of the document attached.


Have a great day,
Artur

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

2,542 Views
csotoalonso
Contributor III

Hi,

you need to do a couple of things:

  1. Add pwm-backlight support in your kernel, as a built-in module or as a loadable module.
  2. Modify your DTB to add backlight support for your board. As a reference, you could take a look to the imx6qdl-sabresd.dtsi file.

Also, you can see what I did to my board here https://community.freescale.com/thread/337988  It's for a iMX25 board, but the DTB configuration is similar.

0 Kudos
2,542 Views
lawrencehuang
Contributor I

Hi Carlos:

thanks for your reply. but i have some point not understand.

1. in imx6solo_RIoTboard.dts have pwm-backlight

        backlight {

        compatible = "pwm-backlight";

        pwms = <&pwm4 0 5000000>;

        brightness-levels = <0 4 8 16 32 64 128 255>;

        default-brightness-level = <7>;

2. if modify to use pwm3 (SD1_DATA1) where can modify it. because i can't fine the file in source code. could you give me the fiel path or which way to modify it?

0 Kudos
2,543 Views
csotoalonso
Contributor III

Ooops! Totally forgot about it.

If you want to change the PWM device, you don't have to change any source code, just the DTS file for your board. Pretty much as I did for my board:

  1. In the backlight section, change <&pwm4 0 5000000>;to pwm3
  2. Enable pwm3:  you need to modify the phandle for pwm3 and change the status to "okay"
  3. In pincontrol, add a group for your pwm and set the correct PAD assignments for your output pin (SD1_DATA1, I presume)

And that's all. As Artur Petukhov pointed out, you'll have your backlight control exported to sysfs, so you can change its brightness value.

0 Kudos