add more brightness level

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

add more brightness level

1,606 Views
Mihan
Contributor IV

Hi

I want to set brightness by setting /sys/class/backlight/backlight/brightness.

But I find the max_brightness is 7,which means that the level is from 0 to 7.

I want to add more level (from 0 to 100) ,but how to know which file is it in ../arch/arm/dts/

I also find some files, but the levels they define are not suitable.

e.g.

# they have 9 levels not 8 levels

arch/arm/dts/am437x-sk-evm.dts:35: brightness-levels = <0 51 53 56 62 75 101 152 255>;
arch/arm/dts/am437x-gp-evm.dts:63: brightness-levels = <0 51 53 56 62 75 101 152 255>;
arch/arm/dts/am335x-evm.dts:105: brightness-levels = <0 51 53 56 62 75 101 152 255>;

Regards

Mihan

Labels (1)
Tags (1)
0 Kudos
7 Replies

1,497 Views
igorpadykov
NXP Employee
NXP Employee

also useful links:

PWM (Linux) 

Backlight (Linux) 

Best regards
igor

0 Kudos

1,497 Views
Mihan
Contributor IV

So where is the level of backlight defined?

I know I can change the backlight by 

/sys/class/backlight/backlight/brightness

but I want to change the 

/sys/class/backlight/backlight/max_brightness

so that I can change the backlight more smoothly.

0 Kudos

1,497 Views
karangajjar
Senior Contributor II

Hi 铭恒 李,

After changing the brightness-level as suggested in the previous comment, the max_brigthtness will be automatically calculated as per number of levels defined in brightness-level.

Let's say you added brightness-level ranging from 0 to 255 in 100 different levels like:

0 5 10 15 ....255        //100 different numbers(level)

The max-brightness will have value 100.

Regards,

Karan Gajjar

0 Kudos

1,497 Views
Mihan
Contributor IV

by the way, if I 

make imx6dl-sabresd.dtb

which device tree file should I change?

0 Kudos

1,497 Views
karangajjar
Senior Contributor II

Hi 铭恒 李,

The backlight node is defined in imx6qdl-sabresd.dtsi which is included by imx6dl-sabresd.dts

So you can make changes in imx6qdl-sabresd.dtsi.

Regards,

Karan Gajjar

0 Kudos

1,497 Views
Mihan
Contributor IV

Oh thanks, that should be what I need!

0 Kudos

1,497 Views
karangajjar
Senior Contributor II

Hi 铭恒 李 ,

You can refer below document for configuring backlight in device tree.

https://www.kernel.org/doc/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt 

As, you can see in node "brightness-level" you can add numbers ranging from 0 to 255 at different levels that you want. And set default-brigthness-level as well.

After compiling and flashing you can change the brightness of backlight from sysfs.

Regards,

Karan Gajjar

0 Kudos