aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/laptops/acer-wmi.txt28
-rw-r--r--drivers/misc/acer-wmi.c101
2 files changed, 25 insertions, 104 deletions
diff --git a/Documentation/laptops/acer-wmi.txt b/Documentation/laptops/acer-wmi.txt
index 69b5dd4e5a59..2b3a6b5260bf 100644
--- a/Documentation/laptops/acer-wmi.txt
+++ b/Documentation/laptops/acer-wmi.txt
@@ -1,7 +1,7 @@
1Acer Laptop WMI Extras Driver 1Acer Laptop WMI Extras Driver
2http://code.google.com/p/aceracpi 2http://code.google.com/p/aceracpi
3Version 0.1 3Version 0.2
49th February 2008 418th August 2008
5 5
6Copyright 2007-2008 Carlos Corbacho <carlos@strangeworlds.co.uk> 6Copyright 2007-2008 Carlos Corbacho <carlos@strangeworlds.co.uk>
7 7
@@ -87,17 +87,7 @@ acer-wmi come with built-in wireless. However, should you feel so inclined to
87ever wish to remove the card, or swap it out at some point, please get in touch 87ever wish to remove the card, or swap it out at some point, please get in touch
88with me, as we may well be able to gain some data on wireless card detection. 88with me, as we may well be able to gain some data on wireless card detection.
89 89
90To read the status of the wireless radio (0=off, 1=on): 90The wireless radio is exposed through rfkill.
91cat /sys/devices/platform/acer-wmi/wireless
92
93To enable the wireless radio:
94echo 1 > /sys/devices/platform/acer-wmi/wireless
95
96To disable the wireless radio:
97echo 0 > /sys/devices/platform/acer-wmi/wireless
98
99To set the state of the wireless radio when loading acer-wmi, pass:
100wireless=X (where X is 0 or 1)
101 91
102Bluetooth 92Bluetooth
103********* 93*********
@@ -117,17 +107,7 @@ For the adventurously minded - if you want to buy an internal bluetooth
117module off the internet that is compatible with your laptop and fit it, then 107module off the internet that is compatible with your laptop and fit it, then
118it will work just fine with acer-wmi. 108it will work just fine with acer-wmi.
119 109
120To read the status of the bluetooth module (0=off, 1=on): 110Bluetooth is exposed through rfkill.
121cat /sys/devices/platform/acer-wmi/wireless
122
123To enable the bluetooth module:
124echo 1 > /sys/devices/platform/acer-wmi/bluetooth
125
126To disable the bluetooth module:
127echo 0 > /sys/devices/platform/acer-wmi/bluetooth
128
129To set the state of the bluetooth module when loading acer-wmi, pass:
130bluetooth=X (where X is 0 or 1)
131 111
1323G 1123G
133** 113**
diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c
index e3e11e88747e..8708d3193788 100644
--- a/drivers/misc/acer-wmi.c
+++ b/drivers/misc/acer-wmi.c
@@ -125,21 +125,15 @@ enum interface_flags {
125 125
126static int max_brightness = 0xF; 126static int max_brightness = 0xF;
127 127
128static int wireless = -1;
129static int bluetooth = -1;
130static int mailled = -1; 128static int mailled = -1;
131static int brightness = -1; 129static int brightness = -1;
132static int threeg = -1; 130static int threeg = -1;
133static int force_series; 131static int force_series;
134 132
135module_param(mailled, int, 0444); 133module_param(mailled, int, 0444);
136module_param(wireless, int, 0444);
137module_param(bluetooth, int, 0444);
138module_param(brightness, int, 0444); 134module_param(brightness, int, 0444);
139module_param(threeg, int, 0444); 135module_param(threeg, int, 0444);
140module_param(force_series, int, 0444); 136module_param(force_series, int, 0444);
141MODULE_PARM_DESC(wireless, "Set initial state of Wireless hardware");
142MODULE_PARM_DESC(bluetooth, "Set initial state of Bluetooth hardware");
143MODULE_PARM_DESC(mailled, "Set initial state of Mail LED"); 137MODULE_PARM_DESC(mailled, "Set initial state of Mail LED");
144MODULE_PARM_DESC(brightness, "Set initial LCD backlight brightness"); 138MODULE_PARM_DESC(brightness, "Set initial LCD backlight brightness");
145MODULE_PARM_DESC(threeg, "Set initial state of 3G hardware"); 139MODULE_PARM_DESC(threeg, "Set initial state of 3G hardware");
@@ -147,8 +141,6 @@ MODULE_PARM_DESC(force_series, "Force a different laptop series");
147 141
148struct acer_data { 142struct acer_data {
149 int mailled; 143 int mailled;
150 int wireless;
151 int bluetooth;
152 int threeg; 144 int threeg;
153 int brightness; 145 int brightness;
154}; 146};
@@ -851,8 +843,6 @@ static void __init acer_commandline_init(void)
851 * capability isn't available on the given interface 843 * capability isn't available on the given interface
852 */ 844 */
853 set_u32(mailled, ACER_CAP_MAILLED); 845 set_u32(mailled, ACER_CAP_MAILLED);
854 set_u32(wireless, ACER_CAP_WIRELESS);
855 set_u32(bluetooth, ACER_CAP_BLUETOOTH);
856 set_u32(threeg, ACER_CAP_THREEG); 846 set_u32(threeg, ACER_CAP_THREEG);
857 set_u32(brightness, ACER_CAP_BRIGHTNESS); 847 set_u32(brightness, ACER_CAP_BRIGHTNESS);
858} 848}
@@ -1057,40 +1047,30 @@ static void acer_rfkill_exit(void)
1057} 1047}
1058 1048
1059/* 1049/*
1060 * Read/ write bool sysfs macro 1050 * sysfs interface
1061 */ 1051 */
1062#define show_set_bool(value, cap) \ 1052static ssize_t show_bool_threeg(struct device *dev,
1063static ssize_t \ 1053 struct device_attribute *attr, char *buf)
1064show_bool_##value(struct device *dev, struct device_attribute *attr, \ 1054{
1065 char *buf) \
1066{ \
1067 u32 result; \ 1055 u32 result; \
1068 acpi_status status = get_u32(&result, cap); \ 1056 acpi_status status = get_u32(&result, ACER_CAP_THREEG);
1069 if (ACPI_SUCCESS(status)) \ 1057 if (ACPI_SUCCESS(status))
1070 return sprintf(buf, "%u\n", result); \ 1058 return sprintf(buf, "%u\n", result);
1071 return sprintf(buf, "Read error\n"); \ 1059 return sprintf(buf, "Read error\n");
1072} \ 1060}
1073\ 1061
1074static ssize_t \ 1062static ssize_t set_bool_threeg(struct device *dev,
1075set_bool_##value(struct device *dev, struct device_attribute *attr, \ 1063 struct device_attribute *attr, const char *buf, size_t count)
1076 const char *buf, size_t count) \ 1064{
1077{ \ 1065 u32 tmp = simple_strtoul(buf, NULL, 10);
1078 u32 tmp = simple_strtoul(buf, NULL, 10); \ 1066 acpi_status status = set_u32(tmp, ACER_CAP_THREEG);
1079 acpi_status status = set_u32(tmp, cap); \ 1067 if (ACPI_FAILURE(status))
1080 if (ACPI_FAILURE(status)) \ 1068 return -EINVAL;
1081 return -EINVAL; \ 1069 return count;
1082 return count; \ 1070}
1083} \ 1071static DEVICE_ATTR(threeg, S_IWUGO | S_IRUGO | S_IWUSR, show_bool_threeg,
1084static DEVICE_ATTR(value, S_IWUGO | S_IRUGO | S_IWUSR, \ 1072 set_bool_threeg);
1085 show_bool_##value, set_bool_##value);
1086
1087show_set_bool(wireless, ACER_CAP_WIRELESS);
1088show_set_bool(bluetooth, ACER_CAP_BLUETOOTH);
1089show_set_bool(threeg, ACER_CAP_THREEG);
1090 1073
1091/*
1092 * Read interface sysfs macro
1093 */
1094static ssize_t show_interface(struct device *dev, struct device_attribute *attr, 1074static ssize_t show_interface(struct device *dev, struct device_attribute *attr,
1095 char *buf) 1075 char *buf)
1096{ 1076{
@@ -1180,16 +1160,6 @@ pm_message_t state)
1180 if (!data) 1160 if (!data)
1181 return -ENOMEM; 1161 return -ENOMEM;
1182 1162
1183 if (has_cap(ACER_CAP_WIRELESS)) {
1184 get_u32(&value, ACER_CAP_WIRELESS);
1185 data->wireless = value;
1186 }
1187
1188 if (has_cap(ACER_CAP_BLUETOOTH)) {
1189 get_u32(&value, ACER_CAP_BLUETOOTH);
1190 data->bluetooth = value;
1191 }
1192
1193 if (has_cap(ACER_CAP_MAILLED)) { 1163 if (has_cap(ACER_CAP_MAILLED)) {
1194 get_u32(&value, ACER_CAP_MAILLED); 1164 get_u32(&value, ACER_CAP_MAILLED);
1195 data->mailled = value; 1165 data->mailled = value;
@@ -1210,15 +1180,6 @@ static int acer_platform_resume(struct platform_device *device)
1210 if (!data) 1180 if (!data)
1211 return -ENOMEM; 1181 return -ENOMEM;
1212 1182
1213 if (has_cap(ACER_CAP_WIRELESS))
1214 set_u32(data->wireless, ACER_CAP_WIRELESS);
1215
1216 if (has_cap(ACER_CAP_BLUETOOTH))
1217 set_u32(data->bluetooth, ACER_CAP_BLUETOOTH);
1218
1219 if (has_cap(ACER_CAP_THREEG))
1220 set_u32(data->threeg, ACER_CAP_THREEG);
1221
1222 if (has_cap(ACER_CAP_MAILLED)) 1183 if (has_cap(ACER_CAP_MAILLED))
1223 set_u32(data->mailled, ACER_CAP_MAILLED); 1184 set_u32(data->mailled, ACER_CAP_MAILLED);
1224 1185
@@ -1243,12 +1204,6 @@ static struct platform_device *acer_platform_device;
1243 1204
1244static int remove_sysfs(struct platform_device *device) 1205static int remove_sysfs(struct platform_device *device)
1245{ 1206{
1246 if (has_cap(ACER_CAP_WIRELESS))
1247 device_remove_file(&device->dev, &dev_attr_wireless);
1248
1249 if (has_cap(ACER_CAP_BLUETOOTH))
1250 device_remove_file(&device->dev, &dev_attr_bluetooth);
1251
1252 if (has_cap(ACER_CAP_THREEG)) 1207 if (has_cap(ACER_CAP_THREEG))
1253 device_remove_file(&device->dev, &dev_attr_threeg); 1208 device_remove_file(&device->dev, &dev_attr_threeg);
1254 1209
@@ -1261,20 +1216,6 @@ static int create_sysfs(void)
1261{ 1216{
1262 int retval = -ENOMEM; 1217 int retval = -ENOMEM;
1263 1218
1264 if (has_cap(ACER_CAP_WIRELESS)) {
1265 retval = device_create_file(&acer_platform_device->dev,
1266 &dev_attr_wireless);
1267 if (retval)
1268 goto error_sysfs;
1269 }
1270
1271 if (has_cap(ACER_CAP_BLUETOOTH)) {
1272 retval = device_create_file(&acer_platform_device->dev,
1273 &dev_attr_bluetooth);
1274 if (retval)
1275 goto error_sysfs;
1276 }
1277
1278 if (has_cap(ACER_CAP_THREEG)) { 1219 if (has_cap(ACER_CAP_THREEG)) {
1279 retval = device_create_file(&acer_platform_device->dev, 1220 retval = device_create_file(&acer_platform_device->dev,
1280 &dev_attr_threeg); 1221 &dev_attr_threeg);