linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] samsung-laptop: Set keyboard backlight initially
@ 2012-12-23 17:21 Roland Stigge
  2012-12-24  8:41 ` Corentin Chary
  0 siblings, 1 reply; 4+ messages in thread
From: Roland Stigge @ 2012-12-23 17:21 UTC (permalink / raw)
  To: gregkh, corentin.chary, mjg, platform-driver-x86, linux-kernel
  Cc: 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.

Fixing via readout-write in samsung_leds_init().

Tested on Samsung NP900X3C.

Signed-off-by: Roland Stigge <stigge@antcom.de>
--

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!

diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
index dd90d15..1d3292c 100644
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -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)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] samsung-laptop: Set keyboard backlight initially
  2012-12-23 17:21 [PATCH] samsung-laptop: Set keyboard backlight initially Roland Stigge
@ 2012-12-24  8:41 ` Corentin Chary
  2012-12-24 12:55   ` Roland Stigge
  0 siblings, 1 reply; 4+ messages in thread
From: Corentin Chary @ 2012-12-24  8:41 UTC (permalink / raw)
  To: Roland Stigge; +Cc: gregkh, Matthew Garrett, platform-driver-x86, LKML

On Sun, Dec 23, 2012 at 6:21 PM, Roland Stigge <stigge@antcom.de> wrote:
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] samsung-laptop: Set keyboard backlight initially
  2012-12-24  8:41 ` Corentin Chary
@ 2012-12-24 12:55   ` Roland Stigge
  2013-01-03 20:46     ` Corentin Chary
  0 siblings, 1 reply; 4+ messages in thread
From: Roland Stigge @ 2012-12-24 12:55 UTC (permalink / raw)
  To: Corentin Chary; +Cc: gregkh, Matthew Garrett, platform-driver-x86, LKML

On 24/12/12 09:41, Corentin Chary wrote:
> On Sun, Dec 23, 2012 at 6:21 PM, Roland Stigge <stigge@antcom.de> wrote:
>> 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.

> What's the behavior on windows ?

There is no windows available on this machine.

Thanks,

Roland

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] samsung-laptop: Set keyboard backlight initially
  2012-12-24 12:55   ` Roland Stigge
@ 2013-01-03 20:46     ` Corentin Chary
  0 siblings, 0 replies; 4+ messages in thread
From: Corentin Chary @ 2013-01-03 20:46 UTC (permalink / raw)
  To: Roland Stigge; +Cc: gregkh, Matthew Garrett, platform-driver-x86, LKML

Sorry for the lag...

On Mon, Dec 24, 2012 at 12:55 PM, Roland Stigge <stigge@antcom.de> wrote:
> On 24/12/12 09:41, Corentin Chary wrote:
>> On Sun, Dec 23, 2012 at 6:21 PM, Roland Stigge <stigge@antcom.de> wrote:
>>> 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,

> 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.

>> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-03 20:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-23 17:21 [PATCH] samsung-laptop: Set keyboard backlight initially Roland Stigge
2012-12-24  8:41 ` Corentin Chary
2012-12-24 12:55   ` Roland Stigge
2013-01-03 20:46     ` Corentin Chary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).