diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-17 13:33:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:46 -0400 |
commit | 3bb36aa266f11f762e345cc85499a15d8df7ec51 (patch) | |
tree | a462c317023dbf528321ab79563b663b99029646 /drivers/usb | |
parent | 995834eb37c22ee9fd85324165ff71e9d6da5ae4 (diff) |
USB: ftdi_sio: checkpatch cleanups
Minor whitespace cleanups to make checkpatch happy.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.h | 126 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio_ids.h | 42 |
3 files changed, 88 insertions, 82 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 00b938a81f33..97f2d9c1edd6 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -61,7 +61,7 @@ static __u16 product; | |||
61 | 61 | ||
62 | struct ftdi_private { | 62 | struct ftdi_private { |
63 | struct kref kref; | 63 | struct kref kref; |
64 | ftdi_chip_type_t chip_type; | 64 | enum ftdi_chip_type chip_type; |
65 | /* type of device, either SIO or FT8U232AM */ | 65 | /* type of device, either SIO or FT8U232AM */ |
66 | int baud_base; /* baud base clock for divisor setting */ | 66 | int baud_base; /* baud base clock for divisor setting */ |
67 | int custom_divisor; /* custom_divisor kludge, this is for | 67 | int custom_divisor; /* custom_divisor kludge, this is for |
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index ff9bf80327a3..213fe3d61282 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -23,14 +23,16 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | /* Commands */ | 25 | /* Commands */ |
26 | #define FTDI_SIO_RESET 0 /* Reset the port */ | 26 | #define FTDI_SIO_RESET 0 /* Reset the port */ |
27 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ | 27 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ |
28 | #define FTDI_SIO_SET_FLOW_CTRL 2 /* Set flow control register */ | 28 | #define FTDI_SIO_SET_FLOW_CTRL 2 /* Set flow control register */ |
29 | #define FTDI_SIO_SET_BAUD_RATE 3 /* Set baud rate */ | 29 | #define FTDI_SIO_SET_BAUD_RATE 3 /* Set baud rate */ |
30 | #define FTDI_SIO_SET_DATA 4 /* Set the data characteristics of the port */ | 30 | #define FTDI_SIO_SET_DATA 4 /* Set the data characteristics of |
31 | #define FTDI_SIO_GET_MODEM_STATUS 5 /* Retrieve current value of modem status register */ | 31 | the port */ |
32 | #define FTDI_SIO_SET_EVENT_CHAR 6 /* Set the event character */ | 32 | #define FTDI_SIO_GET_MODEM_STATUS 5 /* Retrieve current value of modem |
33 | #define FTDI_SIO_SET_ERROR_CHAR 7 /* Set the error character */ | 33 | status register */ |
34 | #define FTDI_SIO_SET_EVENT_CHAR 6 /* Set the event character */ | ||
35 | #define FTDI_SIO_SET_ERROR_CHAR 7 /* Set the error character */ | ||
34 | #define FTDI_SIO_SET_LATENCY_TIMER 9 /* Set the latency timer */ | 36 | #define FTDI_SIO_SET_LATENCY_TIMER 9 /* Set the latency timer */ |
35 | #define FTDI_SIO_GET_LATENCY_TIMER 10 /* Get the latency timer */ | 37 | #define FTDI_SIO_GET_LATENCY_TIMER 10 /* Get the latency timer */ |
36 | 38 | ||
@@ -52,7 +54,7 @@ | |||
52 | */ | 54 | */ |
53 | 55 | ||
54 | /* Port Identifier Table */ | 56 | /* Port Identifier Table */ |
55 | #define PIT_DEFAULT 0 /* SIOA */ | 57 | #define PIT_DEFAULT 0 /* SIOA */ |
56 | #define PIT_SIOA 1 /* SIOA */ | 58 | #define PIT_SIOA 1 /* SIOA */ |
57 | /* The device this driver is tested with one has only one port */ | 59 | /* The device this driver is tested with one has only one port */ |
58 | #define PIT_SIOB 2 /* SIOB */ | 60 | #define PIT_SIOB 2 /* SIOB */ |
@@ -103,20 +105,21 @@ | |||
103 | * wLength: 0 | 105 | * wLength: 0 |
104 | * Data: None | 106 | * Data: None |
105 | * The BaudDivisor values are calculated as follows: | 107 | * The BaudDivisor values are calculated as follows: |
106 | * - BaseClock is either 12000000 or 48000000 depending on the device. FIXME: I wish | 108 | * - BaseClock is either 12000000 or 48000000 depending on the device. |
107 | * I knew how to detect old chips to select proper base clock! | 109 | * FIXME: I wish I knew how to detect old chips to select proper base clock! |
108 | * - BaudDivisor is a fixed point number encoded in a funny way. | 110 | * - BaudDivisor is a fixed point number encoded in a funny way. |
109 | * (--WRONG WAY OF THINKING--) | 111 | * (--WRONG WAY OF THINKING--) |
110 | * BaudDivisor is a fixed point number encoded with following bit weighs: | 112 | * BaudDivisor is a fixed point number encoded with following bit weighs: |
111 | * (-2)(-1)(13..0). It is a radical with a denominator of 4, so values | 113 | * (-2)(-1)(13..0). It is a radical with a denominator of 4, so values |
112 | * end with 0.0 (00...), 0.25 (10...), 0.5 (01...), and 0.75 (11...). | 114 | * end with 0.0 (00...), 0.25 (10...), 0.5 (01...), and 0.75 (11...). |
113 | * (--THE REALITY--) | 115 | * (--THE REALITY--) |
114 | * The both-bits-set has quite different meaning from 0.75 - the chip designers | 116 | * The both-bits-set has quite different meaning from 0.75 - the chip |
115 | * have decided it to mean 0.125 instead of 0.75. | 117 | * designers have decided it to mean 0.125 instead of 0.75. |
116 | * This info looked up in FTDI application note "FT8U232 DEVICES \ Data Rates | 118 | * This info looked up in FTDI application note "FT8U232 DEVICES \ Data Rates |
117 | * and Flow Control Consideration for USB to RS232". | 119 | * and Flow Control Consideration for USB to RS232". |
118 | * - BaudDivisor = (BaseClock / 16) / BaudRate, where the (=) operation should | 120 | * - BaudDivisor = (BaseClock / 16) / BaudRate, where the (=) operation should |
119 | * automagically re-encode the resulting value to take fractions into consideration. | 121 | * automagically re-encode the resulting value to take fractions into |
122 | * consideration. | ||
120 | * As all values are integers, some bit twiddling is in order: | 123 | * As all values are integers, some bit twiddling is in order: |
121 | * BaudDivisor = (BaseClock / 16 / BaudRate) | | 124 | * BaudDivisor = (BaseClock / 16 / BaudRate) | |
122 | * (((BaseClock / 2 / BaudRate) & 4) ? 0x4000 // 0.5 | 125 | * (((BaseClock / 2 / BaudRate) & 4) ? 0x4000 // 0.5 |
@@ -146,7 +149,7 @@ | |||
146 | * not supported by the FT8U232AM). | 149 | * not supported by the FT8U232AM). |
147 | */ | 150 | */ |
148 | 151 | ||
149 | typedef enum { | 152 | enum ftdi_chip_type { |
150 | SIO = 1, | 153 | SIO = 1, |
151 | FT8U232AM = 2, | 154 | FT8U232AM = 2, |
152 | FT232BM = 3, | 155 | FT232BM = 3, |
@@ -154,37 +157,36 @@ typedef enum { | |||
154 | FT232RL = 5, | 157 | FT232RL = 5, |
155 | FT2232H = 6, | 158 | FT2232H = 6, |
156 | FT4232H = 7 | 159 | FT4232H = 7 |
157 | } ftdi_chip_type_t; | 160 | }; |
158 | 161 | ||
159 | typedef enum { | 162 | enum ftdi_sio_baudrate { |
160 | ftdi_sio_b300 = 0, | 163 | ftdi_sio_b300 = 0, |
161 | ftdi_sio_b600 = 1, | 164 | ftdi_sio_b600 = 1, |
162 | ftdi_sio_b1200 = 2, | 165 | ftdi_sio_b1200 = 2, |
163 | ftdi_sio_b2400 = 3, | 166 | ftdi_sio_b2400 = 3, |
164 | ftdi_sio_b4800 = 4, | 167 | ftdi_sio_b4800 = 4, |
165 | ftdi_sio_b9600 = 5, | 168 | ftdi_sio_b9600 = 5, |
166 | ftdi_sio_b19200 = 6, | 169 | ftdi_sio_b19200 = 6, |
167 | ftdi_sio_b38400 = 7, | 170 | ftdi_sio_b38400 = 7, |
168 | ftdi_sio_b57600 = 8, | 171 | ftdi_sio_b57600 = 8, |
169 | ftdi_sio_b115200 = 9 | 172 | ftdi_sio_b115200 = 9 |
170 | } FTDI_SIO_baudrate_t; | 173 | }; |
171 | 174 | ||
172 | /* | 175 | /* |
173 | * The ftdi_8U232AM_xxMHz_byyy constants have been removed. The encoded divisor values | 176 | * The ftdi_8U232AM_xxMHz_byyy constants have been removed. The encoded divisor |
174 | * are calculated internally. | 177 | * values are calculated internally. |
175 | */ | 178 | */ |
176 | 179 | #define FTDI_SIO_SET_DATA_REQUEST FTDI_SIO_SET_DATA | |
177 | #define FTDI_SIO_SET_DATA_REQUEST FTDI_SIO_SET_DATA | 180 | #define FTDI_SIO_SET_DATA_REQUEST_TYPE 0x40 |
178 | #define FTDI_SIO_SET_DATA_REQUEST_TYPE 0x40 | 181 | #define FTDI_SIO_SET_DATA_PARITY_NONE (0x0 << 8) |
179 | #define FTDI_SIO_SET_DATA_PARITY_NONE (0x0 << 8) | 182 | #define FTDI_SIO_SET_DATA_PARITY_ODD (0x1 << 8) |
180 | #define FTDI_SIO_SET_DATA_PARITY_ODD (0x1 << 8) | 183 | #define FTDI_SIO_SET_DATA_PARITY_EVEN (0x2 << 8) |
181 | #define FTDI_SIO_SET_DATA_PARITY_EVEN (0x2 << 8) | 184 | #define FTDI_SIO_SET_DATA_PARITY_MARK (0x3 << 8) |
182 | #define FTDI_SIO_SET_DATA_PARITY_MARK (0x3 << 8) | 185 | #define FTDI_SIO_SET_DATA_PARITY_SPACE (0x4 << 8) |
183 | #define FTDI_SIO_SET_DATA_PARITY_SPACE (0x4 << 8) | 186 | #define FTDI_SIO_SET_DATA_STOP_BITS_1 (0x0 << 11) |
184 | #define FTDI_SIO_SET_DATA_STOP_BITS_1 (0x0 << 11) | 187 | #define FTDI_SIO_SET_DATA_STOP_BITS_15 (0x1 << 11) |
185 | #define FTDI_SIO_SET_DATA_STOP_BITS_15 (0x1 << 11) | 188 | #define FTDI_SIO_SET_DATA_STOP_BITS_2 (0x2 << 11) |
186 | #define FTDI_SIO_SET_DATA_STOP_BITS_2 (0x2 << 11) | 189 | #define FTDI_SIO_SET_BREAK (0x1 << 14) |
187 | #define FTDI_SIO_SET_BREAK (0x1 << 14) | ||
188 | /* FTDI_SIO_SET_DATA */ | 190 | /* FTDI_SIO_SET_DATA */ |
189 | 191 | ||
190 | /* | 192 | /* |
@@ -287,8 +289,8 @@ typedef enum { | |||
287 | * | 289 | * |
288 | * A value of zero in the hIndex field disables handshaking | 290 | * A value of zero in the hIndex field disables handshaking |
289 | * | 291 | * |
290 | * If Xon/Xoff handshaking is specified, the hValue field should contain the XOFF character | 292 | * If Xon/Xoff handshaking is specified, the hValue field should contain the |
291 | * and the lValue field contains the XON character. | 293 | * XOFF character and the lValue field contains the XON character. |
292 | */ | 294 | */ |
293 | 295 | ||
294 | /* | 296 | /* |
@@ -373,7 +375,10 @@ typedef enum { | |||
373 | 375 | ||
374 | /* FTDI_SIO_SET_ERROR_CHAR */ | 376 | /* FTDI_SIO_SET_ERROR_CHAR */ |
375 | 377 | ||
376 | /* Set the parity error replacement character for the specified communications port */ | 378 | /* |
379 | * Set the parity error replacement character for the specified communications | ||
380 | * port | ||
381 | */ | ||
377 | 382 | ||
378 | /* | 383 | /* |
379 | * BmRequestType: 0100 0000b | 384 | * BmRequestType: 0100 0000b |
@@ -496,9 +501,10 @@ typedef enum { | |||
496 | * | 501 | * |
497 | * IN Endpoint | 502 | * IN Endpoint |
498 | * | 503 | * |
499 | * The device reserves the first two bytes of data on this endpoint to contain the current | 504 | * The device reserves the first two bytes of data on this endpoint to contain |
500 | * values of the modem and line status registers. In the absence of data, the device | 505 | * the current values of the modem and line status registers. In the absence of |
501 | * generates a message consisting of these two status bytes every 40 ms | 506 | * data, the device generates a message consisting of these two status bytes |
507 | * every 40 ms | ||
502 | * | 508 | * |
503 | * Byte 0: Modem Status | 509 | * Byte 0: Modem Status |
504 | * | 510 | * |
@@ -530,21 +536,21 @@ typedef enum { | |||
530 | #define FTDI_RS0_RI (1 << 6) | 536 | #define FTDI_RS0_RI (1 << 6) |
531 | #define FTDI_RS0_RLSD (1 << 7) | 537 | #define FTDI_RS0_RLSD (1 << 7) |
532 | 538 | ||
533 | #define FTDI_RS_DR 1 | 539 | #define FTDI_RS_DR 1 |
534 | #define FTDI_RS_OE (1<<1) | 540 | #define FTDI_RS_OE (1<<1) |
535 | #define FTDI_RS_PE (1<<2) | 541 | #define FTDI_RS_PE (1<<2) |
536 | #define FTDI_RS_FE (1<<3) | 542 | #define FTDI_RS_FE (1<<3) |
537 | #define FTDI_RS_BI (1<<4) | 543 | #define FTDI_RS_BI (1<<4) |
538 | #define FTDI_RS_THRE (1<<5) | 544 | #define FTDI_RS_THRE (1<<5) |
539 | #define FTDI_RS_TEMT (1<<6) | 545 | #define FTDI_RS_TEMT (1<<6) |
540 | #define FTDI_RS_FIFO (1<<7) | 546 | #define FTDI_RS_FIFO (1<<7) |
541 | 547 | ||
542 | /* | 548 | /* |
543 | * OUT Endpoint | 549 | * OUT Endpoint |
544 | * | 550 | * |
545 | * This device reserves the first bytes of data on this endpoint contain the length | 551 | * This device reserves the first bytes of data on this endpoint contain the |
546 | * and port identifier of the message. For the FTDI USB Serial converter the port | 552 | * length and port identifier of the message. For the FTDI USB Serial converter |
547 | * identifier is always 1. | 553 | * the port identifier is always 1. |
548 | * | 554 | * |
549 | * Byte 0: Line Status | 555 | * Byte 0: Line Status |
550 | * | 556 | * |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 75482cbc3998..94d86c3febcb 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -275,8 +275,8 @@ | |||
275 | /* | 275 | /* |
276 | * Hameg HO820 and HO870 interface (using VID 0x0403) | 276 | * Hameg HO820 and HO870 interface (using VID 0x0403) |
277 | */ | 277 | */ |
278 | #define HAMEG_HO820_PID 0xed74 | 278 | #define HAMEG_HO820_PID 0xed74 |
279 | #define HAMEG_HO870_PID 0xed71 | 279 | #define HAMEG_HO870_PID 0xed71 |
280 | 280 | ||
281 | /* | 281 | /* |
282 | * MaxStream devices www.maxstream.net | 282 | * MaxStream devices www.maxstream.net |
@@ -289,14 +289,14 @@ | |||
289 | * and Mike Studer (K6EEP) <k6eep@hamsoftware.org>. | 289 | * and Mike Studer (K6EEP) <k6eep@hamsoftware.org>. |
290 | * Ian Abbott <abbotti@mev.co.uk> added a few more from the driver INF file. | 290 | * Ian Abbott <abbotti@mev.co.uk> added a few more from the driver INF file. |
291 | */ | 291 | */ |
292 | #define FTDI_MHAM_KW_PID 0xEEE8 /* USB-KW interface */ | 292 | #define FTDI_MHAM_KW_PID 0xEEE8 /* USB-KW interface */ |
293 | #define FTDI_MHAM_YS_PID 0xEEE9 /* USB-YS interface */ | 293 | #define FTDI_MHAM_YS_PID 0xEEE9 /* USB-YS interface */ |
294 | #define FTDI_MHAM_Y6_PID 0xEEEA /* USB-Y6 interface */ | 294 | #define FTDI_MHAM_Y6_PID 0xEEEA /* USB-Y6 interface */ |
295 | #define FTDI_MHAM_Y8_PID 0xEEEB /* USB-Y8 interface */ | 295 | #define FTDI_MHAM_Y8_PID 0xEEEB /* USB-Y8 interface */ |
296 | #define FTDI_MHAM_IC_PID 0xEEEC /* USB-IC interface */ | 296 | #define FTDI_MHAM_IC_PID 0xEEEC /* USB-IC interface */ |
297 | #define FTDI_MHAM_DB9_PID 0xEEED /* USB-DB9 interface */ | 297 | #define FTDI_MHAM_DB9_PID 0xEEED /* USB-DB9 interface */ |
298 | #define FTDI_MHAM_RS232_PID 0xEEEE /* USB-RS232 interface */ | 298 | #define FTDI_MHAM_RS232_PID 0xEEEE /* USB-RS232 interface */ |
299 | #define FTDI_MHAM_Y9_PID 0xEEEF /* USB-Y9 interface */ | 299 | #define FTDI_MHAM_Y9_PID 0xEEEF /* USB-Y9 interface */ |
300 | 300 | ||
301 | /* Domintell products http://www.domintell.com */ | 301 | /* Domintell products http://www.domintell.com */ |
302 | #define FTDI_DOMINTELL_DGQG_PID 0xEF50 /* Master */ | 302 | #define FTDI_DOMINTELL_DGQG_PID 0xEF50 /* Master */ |
@@ -483,9 +483,9 @@ | |||
483 | * Blackfin gnICE JTAG | 483 | * Blackfin gnICE JTAG |
484 | * http://docs.blackfin.uclinux.org/doku.php?id=hw:jtag:gnice | 484 | * http://docs.blackfin.uclinux.org/doku.php?id=hw:jtag:gnice |
485 | */ | 485 | */ |
486 | #define ADI_VID 0x0456 | 486 | #define ADI_VID 0x0456 |
487 | #define ADI_GNICE_PID 0xF000 | 487 | #define ADI_GNICE_PID 0xF000 |
488 | #define ADI_GNICEPLUS_PID 0xF001 | 488 | #define ADI_GNICEPLUS_PID 0xF001 |
489 | 489 | ||
490 | /* | 490 | /* |
491 | * RATOC REX-USB60F | 491 | * RATOC REX-USB60F |
@@ -611,13 +611,13 @@ | |||
611 | #define SEALEVEL_2802_7_PID 0X2872 /* SeaLINK+8/485 (2802) Port 7 */ | 611 | #define SEALEVEL_2802_7_PID 0X2872 /* SeaLINK+8/485 (2802) Port 7 */ |
612 | #define SEALEVEL_2802_8_PID 0X2882 /* SeaLINK+8/485 (2802) Port 8 */ | 612 | #define SEALEVEL_2802_8_PID 0X2882 /* SeaLINK+8/485 (2802) Port 8 */ |
613 | #define SEALEVEL_2803_1_PID 0X2813 /* SeaLINK+8 (2803) Port 1 */ | 613 | #define SEALEVEL_2803_1_PID 0X2813 /* SeaLINK+8 (2803) Port 1 */ |
614 | #define SEALEVEL_2803_2_PID 0X2823 /* SeaLINK+8 (2803) Port 2 */ | 614 | #define SEALEVEL_2803_2_PID 0X2823 /* SeaLINK+8 (2803) Port 2 */ |
615 | #define SEALEVEL_2803_3_PID 0X2833 /* SeaLINK+8 (2803) Port 3 */ | 615 | #define SEALEVEL_2803_3_PID 0X2833 /* SeaLINK+8 (2803) Port 3 */ |
616 | #define SEALEVEL_2803_4_PID 0X2843 /* SeaLINK+8 (2803) Port 4 */ | 616 | #define SEALEVEL_2803_4_PID 0X2843 /* SeaLINK+8 (2803) Port 4 */ |
617 | #define SEALEVEL_2803_5_PID 0X2853 /* SeaLINK+8 (2803) Port 5 */ | 617 | #define SEALEVEL_2803_5_PID 0X2853 /* SeaLINK+8 (2803) Port 5 */ |
618 | #define SEALEVEL_2803_6_PID 0X2863 /* SeaLINK+8 (2803) Port 6 */ | 618 | #define SEALEVEL_2803_6_PID 0X2863 /* SeaLINK+8 (2803) Port 6 */ |
619 | #define SEALEVEL_2803_7_PID 0X2873 /* SeaLINK+8 (2803) Port 7 */ | 619 | #define SEALEVEL_2803_7_PID 0X2873 /* SeaLINK+8 (2803) Port 7 */ |
620 | #define SEALEVEL_2803_8_PID 0X2883 /* SeaLINK+8 (2803) Port 8 */ | 620 | #define SEALEVEL_2803_8_PID 0X2883 /* SeaLINK+8 (2803) Port 8 */ |
621 | 621 | ||
622 | /* | 622 | /* |
623 | * JETI SPECTROMETER SPECBOS 1201 | 623 | * JETI SPECTROMETER SPECBOS 1201 |
@@ -1013,7 +1013,7 @@ | |||
1013 | */ | 1013 | */ |
1014 | #define EVOLUTION_VID 0xDEEE /* Vendor ID */ | 1014 | #define EVOLUTION_VID 0xDEEE /* Vendor ID */ |
1015 | #define EVOLUTION_ER1_PID 0x0300 /* ER1 Control Module */ | 1015 | #define EVOLUTION_ER1_PID 0x0300 /* ER1 Control Module */ |
1016 | #define EVO_8U232AM_PID 0x02FF /* Evolution robotics RCM2 (FT232AM)*/ | 1016 | #define EVO_8U232AM_PID 0x02FF /* Evolution robotics RCM2 (FT232AM)*/ |
1017 | #define EVO_HYBRID_PID 0x0302 /* Evolution robotics RCM4 PID (FT232BM)*/ | 1017 | #define EVO_HYBRID_PID 0x0302 /* Evolution robotics RCM4 PID (FT232BM)*/ |
1018 | #define EVO_RCM4_PID 0x0303 /* Evolution robotics RCM4 PID */ | 1018 | #define EVO_RCM4_PID 0x0303 /* Evolution robotics RCM4 PID */ |
1019 | 1019 | ||