aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorLee, Chun-Yi <joeyli.kernel@gmail.com>2011-07-30 05:00:45 -0400
committerMatthew Garrett <mjg@redhat.com>2011-08-05 15:21:52 -0400
commit15b956a0b5651bbb1217ec374fdd67291dabb2af (patch)
treea0ebb0f7cc05db86592af6ba0e396b813a277f16 /drivers/platform
parent2c3422d9c475c62adae82743d8507651342925ae (diff)
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>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/acer-wmi.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index fa7153020ca1..af2bb20cb2fb 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -305,6 +305,10 @@ static struct quirk_entry quirk_fujitsu_amilo_li_1718 = {
305 .wireless = 2, 305 .wireless = 2,
306}; 306};
307 307
308static struct quirk_entry quirk_lenovo_ideapad_s205 = {
309 .wireless = 3,
310};
311
308/* The Aspire One has a dummy ACPI-WMI interface - disable it */ 312/* The Aspire One has a dummy ACPI-WMI interface - disable it */
309static struct dmi_system_id __devinitdata acer_blacklist[] = { 313static struct dmi_system_id __devinitdata acer_blacklist[] = {
310 { 314 {
@@ -451,6 +455,15 @@ static struct dmi_system_id acer_quirks[] = {
451 }, 455 },
452 .driver_data = &quirk_medion_md_98300, 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)
543 return AE_ERROR; 556 return AE_ERROR;
544 *value = result & 0x1; 557 *value = result & 0x1;
545 return AE_OK; 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 default: 565 default:
547 err = ec_read(0xA, &result); 566 err = ec_read(0xA, &result);
548 if (err) 567 if (err)
@@ -1267,8 +1286,13 @@ static void acer_rfkill_update(struct work_struct *ignored)
1267 acpi_status status; 1286 acpi_status status;
1268 1287
1269 status = get_u32(&state, ACER_CAP_WIRELESS); 1288 status = get_u32(&state, ACER_CAP_WIRELESS);
1270 if (ACPI_SUCCESS(status)) 1289 if (ACPI_SUCCESS(status)) {
1271 rfkill_set_sw_state(wireless_rfkill, !state); 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 if (has_cap(ACER_CAP_BLUETOOTH)) { 1297 if (has_cap(ACER_CAP_BLUETOOTH)) {
1274 status = get_u32(&state, ACER_CAP_BLUETOOTH); 1298 status = get_u32(&state, ACER_CAP_BLUETOOTH);