aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2011-02-06 07:28:35 -0500
committerMatthew Garrett <mjg@redhat.com>2011-03-28 06:05:17 -0400
commitaafa719dcd0cb0c05bb0690c816b13263c8b36e6 (patch)
tree491bdb8888c9259ec3cf05c4d2ecfdc1020a1f29
parent33e0e6fed04dc6067562c65e3e6d551dc0eb11fc (diff)
eeepc-wmi: use the presence bit correctly
I checked some more DSDT, and it seems that I wasn't totally right about the meaning of DSTS return value. Bit 0 is clearly the status of the device, and I discovered that bit 16 is set when the device is present. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
-rw-r--r--drivers/platform/x86/eeepc-wmi.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index aa9e1d1719da..391c32bd703e 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -75,6 +75,9 @@ MODULE_ALIAS("wmi:"EEEPC_WMI_MGMT_GUID);
75#define EEEPC_WMI_DEVID_BACKLIGHT 0x00050012 75#define EEEPC_WMI_DEVID_BACKLIGHT 0x00050012
76#define EEEPC_WMI_DEVID_TPDLED 0x00100011 76#define EEEPC_WMI_DEVID_TPDLED 0x00100011
77 77
78#define EEEPC_WMI_DSTS_STATUS_BIT 0x00000001
79#define EEEPC_WMI_DSTS_PRESENCE_BIT 0x00010000
80
78static bool hotplug_wireless; 81static bool hotplug_wireless;
79 82
80module_param(hotplug_wireless, bool, 0444); 83module_param(hotplug_wireless, bool, 0444);
@@ -265,16 +268,10 @@ static int eeepc_wmi_get_devstate_simple(u32 dev_id)
265 if (ACPI_FAILURE(status)) 268 if (ACPI_FAILURE(status))
266 return -EINVAL; 269 return -EINVAL;
267 270
268 /* If the device is present, DSTS will always set some bits 271 if (!(retval & EEEPC_WMI_DSTS_PRESENCE_BIT))
269 * 0x00070000 - 1110000000000000000 - device supported
270 * 0x00060000 - 1100000000000000000 - not supported
271 * 0x00020000 - 0100000000000000000 - device supported
272 * 0x00010000 - 0010000000000000000 - not supported / special mode ?
273 */
274 if (!retval || retval == 0x00060000)
275 return -ENODEV; 272 return -ENODEV;
276 273
277 return retval & 0x1; 274 return retval & EEEPC_WMI_DSTS_STATUS_BIT;
278} 275}
279 276
280/* 277/*