Lines Matching refs:serial

33 #include <linux/usb/serial.h>
34 #include <linux/serial.h>
47 #define DRIVER_DESC "USB ARK3116 serial/IrDA driver"
61 static int is_irda(struct usb_serial *serial)
63 struct usb_device *dev = serial->dev;
90 static int ark3116_write_reg(struct usb_serial *serial,
95 result = usb_control_msg(serial->dev,
96 usb_sndctrlpipe(serial->dev, 0),
102 static int ark3116_read_reg(struct usb_serial *serial,
107 result = usb_control_msg(serial->dev,
108 usb_rcvctrlpipe(serial->dev, 0),
127 static int ark3116_attach(struct usb_serial *serial)
129 struct usb_serial_port *port = serial->port[0];
133 if ((serial->num_bulk_in == 0) ||
134 (serial->num_bulk_out == 0) ||
135 (serial->num_interrupt_in == 0)) {
136 dev_err(&serial->dev->dev,
140 serial->num_bulk_in,
141 serial->num_bulk_out,
142 serial->num_interrupt_in);
155 priv->irda = is_irda(serial);
160 ark3116_write_reg(serial, UART_IER, 0);
162 ark3116_write_reg(serial, UART_FCR, 0);
165 ark3116_write_reg(serial, 0x8 , 0);
168 ark3116_write_reg(serial, UART_MCR, 0);
171 ark3116_write_reg(serial, 0xb , 0);
173 ark3116_write_reg(serial, 0xb , 1);
174 ark3116_write_reg(serial, 0xc , 0);
175 ark3116_write_reg(serial, 0xd , 0x41);
176 ark3116_write_reg(serial, 0xa , 1);
180 ark3116_write_reg(serial, UART_LCR, UART_LCR_DLAB);
184 ark3116_write_reg(serial, UART_DLL, priv->quot & 0xff);
185 ark3116_write_reg(serial, UART_DLM, (priv->quot>>8) & 0xff);
188 ark3116_write_reg(serial, UART_LCR, UART_LCR_WLEN8);
190 ark3116_write_reg(serial, 0xe, 0);
193 ark3116_write_reg(serial, 0x9, 0);
195 dev_info(&serial->dev->dev,
202 static void ark3116_release(struct usb_serial *serial)
204 struct usb_serial_port *port = serial->port[0];
230 struct usb_serial *serial = port->serial;
301 ark3116_write_reg(serial, 0x8, hcr);
312 ark3116_write_reg(serial, UART_FCR, 0);
314 ark3116_write_reg(serial, UART_LCR,
316 ark3116_write_reg(serial, UART_DLL, quot & 0xff);
317 ark3116_write_reg(serial, UART_DLM, (quot>>8) & 0xff);
320 ark3116_write_reg(serial, UART_LCR, lcr);
324 ark3116_write_reg(serial, 0xe, eval);
327 ark3116_write_reg(serial, UART_FCR, UART_FCR_DMA_SELECT);
330 ark3116_write_reg(serial, UART_LCR, lcr);
337 dev_warn(&serial->dev->dev,
349 struct usb_serial *serial = port->serial;
351 if (serial->dev) {
353 ark3116_write_reg(serial, UART_FCR, 0);
356 ark3116_write_reg(serial, UART_IER, 0);
359 if (serial->num_interrupt_in)
368 struct usb_serial *serial = port->serial;
384 ark3116_read_reg(serial, UART_RX, buf);
387 priv->msr = ark3116_read_reg(serial, UART_MSR, buf);
389 priv->lsr = ark3116_read_reg(serial, UART_LSR, buf);
400 ark3116_write_reg(port->serial, UART_IER, UART_IER_MSI|UART_IER_RLSI);
403 ark3116_write_reg(port->serial, UART_FCR, UART_FCR_DMA_SELECT);
447 serstruct.line = port->serial->minor;
543 ark3116_write_reg(port->serial, UART_MCR, priv->mcr);
563 ark3116_write_reg(port->serial, UART_LCR, priv->lcr);