Lines Matching refs:tdev

340 static int ti_command_out_sync(struct ti_device *tdev, __u8 command,
342 static int ti_command_in_sync(struct ti_device *tdev, __u8 command,
345 static int ti_write_byte(struct usb_serial_port *port, struct ti_device *tdev,
348 static int ti_download_firmware(struct ti_device *tdev);
515 struct ti_device *tdev; in ti_startup() local
528 tdev = kzalloc(sizeof(struct ti_device), GFP_KERNEL); in ti_startup()
529 if (!tdev) in ti_startup()
532 mutex_init(&tdev->td_open_close_lock); in ti_startup()
533 tdev->td_serial = serial; in ti_startup()
534 usb_set_serial_data(serial, tdev); in ti_startup()
538 tdev->td_is_3410 = 1; in ti_startup()
540 tdev->td_is_3410 ? "3410" : "5052"); in ti_startup()
548 tdev->td_rs485_only = true; in ti_startup()
558 status = ti_download_firmware(tdev); in ti_startup()
564 if (tdev->td_is_3410) { in ti_startup()
590 kfree(tdev); in ti_startup()
598 struct ti_device *tdev = usb_get_serial_data(serial); in ti_release() local
600 kfree(tdev); in ti_release()
645 struct ti_device *tdev; in ti_open() local
657 tdev = tport->tp_tdev; in ti_open()
660 if (mutex_lock_interruptible(&tdev->td_open_close_lock)) in ti_open()
669 if (tdev->td_open_port_count == 0) { in ti_open()
671 urb = tdev->td_serial->port[0]->interrupt_in_urb; in ti_open()
677 urb->context = tdev; in ti_open()
688 status = ti_command_out_sync(tdev, TI_OPEN_PORT, in ti_open()
696 status = ti_command_out_sync(tdev, TI_START_PORT, in ti_open()
704 status = ti_command_out_sync(tdev, TI_PURGE_PORT, in ti_open()
711 status = ti_command_out_sync(tdev, TI_PURGE_PORT, in ti_open()
727 status = ti_command_out_sync(tdev, TI_OPEN_PORT, in ti_open()
735 status = ti_command_out_sync(tdev, TI_START_PORT, in ti_open()
760 ++tdev->td_open_port_count; in ti_open()
765 if (tdev->td_open_port_count == 0) in ti_open()
768 mutex_unlock(&tdev->td_open_close_lock); in ti_open()
775 struct ti_device *tdev; in ti_close() local
781 tdev = usb_get_serial_data(port->serial); in ti_close()
795 status = ti_command_out_sync(tdev, TI_CLOSE_PORT, in ti_close()
802 mutex_lock(&tdev->td_open_close_lock); in ti_close()
803 --tdev->td_open_port_count; in ti_close()
804 if (tdev->td_open_port_count == 0) { in ti_close()
808 mutex_unlock(&tdev->td_open_close_lock); in ti_close()
1110 struct ti_device *tdev = urb->context; in ti_interrupt_callback() local
1112 struct usb_serial *serial = tdev->td_serial; in ti_interrupt_callback()
1369 struct ti_device *tdev = tport->tp_tdev; in ti_get_lsr() local
1379 status = ti_command_in_sync(tdev, TI_GET_PORT_STATUS, in ti_get_lsr()
1507 static int ti_command_out_sync(struct ti_device *tdev, __u8 command, in ti_command_out_sync() argument
1512 status = usb_control_msg(tdev->td_serial->dev, in ti_command_out_sync()
1513 usb_sndctrlpipe(tdev->td_serial->dev, 0), command, in ti_command_out_sync()
1524 static int ti_command_in_sync(struct ti_device *tdev, __u8 command, in ti_command_in_sync() argument
1529 status = usb_control_msg(tdev->td_serial->dev, in ti_command_in_sync()
1530 usb_rcvctrlpipe(tdev->td_serial->dev, 0), command, in ti_command_in_sync()
1544 struct ti_device *tdev, unsigned long addr, in ti_write_byte() argument
1567 status = ti_command_out_sync(tdev, TI_WRITE_DATA, TI_RAM_PORT, 0, in ti_write_byte()
1606 static int ti_download_firmware(struct ti_device *tdev) in ti_download_firmware() argument
1611 struct usb_device *dev = tdev->td_serial->dev; in ti_download_firmware()
1613 tdev->td_serial->port[0]->bulk_out_endpointAddress); in ti_download_firmware()
1657 if (tdev->td_is_3410) in ti_download_firmware()