Commit a912d329 authored by Corentin Chary's avatar Corentin Chary Committed by Matthew Garrett

asus-wmi: add uwb rfkill support

Signed-off-by: default avatarCorentin Chary <corentin.chary@gmail.com>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent 43be8bde
...@@ -195,6 +195,7 @@ struct asus_wmi { ...@@ -195,6 +195,7 @@ struct asus_wmi {
struct asus_rfkill wimax; struct asus_rfkill wimax;
struct asus_rfkill wwan3g; struct asus_rfkill wwan3g;
struct asus_rfkill gps; struct asus_rfkill gps;
struct asus_rfkill uwb;
struct hotplug_slot *hotplug_slot; struct hotplug_slot *hotplug_slot;
struct mutex hotplug_lock; struct mutex hotplug_lock;
...@@ -841,6 +842,11 @@ static void asus_wmi_rfkill_exit(struct asus_wmi *asus) ...@@ -841,6 +842,11 @@ static void asus_wmi_rfkill_exit(struct asus_wmi *asus)
rfkill_destroy(asus->gps.rfkill); rfkill_destroy(asus->gps.rfkill);
asus->gps.rfkill = NULL; asus->gps.rfkill = NULL;
} }
if (asus->uwb.rfkill) {
rfkill_unregister(asus->uwb.rfkill);
rfkill_destroy(asus->uwb.rfkill);
asus->uwb.rfkill = NULL;
}
} }
static int asus_wmi_rfkill_init(struct asus_wmi *asus) 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,6 +887,12 @@ static int asus_wmi_rfkill_init(struct asus_wmi *asus)
if (result && result != -ENODEV) if (result && result != -ENODEV)
goto exit; goto exit;
result = asus_new_rfkill(asus, &asus->uwb, "asus-uwb",
RFKILL_TYPE_UWB, ASUS_WMI_DEVID_UWB);
if (result && result != -ENODEV)
goto exit;
if (!asus->driver->hotplug_wireless) if (!asus->driver->hotplug_wireless)
goto exit; goto exit;
...@@ -1737,6 +1749,10 @@ static int asus_hotk_restore(struct device *device) ...@@ -1737,6 +1749,10 @@ static int asus_hotk_restore(struct device *device)
bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_GPS); bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_GPS);
rfkill_set_sw_state(asus->gps.rfkill, bl); rfkill_set_sw_state(asus->gps.rfkill, bl);
} }
if (asus->uwb.rfkill) {
bl = !asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_UWB);
rfkill_set_sw_state(asus->uwb.rfkill, bl);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment