aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2012-06-01 12:46:56 -0400
committerMatthew Garrett <mjg@redhat.com>2012-06-01 12:46:56 -0400
commita6c2390cd6d2083d27a2359658e08f2d3df375ac (patch)
treeb44be55f429f0da9a7081d49fab2f43eede7d394 /drivers
parent53039f222c548bfc119eea6df4dca2b57550e271 (diff)
dell-laptop: Remove rfkill code
The interface just doesn't work on some machines, and Dell haven't been able to tell us either which machines those are or what we should be doing instead. This would be fine, except it results in userspace ending up confused and general sadness. So let's just rip it out for now. Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/platform/x86/dell-laptop.c289
1 files changed, 0 insertions, 289 deletions
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index c188d43b93c5..5f78aac9b163 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -21,7 +21,6 @@
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/dmi.h> 22#include <linux/dmi.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/rfkill.h>
25#include <linux/power_supply.h> 24#include <linux/power_supply.h>
26#include <linux/acpi.h> 25#include <linux/acpi.h>
27#include <linux/mm.h> 26#include <linux/mm.h>
@@ -90,9 +89,6 @@ static struct platform_driver platform_driver = {
90 89
91static struct platform_device *platform_device; 90static struct platform_device *platform_device;
92static struct backlight_device *dell_backlight_device; 91static struct backlight_device *dell_backlight_device;
93static struct rfkill *wifi_rfkill;
94static struct rfkill *bluetooth_rfkill;
95static struct rfkill *wwan_rfkill;
96 92
97static const struct dmi_system_id dell_device_table[] __initconst = { 93static const struct dmi_system_id dell_device_table[] __initconst = {
98 { 94 {
@@ -119,53 +115,6 @@ static const struct dmi_system_id dell_device_table[] __initconst = {
119}; 115};
120MODULE_DEVICE_TABLE(dmi, dell_device_table); 116MODULE_DEVICE_TABLE(dmi, dell_device_table);
121 117
122static struct dmi_system_id __devinitdata dell_blacklist[] = {
123 /* Supported by compal-laptop */
124 {
125 .ident = "Dell Mini 9",
126 .matches = {
127 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
128 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 910"),
129 },
130 },
131 {
132 .ident = "Dell Mini 10",
133 .matches = {
134 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
135 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1010"),
136 },
137 },
138 {
139 .ident = "Dell Mini 10v",
140 .matches = {
141 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
142 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1011"),
143 },
144 },
145 {
146 .ident = "Dell Mini 1012",
147 .matches = {
148 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
149 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
150 },
151 },
152 {
153 .ident = "Dell Inspiron 11z",
154 .matches = {
155 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
156 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1110"),
157 },
158 },
159 {
160 .ident = "Dell Mini 12",
161 .matches = {
162 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
163 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1210"),
164 },
165 },
166 {}
167};
168
169static struct dmi_system_id __devinitdata dell_quirks[] = { 118static struct dmi_system_id __devinitdata dell_quirks[] = {
170 { 119 {
171 .callback = dmi_matched, 120 .callback = dmi_matched,
@@ -350,94 +299,6 @@ dell_send_request(struct calling_interface_buffer *buffer, int class,
350 return buffer; 299 return buffer;
351} 300}
352 301
353/* Derived from information in DellWirelessCtl.cpp:
354 Class 17, select 11 is radio control. It returns an array of 32-bit values.
355
356 Input byte 0 = 0: Wireless information
357
358 result[0]: return code
359 result[1]:
360 Bit 0: Hardware switch supported
361 Bit 1: Wifi locator supported
362 Bit 2: Wifi is supported
363 Bit 3: Bluetooth is supported
364 Bit 4: WWAN is supported
365 Bit 5: Wireless keyboard supported
366 Bits 6-7: Reserved
367 Bit 8: Wifi is installed
368 Bit 9: Bluetooth is installed
369 Bit 10: WWAN is installed
370 Bits 11-15: Reserved
371 Bit 16: Hardware switch is on
372 Bit 17: Wifi is blocked
373 Bit 18: Bluetooth is blocked
374 Bit 19: WWAN is blocked
375 Bits 20-31: Reserved
376 result[2]: NVRAM size in bytes
377 result[3]: NVRAM format version number
378
379 Input byte 0 = 2: Wireless switch configuration
380 result[0]: return code
381 result[1]:
382 Bit 0: Wifi controlled by switch
383 Bit 1: Bluetooth controlled by switch
384 Bit 2: WWAN controlled by switch
385 Bits 3-6: Reserved
386 Bit 7: Wireless switch config locked
387 Bit 8: Wifi locator enabled
388 Bits 9-14: Reserved
389 Bit 15: Wifi locator setting locked
390 Bits 16-31: Reserved
391*/
392
393static int dell_rfkill_set(void *data, bool blocked)
394{
395 int disable = blocked ? 1 : 0;
396 unsigned long radio = (unsigned long)data;
397 int hwswitch_bit = (unsigned long)data - 1;
398 int ret = 0;
399
400 get_buffer();
401 dell_send_request(buffer, 17, 11);
402
403 /* If the hardware switch controls this radio, and the hardware
404 switch is disabled, don't allow changing the software state */
405 if ((hwswitch_state & BIT(hwswitch_bit)) &&
406 !(buffer->output[1] & BIT(16))) {
407 ret = -EINVAL;
408 goto out;
409 }
410
411 buffer->input[0] = (1 | (radio<<8) | (disable << 16));
412 dell_send_request(buffer, 17, 11);
413
414out:
415 release_buffer();
416 return ret;
417}
418
419static void dell_rfkill_query(struct rfkill *rfkill, void *data)
420{
421 int status;
422 int bit = (unsigned long)data + 16;
423 int hwswitch_bit = (unsigned long)data - 1;
424
425 get_buffer();
426 dell_send_request(buffer, 17, 11);
427 status = buffer->output[1];
428 release_buffer();
429
430 rfkill_set_sw_state(rfkill, !!(status & BIT(bit)));
431
432 if (hwswitch_state & (BIT(hwswitch_bit)))
433 rfkill_set_hw_state(rfkill, !(status & BIT(16)));
434}
435
436static const struct rfkill_ops dell_rfkill_ops = {
437 .set_block = dell_rfkill_set,
438 .query = dell_rfkill_query,
439};
440
441static struct dentry *dell_laptop_dir; 302static struct dentry *dell_laptop_dir;
442 303
443static int dell_debugfs_show(struct seq_file *s, void *data) 304static int dell_debugfs_show(struct seq_file *s, void *data)
@@ -507,108 +368,6 @@ static const struct file_operations dell_debugfs_fops = {
507 .release = single_release, 368 .release = single_release,
508}; 369};
509 370
510static void dell_update_rfkill(struct work_struct *ignored)
511{
512 if (wifi_rfkill)
513 dell_rfkill_query(wifi_rfkill, (void *)1);
514 if (bluetooth_rfkill)
515 dell_rfkill_query(bluetooth_rfkill, (void *)2);
516 if (wwan_rfkill)
517 dell_rfkill_query(wwan_rfkill, (void *)3);