aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2008-01-25 01:47:49 -0500
committerLen Brown <len.brown@intel.com>2008-02-07 03:22:56 -0500
commit8a681a4dee07ea09aedaadc6a2da28d2131dc414 (patch)
tree051ace265079d74b815539be73599339d8c55b42 /drivers/acpi
parent488b5ec871191359b9b79262a3d48456dae7ea5f (diff)
ACPI: video: create "brightness_switch_enabled" modparam
Introduce new module parameter for brightness control. "brightness_switch_enabled" is set by default which means nothing changes upon brightness switch events. When "brightness_switch_enabled" is cleared via "echo 0 > /sys/module/video/parameters/brightness_switch_enabled", ACPI will not try to change the brightness level any more. Either X will take charge of this or users can change the brightness level by poking /sys/class/backlight/acpi_videoX/... Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/video.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index bd77e81e81c1..b1a56bf682ae 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -72,6 +72,9 @@ MODULE_AUTHOR("Bruno Ducrot");
72MODULE_DESCRIPTION("ACPI Video Driver"); 72MODULE_DESCRIPTION("ACPI Video Driver");
73MODULE_LICENSE("GPL"); 73MODULE_LICENSE("GPL");
74 74
75static int brightness_switch_enabled = 1;
76module_param(brightness_switch_enabled, bool, 0644);
77
75static int acpi_video_bus_add(struct acpi_device *device); 78static int acpi_video_bus_add(struct acpi_device *device);
76static int acpi_video_bus_remove(struct acpi_device *device, int type); 79static int acpi_video_bus_remove(struct acpi_device *device, int type);
77 80
@@ -1850,27 +1853,32 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
1850 1853
1851 switch (event) { 1854 switch (event) {
1852 case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */ 1855 case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */
1853 acpi_video_switch_brightness(video_device, event); 1856 if (brightness_switch_enabled)
1857 acpi_video_switch_brightness(video_device, event);
1854 acpi_bus_generate_proc_event(device, event, 0); 1858 acpi_bus_generate_proc_event(device, event, 0);
1855 keycode = KEY_BRIGHTNESS_CYCLE; 1859 keycode = KEY_BRIGHTNESS_CYCLE;
1856 break; 1860 break;
1857 case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS: /* Increase brightness */ 1861 case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS: /* Increase brightness */
1858 acpi_video_switch_brightness(video_device, event); 1862 if (brightness_switch_enabled)
1863 acpi_video_switch_brightness(video_device, event);
1859 acpi_bus_generate_proc_event(device, event, 0); 1864 acpi_bus_generate_proc_event(device, event, 0);
1860 keycode = KEY_BRIGHTNESSUP; 1865 keycode = KEY_BRIGHTNESSUP;
1861 break; 1866 break;
1862 case ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS: /* Decrease brightness */ 1867 case ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS: /* Decrease brightness */
1863 acpi_video_switch_brightness(video_device, event); 1868 if (brightness_switch_enabled)
1869 acpi_video_switch_brightness(video_device, event);
1864 acpi_bus_generate_proc_event(device, event, 0); 1870 acpi_bus_generate_proc_event(device, event, 0);
1865 keycode = KEY_BRIGHTNESSDOWN; 1871 keycode = KEY_BRIGHTNESSDOWN;
1866 break; 1872 break;
1867 case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS: /* zero brightnesss */ 1873 case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS: /* zero brightnesss */
1868 acpi_video_switch_brightness(video_device, event); 1874 if (brightness_switch_enabled)
1875 acpi_video_switch_brightness(video_device, event);
1869 acpi_bus_generate_proc_event(device, event, 0); 1876 acpi_bus_generate_proc_event(device, event, 0);
1870 keycode = KEY_BRIGHTNESS_ZERO; 1877 keycode = KEY_BRIGHTNESS_ZERO;
1871 break; 1878 break;
1872 case ACPI_VIDEO_NOTIFY_DISPLAY_OFF: /* display device off */ 1879 case ACPI_VIDEO_NOTIFY_DISPLAY_OFF: /* display device off */
1873 acpi_video_switch_brightness(video_device, event); 1880 if (brightness_switch_enabled)
1881 acpi_video_switch_brightness(video_device, event);
1874 acpi_bus_generate_proc_event(device, event, 0); 1882 acpi_bus_generate_proc_event(device, event, 0);
1875 keycode = KEY_DISPLAY_OFF; 1883 keycode = KEY_DISPLAY_OFF;
1876 break; 1884 break;