aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 14:54:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 14:54:53 -0400
commit7d3d09b01a028e9dd1282149fdcd2a6e0edd73e4 (patch)
tree283664c2383ded3ef44ea36e3fa5b33d586c0652 /drivers/acpi
parent287dc4b7642df15fa6b9f286c812e79138acd698 (diff)
parent00d39597e825a2b09ec88d4dd429ff72fe60d9d4 (diff)
Merge branch 'linux-next' of git://cavan.codon.org.uk/platform-drivers-x86
Pull x86 platform driver updates from Matthew Garrett: "Nothing overly dramatic here - improved support for the Classmate, some random small fixes and a rework of backlight management to deal with some of the more awkward cases." * 'linux-next' of git://cavan.codon.org.uk/platform-drivers-x86: thinkpad_acpi: Free hotkey_keycode_map after unregistering tpacpi_inputdev thinkpad_acpi: Fix a memory leak during module exit thinkpad_acpi: Flush the workqueue before freeing tpacpi_leds dell-laptop: Add 6 machines to touchpad led quirk ACER: Fix Smatch double-free issue ACER: Fix up sparse warning asus-nb-wmi: add some video toggle keys asus-nb-wmi: add wapf quirk for ASUS machines classmate-laptop: Fix extra keys hardware id. classmate-laptop: Add support for Classmate V4 accelerometer. asus-wmi: enable resume on lid open asus-wmi: control backlight power through WMI, not ACPI samsung-laptop: support R40/R41 acpi/video_detect: blacklist samsung x360 samsung-laptop: X360 ACPI backlight device is broken drivers-platform-x86: use acpi_video_dmi_promote_vendor() acpi: add a way to promote/demote vendor backlight drivers ACER: Add support for accelerometer sensor asus-wmi: use ASUS_WMI_METHODID_DSTS2 as default DSTS ID.
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/video_detect.c60
1 files changed, 58 insertions, 2 deletions
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index 45d8097ef4c..b728880ef10 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -132,6 +132,33 @@ find_video(acpi_handle handle, u32 lvl, void *context, void **rv)
132 return AE_OK; 132 return AE_OK;
133} 133}
134 134
135/* Force to use vendor driver when the ACPI device is known to be
136 * buggy */
137static int video_detect_force_vendor(const struct dmi_system_id *d)
138{
139 acpi_video_support |= ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
140 return 0;
141}
142
143static struct dmi_system_id video_detect_dmi_table[] = {
144 /* On Samsung X360, the BIOS will set a flag (VDRV) if generic
145 * ACPI backlight device is used. This flag will definitively break
146 * the backlight interface (even the vendor interface) untill next
147 * reboot. It's why we should prevent video.ko from being used here
148 * and we can't rely on a later call to acpi_video_unregister().
149 */
150 {
151 .callback = video_detect_force_vendor,
152 .ident = "X360",
153 .matches = {
154 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
155 DMI_MATCH(DMI_PRODUCT_NAME, "X360"),
156 DMI_MATCH(DMI_BOARD_NAME, "X360"),
157 },
158 },
159 { },
160};
161
135/* 162/*
136 * Returns the video capabilities of a specific ACPI graphics device 163 * Returns the video capabilities of a specific ACPI graphics device
137 * 164 *
@@ -164,6 +191,8 @@ long acpi_video_get_capabilities(acpi_handle graphics_handle)
164 * ACPI_VIDEO_BACKLIGHT_DMI_VENDOR; 191 * ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
165 *} 192 *}
166 */ 193 */
194
195 dmi_check_system(video_detect_dmi_table);
167 } else { 196 } else {
168 status = acpi_bus_get_device(graphics_handle, &tmp_dev); 197 status = acpi_bus_get_device(graphics_handle, &tmp_dev);
169 if (ACPI_FAILURE(status)) { 198 if (ACPI_FAILURE(status)) {
@@ -182,8 +211,7 @@ long acpi_video_get_capabilities(acpi_handle graphics_handle)
182} 211}
183EXPORT_SYMBOL(acpi_video_get_capabilities); 212EXPORT_SYMBOL(acpi_video_get_capabilities);
184 213
185/* Returns true if video.ko can do backlight switching */ 214static void acpi_video_caps_check(void)
186int acpi_video_backlight_support(void)
187{ 215{
188 /* 216 /*
189 * We must check whether the ACPI graphics device is physically plugged 217 * We must check whether the ACPI graphics device is physically plugged
@@ -191,6 +219,34 @@ int acpi_video_backlight_support(void)
191 */ 219 */
192 if (!acpi_video_caps_checked) 220 if (!acpi_video_caps_checked)
193 acpi_video_get_capabilities(NULL); 221 acpi_video_get_capabilities(NULL);
222}
223
224/* Promote the vendor interface instead of the generic video module.
225 * This function allow DMI blacklists to be implemented by externals
226 * platform drivers instead of putting a big blacklist in video_detect.c
227 * After calling this function you will probably want to call
228 * acpi_video_unregister() to make sure the video module is not loaded
229 */
230void acpi_video_dmi_promote_vendor(void)
231{
232 acpi_video_caps_check();
233 acpi_video_support |= ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
234}
235EXPORT_SYMBOL(acpi_video_dmi_promote_vendor);
236
237/* To be called when a driver who previously promoted the vendor
238 * interface */
239void acpi_video_dmi_demote_vendor(void)
240{
241 acpi_video_caps_check();
242 acpi_video_support &= ~ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
243}
244EXPORT_SYMBOL(acpi_video_dmi_demote_vendor);
245
246/* Returns true if video.ko can do backlight switching */
247int acpi_video_backlight_support(void)
248{
249 acpi_video_caps_check();
194 250
195 /* First check for boot param -> highest prio */ 251 /* First check for boot param -> highest prio */
196 if (acpi_video_support & ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR) 252 if (acpi_video_support & ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR)