aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2011-02-26 04:20:34 -0500
committerMatthew Garrett <mjg@redhat.com>2011-03-28 06:07:21 -0400
commita75fe0d78ec00d3d5b2c42b1ee76b22e99f213d1 (patch)
treec569e79696521570131cefce464f882e60ae42fc /drivers/platform
parenta7ce3f041e640daf96e227d8f7ffa6b988f33025 (diff)
asus-wmi: handle "unknown status" bit
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/asus-wmi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index d0f0931ea5eb..39ce3c1a7712 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -92,6 +92,7 @@ MODULE_LICENSE("GPL");
92 92
93/* DSTS masks */ 93/* DSTS masks */
94#define ASUS_WMI_DSTS_STATUS_BIT 0x00000001 94#define ASUS_WMI_DSTS_STATUS_BIT 0x00000001
95#define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002
95#define ASUS_WMI_DSTS_PRESENCE_BIT 0x00010000 96#define ASUS_WMI_DSTS_PRESENCE_BIT 0x00010000
96#define ASUS_WMI_DSTS_BRIGHTNESS_MASK 0x000000FF 97#define ASUS_WMI_DSTS_BRIGHTNESS_MASK 0x000000FF
97#define ASUS_WMI_DSTS_MAX_BRIGTH_MASK 0x0000FF00 98#define ASUS_WMI_DSTS_MAX_BRIGTH_MASK 0x0000FF00
@@ -270,6 +271,11 @@ static int asus_wmi_get_devstate_bits(u32 dev_id, u32 mask)
270 if (!(retval & ASUS_WMI_DSTS_PRESENCE_BIT)) 271 if (!(retval & ASUS_WMI_DSTS_PRESENCE_BIT))
271 return -ENODEV; 272 return -ENODEV;
272 273
274 if (mask == ASUS_WMI_DSTS_STATUS_BIT) {
275 if (retval & ASUS_WMI_DSTS_UNKNOWN_BIT)
276 return -ENODEV;
277 }
278
273 return retval & mask; 279 return retval & mask;
274} 280}
275 281