aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-12-20 02:52:17 -0500
committerLen Brown <len.brown@intel.com>2006-12-20 02:52:17 -0500
commit40b20c257a13c5a526ac540bc5e43d0fdf29792a (patch)
treee125c0c2b557e36cb0c3a2c3726fadbcdae0dca3 /drivers/acpi
parentcece901481bafbf14de8cbd3a89ae869ea881055 (diff)
parenta8274d57afb83e4954ddcb3f8b7dd1c03a379bd4 (diff)
Pull platform-drivers into test branch
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/asus_acpi.c2
-rw-r--r--drivers/acpi/ibm_acpi.c5
-rw-r--r--drivers/acpi/toshiba_acpi.c3
-rw-r--r--drivers/acpi/video.c41
4 files changed, 39 insertions, 12 deletions
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index bfae3ffff13c..7cc54aacd4c0 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -1401,7 +1401,7 @@ static int __init asus_acpi_init(void)
1401 return result; 1401 return result;
1402 } 1402 }
1403 1403
1404 asus_backlight_device = backlight_device_register("asus", NULL, 1404 asus_backlight_device = backlight_device_register("asus",NULL,NULL,
1405 &asus_backlight_data); 1405 &asus_backlight_data);
1406 if (IS_ERR(asus_backlight_device)) { 1406 if (IS_ERR(asus_backlight_device)) {
1407 printk(KERN_ERR "Could not register asus backlight device\n"); 1407 printk(KERN_ERR "Could not register asus backlight device\n");
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 1e7abef404b0..130cc8c37e22 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -1714,7 +1714,7 @@ static struct backlight_properties ibm_backlight_data = {
1714 1714
1715static int brightness_init(void) 1715static int brightness_init(void)
1716{ 1716{
1717 ibm_backlight_device = backlight_device_register("ibm", NULL, 1717 ibm_backlight_device = backlight_device_register("ibm", NULL, NULL,
1718 &ibm_backlight_data); 1718 &ibm_backlight_data);
1719 if (IS_ERR(ibm_backlight_device)) { 1719 if (IS_ERR(ibm_backlight_device)) {
1720 printk(IBM_ERR "Could not register backlight device\n"); 1720 printk(IBM_ERR "Could not register backlight device\n");
@@ -2503,7 +2503,7 @@ static int __init setup_notify(struct ibm_struct *ibm)
2503 ibm->name, status); 2503 ibm->name, status);
2504 return -ENODEV; 2504 return -ENODEV;
2505 } 2505 }
2506 2506 ibm->notify_installed = 1;
2507 return 0; 2507 return 0;
2508} 2508}
2509 2509
@@ -2580,7 +2580,6 @@ static int __init ibm_init(struct ibm_struct *ibm)
2580 ret = setup_notify(ibm); 2580 ret = setup_notify(ibm);
2581 if (ret < 0) 2581 if (ret < 0)
2582 return ret; 2582 return ret;
2583 ibm->notify_installed = 1;
2584 } 2583 }
2585 2584
2586 return 0; 2585 return 0;
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index 2f35f891593f..88aeccbafaaf 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -590,7 +590,8 @@ static int __init toshiba_acpi_init(void)
590 remove_proc_entry(PROC_TOSHIBA, acpi_root_dir); 590 remove_proc_entry(PROC_TOSHIBA, acpi_root_dir);
591 } 591 }
592 592
593 toshiba_backlight_device = backlight_device_register("toshiba", NULL, 593 toshiba_backlight_device = backlight_device_register("toshiba",NULL,
594 NULL,
594 &toshiba_backlight_data); 595 &toshiba_backlight_data);
595 if (IS_ERR(toshiba_backlight_device)) { 596 if (IS_ERR(toshiba_backlight_device)) {
596 printk(KERN_ERR "Could not register toshiba backlight device\n"); 597 printk(KERN_ERR "Could not register toshiba backlight device\n");
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 53a9eb015d6b..eb5141f9ef8f 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * Copyright (C) 2004 Luming Yu <luming.yu@intel.com> 4 * Copyright (C) 2004 Luming Yu <luming.yu@intel.com>
5 * Copyright (C) 2004 Bruno Ducrot <ducrot@poupinou.org> 5 * Copyright (C) 2004 Bruno Ducrot <ducrot@poupinou.org>
6 * Copyright (C) 2006 Thomas Tuttle <linux-kernel@ttuttle.net>
6 * 7 *
7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 * 9 *
@@ -47,11 +48,11 @@
47#define ACPI_VIDEO_NOTIFY_NEXT_OUTPUT 0x83 48#define ACPI_VIDEO_NOTIFY_NEXT_OUTPUT 0x83
48#define ACPI_VIDEO_NOTIFY_PREV_OUTPUT 0x84 49#define ACPI_VIDEO_NOTIFY_PREV_OUTPUT 0x84
49 50
50#define ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS 0x82 51#define ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS 0x85
51#define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x83 52#define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x86
52#define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x84 53#define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x87
53#define ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS 0x85 54#define ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS 0x88
54#define ACPI_VIDEO_NOTIFY_DISPLAY_OFF 0x86 55#define ACPI_VIDEO_NOTIFY_DISPLAY_OFF 0x89
55 56
56#define ACPI_VIDEO_HEAD_INVALID (~0u - 1) 57#define ACPI_VIDEO_HEAD_INVALID (~0u - 1)
57#define ACPI_VIDEO_HEAD_END (~0u) 58#define ACPI_VIDEO_HEAD_END (~0u)
@@ -1505,8 +1506,34 @@ static int
1505acpi_video_get_next_level(struct acpi_video_device *device, 1506acpi_video_get_next_level(struct acpi_video_device *device,
1506 u32 level_current, u32 event) 1507 u32 level_current, u32 event)
1507{ 1508{
1508 /*Fix me */ 1509 int min, max, min_above, max_below, i, l;
1509 return level_current; 1510 max = max_below = 0;
1511 min = min_above = 255;
1512 for (i = 0; i < device->brightness->count; i++) {
1513 l = device->brightness->levels[i];
1514 if (l < min)
1515 min = l;
1516 if (l > max)
1517 max = l;
1518 if (l < min_above && l > level_current)
1519 min_above = l;
1520 if (l > max_below && l < level_current)
1521 max_below = l;
1522 }
1523
1524 switch (event) {
1525 case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS:
1526 return (level_current < max) ? min_above : min;
1527 case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS:
1528 return (level_current < max) ? min_above : max;
1529 case ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS:
1530 return (level_current > min) ? max_below : min;
1531 case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS:
1532 case ACPI_VIDEO_NOTIFY_DISPLAY_OFF:
1533 return 0;
1534 default:
1535 return level_current;
1536 }
1510} 1537}
1511 1538
1512static void 1539static void