aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorCorentin Chary <corentin.chary@gmail.com>2011-12-15 02:27:35 -0500
committerMatthew Garrett <mjg@redhat.com>2012-03-20 12:02:17 -0400
commit3c8671ffd334cfb692089ec00141b56d5a796ae7 (patch)
tree5d4238adced28ae322089b848617e34470d74c29 /drivers/platform
parent774b06780be20d07c5459becd6495c04523a93a2 (diff)
asus-laptop: add rfkill interfaces for wlan and wwan
But don't try to do than on pegatron tablets to avoid any conflict. Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/asus-laptop.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index e416867c0725..547b9eba03ae 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -282,6 +282,7 @@ struct asus_laptop {
282 struct asus_rfkill wlan; 282 struct asus_rfkill wlan;
283 struct asus_rfkill bluetooth; 283 struct asus_rfkill bluetooth;
284 struct asus_rfkill wwan; 284 struct asus_rfkill wwan;
285 struct asus_rfkill wimax;
285 struct asus_rfkill gps; 286 struct asus_rfkill gps;
286 287
287 acpi_handle handle; /* the handle of the hotk device */ 288 acpi_handle handle; /* the handle of the hotk device */
@@ -1291,6 +1292,10 @@ static int asus_rfkill_set(void *data, bool blocked)
1291 return asus_wlan_set(asus, !blocked); 1292 return asus_wlan_set(asus, !blocked);
1292 else if (rfk->control_id == BT_RSTS) 1293 else if (rfk->control_id == BT_RSTS)
1293 return asus_bluetooth_set(asus, !blocked); 1294 return asus_bluetooth_set(asus, !blocked);
1295 else if (rfk->control_id == WM_RSTS)
1296 return asus_wimax_set(asus, !blocked);
1297 else if (rfk->control_id == WW_RSTS)
1298 return asus_wwan_set(asus, !blocked);
1294 1299
1295 return -EINVAL; 1300 return -EINVAL;
1296} 1301}
@@ -1343,6 +1348,9 @@ static int asus_rfkill_init(struct asus_laptop *asus)
1343{ 1348{
1344 int result = 0; 1349 int result = 0;
1345 1350
1351 if (asus->is_pega_lucid)
1352 return -ENODEV;
1353
1346 if (!acpi_check_handle(asus->handle, METHOD_GPS_ON, NULL) && 1354 if (!acpi_check_handle(asus->handle, METHOD_GPS_ON, NULL) &&
1347 !acpi_check_handle(asus->handle, METHOD_GPS_OFF, NULL) && 1355 !acpi_check_handle(asus->handle, METHOD_GPS_OFF, NULL) &&
1348 !acpi_check_handle(asus->handle, METHOD_GPS_STATUS, NULL)) 1356 !acpi_check_handle(asus->handle, METHOD_GPS_STATUS, NULL))
@@ -1368,6 +1376,20 @@ static int asus_rfkill_init(struct asus_laptop *asus)
1368 if (result) 1376 if (result)
1369 goto exit; 1377 goto exit;
1370 1378
1379 if (!acpi_check_handle(asus->handle, METHOD_WWAN, NULL))
1380 result = asus_rfkill_setup(asus, &asus->wwan, "asus-wwan",
1381 WW_RSTS, RFKILL_TYPE_WWAN,
1382 &asus_rfkill_ops);
1383 if (result)
1384 goto exit;
1385
1386 if (!acpi_check_handle(asus->handle, METHOD_WIMAX, NULL))
1387 result = asus_rfkill_setup(asus, &asus->wimax, "asus-wimax",
1388 WM_RSTS, RFKILL_TYPE_WIMAX,
1389 &asus_rfkill_ops);
1390 if (result)
1391 goto exit;
1392
1371exit: 1393exit:
1372 if (result) 1394 if (result)
1373 asus_rfkill_exit(asus); 1395 asus_rfkill_exit(asus);
@@ -1859,7 +1881,7 @@ static int __devinit asus_acpi_add(struct acpi_device *device)
1859 goto fail_led; 1881 goto fail_led;
1860 1882
1861 result = asus_rfkill_init(asus); 1883 result = asus_rfkill_init(asus);
1862 if (result) 1884 if (result && result != -ENODEV)
1863 goto fail_rfkill; 1885 goto fail_rfkill;
1864 1886
1865 result = pega_accel_init(asus); 1887 result = pega_accel_init(asus);