Lines Matching refs:tdev

342 static int ti_command_out_sync(struct ti_device *tdev, __u8 command,
344 static int ti_command_in_sync(struct ti_device *tdev, __u8 command,
347 static int ti_write_byte(struct usb_serial_port *port, struct ti_device *tdev,
350 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
782 tdev = usb_get_serial_data(port->serial); in ti_close()
796 status = ti_command_out_sync(tdev, TI_CLOSE_PORT, in ti_close()
804 do_unlock = !mutex_lock_interruptible(&tdev->td_open_close_lock); in ti_close()
812 mutex_unlock(&tdev->td_open_close_lock); in ti_close()
1132 struct ti_device *tdev = urb->context; in ti_interrupt_callback() local
1134 struct usb_serial *serial = tdev->td_serial; in ti_interrupt_callback()
1391 struct ti_device *tdev = tport->tp_tdev; in ti_get_lsr() local
1401 status = ti_command_in_sync(tdev, TI_GET_PORT_STATUS, in ti_get_lsr()
1537 static int ti_command_out_sync(struct ti_device *tdev, __u8 command, in ti_command_out_sync() argument
1542 status = usb_control_msg(tdev->td_serial->dev, in ti_command_out_sync()
1543 usb_sndctrlpipe(tdev->td_serial->dev, 0), command, in ti_command_out_sync()
1554 static int ti_command_in_sync(struct ti_device *tdev, __u8 command, in ti_command_in_sync() argument
1559 status = usb_control_msg(tdev->td_serial->dev, in ti_command_in_sync()
1560 usb_rcvctrlpipe(tdev->td_serial->dev, 0), command, in ti_command_in_sync()
1574 struct ti_device *tdev, unsigned long addr, in ti_write_byte() argument
1597 status = ti_command_out_sync(tdev, TI_WRITE_DATA, TI_RAM_PORT, 0, in ti_write_byte()
1636 static int ti_download_firmware(struct ti_device *tdev) in ti_download_firmware() argument
1641 struct usb_device *dev = tdev->td_serial->dev; in ti_download_firmware()
1643 tdev->td_serial->port[0]->bulk_out_endpointAddress); in ti_download_firmware()
1687 if (tdev->td_is_3410) in ti_download_firmware()