diff options
author | Corentin Chary <corentin.chary@gmail.com> | 2011-07-01 05:34:41 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2011-08-05 14:46:07 -0400 |
commit | a912d329102aa13c572989c6adc103685c9d24ae (patch) | |
tree | 63cbcec09342e8d5913df0908aa2456bacb5a5da /drivers | |
parent | 43be8bde1fdfbe3f4dedfd04ca4f9d6dd1e04b46 (diff) |
asus-wmi: add uwb rfkill support
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers')
-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 57514deb8e2b..95cba9ebf6c0 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c | |||
@@ -195,6 +195,7 @@ struct asus_wmi { | |||
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 | struct asus_rfkill gps; |
198 | struct asus_rfkill uwb; | ||
198 | 199 | ||
199 | struct hotplug_slot *hotplug_slot; | 200 | struct hotplug_slot *hotplug_slot; |
200 | struct mutex hotplug_lock; | 201 | struct mutex hotplug_lock; |
@@ -841,6 +842,11 @@ static void asus_wmi_rfkill_exit(struct asus_wmi *asus) | |||
841 | rfkill_destroy(asus->gps.rfkill); | 842 | rfkill_destroy(asus->gps.rfkill); |
842 | asus->gps.rfkill = NULL; | 843 | asus->gps.rfkill = NULL; |
843 | } | 844 | } |
845 | if (asus->uwb.rfkill) { | ||
846 | rfkill_unregister(asus->uwb.rfkill); | ||
847 | rfkill_destroy(asus->uwb.rfkill); | ||
848 | asus->uwb.rfkill = NULL; | ||
849 | } | ||
844 | } | 850 | } |
845 | 851 | ||
846 | static int asus_wmi_rfkill_init(struct asus_wmi *asus) | 852 | static int asus_wmi_rfkill_init(struct asus_wmi *asus) |
@@ -881,6 +887,12 @@ static int asus_wmi_rfkill_init(struct asus_wmi *asus) | |||
881 | if (result && result != -ENODEV) | 887 | if (result && result != -ENODEV) |
882 | goto exit; | 888 | goto exit; |
883 | 889 | ||
890 | result = asus_new_rfkill(asus, &asus->uwb, "asus-uwb", | ||
891 | RFKILL_TYPE_UWB, ASUS_WMI_DEVID_UWB); | ||
892 | |||
893 | if (result && result != -ENODEV) | ||
894 | goto exit; | ||
895 | |||
884 | if (!asus->driver->hotplug_wireless) | 896 | if (!asus->driver->hotplug_wireless) |
885 | goto exit; | 897 | goto exit; |
886 | 898 | ||
@@ -1737,6 +1749,10 @@ static int asus_hotk_restore(struct device *device) | |||
1737 | bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_GPS); | 1749 | bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_GPS); |
1738 | rfkill_set_sw_state(asus->gps.rfkill, bl); | 1750 | rfkill_set_sw_state(asus->gps.rfkill, bl); |
1739 | } | 1751 | } |
1752 | if (asus->uwb.rfkill) { | ||
1753 | bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_UWB); | ||
1754 | rfkill_set_sw_state(asus->uwb.rfkill, bl); | ||
1755 | } | ||
1740 | 1756 | ||
1741 | return 0; | 1757 | return 0; |
1742 | } | 1758 | } |