diff options
author | Corentin Chary <corentin.chary@gmail.com> | 2011-07-01 05:34:40 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2011-08-05 14:46:05 -0400 |
commit | 43be8bde1fdfbe3f4dedfd04ca4f9d6dd1e04b46 (patch) | |
tree | 1f2a0d4941d193eba8c4163072f8701e42a4ad95 | |
parent | fddbfed595b307f9dddc7a86ddfbcbcb80141e28 (diff) |
asus-wmi: add gps rfkill support
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 8787dfacf11d..57514deb8e2b 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c | |||
@@ -194,6 +194,7 @@ struct asus_wmi { | |||
194 | struct asus_rfkill bluetooth; | 194 | struct asus_rfkill bluetooth; |
195 | struct asus_rfkill wimax; | 195 | struct asus_rfkill wimax; |
196 | struct asus_rfkill wwan3g; | 196 | struct asus_rfkill wwan3g; |
197 | struct asus_rfkill gps; | ||
197 | 198 | ||
198 | struct hotplug_slot *hotplug_slot; | 199 | struct hotplug_slot *hotplug_slot; |
199 | struct mutex hotplug_lock; | 200 | struct mutex hotplug_lock; |
@@ -835,6 +836,11 @@ static void asus_wmi_rfkill_exit(struct asus_wmi *asus) | |||
835 | rfkill_destroy(asus->wwan3g.rfkill); | 836 | rfkill_destroy(asus->wwan3g.rfkill); |
836 | asus->wwan3g.rfkill = NULL; | 837 | asus->wwan3g.rfkill = NULL; |
837 | } | 838 | } |
839 | if (asus->gps.rfkill) { | ||
840 | rfkill_unregister(asus->gps.rfkill); | ||
841 | rfkill_destroy(asus->gps.rfkill); | ||
842 | asus->gps.rfkill = NULL; | ||
843 | } | ||
838 | } | 844 | } |
839 | 845 | ||
840 | static int asus_wmi_rfkill_init(struct asus_wmi *asus) | 846 | static int asus_wmi_rfkill_init(struct asus_wmi *asus) |
@@ -869,6 +875,12 @@ static int asus_wmi_rfkill_init(struct asus_wmi *asus) | |||
869 | if (result && result != -ENODEV) | 875 | if (result && result != -ENODEV) |
870 | goto exit; | 876 | goto exit; |
871 | 877 | ||
878 | result = asus_new_rfkill(asus, &asus->gps, "asus-gps", | ||
879 | RFKILL_TYPE_GPS, ASUS_WMI_DEVID_GPS); | ||
880 | |||
881 | if (result && result != -ENODEV) | ||
882 | goto exit; | ||
883 | |||
872 | if (!asus->driver->hotplug_wireless) | 884 | if (!asus->driver->hotplug_wireless) |
873 | goto exit; | 885 | goto exit; |
874 | 886 | ||
@@ -1721,6 +1733,10 @@ static int asus_hotk_restore(struct device *device) | |||
1721 | bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_WWAN3G); | 1733 | bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_WWAN3G); |
1722 | rfkill_set_sw_state(asus->wwan3g.rfkill, bl); | 1734 | rfkill_set_sw_state(asus->wwan3g.rfkill, bl); |
1723 | } | 1735 | } |
1736 | if (asus->gps.rfkill) { | ||
1737 | bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_GPS); | ||
1738 | rfkill_set_sw_state(asus->gps.rfkill, bl); | ||
1739 | } | ||
1724 | 1740 | ||
1725 | return 0; | 1741 | return 0; |
1726 | } | 1742 | } |