Skip to content

Commit

Permalink
acer-wmi: support Lenovo ideapad S205 wifi switch
Browse files Browse the repository at this point in the history
The AMW0 function in acer-wmi works on Lenovo ideapad S205 for control
the wifi hardware state. We also found there have a 0x78 EC register
exposes the state of wifi hardware switch on the machine.

So, add this patch to support Lenovo ideapad S205 wifi hardware switch
in acer-wmi driver.

Reference: bko#37892
	https://bugzilla.kernel.org/show_bug.cgi?id=37892

Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Tested-by: Florian Heyer <heyho@flanto.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
  • Loading branch information
Lee, Chun-Yi authored and Matthew Garrett committed Aug 5, 2011
1 parent 2c3422d commit 15b956a
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions drivers/platform/x86/acer-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ static struct quirk_entry quirk_fujitsu_amilo_li_1718 = {
.wireless = 2,
};

static struct quirk_entry quirk_lenovo_ideapad_s205 = {
.wireless = 3,
};

/* The Aspire One has a dummy ACPI-WMI interface - disable it */
static struct dmi_system_id __devinitdata acer_blacklist[] = {
{
Expand Down Expand Up @@ -451,6 +455,15 @@ static struct dmi_system_id acer_quirks[] = {
},
.driver_data = &quirk_medion_md_98300,
},
{
.callback = dmi_matched,
.ident = "Lenovo Ideapad S205",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "10382LG"),
},
.driver_data = &quirk_lenovo_ideapad_s205,
},
{}
};

Expand Down Expand Up @@ -543,6 +556,12 @@ struct wmi_interface *iface)
return AE_ERROR;
*value = result & 0x1;
return AE_OK;
case 3:
err = ec_read(0x78, &result);
if (err)
return AE_ERROR;
*value = result & 0x1;
return AE_OK;
default:
err = ec_read(0xA, &result);
if (err)
Expand Down Expand Up @@ -1267,8 +1286,13 @@ static void acer_rfkill_update(struct work_struct *ignored)
acpi_status status;

status = get_u32(&state, ACER_CAP_WIRELESS);
if (ACPI_SUCCESS(status))
rfkill_set_sw_state(wireless_rfkill, !state);
if (ACPI_SUCCESS(status)) {
if (quirks->wireless == 3) {
rfkill_set_hw_state(wireless_rfkill, !state);
} else {
rfkill_set_sw_state(wireless_rfkill, !state);
}
}

if (has_cap(ACER_CAP_BLUETOOTH)) {
status = get_u32(&state, ACER_CAP_BLUETOOTH);
Expand Down

0 comments on commit 15b956a

Please sign in to comment.