Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sony-laptop: don't change keyboard backlight settings

Do not touch keyboard backlight unless explicitly passed a module
parameter. In this way we won't make wrong assumptions about what are
good default values since they actually are different from model to
model.

The only side effect is that we won't know what is the current value
until set via the sysfs attributes.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mattia Dongili and committed by
Linus Torvalds
294d31e8 69c88dc7

+9 -17
+9 -17
drivers/platform/x86/sony-laptop.c
··· 127 127 "default is -1 (automatic)"); 128 128 #endif 129 129 130 - static int kbd_backlight = 1; 130 + static int kbd_backlight = -1; 131 131 module_param(kbd_backlight, int, 0444); 132 132 MODULE_PARM_DESC(kbd_backlight, 133 133 "set this to 0 to disable keyboard backlight, " 134 - "1 to enable it (default: 0)"); 134 + "1 to enable it (default: no change from current value)"); 135 135 136 - static int kbd_backlight_timeout; /* = 0 */ 136 + static int kbd_backlight_timeout = -1; 137 137 module_param(kbd_backlight_timeout, int, 0444); 138 138 MODULE_PARM_DESC(kbd_backlight_timeout, 139 - "set this to 0 to set the default 10 seconds timeout, " 140 - "1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout " 141 - "(default: 0)"); 139 + "meaningful values vary from 0 to 3 and their meaning depends " 140 + "on the model (default: no change from current value)"); 142 141 143 142 #ifdef CONFIG_PM_SLEEP 144 143 static void sony_nc_kbd_backlight_resume(void); ··· 1843 1844 if (!kbdbl_ctl) 1844 1845 return -ENOMEM; 1845 1846 1847 + kbdbl_ctl->mode = kbd_backlight; 1848 + kbdbl_ctl->timeout = kbd_backlight_timeout; 1846 1849 kbdbl_ctl->handle = handle; 1847 1850 if (handle == 0x0137) 1848 1851 kbdbl_ctl->base = 0x0C00; ··· 1871 1870 if (ret) 1872 1871 goto outmode; 1873 1872 1874 - __sony_nc_kbd_backlight_mode_set(kbd_backlight); 1875 - __sony_nc_kbd_backlight_timeout_set(kbd_backlight_timeout); 1873 + __sony_nc_kbd_backlight_mode_set(kbdbl_ctl->mode); 1874 + __sony_nc_kbd_backlight_timeout_set(kbdbl_ctl->timeout); 1876 1875 1877 1876 return 0; 1878 1877 ··· 1887 1886 static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd) 1888 1887 { 1889 1888 if (kbdbl_ctl) { 1890 - int result; 1891 - 1892 1889 device_remove_file(&pd->dev, &kbdbl_ctl->mode_attr); 1893 1890 device_remove_file(&pd->dev, &kbdbl_ctl->timeout_attr); 1894 - 1895 - /* restore the default hw behaviour */ 1896 - sony_call_snc_handle(kbdbl_ctl->handle, 1897 - kbdbl_ctl->base | 0x10000, &result); 1898 - sony_call_snc_handle(kbdbl_ctl->handle, 1899 - kbdbl_ctl->base + 0x200, &result); 1900 - 1901 1891 kfree(kbdbl_ctl); 1902 1892 kbdbl_ctl = NULL; 1903 1893 }