diff options
author | AceLan Kao <acelan.kao@canonical.com> | 2012-06-13 03:32:07 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2012-07-28 00:11:49 -0400 |
commit | c0b91b6d5226247fa4fe894eb592bcc56bc7e9fd (patch) | |
tree | bdd3cde2c30bdf54a9bd9d287cdd1eb1f2a16925 /drivers/platform | |
parent | 272c77d55672ef92eda9d5e24a5a7ac62df9c431 (diff) |
asus-wmi: enable resume on lid open
According to the ASUS WMI spec., to enable resume on lid open should
use the device ID(0x00120032), but it doesn't work indeed.
After discussing with ASUS' BIOS engineer, they say wake on lid open
doesn't have a uniq device ID(0x00120032) in the BIOS. It shares the same
device ID with deep S3(0x00120031), and the deep S3(resume on lid open)
is disable by default.
Adding this option in asus wmi sysfs
/sys/devices/platform/<platform>/lid_resume
so that userspace apps can enable/disable this feature by themselves.
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 486f836b79df..c7a36f6b0580 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c | |||
@@ -139,6 +139,9 @@ MODULE_LICENSE("GPL"); | |||
139 | /* Power */ | 139 | /* Power */ |
140 | #define ASUS_WMI_DEVID_PROCESSOR_STATE 0x00120012 | 140 | #define ASUS_WMI_DEVID_PROCESSOR_STATE 0x00120012 |
141 | 141 | ||
142 | /* Deep S3 / Resume on LID open */ | ||
143 | #define ASUS_WMI_DEVID_LID_RESUME 0x00120031 | ||
144 | |||
142 | /* DSTS masks */ | 145 | /* DSTS masks */ |
143 | #define ASUS_WMI_DSTS_STATUS_BIT 0x00000001 | 146 | #define ASUS_WMI_DSTS_STATUS_BIT 0x00000001 |
144 | #define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002 | 147 | #define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002 |
@@ -1368,6 +1371,7 @@ static ssize_t show_sys_wmi(struct asus_wmi *asus, int devid, char *buf) | |||
1368 | ASUS_WMI_CREATE_DEVICE_ATTR(touchpad, 0644, ASUS_WMI_DEVID_TOUCHPAD); | 1371 | ASUS_WMI_CREATE_DEVICE_ATTR(touchpad, 0644, ASUS_WMI_DEVID_TOUCHPAD); |
1369 | ASUS_WMI_CREATE_DEVICE_ATTR(camera, 0644, ASUS_WMI_DEVID_CAMERA); | 1372 | ASUS_WMI_CREATE_DEVICE_ATTR(camera, 0644, ASUS_WMI_DEVID_CAMERA); |
1370 | 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); | ||
1371 | 1375 | ||
1372 | 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, |
1373 | const char *buf, size_t count) | 1377 | const char *buf, size_t count) |
@@ -1393,6 +1397,7 @@ static struct attribute *platform_attributes[] = { | |||
1393 | &dev_attr_camera.attr, | 1397 | &dev_attr_camera.attr, |
1394 | &dev_attr_cardr.attr, | 1398 | &dev_attr_cardr.attr, |
1395 | &dev_attr_touchpad.attr, | 1399 | &dev_attr_touchpad.attr, |
1400 | &dev_attr_lid_resume.attr, | ||
1396 | NULL | 1401 | NULL |
1397 | }; | 1402 | }; |
1398 | 1403 | ||
@@ -1411,6 +1416,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, | |||
1411 | devid = ASUS_WMI_DEVID_CARDREADER; | 1416 | devid = ASUS_WMI_DEVID_CARDREADER; |
1412 | else if (attr == &dev_attr_touchpad.attr) | 1417 | else if (attr == &dev_attr_touchpad.attr) |
1413 | 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; | ||
1414 | 1421 | ||
1415 | if (devid != -1) | 1422 | if (devid != -1) |
1416 | ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0); | 1423 | ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0); |