Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227880
b: refs/heads/master
c: 466449c
h: refs/heads/master
v: v3
  • Loading branch information
Lee, Chun-Yi authored and Matthew Garrett committed Jan 7, 2011
1 parent 3c71f0c commit 3692cc9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6c3df88f19375217f0dbfc6160e8c2a635f56c53
refs/heads/master: 466449cfe797b8a5d82d25d0e0e08426d8dfba19
31 changes: 31 additions & 0 deletions trunk/drivers/platform/x86/acer-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,31 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device)
return status;
}

static acpi_status get_device_status(u32 *value, u32 cap)
{
if (wmi_has_guid(WMID_GUID3)) {
u16 device;

switch (cap) {
case ACER_CAP_WIRELESS:
device = ACER_WMID3_GDS_WIRELESS;
break;
case ACER_CAP_BLUETOOTH:
device = ACER_WMID3_GDS_BLUETOOTH;
break;
case ACER_CAP_THREEG:
device = ACER_WMID3_GDS_THREEG;
break;
default:
return AE_ERROR;
}
return wmid3_get_device_status(value, device);

} else {
return get_u32(value, cap);
}
}

/*
* Rfkill devices
*/
Expand Down Expand Up @@ -1135,13 +1160,19 @@ static struct rfkill *acer_rfkill_register(struct device *dev,
{
int err;
struct rfkill *rfkill_dev;
u32 state;
acpi_status status;

rfkill_dev = rfkill_alloc(name, dev, type,
&acer_rfkill_ops,
(void *)(unsigned long)cap);
if (!rfkill_dev)
return ERR_PTR(-ENOMEM);

status = get_device_status(&state, cap);
if (ACPI_SUCCESS(status))
rfkill_init_sw_state(rfkill_dev, !state);

err = rfkill_register(rfkill_dev);
if (err) {
rfkill_destroy(rfkill_dev);
Expand Down

0 comments on commit 3692cc9

Please sign in to comment.