diff options
author | Matthew Garrett <mjg59@srcf.ucam.org> | 2008-02-05 02:31:24 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-02-07 03:22:57 -0500 |
commit | 863c1490e512db40dab61e44b694a493a9e68b3f (patch) | |
tree | 3abfb2217b1331b3a4dfd917025ef2a87499be03 /drivers/acpi/video.c | |
parent | 7761f638f6e0f276fe8612ba306d09c40d1b553c (diff) |
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.c | 21 |
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); | |||
77 | 77 | ||
78 | static int acpi_video_bus_add(struct acpi_device *device); | 78 | static int acpi_video_bus_add(struct acpi_device *device); |
79 | static int acpi_video_bus_remove(struct acpi_device *device, int type); | 79 | static int acpi_video_bus_remove(struct acpi_device *device, int type); |
80 | static int acpi_video_resume(struct acpi_device *device); | ||
80 | 81 | ||
81 | static const struct acpi_device_id video_device_ids[] = { | 82 | static const struct acpi_device_id video_device_ids[] = { |
82 | {ACPI_VIDEO_HID, 0}, | 83 | {ACPI_VIDEO_HID, 0}, |
@@ -91,6 +92,7 @@ static struct acpi_driver acpi_video_bus = { | |||
91 | .ops = { | 92 | .ops = { |
92 | .add = acpi_video_bus_add, | 93 | .add = acpi_video_bus_add, |
93 | .remove = acpi_video_bus_remove, | 94 | .remove = acpi_video_bus_remove, |
95 | .resume = acpi_video_resume, | ||
94 | }, | 96 | }, |
95 | }; | 97 | }; |
96 | 98 | ||
@@ -1837,6 +1839,25 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) | |||
1837 | } | 1839 | } |
1838 | 1840 | ||
1839 | static int instance; | 1841 | static int instance; |
1842 | static int acpi_video_resume(struct acpi_device *device) | ||
1843 | { | ||
1844 | struct acpi_video_bus *video; | ||
1845 | struct acpi_video_device *video_device; | ||
1846 | int i; | ||
1847 | |||
1848 | if (!device || !acpi_driver_data(device)) | ||
1849 | return -EINVAL; | ||
1850 | |||
1851 | video = acpi_driver_data(device); | ||
1852 | |||
1853 | for (i = 0; i < video->attached_count; i++) { | ||
1854 | video_device = video->attached_array[i].bind_info; | ||
1855 | if (video_device && video_device->backlight) | ||
1856 | acpi_video_set_brightness(video_device->backlight); | ||
1857 | } | ||
1858 | return AE_OK; | ||
1859 | } | ||
1860 | |||
1840 | static int acpi_video_bus_add(struct acpi_device *device) | 1861 | static int acpi_video_bus_add(struct acpi_device *device) |
1841 | { | 1862 | { |
1842 | acpi_status status; | 1863 | acpi_status status; |