Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296980
b: refs/heads/master
c: 3c8671f
h: refs/heads/master
v: v3
  • Loading branch information
Corentin Chary authored and Matthew Garrett committed Mar 20, 2012
1 parent b6e0bf4 commit a2de6dd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 774b06780be20d07c5459becd6495c04523a93a2
refs/heads/master: 3c8671ffd334cfb692089ec00141b56d5a796ae7
24 changes: 23 additions & 1 deletion trunk/drivers/platform/x86/asus-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ struct asus_laptop {
struct asus_rfkill wlan;
struct asus_rfkill bluetooth;
struct asus_rfkill wwan;
struct asus_rfkill wimax;
struct asus_rfkill gps;

acpi_handle handle; /* the handle of the hotk device */
Expand Down Expand Up @@ -1291,6 +1292,10 @@ static int asus_rfkill_set(void *data, bool blocked)
return asus_wlan_set(asus, !blocked);
else if (rfk->control_id == BT_RSTS)
return asus_bluetooth_set(asus, !blocked);
else if (rfk->control_id == WM_RSTS)
return asus_wimax_set(asus, !blocked);
else if (rfk->control_id == WW_RSTS)
return asus_wwan_set(asus, !blocked);

return -EINVAL;
}
Expand Down Expand Up @@ -1343,6 +1348,9 @@ static int asus_rfkill_init(struct asus_laptop *asus)
{
int result = 0;

if (asus->is_pega_lucid)
return -ENODEV;

if (!acpi_check_handle(asus->handle, METHOD_GPS_ON, NULL) &&
!acpi_check_handle(asus->handle, METHOD_GPS_OFF, NULL) &&
!acpi_check_handle(asus->handle, METHOD_GPS_STATUS, NULL))
Expand All @@ -1368,6 +1376,20 @@ static int asus_rfkill_init(struct asus_laptop *asus)
if (result)
goto exit;

if (!acpi_check_handle(asus->handle, METHOD_WWAN, NULL))
result = asus_rfkill_setup(asus, &asus->wwan, "asus-wwan",
WW_RSTS, RFKILL_TYPE_WWAN,
&asus_rfkill_ops);
if (result)
goto exit;

if (!acpi_check_handle(asus->handle, METHOD_WIMAX, NULL))
result = asus_rfkill_setup(asus, &asus->wimax, "asus-wimax",
WM_RSTS, RFKILL_TYPE_WIMAX,
&asus_rfkill_ops);
if (result)
goto exit;

exit:
if (result)
asus_rfkill_exit(asus);
Expand Down Expand Up @@ -1859,7 +1881,7 @@ static int __devinit asus_acpi_add(struct acpi_device *device)
goto fail_led;

result = asus_rfkill_init(asus);
if (result)
if (result && result != -ENODEV)
goto fail_rfkill;

result = pega_accel_init(asus);
Expand Down

0 comments on commit a2de6dd

Please sign in to comment.