Lines Matching refs:tdev

128 static int ti_command_out_sync(struct ti_device *tdev, __u8 command,
130 static int ti_command_in_sync(struct ti_device *tdev, __u8 command,
133 static int ti_write_byte(struct usb_serial_port *port, struct ti_device *tdev,
136 static int ti_download_firmware(struct ti_device *tdev);
293 struct ti_device *tdev; in ti_startup() local
304 tdev = kzalloc(sizeof(struct ti_device), GFP_KERNEL); in ti_startup()
305 if (!tdev) in ti_startup()
308 mutex_init(&tdev->td_open_close_lock); in ti_startup()
309 tdev->td_serial = serial; in ti_startup()
310 usb_set_serial_data(serial, tdev); in ti_startup()
314 tdev->td_is_3410 = 1; in ti_startup()
316 tdev->td_is_3410 ? "3410" : "5052"); in ti_startup()
320 status = ti_download_firmware(tdev); in ti_startup()
326 if (tdev->td_is_3410) { in ti_startup()
345 kfree(tdev); in ti_startup()
353 struct ti_device *tdev = usb_get_serial_data(serial); in ti_release() local
355 kfree(tdev); in ti_release()
396 struct ti_device *tdev; in ti_open() local
409 tdev = tport->tp_tdev; in ti_open()
412 if (mutex_lock_interruptible(&tdev->td_open_close_lock)) in ti_open()
421 if (tdev->td_open_port_count == 0) { in ti_open()
423 urb = tdev->td_serial->port[0]->interrupt_in_urb; in ti_open()
429 urb->context = tdev; in ti_open()
441 status = ti_command_out_sync(tdev, TI_OPEN_PORT, in ti_open()
450 status = ti_command_out_sync(tdev, TI_START_PORT, in ti_open()
459 status = ti_command_out_sync(tdev, TI_PURGE_PORT, in ti_open()
466 status = ti_command_out_sync(tdev, TI_PURGE_PORT, in ti_open()
483 status = ti_command_out_sync(tdev, TI_OPEN_PORT, in ti_open()
492 status = ti_command_out_sync(tdev, TI_START_PORT, in ti_open()
518 ++tdev->td_open_port_count; in ti_open()
523 if (tdev->td_open_port_count == 0) in ti_open()
526 mutex_unlock(&tdev->td_open_close_lock); in ti_open()
534 struct ti_device *tdev; in ti_close() local
541 tdev = usb_get_serial_data(port->serial); in ti_close()
543 if (tdev == NULL || tport == NULL) in ti_close()
558 status = ti_command_out_sync(tdev, TI_CLOSE_PORT, in ti_close()
566 do_unlock = !mutex_lock_interruptible(&tdev->td_open_close_lock); in ti_close()
574 mutex_unlock(&tdev->td_open_close_lock); in ti_close()
923 struct ti_device *tdev = urb->context; in ti_interrupt_callback() local
925 struct usb_serial *serial = tdev->td_serial; in ti_interrupt_callback()
943 tdev->td_urb_error = 1; in ti_interrupt_callback()
947 tdev->td_urb_error = 1; in ti_interrupt_callback()
1187 struct ti_device *tdev = tport->tp_tdev; in ti_get_lsr() local
1197 status = ti_command_in_sync(tdev, TI_GET_PORT_STATUS, in ti_get_lsr()
1338 static int ti_command_out_sync(struct ti_device *tdev, __u8 command, in ti_command_out_sync() argument
1343 status = usb_control_msg(tdev->td_serial->dev, in ti_command_out_sync()
1344 usb_sndctrlpipe(tdev->td_serial->dev, 0), command, in ti_command_out_sync()
1358 static int ti_command_in_sync(struct ti_device *tdev, __u8 command, in ti_command_in_sync() argument
1363 status = usb_control_msg(tdev->td_serial->dev, in ti_command_in_sync()
1364 usb_rcvctrlpipe(tdev->td_serial->dev, 0), command, in ti_command_in_sync()
1379 struct ti_device *tdev, unsigned long addr, in ti_write_byte() argument
1402 status = ti_command_out_sync(tdev, TI_WRITE_DATA, TI_RAM_PORT, 0, in ti_write_byte()
1442 static int ti_download_firmware(struct ti_device *tdev) in ti_download_firmware() argument
1447 struct usb_device *dev = tdev->td_serial->dev; in ti_download_firmware()
1449 tdev->td_serial->port[0]->bulk_out_endpointAddress); in ti_download_firmware()
1483 if (tdev->td_is_3410) in ti_download_firmware()