Skip to contentSkip to conversation

sony-laptop: Enable keyboard backlight by default

PATCH Superseded Josh Boyer 2 participants 2 messages Nov 2, 2011 – Nov 3, 2011

Subsystems (2)
lore
Share & tools
lore

Josh Boyer

author
#0 lore raw

PATCH 1/1 sony-laptop: Enable keyboard backlight by default

When the keyboard backlight support was originally added, the commit said to default it to on with a 10 second timeout. That actually wasn't the case, as the default value is commented out for the kbd_backlight parameter. Because it is a static variable, it gets set to 0 by default without some other form of initialization.

However, it seems the function to set the value wasn't actually called immediately, so whatever state the keyboard was in initially would remain. Then commit df410d522410e67660 was introduced during the 2.6.39 timeframe to immediately set whatever value was present (as well as attempt to restore/reset the state on module removal or resume). That seems to have now forced the light off immediately when the module is loaded unless the option kbd_backlight=1 is specified.

Let's enable it by default again (for the first time). This should solve
https://bugzilla.redhat.com/show_bug.cgi?id=728478

---

drivers/platform/x86/sony-laptop.c +1 -1
index c006dee..40c4705 100644
@@ -127,7 +127,7 @@ MODULE_PARM_DESC(minor,
 		 "default is -1 (automatic)");
 #endif
 
-static int kbd_backlight;	/* = 1 */
+static int kbd_backlight = 1;
 module_param(kbd_backlight, int, 0444);
 MODULE_PARM_DESC(kbd_backlight,
 		 "set this to 0 to disable keyboard backlight, "
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Josh Boyer

When the keyboard backlight support was originally added, the commit said to default it to on with a 10 second timeout. That actually wasn't the case, as the default value is commented out for the kbd_backlight parameter. Because it is a static variable, it gets set to 0 by default without some other form of initialization.

However, it seems the function to set the value wasn't actually called immediately, so whatever state the keyboard was in initially would remain. Then commit df410d522410e67660 was introduced during the 2.6.39 timeframe to immediately set whatever value was present (as well as attempt to restore/reset the state on module removal or resume). That seems to have now forced the light off immediately when the module is loaded unless the option kbd_backlight=1 is specified.

Quoted 2 lines

Let's enable it by default again (for the first time). This should solve
https://bugzilla.redhat.com/show_bug.cgi?id=728478

I am trying to recollect the reason why I commented out that assignment at some point... but it seems I can't, to the point that I have a commit to my local tree that changes the value in the commented out code... Thanks for spotting this.

Quoted 1 line
Quoted 15 lines

---

drivers/platform/x86/sony-laptop.c +1 -1
index c006dee..40c4705 100644
@@ -127,7 +127,7 @@ MODULE_PARM_DESC(minor,
 		 "default is -1 (automatic)");
 #endif
 
-static int kbd_backlight;	/* = 1 */
+static int kbd_backlight = 1;
 module_param(kbd_backlight, int, 0444);
 MODULE_PARM_DESC(kbd_backlight,
 		 "set this to 0 to disable keyboard backlight, "
Signature · 2 lines
mattia
:wq!