aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorRobert Butora <robert.butora.fi@gmail.com>2013-05-31 11:09:51 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-03 13:33:10 -0400
commit6529591e3eef65f0f528a81ac169f6e294b947a7 (patch)
tree69c78c0c918fef40b1b50a5c0079f9db4466733a /drivers/usb
parent077f5f1c23b3cf1134c031677497dfb6077e6bdd (diff)
USB: Serial: cypress_M8: Enable FRWD Dongle hidcom device
The patch adds a new HIDCOM device and does not affect other devices driven by the cypress_M8 module. Changes are: - add VendorID ProductID to device tables - skip unstable speed check because FRWD uses 115200bps - skip reset at probe which is an issue workaround for this particular device. Signed-off-by: Robert Butora <robert.butora.fi@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/cypress_m8.c18
-rw-r--r--drivers/usb/serial/cypress_m8.h4
2 files changed, 21 insertions, 1 deletions
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index d341555d37d8..082120198f87 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -65,6 +65,7 @@ static const struct usb_device_id id_table_earthmate[] = {
65static const struct usb_device_id id_table_cyphidcomrs232[] = { 65static const struct usb_device_id id_table_cyphidcomrs232[] = {
66 { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, 66 { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) },
67 { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, 67 { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) },
68 { USB_DEVICE(VENDOR_ID_FRWD, PRODUCT_ID_CYPHIDCOM_FRWD) },
68 { } /* Terminating entry */ 69 { } /* Terminating entry */
69}; 70};
70 71
@@ -78,6 +79,7 @@ static const struct usb_device_id id_table_combined[] = {
78 { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB_LT20) }, 79 { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB_LT20) },
79 { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, 80 { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) },
80 { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, 81 { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) },
82 { USB_DEVICE(VENDOR_ID_FRWD, PRODUCT_ID_CYPHIDCOM_FRWD) },
81 { USB_DEVICE(VENDOR_ID_DAZZLE, PRODUCT_ID_CA42) }, 83 { USB_DEVICE(VENDOR_ID_DAZZLE, PRODUCT_ID_CA42) },
82 { } /* Terminating entry */ 84 { } /* Terminating entry */
83}; 85};
@@ -229,6 +231,12 @@ static struct usb_serial_driver * const serial_drivers[] = {
229 * Cypress serial helper functions 231 * Cypress serial helper functions
230 *****************************************************************************/ 232 *****************************************************************************/
231 233
234/* FRWD Dongle hidcom needs to skip reset and speed checks */
235static inline bool is_frwd(struct usb_device *dev)
236{
237 return ((le16_to_cpu(dev->descriptor.idVendor) == VENDOR_ID_FRWD) &&
238 (le16_to_cpu(dev->descriptor.idProduct) == PRODUCT_ID_CYPHIDCOM_FRWD));
239}
232 240
233static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate) 241static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate)
234{ 242{
@@ -238,6 +246,10 @@ static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate)
238 if (unstable_bauds) 246 if (unstable_bauds)
239 return new_rate; 247 return new_rate;
240 248
249 /* FRWD Dongle uses 115200 bps */
250 if (is_frwd(port->serial->dev))
251 return new_rate;
252
241 /* 253 /*
242 * The general purpose firmware for the Cypress M8 allows for 254 * The general purpose firmware for the Cypress M8 allows for
243 * a maximum speed of 57600bps (I have no idea whether DeLorme 255 * a maximum speed of 57600bps (I have no idea whether DeLorme
@@ -448,7 +460,11 @@ static int cypress_generic_port_probe(struct usb_serial_port *port)
448 return -ENOMEM; 460 return -ENOMEM;
449 } 461 }
450 462
451 usb_reset_configuration(serial->dev); 463 /* Skip reset for FRWD device. It is a workaound:
464 device hangs if it receives SET_CONFIGURE in Configured
465 state. */
466 if (!is_frwd(serial->dev))
467 usb_reset_configuration(serial->dev);
452 468
453 priv->cmd_ctrl = 0; 469 priv->cmd_ctrl = 0;
454 priv->line_control = 0; 470 priv->line_control = 0;
diff --git a/drivers/usb/serial/cypress_m8.h b/drivers/usb/serial/cypress_m8.h
index 67cf60826884..b461311a2ae7 100644
--- a/drivers/usb/serial/cypress_m8.h
+++ b/drivers/usb/serial/cypress_m8.h
@@ -24,6 +24,10 @@
24#define VENDOR_ID_CYPRESS 0x04b4 24#define VENDOR_ID_CYPRESS 0x04b4
25#define PRODUCT_ID_CYPHIDCOM 0x5500 25#define PRODUCT_ID_CYPHIDCOM 0x5500
26 26
27/* FRWD Dongle - a GPS sports watch */
28#define VENDOR_ID_FRWD 0x6737
29#define PRODUCT_ID_CYPHIDCOM_FRWD 0x0001
30
27/* Powercom UPS, chip CY7C63723 */ 31/* Powercom UPS, chip CY7C63723 */
28#define VENDOR_ID_POWERCOM 0x0d9f 32#define VENDOR_ID_POWERCOM 0x0d9f
29#define PRODUCT_ID_UPS 0x0002 33#define PRODUCT_ID_UPS 0x0002