aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorCarlos Corbacho <carlos@strangeworlds.co.uk>2008-10-08 16:40:26 -0400
committerLen Brown <len.brown@intel.com>2008-10-08 16:56:04 -0400
commit7d9a06de616f69374dab00396f27cf00962a72c9 (patch)
tree7d3b3221372b67a7fbf5d31cf20a5c51170814a8 /drivers/misc
parent0606e1abfcb66c3a29722162f5d2c7ad8b638237 (diff)
acer-wmi: Remove wireless and bluetooth sysfs entries
These are now replaced by the rfkill interface. Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/acer-wmi.c101
1 files changed, 21 insertions, 80 deletions
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);