Commit 3bb36aa2 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: ftdi_sio: checkpatch cleanups

Minor whitespace cleanups to make checkpatch happy.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 995834eb
...@@ -61,7 +61,7 @@ static __u16 product; ...@@ -61,7 +61,7 @@ static __u16 product;
struct ftdi_private { struct ftdi_private {
struct kref kref; struct kref kref;
ftdi_chip_type_t chip_type; enum ftdi_chip_type chip_type;
/* type of device, either SIO or FT8U232AM */ /* type of device, either SIO or FT8U232AM */
int baud_base; /* baud base clock for divisor setting */ int baud_base; /* baud base clock for divisor setting */
int custom_divisor; /* custom_divisor kludge, this is for int custom_divisor; /* custom_divisor kludge, this is for
......
...@@ -27,8 +27,10 @@ ...@@ -27,8 +27,10 @@
#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
#define FTDI_SIO_SET_FLOW_CTRL 2 /* Set flow control register */ #define FTDI_SIO_SET_FLOW_CTRL 2 /* Set flow control register */
#define FTDI_SIO_SET_BAUD_RATE 3 /* Set baud rate */ #define FTDI_SIO_SET_BAUD_RATE 3 /* Set baud rate */
#define FTDI_SIO_SET_DATA 4 /* Set the data characteristics of the port */ #define FTDI_SIO_SET_DATA 4 /* Set the data characteristics of
#define FTDI_SIO_GET_MODEM_STATUS 5 /* Retrieve current value of modem status register */ the port */
#define FTDI_SIO_GET_MODEM_STATUS 5 /* Retrieve current value of modem
status register */
#define FTDI_SIO_SET_EVENT_CHAR 6 /* Set the event character */ #define FTDI_SIO_SET_EVENT_CHAR 6 /* Set the event character */
#define FTDI_SIO_SET_ERROR_CHAR 7 /* Set the error character */ #define FTDI_SIO_SET_ERROR_CHAR 7 /* Set the error character */
#define FTDI_SIO_SET_LATENCY_TIMER 9 /* Set the latency timer */ #define FTDI_SIO_SET_LATENCY_TIMER 9 /* Set the latency timer */
...@@ -103,20 +105,21 @@ ...@@ -103,20 +105,21 @@
* wLength: 0 * wLength: 0
* Data: None * Data: None
* The BaudDivisor values are calculated as follows: * The BaudDivisor values are calculated as follows:
* - BaseClock is either 12000000 or 48000000 depending on the device. FIXME: I wish * - BaseClock is either 12000000 or 48000000 depending on the device.
* I knew how to detect old chips to select proper base clock! * FIXME: I wish I knew how to detect old chips to select proper base clock!
* - BaudDivisor is a fixed point number encoded in a funny way. * - BaudDivisor is a fixed point number encoded in a funny way.
* (--WRONG WAY OF THINKING--) * (--WRONG WAY OF THINKING--)
* BaudDivisor is a fixed point number encoded with following bit weighs: * BaudDivisor is a fixed point number encoded with following bit weighs:
* (-2)(-1)(13..0). It is a radical with a denominator of 4, so values * (-2)(-1)(13..0). It is a radical with a denominator of 4, so values
* end with 0.0 (00...), 0.25 (10...), 0.5 (01...), and 0.75 (11...). * end with 0.0 (00...), 0.25 (10...), 0.5 (01...), and 0.75 (11...).
* (--THE REALITY--) * (--THE REALITY--)
* The both-bits-set has quite different meaning from 0.75 - the chip designers * The both-bits-set has quite different meaning from 0.75 - the chip
* have decided it to mean 0.125 instead of 0.75. * designers have decided it to mean 0.125 instead of 0.75.
* This info looked up in FTDI application note "FT8U232 DEVICES \ Data Rates * This info looked up in FTDI application note "FT8U232 DEVICES \ Data Rates
* and Flow Control Consideration for USB to RS232". * and Flow Control Consideration for USB to RS232".
* - BaudDivisor = (BaseClock / 16) / BaudRate, where the (=) operation should * - BaudDivisor = (BaseClock / 16) / BaudRate, where the (=) operation should
* automagically re-encode the resulting value to take fractions into consideration. * automagically re-encode the resulting value to take fractions into
* consideration.
* As all values are integers, some bit twiddling is in order: * As all values are integers, some bit twiddling is in order:
* BaudDivisor = (BaseClock / 16 / BaudRate) | * BaudDivisor = (BaseClock / 16 / BaudRate) |
* (((BaseClock / 2 / BaudRate) & 4) ? 0x4000 // 0.5 * (((BaseClock / 2 / BaudRate) & 4) ? 0x4000 // 0.5
...@@ -146,7 +149,7 @@ ...@@ -146,7 +149,7 @@
* not supported by the FT8U232AM). * not supported by the FT8U232AM).
*/ */
typedef enum { enum ftdi_chip_type {
SIO = 1, SIO = 1,
FT8U232AM = 2, FT8U232AM = 2,
FT232BM = 3, FT232BM = 3,
...@@ -154,9 +157,9 @@ typedef enum { ...@@ -154,9 +157,9 @@ typedef enum {
FT232RL = 5, FT232RL = 5,
FT2232H = 6, FT2232H = 6,
FT4232H = 7 FT4232H = 7
} ftdi_chip_type_t; };
typedef enum { enum ftdi_sio_baudrate {
ftdi_sio_b300 = 0, ftdi_sio_b300 = 0,
ftdi_sio_b600 = 1, ftdi_sio_b600 = 1,
ftdi_sio_b1200 = 2, ftdi_sio_b1200 = 2,
...@@ -167,13 +170,12 @@ typedef enum { ...@@ -167,13 +170,12 @@ typedef enum {
ftdi_sio_b38400 = 7, ftdi_sio_b38400 = 7,
ftdi_sio_b57600 = 8, ftdi_sio_b57600 = 8,
ftdi_sio_b115200 = 9 ftdi_sio_b115200 = 9
} FTDI_SIO_baudrate_t; };
/* /*
* The ftdi_8U232AM_xxMHz_byyy constants have been removed. The encoded divisor values * The ftdi_8U232AM_xxMHz_byyy constants have been removed. The encoded divisor
* are calculated internally. * values are calculated internally.
*/ */
#define FTDI_SIO_SET_DATA_REQUEST FTDI_SIO_SET_DATA #define FTDI_SIO_SET_DATA_REQUEST FTDI_SIO_SET_DATA
#define FTDI_SIO_SET_DATA_REQUEST_TYPE 0x40 #define FTDI_SIO_SET_DATA_REQUEST_TYPE 0x40
#define FTDI_SIO_SET_DATA_PARITY_NONE (0x0 << 8) #define FTDI_SIO_SET_DATA_PARITY_NONE (0x0 << 8)
...@@ -287,8 +289,8 @@ typedef enum { ...@@ -287,8 +289,8 @@ typedef enum {
* *
* A value of zero in the hIndex field disables handshaking * A value of zero in the hIndex field disables handshaking
* *
* If Xon/Xoff handshaking is specified, the hValue field should contain the XOFF character * If Xon/Xoff handshaking is specified, the hValue field should contain the
* and the lValue field contains the XON character. * XOFF character and the lValue field contains the XON character.
*/ */
/* /*
...@@ -373,7 +375,10 @@ typedef enum { ...@@ -373,7 +375,10 @@ typedef enum {
/* FTDI_SIO_SET_ERROR_CHAR */ /* FTDI_SIO_SET_ERROR_CHAR */
/* Set the parity error replacement character for the specified communications port */ /*
* Set the parity error replacement character for the specified communications
* port
*/
/* /*
* BmRequestType: 0100 0000b * BmRequestType: 0100 0000b
...@@ -496,9 +501,10 @@ typedef enum { ...@@ -496,9 +501,10 @@ typedef enum {
* *
* IN Endpoint * IN Endpoint
* *
* The device reserves the first two bytes of data on this endpoint to contain the current * The device reserves the first two bytes of data on this endpoint to contain
* values of the modem and line status registers. In the absence of data, the device * the current values of the modem and line status registers. In the absence of
* generates a message consisting of these two status bytes every 40 ms * data, the device generates a message consisting of these two status bytes
* every 40 ms
* *
* Byte 0: Modem Status * Byte 0: Modem Status
* *
...@@ -542,9 +548,9 @@ typedef enum { ...@@ -542,9 +548,9 @@ typedef enum {
/* /*
* OUT Endpoint * OUT Endpoint
* *
* This device reserves the first bytes of data on this endpoint contain the length * This device reserves the first bytes of data on this endpoint contain the
* and port identifier of the message. For the FTDI USB Serial converter the port * length and port identifier of the message. For the FTDI USB Serial converter
* identifier is always 1. * the port identifier is always 1.
* *
* Byte 0: Line Status * Byte 0: Line Status
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment