diff options
Diffstat (limited to 'drivers/usb/serial/ssu100.c')
-rw-r--r-- | drivers/usb/serial/ssu100.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c index cf2d30cf7588..015810b3785b 100644 --- a/drivers/usb/serial/ssu100.c +++ b/drivers/usb/serial/ssu100.c | |||
@@ -46,8 +46,6 @@ | |||
46 | #define FULLPWRBIT 0x00000080 | 46 | #define FULLPWRBIT 0x00000080 |
47 | #define NEXT_BOARD_POWER_BIT 0x00000004 | 47 | #define NEXT_BOARD_POWER_BIT 0x00000004 |
48 | 48 | ||
49 | static bool debug; | ||
50 | |||
51 | /* Version Information */ | 49 | /* Version Information */ |
52 | #define DRIVER_VERSION "v0.1" | 50 | #define DRIVER_VERSION "v0.1" |
53 | #define DRIVER_DESC "Quatech SSU-100 USB to Serial Driver" | 51 | #define DRIVER_DESC "Quatech SSU-100 USB to Serial Driver" |
@@ -135,7 +133,7 @@ static inline int update_mctrl(struct usb_device *dev, unsigned int set, | |||
135 | int result; | 133 | int result; |
136 | 134 | ||
137 | if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { | 135 | if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { |
138 | dbg("%s - DTR|RTS not being set|cleared", __func__); | 136 | dev_dbg(&dev->dev, "%s - DTR|RTS not being set|cleared\n", __func__); |
139 | return 0; /* no change */ | 137 | return 0; /* no change */ |
140 | } | 138 | } |
141 | 139 | ||
@@ -148,7 +146,7 @@ static inline int update_mctrl(struct usb_device *dev, unsigned int set, | |||
148 | 146 | ||
149 | result = ssu100_setregister(dev, 0, UART_MCR, urb_value); | 147 | result = ssu100_setregister(dev, 0, UART_MCR, urb_value); |
150 | if (result < 0) | 148 | if (result < 0) |
151 | dbg("%s Error from MODEM_CTRL urb", __func__); | 149 | dev_dbg(&dev->dev, "%s Error from MODEM_CTRL urb\n", __func__); |
152 | 150 | ||
153 | return result; | 151 | return result; |
154 | } | 152 | } |
@@ -164,7 +162,7 @@ static int ssu100_initdevice(struct usb_device *dev) | |||
164 | 162 | ||
165 | result = ssu100_getdevice(dev, data); | 163 | result = ssu100_getdevice(dev, data); |
166 | if (result < 0) { | 164 | if (result < 0) { |
167 | dbg("%s - get_device failed %i", __func__, result); | 165 | dev_dbg(&dev->dev, "%s - get_device failed %i\n", __func__, result); |
168 | goto out; | 166 | goto out; |
169 | } | 167 | } |
170 | 168 | ||
@@ -172,25 +170,25 @@ static int ssu100_initdevice(struct usb_device *dev) | |||
172 | 170 | ||
173 | result = ssu100_setdevice(dev, data); | 171 | result = ssu100_setdevice(dev, data); |
174 | if (result < 0) { | 172 | if (result < 0) { |
175 | dbg("%s - setdevice failed %i", __func__, result); | 173 | dev_dbg(&dev->dev, "%s - setdevice failed %i\n", __func__, result); |
176 | goto out; | 174 | goto out; |
177 | } | 175 | } |
178 | 176 | ||
179 | result = ssu100_control_msg(dev, QT_GET_SET_PREBUF_TRIG_LVL, 128, 0); | 177 | result = ssu100_control_msg(dev, QT_GET_SET_PREBUF_TRIG_LVL, 128, 0); |
180 | if (result < 0) { | 178 | if (result < 0) { |
181 | dbg("%s - set prebuffer level failed %i", __func__, result); | 179 | dev_dbg(&dev->dev, "%s - set prebuffer level failed %i\n", __func__, result); |
182 | goto out; | 180 | goto out; |
183 | } | 181 | } |
184 | 182 | ||
185 | result = ssu100_control_msg(dev, QT_SET_ATF, ATC_DISABLED, 0); | 183 | result = ssu100_control_msg(dev, QT_SET_ATF, ATC_DISABLED, 0); |
186 | if (result < 0) { | 184 | if (result < 0) { |
187 | dbg("%s - set ATFprebuffer level failed %i", __func__, result); | 185 | dev_dbg(&dev->dev, "%s - set ATFprebuffer level failed %i\n", __func__, result); |
188 | goto out; | 186 | goto out; |
189 | } | 187 | } |
190 | 188 | ||
191 | result = ssu100_getdevice(dev, data); | 189 | result = ssu100_getdevice(dev, data); |
192 | if (result < 0) { | 190 | if (result < 0) { |
193 | dbg("%s - get_device failed %i", __func__, result); | 191 | dev_dbg(&dev->dev, "%s - get_device failed %i\n", __func__, result); |
194 | goto out; | 192 | goto out; |
195 | } | 193 | } |
196 | 194 | ||
@@ -201,7 +199,7 @@ static int ssu100_initdevice(struct usb_device *dev) | |||
201 | 199 | ||
202 | result = ssu100_setdevice(dev, data); | 200 | result = ssu100_setdevice(dev, data); |
203 | if (result < 0) { | 201 | if (result < 0) { |
204 | dbg("%s - setdevice failed %i", __func__, result); | 202 | dev_dbg(&dev->dev, "%s - setdevice failed %i\n", __func__, result); |
205 | goto out; | 203 | goto out; |
206 | } | 204 | } |
207 | 205 | ||
@@ -249,7 +247,7 @@ static void ssu100_set_termios(struct tty_struct *tty, | |||
249 | if (!baud) | 247 | if (!baud) |
250 | baud = 9600; | 248 | baud = 9600; |
251 | 249 | ||
252 | dbg("%s - got baud = %d\n", __func__, baud); | 250 | dev_dbg(&port->dev, "%s - got baud = %d\n", __func__, baud); |
253 | 251 | ||
254 | 252 | ||
255 | divisor = MAX_BAUD_RATE / baud; | 253 | divisor = MAX_BAUD_RATE / baud; |
@@ -261,7 +259,7 @@ static void ssu100_set_termios(struct tty_struct *tty, | |||
261 | 259 | ||
262 | result = ssu100_control_msg(dev, QT_GET_SET_UART, divisor, urb_value); | 260 | result = ssu100_control_msg(dev, QT_GET_SET_UART, divisor, urb_value); |
263 | if (result < 0) | 261 | if (result < 0) |
264 | dbg("%s - set uart failed", __func__); | 262 | dev_dbg(&port->dev, "%s - set uart failed\n", __func__); |
265 | 263 | ||
266 | if (cflag & CRTSCTS) | 264 | if (cflag & CRTSCTS) |
267 | result = ssu100_control_msg(dev, QT_HW_FLOW_CONTROL_MASK, | 265 | result = ssu100_control_msg(dev, QT_HW_FLOW_CONTROL_MASK, |
@@ -270,7 +268,7 @@ static void ssu100_set_termios(struct tty_struct *tty, | |||
270 | result = ssu100_control_msg(dev, QT_HW_FLOW_CONTROL_MASK, | 268 | result = ssu100_control_msg(dev, QT_HW_FLOW_CONTROL_MASK, |
271 | 0, 0); | 269 | 0, 0); |
272 | if (result < 0) | 270 | if (result < 0) |
273 | dbg("%s - set HW flow control failed", __func__); | 271 | dev_dbg(&port->dev, "%s - set HW flow control failed\n", __func__); |
274 | 272 | ||
275 | if (I_IXOFF(tty) || I_IXON(tty)) { | 273 | if (I_IXOFF(tty) || I_IXON(tty)) { |
276 | u16 x = ((u16)(START_CHAR(tty) << 8) | (u16)(STOP_CHAR(tty))); | 274 | u16 x = ((u16)(START_CHAR(tty) << 8) | (u16)(STOP_CHAR(tty))); |
@@ -282,7 +280,7 @@ static void ssu100_set_termios(struct tty_struct *tty, | |||
282 | 0, 0); | 280 | 0, 0); |
283 | 281 | ||
284 | if (result < 0) | 282 | if (result < 0) |
285 | dbg("%s - set SW flow control failed", __func__); | 283 | dev_dbg(&port->dev, "%s - set SW flow control failed\n", __func__); |
286 | 284 | ||
287 | } | 285 | } |
288 | 286 | ||
@@ -304,7 +302,7 @@ static int ssu100_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
304 | QT_TRANSFER_IN, 0x01, | 302 | QT_TRANSFER_IN, 0x01, |
305 | 0, data, 2, 300); | 303 | 0, data, 2, 300); |
306 | if (result < 0) { | 304 | if (result < 0) { |
307 | dbg("%s - open failed %i", __func__, result); | 305 | dev_dbg(&port->dev, "%s - open failed %i\n", __func__, result); |
308 | kfree(data); | 306 | kfree(data); |
309 | return result; | 307 | return result; |
310 | } | 308 | } |
@@ -319,7 +317,7 @@ static int ssu100_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
319 | /* set to 9600 */ | 317 | /* set to 9600 */ |
320 | result = ssu100_control_msg(dev, QT_GET_SET_UART, 0x30, 0x0300); | 318 | result = ssu100_control_msg(dev, QT_GET_SET_UART, 0x30, 0x0300); |
321 | if (result < 0) | 319 | if (result < 0) |
322 | dbg("%s - set uart failed", __func__); | 320 | dev_dbg(&port->dev, "%s - set uart failed\n", __func__); |
323 | 321 | ||
324 | if (tty) | 322 | if (tty) |
325 | ssu100_set_termios(tty, port, &tty->termios); | 323 | ssu100_set_termios(tty, port, &tty->termios); |
@@ -423,7 +421,7 @@ static int ssu100_ioctl(struct tty_struct *tty, | |||
423 | { | 421 | { |
424 | struct usb_serial_port *port = tty->driver_data; | 422 | struct usb_serial_port *port = tty->driver_data; |
425 | 423 | ||
426 | dbg("%s cmd 0x%04x", __func__, cmd); | 424 | dev_dbg(&port->dev, "%s cmd 0x%04x\n", __func__, cmd); |
427 | 425 | ||
428 | switch (cmd) { | 426 | switch (cmd) { |
429 | case TIOCGSERIAL: | 427 | case TIOCGSERIAL: |
@@ -437,7 +435,7 @@ static int ssu100_ioctl(struct tty_struct *tty, | |||
437 | break; | 435 | break; |
438 | } | 436 | } |
439 | 437 | ||
440 | dbg("%s arg not supported", __func__); | 438 | dev_dbg(&port->dev, "%s arg not supported\n", __func__); |
441 | 439 | ||
442 | return -ENOIOCTLCMD; | 440 | return -ENOIOCTLCMD; |
443 | } | 441 | } |
@@ -668,6 +666,3 @@ module_usb_serial_driver(serial_drivers, id_table); | |||
668 | 666 | ||
669 | MODULE_DESCRIPTION(DRIVER_DESC); | 667 | MODULE_DESCRIPTION(DRIVER_DESC); |
670 | MODULE_LICENSE("GPL"); | 668 | MODULE_LICENSE("GPL"); |
671 | |||
672 | module_param(debug, bool, S_IRUGO | S_IWUSR); | ||
673 | MODULE_PARM_DESC(debug, "Debug enabled or not"); | ||