add more brightness level

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

add more brightness level

3,364件の閲覧回数
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

ラベル(1)
タグ(1)
0 件の賞賛
返信
7 返答(返信)

3,255件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

also useful links:

PWM (Linux) 

Backlight (Linux) 

Best regards
igor

0 件の賞賛
返信

3,255件の閲覧回数
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 件の賞賛
返信

3,255件の閲覧回数
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 件の賞賛
返信

3,255件の閲覧回数
Mihan
Contributor IV

by the way, if I 

make imx6dl-sabresd.dtb

which device tree file should I change?

0 件の賞賛
返信

3,255件の閲覧回数
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 件の賞賛
返信

3,255件の閲覧回数
Mihan
Contributor IV

Oh thanks, that should be what I need!

0 件の賞賛
返信

3,255件の閲覧回数
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 件の賞賛
返信