diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 14:54:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 14:54:53 -0400 |
commit | 7d3d09b01a028e9dd1282149fdcd2a6e0edd73e4 (patch) | |
tree | 283664c2383ded3ef44ea36e3fa5b33d586c0652 /drivers/platform/x86/asus-wmi.c | |
parent | 287dc4b7642df15fa6b9f286c812e79138acd698 (diff) | |
parent | 00d39597e825a2b09ec88d4dd429ff72fe60d9d4 (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/platform/x86/asus-wmi.c')
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 77aadde5281..c7a36f6b058 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c | |||
@@ -47,6 +47,9 @@ | |||
47 | #include <linux/thermal.h> | 47 | #include <linux/thermal.h> |
48 | #include <acpi/acpi_bus.h> | 48 | #include <acpi/acpi_bus.h> |
49 | #include <acpi/acpi_drivers.h> | 49 | #include <acpi/acpi_drivers.h> |
50 | #ifdef CONFIG_ACPI_VIDEO | ||
51 | #include <acpi/video.h> | ||
52 | #endif | ||
50 | 53 | ||
51 | #include "asus-wmi.h" | 54 | #include "asus-wmi.h" |
52 | 55 | ||
@@ -136,6 +139,9 @@ MODULE_LICENSE("GPL"); | |||
136 | /* Power */ | 139 | /* Power */ |
137 | #define ASUS_WMI_DEVID_PROCESSOR_STATE 0x00120012 | 140 | #define ASUS_WMI_DEVID_PROCESSOR_STATE 0x00120012 |
138 | 141 | ||
142 | /* Deep S3 / Resume on LID open */ | ||
143 | #define ASUS_WMI_DEVID_LID_RESUME 0x00120031 | ||
144 | |||
139 | /* DSTS masks */ | 145 | /* DSTS masks */ |
140 | #define ASUS_WMI_DSTS_STATUS_BIT 0x00000001 | 146 | #define ASUS_WMI_DSTS_STATUS_BIT 0x00000001 |
141 | #define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002 | 147 | #define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002 |
@@ -1365,6 +1371,7 @@ static ssize_t show_sys_wmi(struct asus_wmi *asus, int devid, char *buf) | |||
1365 | ASUS_WMI_CREATE_DEVICE_ATTR(touchpad, 0644, ASUS_WMI_DEVID_TOUCHPAD); | 1371 | ASUS_WMI_CREATE_DEVICE_ATTR(touchpad, 0644, ASUS_WMI_DEVID_TOUCHPAD); |
1366 | ASUS_WMI_CREATE_DEVICE_ATTR(camera, 0644, ASUS_WMI_DEVID_CAMERA); | 1372 | ASUS_WMI_CREATE_DEVICE_ATTR(camera, 0644, ASUS_WMI_DEVID_CAMERA); |
1367 | ASUS_WMI_CREATE_DEVICE_ATTR(cardr, 0644, ASUS_WMI_DEVID_CARDREADER); | 1373 | ASUS_WMI_CREATE_DEVICE_ATTR(cardr, 0644, ASUS_WMI_DEVID_CARDREADER); |
1374 | ASUS_WMI_CREATE_DEVICE_ATTR(lid_resume, 0644, ASUS_WMI_DEVID_LID_RESUME); | ||
1368 | 1375 | ||
1369 | static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr, | 1376 | static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr, |
1370 | const char *buf, size_t count) | 1377 | const char *buf, size_t count) |
@@ -1390,6 +1397,7 @@ static struct attribute *platform_attributes[] = { | |||
1390 | &dev_attr_camera.attr, | 1397 | &dev_attr_camera.attr, |
1391 | &dev_attr_cardr.attr, | 1398 | &dev_attr_cardr.attr, |
1392 | &dev_attr_touchpad.attr, | 1399 | &dev_attr_touchpad.attr, |
1400 | &dev_attr_lid_resume.attr, | ||
1393 | NULL | 1401 | NULL |
1394 | }; | 1402 | }; |
1395 | 1403 | ||
@@ -1408,6 +1416,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, | |||
1408 | devid = ASUS_WMI_DEVID_CARDREADER; | 1416 | devid = ASUS_WMI_DEVID_CARDREADER; |
1409 | else if (attr == &dev_attr_touchpad.attr) | 1417 | else if (attr == &dev_attr_touchpad.attr) |
1410 | devid = ASUS_WMI_DEVID_TOUCHPAD; | 1418 | devid = ASUS_WMI_DEVID_TOUCHPAD; |
1419 | else if (attr == &dev_attr_lid_resume.attr) | ||
1420 | devid = ASUS_WMI_DEVID_LID_RESUME; | ||
1411 | 1421 | ||
1412 | if (devid != -1) | 1422 | if (devid != -1) |
1413 | ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0); | 1423 | ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0); |
@@ -1467,14 +1477,9 @@ static int asus_wmi_platform_init(struct asus_wmi *asus) | |||
1467 | */ | 1477 | */ |
1468 | if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS, 0, 0, NULL)) | 1478 | if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS, 0, 0, NULL)) |
1469 | asus->dsts_id = ASUS_WMI_METHODID_DSTS; | 1479 | asus->dsts_id = ASUS_WMI_METHODID_DSTS; |
1470 | else if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS2, 0, 0, NULL)) | 1480 | else |
1471 | asus->dsts_id = ASUS_WMI_METHODID_DSTS2; | 1481 | asus->dsts_id = ASUS_WMI_METHODID_DSTS2; |
1472 | 1482 | ||
1473 | if (!asus->dsts_id) { | ||
1474 | pr_err("Can't find DSTS"); | ||
1475 | return -ENODEV; | ||
1476 | } | ||
1477 | |||
1478 | /* CWAP allow to define the behavior of the Fn+F2 key, | 1483 | /* CWAP allow to define the behavior of the Fn+F2 key, |
1479 | * this method doesn't seems to be present on Eee PCs */ | 1484 | * this method doesn't seems to be present on Eee PCs */ |
1480 | if (asus->driver->quirks->wapf >= 0) | 1485 | if (asus->driver->quirks->wapf >= 0) |
@@ -1681,7 +1686,13 @@ static int asus_wmi_add(struct platform_device *pdev) | |||
1681 | if (err) | 1686 | if (err) |
1682 | goto fail_rfkill; | 1687 | goto fail_rfkill; |
1683 | 1688 | ||
1689 | if (asus->driver->quirks->wmi_backlight_power) | ||
1690 | acpi_video_dmi_promote_vendor(); | ||
1684 | if (!acpi_video_backlight_support()) { | 1691 | if (!acpi_video_backlight_support()) { |
1692 | #ifdef CONFIG_ACPI_VIDEO | ||
1693 | pr_info("Disabling ACPI video driver\n"); | ||
1694 | acpi_video_unregister(); | ||
1695 | #endif | ||
1685 | err = asus_wmi_backlight_init(asus); | 1696 | err = asus_wmi_backlight_init(asus); |
1686 | if (err && err != -ENODEV) | 1697 | if (err && err != -ENODEV) |
1687 | goto fail_backlight; | 1698 | goto fail_backlight; |