Commit 556f1a0e authored by Bill Pemberton's avatar Bill Pemberton Committed by Greg Kroah-Hartman

USB: ssu100: add register parameter to ssu100_setregister

The function ssu100_setregister was hard coded to only set the MCR
register.  Add a register parameter so that other registers can be
set.
Signed-off-by: default avatarBill Pemberton <wfp5p@virginia.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 79f203a2
...@@ -127,9 +127,10 @@ static inline int ssu100_getregister(struct usb_device *dev, ...@@ -127,9 +127,10 @@ static inline int ssu100_getregister(struct usb_device *dev,
static inline int ssu100_setregister(struct usb_device *dev, static inline int ssu100_setregister(struct usb_device *dev,
unsigned short uart, unsigned short uart,
unsigned short reg,
u16 data) u16 data)
{ {
u16 value = (data << 8) | UART_MCR; u16 value = (data << 8) | reg;
return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
QT_SET_GET_REGISTER, 0x40, value, uart, QT_SET_GET_REGISTER, 0x40, value, uart,
...@@ -159,7 +160,7 @@ static inline int update_mctrl(struct usb_device *dev, unsigned int set, ...@@ -159,7 +160,7 @@ static inline int update_mctrl(struct usb_device *dev, unsigned int set,
if (set & TIOCM_RTS) if (set & TIOCM_RTS)
urb_value |= UART_MCR_RTS; urb_value |= UART_MCR_RTS;
result = ssu100_setregister(dev, 0, urb_value); result = ssu100_setregister(dev, 0, UART_MCR, urb_value);
if (result < 0) if (result < 0)
dbg("%s Error from MODEM_CTRL urb", __func__); dbg("%s Error from MODEM_CTRL urb", __func__);
...@@ -529,7 +530,7 @@ static void ssu100_dtr_rts(struct usb_serial_port *port, int on) ...@@ -529,7 +530,7 @@ static void ssu100_dtr_rts(struct usb_serial_port *port, int on)
if (!port->serial->disconnected) { if (!port->serial->disconnected) {
/* Disable flow control */ /* Disable flow control */
if (!on && if (!on &&
ssu100_setregister(dev, 0, 0) < 0) ssu100_setregister(dev, 0, UART_MCR, 0) < 0)
dev_err(&port->dev, "error from flowcontrol urb\n"); dev_err(&port->dev, "error from flowcontrol urb\n");
/* drop RTS and DTR */ /* drop RTS and DTR */
if (on) if (on)
......
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