Skip to content

Commit

Permalink
ARM: dts: droid4: Configure LED backlight for lm3532
Browse files Browse the repository at this point in the history
With the LED backlight changes merged, we still need the dts configured
to have backlight working for droid4. Based on an earlier patch from
Pavel Machek <[email protected]>, let's configure the backlight but update
the value range to be more usable.

We have a range of 256 register values split into 8 steps, so we can
generate the brightness levels backwards with:

$ for i in 0 1 2 3 4 5 6 7; do echo "255 - ${i} * (256 / 8)" | bc; done

To avoid more confusion why the LCD backlight is still not on, let's
also enable LED backlight as a loadable module for omap2plus_defconfig.

Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Reviewed-by: Sebastian Reichel <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
  • Loading branch information
tmlind committed Feb 20, 2020
1 parent ae232e4 commit 10dc62d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions arch/arm/boot/dts/motorola-mapphone-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@
pwm-names = "enable", "direction";
direction-duty-cycle-ns = <10000000>;
};

backlight: backlight {
compatible = "led-backlight";

leds = <&backlight_led>;
brightness-levels = <31 63 95 127 159 191 223 255>;
default-brightness-level = <6>;
};
};

&dss {
Expand All @@ -205,6 +213,8 @@
vddi-supply = <&lcd_regulator>;
reset-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* gpio101 */

backlight = <&backlight>;

width-mm = <50>;
height-mm = <89>;

Expand Down Expand Up @@ -393,12 +403,11 @@
ramp-up-us = <1024>;
ramp-down-us = <8193>;

led@0 {
backlight_led: led@0 {
reg = <0>;
led-sources = <2>;
ti,led-mode = <0>;
label = ":backlight";
linux,default-trigger = "backlight";
};

led@1 {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/omap2plus_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ CONFIG_BACKLIGHT_GENERIC=m
CONFIG_BACKLIGHT_PWM=m
CONFIG_BACKLIGHT_PANDORA=m
CONFIG_BACKLIGHT_GPIO=m
CONFIG_BACKLIGHT_LED=m
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
CONFIG_LOGO=y
Expand Down

0 comments on commit 10dc62d

Please sign in to comment.