summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg59@srcf.ucam.org>2008-02-04 23:31:24 -0800
committerLen Brown <len.brown@intel.com>2008-02-07 03:22:57 -0500
commit863c1490e512db40dab61e44b694a493a9e68b3f (patch)
tree3abfb2217b1331b3a4dfd917025ef2a87499be03 /drivers/acpi/video.c
parent7761f638f6e0f276fe8612ba306d09c40d1b553c (diff)
downloadlinux-863c1490e512db40dab61e44b694a493a9e68b3f.tar.gz
linux-863c1490e512db40dab61e44b694a493a9e68b3f.tar.bz2
linux-863c1490e512db40dab61e44b694a493a9e68b3f.zip
ACPI: video: reset brightness on resume
Some machines seem to need the backlight brightness to be reset on resume. Add support for doing so to the video module. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 74ff0faeab57..b5e35cd559ea 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -77,6 +77,7 @@ module_param(brightness_switch_enabled, bool, 0644);
static int acpi_video_bus_add(struct acpi_device *device);
static int acpi_video_bus_remove(struct acpi_device *device, int type);
+static int acpi_video_resume(struct acpi_device *device);
static const struct acpi_device_id video_device_ids[] = {
{ACPI_VIDEO_HID, 0},
@@ -91,6 +92,7 @@ static struct acpi_driver acpi_video_bus = {
.ops = {
.add = acpi_video_bus_add,
.remove = acpi_video_bus_remove,
+ .resume = acpi_video_resume,
},
};
@@ -1837,6 +1839,25 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
}
static int instance;
+static int acpi_video_resume(struct acpi_device *device)
+{
+ struct acpi_video_bus *video;
+ struct acpi_video_device *video_device;
+ int i;
+
+ if (!device || !acpi_driver_data(device))
+ return -EINVAL;
+
+ video = acpi_driver_data(device);
+
+ for (i = 0; i < video->attached_count; i++) {
+ video_device = video->attached_array[i].bind_info;
+ if (video_device && video_device->backlight)
+ acpi_video_set_brightness(video_device->backlight);
+ }
+ return AE_OK;
+}
+
static int acpi_video_bus_add(struct acpi_device *device)
{
acpi_status status;