Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lee, Chun-Yi and committed by
Matthew Garrett
15b956a0 2c3422d9

+26 -2
+26 -2
drivers/platform/x86/acer-wmi.c
··· 305 305 .wireless = 2, 306 306 }; 307 307 308 + static struct quirk_entry quirk_lenovo_ideapad_s205 = { 309 + .wireless = 3, 310 + }; 311 + 308 312 /* The Aspire One has a dummy ACPI-WMI interface - disable it */ 309 313 static struct dmi_system_id __devinitdata acer_blacklist[] = { 310 314 { ··· 455 451 }, 456 452 .driver_data = &quirk_medion_md_98300, 457 453 }, 454 + { 455 + .callback = dmi_matched, 456 + .ident = "Lenovo Ideapad S205", 457 + .matches = { 458 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 459 + DMI_MATCH(DMI_PRODUCT_NAME, "10382LG"), 460 + }, 461 + .driver_data = &quirk_lenovo_ideapad_s205, 462 + }, 458 463 {} 459 464 }; 460 465 ··· 552 539 return AE_OK; 553 540 case 2: 554 541 err = ec_read(0x71, &result); 542 + if (err) 543 + return AE_ERROR; 544 + *value = result & 0x1; 545 + return AE_OK; 546 + case 3: 547 + err = ec_read(0x78, &result); 555 548 if (err) 556 549 return AE_ERROR; 557 550 *value = result & 0x1; ··· 1286 1267 acpi_status status; 1287 1268 1288 1269 status = get_u32(&state, ACER_CAP_WIRELESS); 1289 - if (ACPI_SUCCESS(status)) 1290 - rfkill_set_sw_state(wireless_rfkill, !state); 1270 + if (ACPI_SUCCESS(status)) { 1271 + if (quirks->wireless == 3) { 1272 + rfkill_set_hw_state(wireless_rfkill, !state); 1273 + } else { 1274 + rfkill_set_sw_state(wireless_rfkill, !state); 1275 + } 1276 + } 1291 1277 1292 1278 if (has_cap(ACER_CAP_BLUETOOTH)) { 1293 1279 status = get_u32(&state, ACER_CAP_BLUETOOTH);