aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2010-01-21 17:54:10 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:54:33 -0500
commita8d4211f33a9573f7b1bdcfd9c9c48631d1515ee (patch)
tree927498470110063b548ddeb97a9e1e5caae63da0 /drivers/usb
parent2a9d0083f63da961a8cd4fdf9f4e8e6433c36966 (diff)
USB: remove the berry_charge driver
The Barry project's userspace program, bcharge, can better handle this device and functionality, and it also works with the latest phones, which this driver does not support. So remove it, as the userspace code should be used instead. Cc: Chris Frey <cdfrey@foursquare.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/misc/Kconfig11
-rw-r--r--drivers/usb/misc/Makefile1
-rw-r--r--drivers/usb/misc/berry_charge.c183
3 files changed, 0 insertions, 195 deletions
diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
index abe3aa67ed00..ef9bbef7a88b 100644
--- a/drivers/usb/misc/Kconfig
+++ b/drivers/usb/misc/Kconfig
@@ -87,17 +87,6 @@ config USB_LCD
87 To compile this driver as a module, choose M here: the 87 To compile this driver as a module, choose M here: the
88 module will be called usblcd. 88 module will be called usblcd.
89 89
90config USB_BERRY_CHARGE
91 tristate "USB BlackBerry recharge support"
92 depends on USB
93 help
94 Say Y here if you want to connect a BlackBerry device to your
95 computer's USB port and have it automatically switch to "recharge"
96 mode.
97
98 To compile this driver as a module, choose M here: the
99 module will be called berry_charge.
100
101config USB_LED 90config USB_LED
102 tristate "USB LED driver support" 91 tristate "USB LED driver support"
103 depends on USB 92 depends on USB
diff --git a/drivers/usb/misc/Makefile b/drivers/usb/misc/Makefile
index 0826aab8303f..36dd40dda1b3 100644
--- a/drivers/usb/misc/Makefile
+++ b/drivers/usb/misc/Makefile
@@ -5,7 +5,6 @@
5 5
6obj-$(CONFIG_USB_ADUTUX) += adutux.o 6obj-$(CONFIG_USB_ADUTUX) += adutux.o
7obj-$(CONFIG_USB_APPLEDISPLAY) += appledisplay.o 7obj-$(CONFIG_USB_APPLEDISPLAY) += appledisplay.o
8obj-$(CONFIG_USB_BERRY_CHARGE) += berry_charge.o
9obj-$(CONFIG_USB_CYPRESS_CY7C63)+= cypress_cy7c63.o 8obj-$(CONFIG_USB_CYPRESS_CY7C63)+= cypress_cy7c63.o
10obj-$(CONFIG_USB_CYTHERM) += cytherm.o 9obj-$(CONFIG_USB_CYTHERM) += cytherm.o
11obj-$(CONFIG_USB_EMI26) += emi26.o 10obj-$(CONFIG_USB_EMI26) += emi26.o
diff --git a/drivers/usb/misc/berry_charge.c b/drivers/usb/misc/berry_charge.c
deleted file mode 100644
index a96e58ce8b34..000000000000
--- a/drivers/usb/misc/berry_charge.c
+++ /dev/null
@@ -1,183 +0,0 @@
1/*
2 * USB BlackBerry charging module
3 *
4 * Copyright (C) 2007 Greg Kroah-Hartman <gregkh@suse.de>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, version 2.
9 *
10 * Information on how to switch configs was taken by the bcharge.cc file
11 * created by the barry.sf.net project.
12 *
13 * bcharge.cc has the following copyright:
14 * Copyright (C) 2006, Net Direct Inc. (http://www.netdirect.ca/)
15 * and is released under the GPLv2.
16 *
17 *
18 */
19
20#include <linux/kernel.h>
21#include <linux/errno.h>
22#include <linux/init.h>
23#include <linux/slab.h>
24#include <linux/module.h>
25#include <linux/usb.h>
26
27#define RIM_VENDOR 0x0fca
28#define BLACKBERRY 0x0001
29#define BLACKBERRY_PEARL_DUAL 0x0004
30#define BLACKBERRY_PEARL 0x0006
31
32static int debug;
33static int pearl_dual_mode = 1;
34
35#ifdef dbg
36#undef dbg
37#endif
38#define dbg(dev, format, arg...) \
39 if (debug) \
40 dev_printk(KERN_DEBUG , dev , format , ## arg)
41
42static const struct usb_device_id id_table[] = {
43 { USB_DEVICE(RIM_VENDOR, BLACKBERRY) },
44 { USB_DEVICE(RIM_VENDOR, BLACKBERRY_PEARL) },
45 { USB_DEVICE(RIM_VENDOR, BLACKBERRY_PEARL_DUAL) },
46 { }, /* Terminating entry */
47};
48MODULE_DEVICE_TABLE(usb, id_table);
49
50static int magic_charge(struct usb_device *udev)
51{
52 char *dummy_buffer = kzalloc(2, GFP_KERNEL);
53 int retval;
54
55 if (!dummy_buffer)
56 return -ENOMEM;
57
58 /* send two magic commands and then set the configuration. The device
59 * will then reset itself with the new power usage and should start
60 * charging. */
61
62 /* Note, with testing, it only seems that the first message is really
63 * needed (at least for the 8700c), but to be safe, we emulate what
64 * other operating systems seem to be sending to their device. We
65 * really need to get some specs for this device to be sure about what
66 * is going on here.
67 */
68 dbg(&udev->dev, "Sending first magic command\n");
69 retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
70 0xa5, 0xc0, 0, 1, dummy_buffer, 2, 100);
71 if (retval != 2) {
72 dev_err(&udev->dev, "First magic command failed: %d.\n",
73 retval);
74 goto exit;
75 }
76
77 dbg(&udev->dev, "Sending second magic command\n");
78 retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
79 0xa2, 0x40, 0, 1, dummy_buffer, 0, 100);
80 if (retval != 0) {
81 dev_err(&udev->dev, "Second magic command failed: %d.\n",
82 retval);
83 goto exit;
84 }
85
86 dbg(&udev->dev, "Calling set_configuration\n");
87 retval = usb_driver_set_configuration(udev, 1);
88 if (retval)
89 dev_err(&udev->dev, "Set Configuration failed :%d.\n", retval);
90
91exit:
92 kfree(dummy_buffer);
93 return retval;
94}
95
96static int magic_dual_mode(struct usb_device *udev)
97{
98 char *dummy_buffer = kzalloc(2, GFP_KERNEL);
99 int retval;
100
101 if (!dummy_buffer)
102 return -ENOMEM;
103
104 /* send magic command so that the Blackberry Pearl device exposes
105 * two interfaces: both the USB mass-storage one and one which can
106 * be used for database access. */
107 dbg(&udev->dev, "Sending magic pearl command\n");
108 retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
109 0xa9, 0xc0, 1, 1, dummy_buffer, 2, 100);
110 dbg(&udev->dev, "Magic pearl command returned %d\n", retval);
111
112 dbg(&udev->dev, "Calling set_configuration\n");
113 retval = usb_driver_set_configuration(udev, 1);
114 if (retval)
115 dev_err(&udev->dev, "Set Configuration failed :%d.\n", retval);
116
117 kfree(dummy_buffer);
118 return retval;
119}
120
121static int berry_probe(struct usb_interface *intf,
122 const struct usb_device_id *id)
123{
124 struct usb_device *udev = interface_to_usbdev(intf);
125
126 if (udev->bus_mA < 500) {
127 dbg(&udev->dev, "Not enough power to charge available\n");
128 return -ENODEV;
129 }
130
131 dbg(&udev->dev, "Power is set to %dmA\n",
132 udev->actconfig->desc.bMaxPower * 2);
133
134 /* check the power usage so we don't try to enable something that is
135 * already enabled */
136 if ((udev->actconfig->desc.bMaxPower * 2) == 500) {
137 dbg(&udev->dev, "device is already charging, power is "
138 "set to %dmA\n", udev->actconfig->desc.bMaxPower * 2);
139 return -ENODEV;
140 }
141
142 /* turn the power on */
143 magic_charge(udev);
144
145 if ((le16_to_cpu(udev->descriptor.idProduct) == BLACKBERRY_PEARL) &&
146 (pearl_dual_mode))
147 magic_dual_mode(udev);
148
149 /* we don't really want to bind to the device, userspace programs can
150 * handle the syncing just fine, so get outta here. */
151 return -ENODEV;
152}
153
154static void berry_disconnect(struct usb_interface *intf)
155{
156}
157
158static struct usb_driver berry_driver = {
159 .name = "berry_charge",
160 .probe = berry_probe,
161 .disconnect = berry_disconnect,
162 .id_table = id_table,
163};
164
165static int __init berry_init(void)
166{
167 return usb_register(&berry_driver);
168}
169
170static void __exit berry_exit(void)
171{
172 usb_deregister(&berry_driver);
173}
174
175module_init(berry_init);
176module_exit(berry_exit);
177
178MODULE_LICENSE("GPL");
179MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@suse.de>");
180module_param(debug, bool, S_IRUGO | S_IWUSR);
181MODULE_PARM_DESC(debug, "Debug enabled or not");
182module_param(pearl_dual_mode, bool, S_IRUGO | S_IWUSR);
183MODULE_PARM_DESC(pearl_dual_mode, "Change Blackberry Pearl to run in dual mode");