Skip to content

Commit 15b956a

Browse files
Lee, Chun-YiMatthew Garrett
authored andcommitted
acer-wmi: support Lenovo ideapad S205 wifi switch
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>
1 parent 2c3422d commit 15b956a

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

drivers/platform/x86/acer-wmi.c

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,10 @@ static struct quirk_entry quirk_fujitsu_amilo_li_1718 = {
305305
.wireless = 2,
306306
};
307307

308+
static struct quirk_entry quirk_lenovo_ideapad_s205 = {
309+
.wireless = 3,
310+
};
311+
308312
/* The Aspire One has a dummy ACPI-WMI interface - disable it */
309313
static struct dmi_system_id __devinitdata acer_blacklist[] = {
310314
{
@@ -451,6 +455,15 @@ static struct dmi_system_id acer_quirks[] = {
451455
},
452456
.driver_data = &quirk_medion_md_98300,
453457
},
458+
{
459+
.callback = dmi_matched,
460+
.ident = "Lenovo Ideapad S205",
461+
.matches = {
462+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
463+
DMI_MATCH(DMI_PRODUCT_NAME, "10382LG"),
464+
},
465+
.driver_data = &quirk_lenovo_ideapad_s205,
466+
},
454467
{}
455468
};
456469

@@ -543,6 +556,12 @@ struct wmi_interface *iface)
543556
return AE_ERROR;
544557
*value = result & 0x1;
545558
return AE_OK;
559+
case 3:
560+
err = ec_read(0x78, &result);
561+
if (err)
562+
return AE_ERROR;
563+
*value = result & 0x1;
564+
return AE_OK;
546565
default:
547566
err = ec_read(0xA, &result);
548567
if (err)
@@ -1267,8 +1286,13 @@ static void acer_rfkill_update(struct work_struct *ignored)
12671286
acpi_status status;
12681287

12691288
status = get_u32(&state, ACER_CAP_WIRELESS);
1270-
if (ACPI_SUCCESS(status))
1271-
rfkill_set_sw_state(wireless_rfkill, !state);
1289+
if (ACPI_SUCCESS(status)) {
1290+
if (quirks->wireless == 3) {
1291+
rfkill_set_hw_state(wireless_rfkill, !state);
1292+
} else {
1293+
rfkill_set_sw_state(wireless_rfkill, !state);
1294+
}
1295+
}
12721296

12731297
if (has_cap(ACER_CAP_BLUETOOTH)) {
12741298
status = get_u32(&state, ACER_CAP_BLUETOOTH);

0 commit comments

Comments
 (0)