Commit 0e875f49 authored by Corentin Chary's avatar Corentin Chary

asus-laptop: add wireless and bluetooth status parameter

These to parameter allow to set the status of wlan and bluetooth
device when the module load. On some models, the device will
always be down on boot, so the default behavior is to always
enable these devices.
Signed-off-by: default avatarCorentin Chary <corentincj@iksaif.net>
parent baac35c4
...@@ -113,6 +113,19 @@ static uint wapf = 1; ...@@ -113,6 +113,19 @@ static uint wapf = 1;
module_param(wapf, uint, 0644); module_param(wapf, uint, 0644);
MODULE_PARM_DESC(wapf, "WAPF value"); MODULE_PARM_DESC(wapf, "WAPF value");
static uint wireless_status = 1;
static uint bluetooth_status = 1;
module_param(wireless_status, uint, 0644);
MODULE_PARM_DESC(wireless_status, "Set the wireless status on boot "
"(0 = disabled, 1 = enabled, -1 = don't do anything). "
"default is 1");
module_param(bluetooth_status, uint, 0644);
MODULE_PARM_DESC(bluetooth_status, "Set the wireless status on boot "
"(0 = disabled, 1 = enabled, -1 = don't do anything). "
"default is 1");
#define ASUS_HANDLE(object, paths...) \ #define ASUS_HANDLE(object, paths...) \
static acpi_handle object##_handle = NULL; \ static acpi_handle object##_handle = NULL; \
static char *object##_paths[] = { paths } static char *object##_paths[] = { paths }
...@@ -1272,8 +1285,10 @@ static int asus_hotk_add(struct acpi_device *device) ...@@ -1272,8 +1285,10 @@ static int asus_hotk_add(struct acpi_device *device)
asus_hotk_found = 1; asus_hotk_found = 1;
/* WLED and BLED are on by default */ /* WLED and BLED are on by default */
write_status(bt_switch_handle, 1, BT_ON); if (bluetooth_status != -1)
write_status(wl_switch_handle, 1, WL_ON); write_status(bt_switch_handle, !!bluetooth_status, BT_ON);
if (wireless_status != -1)
write_status(wl_switch_handle, !!wireless_status, WL_ON);
/* If the h/w switch is off, we need to check the real status */ /* If the h/w switch is off, we need to check the real status */
write_status(NULL, read_status(BT_ON), BT_ON); write_status(NULL, read_status(BT_ON), BT_ON);
......
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