[PATCH] USB: ftdi_sio: Added PID for new ekey device and some coding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Added support for ekey Converter USB which uses an FT232BM chip.
Also cleaned up some code style warnings, mostly whitespace and some 
braces.
* ftdi_sio.c: checkpatch.pl 11E and 27W down to 11E and 21W
* ftdi_sio_ids.h: checkpatch.pl 60W down to 58W, only long lines left

Signed-off-by: Jaša Bartelj <jasa.bartelj@xxxxxxxxx>
---
 drivers/usb/serial/ftdi_sio.c     | 21 +++++++++++++--------
 drivers/usb/serial/ftdi_sio_ids.h |  9 +++++++--
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio.c 
b/drivers/usb/serial/ftdi_sio.c
index 216ce30..d85616f 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -58,7 +58,7 @@ struct ftdi_private {
        int custom_divisor;/* custom_divisor kludge, this is for
        baud_base (different from what goes to the
        chip!) */
-       __u16 last_set_data_urb_value ;
+       __u16 last_set_data_urb_value;
        /* the last data state set - needed for doing
        * a break
        */
@@ -934,6 +934,8 @@ static const struct usb_device_id 
id_table_combined[] = {
        { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_2_PID) },
        { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_3_PID) },
        { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_4_PID) },
+       /* ekey Devices */
+       { USB_DEVICE(FTDI_VID, FTDI_EKEY_CONV_USB_PID) },
        /* Infineon Devices */
        { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, 
INFINEON_TRIBOARD_PID, 1) },
        { }     /* Terminating entry */
@@ -1036,6 +1038,7 @@ static unsigned short int 
ftdi_232am_baud_base_to_divisor(int baud, int base)
        unsigned short int divisor;
        /* divisor shifted 3 bits to the left */
        int divisor3 = base / 2 / baud;
+
        if ((divisor3 & 0x7) == 7)
        divisor3++; /* round x.7/8 up to x+1 */
        divisor = divisor3 >> 3;
@@ -1062,6 +1065,7 @@ static __u32 ftdi_232bm_baud_base_to_divisor(int 
baud, int base)
        __u32 divisor;
        /* divisor shifted 3 bits to the left */
        int divisor3 = base / 2 / baud;
+
        divisor = divisor3 >> 3;
        divisor |= (__u32)divfrac[divisor3 & 0x7] << 14;
        /* Deal with special cases for highest baud rates. */
@@ -1448,8 +1452,7 @@ check_and_exit:
        (old_priv.custom_divisor != priv->custom_divisor))) {
        change_speed(tty, port);
        mutex_unlock(&priv->cfg_lock);
-       }
-       else
+       } else
        mutex_unlock(&priv->cfg_lock);
        return 0;
 }
@@ -1505,15 +1508,15 @@ static void ftdi_determine_type(struct 
usb_serial_port *port)

        /* Determine interface code. */
        inter = serial->interface->altsetting->desc.bInterfaceNumber;
-       if (inter == 0) {
+       if (inter == 0)
        priv->interface = INTERFACE_A;
-       } else  if (inter == 1) {
+       else  if (inter == 1)
        priv->interface = INTERFACE_B;
-       } else  if (inter == 2) {
+       else  if (inter == 2)
        priv->interface = INTERFACE_C;
-       } else  if (inter == 3) {
+       else  if (inter == 3)
        priv->interface = INTERFACE_D;
-       }
+
        /* BM-type devices have a bug where bcdDevice gets set
        * to 0x200 when iSerialNumber is 0.  */
        if (version < 0x500) {
@@ -1596,6 +1599,7 @@ static ssize_t latency_timer_show(struct device 
*dev,
 {
        struct usb_serial_port *port = to_usb_serial_port(dev);
        struct ftdi_private *priv = usb_get_serial_port_data(port);
+
        if (priv->flags & ASYNC_LOW_LATENCY)
        return sprintf(buf, "1\n");
        else
@@ -1708,6 +1712,7 @@ static int ftdi_sio_probe(struct usb_serial 
*serial,

        if (quirk && quirk->probe) {
        int ret = quirk->probe(serial);
+
        if (ret != 0)
        return ret;
        }
diff --git a/drivers/usb/serial/ftdi_sio_ids.h 
b/drivers/usb/serial/ftdi_sio_ids.h
index 1e58d90..c16d330 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -897,7 +897,7 @@
  * Kondo Kagaku Co.Ltd.
  * http://www.kondo-robot.com/EN
  */
-#define KONDO_VID      0x165c
+#define KONDO_VID      0x165c
 #define KONDO_USB_SERIAL_PID   0x0002

 /*
@@ -1284,7 +1284,7 @@
 /*
  * Accesio USB Data Acquisition products (http://www.accesio.com/)
  */
-#define ACCESIO_COM4SM_PID     0xD578
+#define ACCESIO_COM4SM_PID     0xD578

 /* www.sciencescope.co.uk educational dataloggers */
 #define FTDI_SCIENCESCOPE_LOGBOOKML_PID        0xFF18
@@ -1378,3 +1378,8 @@
 #define BRAINBOXES_US_160_6_PID        0x9006 /* US-160 16xRS232 
1Mbaud Port 11 and 12 */
 #define BRAINBOXES_US_160_7_PID        0x9007 /* US-160 16xRS232 
1Mbaud Port 13 and 14 */
 #define BRAINBOXES_US_160_8_PID        0x9008 /* US-160 16xRS232 
1Mbaud Port 15 and 16 */
+
+/*
+ * ekey biometric systems GmbH (http://ekey.net/)
+ */
+#define FTDI_EKEY_CONV_USB_PID 0xCB08 /* Converter USB */
--
2.0.4


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux