Skip to contentSkip to conversation

samsung-laptop: Set keyboard backlight initially

PATCH In review Roland Stigge 2 participants 4 messages Dec 23, 2012 – Jan 3, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 samsung-laptop: Set keyboard backlight initially

After boot, /sys/devices/platform/samsung/leds/samsung::kbd_backlight/brightness shows the maximum value (8) by readout, but the led is off. I need to manually set it to the respective value to have keyboard backlight.

Fixing via readout-write in samsung_leds_init().

Tested on Samsung NP900X3C.

--

I'm encountering a similar issue after suspend/resume (led is off). Still wondering if and by which technique I should add a respective .resume() because the driver currently doesn't have pm support and also doesn't register as a driver. Any hint appreciated.

Thanks in advance!

drivers/platform/x86/samsung-laptop.c +1 -0
index dd90d15..1d3292c 100644
@@ -1053,6 +1053,7 @@ static int __init samsung_leds_init(struct samsung_laptop *samsung)
 
 		ret = led_classdev_register(&samsung->platform_device->dev,
 					   &samsung->kbd_led);
+		kbd_led_set(&samsung->kbd_led, kbd_led_get(&samsung->kbd_led));
 	}
 
 	if (ret)
maintainer
#1 lore raw
Quoted 3 lines · Roland Stigge

After boot, /sys/devices/platform/samsung/leds/samsung::kbd_backlight/brightness shows the maximum value (8) by readout, but the led is off. I need to manually set it to the respective value to have keyboard backlight.

If the led is set to 0, what's the value after reboot ? 0 or 8 ? What's the behavior on windows ?

--
Corentin Chary
http://xf.iksaif.net

#2 lore raw
Quoted 6 lines · Corentin Chary
Quoted 3 lines · Roland Stigge

After boot, /sys/devices/platform/samsung/leds/samsung::kbd_backlight/brightness shows the maximum value (8) by readout, but the led is off. I need to manually set it to the respective value to have keyboard backlight.

If the led is set to 0, what's the value after reboot ? 0 or 8 ?

Right - when writing 0 there before restart, the led value is actually 8 after reboot, and the LED hardware is ON. This holds for both reboot and halt+poweron cycle.

Maybe this is related to the "#define MAX_BRIGHT 0x07" (which is unused in samsung-laptop.c)? A bit confusing in the code - but your question hints for some other bug (to be solved differently). Tell me if I can help somehow, here.

Quoted 1 line

What's the behavior on windows ?

There is no windows available on this machine.

Thanks,

Roland

maintainer
#3 lore raw

Sorry for the lag...

Quoted 11 lines · Roland Stigge
Quoted 6 lines · Corentin Chary
Quoted 3 lines · Roland Stigge

After boot, /sys/devices/platform/samsung/leds/samsung::kbd_backlight/brightness shows the maximum value (8) by readout, but the led is off. I need to manually set it to the respective value to have keyboard backlight.

If the led is set to 0, what's the value after reboot ? 0 or 8 ?

Right - when writing 0 there before restart, the led value is actually 8 after reboot, and the LED hardware is ON. This holds for both reboot and halt+poweron cycle.

Ok,

Quoted 4 lines

Maybe this is related to the "#define MAX_BRIGHT 0x07" (which is unused in samsung-laptop.c)? A bit confusing in the code - but your question hints for some other bug (to be solved differently). Tell me if I can help somehow, here.

I don't think this is really used.

Quoted 3 lines
Quoted 1 line

What's the behavior on windows ?

There is no windows available on this machine.

Too bad, let's assume your patch is the best behavior :). Will merge it soon.

--
Corentin Chary
http://xf.iksaif.net