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
Unified · Split
| @@ -305,6 +305,10 @@ static struct quirk_entry quirk_fujitsu_amilo_li_1718 = { · 304 unmodified lines | ||
| 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 | { |
| @@ -451,6 +455,15 @@ static struct dmi_system_id acer_quirks[] = { · 140 unmodified lines | ||
| 451 | 455 | }, |
| 452 | 456 | .driver_data = &quirk_medion_md_98300, |
| 453 | 457 | }, |
| 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 | + }, | |
| 454 | 467 | {} |
| 455 | 468 | }; |
| 456 | 469 | |
| @@ -543,6 +556,12 @@ struct wmi_interface *iface) · 86 unmodified lines | ||
| 543 | 556 | return AE_ERROR; |
| 544 | 557 | *value = result & 0x1; |
| 545 | 558 | 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; | |
| 546 | 565 | default: |
| 547 | 566 | err = ec_read(0xA, &result); |
| 548 | 567 | if (err) |
| @@ -1267,8 +1286,13 @@ static void acer_rfkill_update(struct work_struct *ignored) · 718 unmodified lines | ||
| 1267 | 1286 | acpi_status status; |
| 1268 | 1287 | |
| 1269 | 1288 | 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 | + } | |
| 1272 | 1296 | |
| 1273 | 1297 | if (has_cap(ACER_CAP_BLUETOOTH)) { |
| 1274 | 1298 | status = get_u32(&state, ACER_CAP_BLUETOOTH); |