Lines Matching refs:hcd
337 hcd_to_max3421(struct usb_hcd *hcd) in hcd_to_max3421() argument
339 return (struct max3421_hcd *) hcd->hcd_priv; in hcd_to_max3421()
349 spi_rd8(struct usb_hcd *hcd, unsigned int reg) in spi_rd8() argument
351 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in spi_rd8()
352 struct spi_device *spi = to_spi_device(hcd->self.controller); in spi_rd8()
375 spi_wr8(struct usb_hcd *hcd, unsigned int reg, u8 val) in spi_wr8() argument
377 struct spi_device *spi = to_spi_device(hcd->self.controller); in spi_wr8()
378 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in spi_wr8()
399 spi_rd_buf(struct usb_hcd *hcd, unsigned int reg, void *buf, size_t len) in spi_rd_buf() argument
401 struct spi_device *spi = to_spi_device(hcd->self.controller); in spi_rd_buf()
402 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in spi_rd_buf()
425 spi_wr_buf(struct usb_hcd *hcd, unsigned int reg, void *buf, size_t len) in spi_wr_buf() argument
427 struct spi_device *spi = to_spi_device(hcd->self.controller); in spi_wr_buf()
428 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in spi_wr_buf()
465 max3421_set_speed(struct usb_hcd *hcd, struct usb_device *dev) in max3421_set_speed() argument
467 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_set_speed()
482 spi_wr8(hcd, MAX3421_REG_MODE, max3421_hcd->mode); in max3421_set_speed()
491 max3421_set_address(struct usb_hcd *hcd, struct usb_device *dev, int epnum, in max3421_set_address() argument
494 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_set_address()
508 u8 hrsl = spi_rd8(hcd, MAX3421_REG_HRSL); in max3421_set_address()
524 spi_wr8(hcd, MAX3421_REG_HCTL, hctl); in max3421_set_address()
532 spi_wr8(hcd, MAX3421_REG_PERADDR, dev->devnum); in max3421_set_address()
536 max3421_ctrl_setup(struct usb_hcd *hcd, struct urb *urb) in max3421_ctrl_setup() argument
538 spi_wr_buf(hcd, MAX3421_REG_SUDFIFO, urb->setup_packet, 8); in max3421_ctrl_setup()
543 max3421_transfer_in(struct usb_hcd *hcd, struct urb *urb) in max3421_transfer_in() argument
545 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_transfer_in()
554 max3421_transfer_out(struct usb_hcd *hcd, struct urb *urb, int fast_retransmit) in max3421_transfer_out() argument
556 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_transfer_out()
557 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_transfer_out()
567 spi_wr8(hcd, MAX3421_REG_SNDBC, 0); in max3421_transfer_out()
568 spi_wr8(hcd, MAX3421_REG_SNDFIFO, ((u8 *) src)[0]); in max3421_transfer_out()
569 spi_wr8(hcd, MAX3421_REG_SNDBC, max3421_hcd->curr_len); in max3421_transfer_out()
590 spi_wr_buf(hcd, MAX3421_REG_SNDFIFO, src, max3421_hcd->curr_len); in max3421_transfer_out()
591 spi_wr8(hcd, MAX3421_REG_SNDBC, max3421_hcd->curr_len); in max3421_transfer_out()
600 max3421_next_transfer(struct usb_hcd *hcd, int fast_retransmit) in max3421_next_transfer() argument
602 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_next_transfer()
614 cmd = max3421_ctrl_setup(hcd, urb); in max3421_next_transfer()
619 cmd = max3421_transfer_in(hcd, urb); in max3421_next_transfer()
621 cmd = max3421_transfer_out(hcd, urb, fast_retransmit); in max3421_next_transfer()
641 spi_wr8(hcd, MAX3421_REG_HXFR, cmd); in max3421_next_transfer()
660 max3421_select_and_start_urb(struct usb_hcd *hcd) in max3421_select_and_start_urb() argument
662 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_select_and_start_urb()
663 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_select_and_start_urb()
784 max3421_set_address(hcd, urb->dev, epnum, force_toggles); in max3421_select_and_start_urb()
785 max3421_set_speed(hcd, urb->dev); in max3421_select_and_start_urb()
786 max3421_next_transfer(hcd, 0); in max3421_select_and_start_urb()
796 max3421_check_unlink(struct usb_hcd *hcd) in max3421_check_unlink() argument
798 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_check_unlink()
799 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_check_unlink()
814 usb_hcd_unlink_urb_from_ep(hcd, urb); in max3421_check_unlink()
817 usb_hcd_giveback_urb(hcd, urb, 0); in max3421_check_unlink()
830 max3421_slow_retransmit(struct usb_hcd *hcd) in max3421_slow_retransmit() argument
832 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_slow_retransmit()
845 max3421_recv_data_available(struct usb_hcd *hcd) in max3421_recv_data_available() argument
847 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_recv_data_available()
852 rcvbc = spi_rd8(hcd, MAX3421_REG_RCVBC); in max3421_recv_data_available()
866 spi_rd_buf(hcd, MAX3421_REG_RCVFIFO, dst, transfer_size); in max3421_recv_data_available()
872 spi_wr8(hcd, MAX3421_REG_HIRQ, BIT(MAX3421_HI_RCVDAV_BIT)); in max3421_recv_data_available()
876 max3421_handle_error(struct usb_hcd *hcd, u8 hrsl) in max3421_handle_error() argument
878 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_handle_error()
879 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_handle_error()
921 spi_wr8(hcd, MAX3421_REG_HCTL, in max3421_handle_error()
933 max3421_slow_retransmit(hcd); in max3421_handle_error()
954 max3421_next_transfer(hcd, 1); in max3421_handle_error()
957 max3421_slow_retransmit(hcd); in max3421_handle_error()
961 spi_wr8(hcd, MAX3421_REG_SNDBC, 0); in max3421_handle_error()
968 max3421_transfer_in_done(struct usb_hcd *hcd, struct urb *urb) in max3421_transfer_in_done() argument
970 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_transfer_in_done()
971 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_transfer_in_done()
1012 max3421_transfer_out_done(struct usb_hcd *hcd, struct urb *urb) in max3421_transfer_out_done() argument
1014 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_transfer_out_done()
1039 max3421_host_transfer_done(struct usb_hcd *hcd) in max3421_host_transfer_done() argument
1041 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_host_transfer_done()
1050 hrsl = spi_rd8(hcd, MAX3421_REG_HRSL); in max3421_host_transfer_done()
1060 max3421_handle_error(hcd, hrsl); in max3421_host_transfer_done()
1077 urb_done = max3421_transfer_in_done(hcd, urb); in max3421_host_transfer_done()
1079 urb_done = max3421_transfer_out_done(hcd, urb); in max3421_host_transfer_done()
1098 max3421_next_transfer(hcd, 0); in max3421_host_transfer_done()
1105 max3421_detect_conn(struct usb_hcd *hcd) in max3421_detect_conn() argument
1107 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_detect_conn()
1113 hrsl = spi_rd8(hcd, MAX3421_REG_HRSL); in max3421_detect_conn()
1144 spi_wr8(hcd, MAX3421_REG_MODE, max3421_hcd->mode); in max3421_detect_conn()
1164 struct usb_hcd *hcd = dev_id; in max3421_irq_handler() local
1165 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_irq_handler()
1166 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_irq_handler()
1179 dump_eps(struct usb_hcd *hcd) in dump_eps() argument
1181 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in dump_eps()
1220 max3421_handle_irqs(struct usb_hcd *hcd) in max3421_handle_irqs() argument
1222 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_handle_irqs()
1232 hirq = spi_rd8(hcd, MAX3421_REG_HIRQ); in max3421_handle_irqs()
1237 spi_wr8(hcd, MAX3421_REG_HIRQ, in max3421_handle_irqs()
1248 max3421_recv_data_available(hcd); in max3421_handle_irqs()
1251 max3421_host_transfer_done(hcd); in max3421_handle_irqs()
1254 max3421_detect_conn(hcd); in max3421_handle_irqs()
1305 dump_eps(hcd); in max3421_handle_irqs()
1313 max3421_reset_hcd(struct usb_hcd *hcd) in max3421_reset_hcd() argument
1315 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_reset_hcd()
1316 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_reset_hcd()
1320 spi_wr8(hcd, MAX3421_REG_USBCTL, BIT(MAX3421_USBCTL_CHIPRES_BIT)); in max3421_reset_hcd()
1322 spi_wr8(hcd, MAX3421_REG_USBCTL, 0); in max3421_reset_hcd()
1325 if (spi_rd8(hcd, MAX3421_REG_USBIRQ) in max3421_reset_hcd()
1344 spi_wr8(hcd, MAX3421_REG_MODE, max3421_hcd->mode); in max3421_reset_hcd()
1348 spi_wr8(hcd, MAX3421_REG_HCTL, BIT(MAX3421_HCTL_FRMRST_BIT)); in max3421_reset_hcd()
1351 spi_wr8(hcd, MAX3421_REG_HCTL, BIT(MAX3421_HCTL_SAMPLEBUS_BIT)); in max3421_reset_hcd()
1352 max3421_detect_conn(hcd); in max3421_reset_hcd()
1358 spi_wr8(hcd, MAX3421_REG_HIEN, max3421_hcd->hien); in max3421_reset_hcd()
1361 spi_wr8(hcd, MAX3421_REG_CPUCTL, BIT(MAX3421_CPUCTL_IE_BIT)); in max3421_reset_hcd()
1366 max3421_urb_done(struct usb_hcd *hcd) in max3421_urb_done() argument
1368 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_urb_done()
1381 usb_hcd_unlink_urb_from_ep(hcd, urb); in max3421_urb_done()
1385 usb_hcd_giveback_urb(hcd, urb, status); in max3421_urb_done()
1393 struct usb_hcd *hcd = dev_id; in max3421_spi_thread() local
1394 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_spi_thread()
1395 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_spi_thread()
1399 spi_wr8(hcd, MAX3421_REG_PINCTL, in max3421_spi_thread()
1404 max3421_hcd->rev = spi_rd8(hcd, MAX3421_REG_REVISION); in max3421_spi_thread()
1421 spi_wr8(hcd, MAX3421_REG_HIEN, max3421_hcd->hien); in max3421_spi_thread()
1433 i_worked |= max3421_urb_done(hcd); in max3421_spi_thread()
1434 else if (max3421_handle_irqs(hcd)) in max3421_spi_thread()
1437 i_worked |= max3421_select_and_start_urb(hcd); in max3421_spi_thread()
1441 i_worked |= max3421_reset_hcd(hcd); in max3421_spi_thread()
1444 spi_wr8(hcd, MAX3421_REG_HCTL, in max3421_spi_thread()
1449 i_worked |= max3421_check_unlink(hcd); in max3421_spi_thread()
1456 u8 val = spi_rd8(hcd, MAX3421_REG_IOPINS1); in max3421_spi_thread()
1460 spi_wr8(hcd, MAX3421_REG_IOPINS1 + i, val); in max3421_spi_thread()
1472 max3421_reset_port(struct usb_hcd *hcd) in max3421_reset_port() argument
1474 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_reset_port()
1485 max3421_reset(struct usb_hcd *hcd) in max3421_reset() argument
1487 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_reset()
1489 hcd->self.sg_tablesize = 0; in max3421_reset()
1490 hcd->speed = HCD_USB2; in max3421_reset()
1491 hcd->self.root_hub->speed = USB_SPEED_FULL; in max3421_reset()
1498 max3421_start(struct usb_hcd *hcd) in max3421_start() argument
1500 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_start()
1507 hcd->power_budget = POWER_BUDGET; in max3421_start()
1508 hcd->state = HC_STATE_RUNNING; in max3421_start()
1509 hcd->uses_new_polling = 1; in max3421_start()
1514 max3421_stop(struct usb_hcd *hcd) in max3421_stop() argument
1519 max3421_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) in max3421_urb_enqueue() argument
1521 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_urb_enqueue()
1522 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_urb_enqueue()
1557 retval = usb_hcd_link_urb_to_ep(hcd, urb); in max3421_urb_enqueue()
1570 max3421_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) in max3421_urb_dequeue() argument
1572 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_urb_dequeue()
1582 retval = usb_hcd_check_unlink_urb(hcd, urb, status); in max3421_urb_dequeue()
1592 max3421_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *ep) in max3421_endpoint_disable() argument
1594 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_endpoint_disable()
1613 max3421_get_frame_number(struct usb_hcd *hcd) in max3421_get_frame_number() argument
1615 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_get_frame_number()
1624 max3421_hub_status_data(struct usb_hcd *hcd, char *buf) in max3421_hub_status_data() argument
1626 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_hub_status_data()
1631 if (!HCD_HW_ACCESSIBLE(hcd)) in max3421_hub_status_data()
1637 dev_dbg(hcd->self.controller, in max3421_hub_status_data()
1642 usb_hcd_resume_root_hub(hcd); in max3421_hub_status_data()
1669 max3421_gpout_set_value(struct usb_hcd *hcd, u8 pin_number, u8 value) in max3421_gpout_set_value() argument
1671 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_gpout_set_value()
1690 max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index, in max3421_hub_control() argument
1693 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_hub_control()
1694 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_hub_control()
1711 dev_dbg(hcd->self.controller, "power-off\n"); in max3421_hub_control()
1712 max3421_gpout_set_value(hcd, pdata->vbus_gpout, in max3421_hub_control()
1760 dev_dbg(hcd->self.controller, "power-on\n"); in max3421_hub_control()
1762 max3421_gpout_set_value(hcd, pdata->vbus_gpout, in max3421_hub_control()
1766 max3421_reset_port(hcd); in max3421_hub_control()
1776 dev_dbg(hcd->self.controller, in max3421_hub_control()
1788 max3421_bus_suspend(struct usb_hcd *hcd) in max3421_bus_suspend() argument
1794 max3421_bus_resume(struct usb_hcd *hcd) in max3421_bus_resume() argument
1804 max3421_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) in max3421_map_urb_for_dma() argument
1810 max3421_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) in max3421_unmap_urb_for_dma() argument
1838 struct usb_hcd *hcd = NULL; in max3421_probe() local
1846 hcd = usb_create_hcd(&max3421_hcd_desc, &spi->dev, in max3421_probe()
1848 if (!hcd) { in max3421_probe()
1852 set_bit(HCD_FLAG_POLL_RH, &hcd->flags); in max3421_probe()
1853 max3421_hcd = hcd_to_max3421(hcd); in max3421_probe()
1865 max3421_hcd->spi_thread = kthread_run(max3421_spi_thread, hcd, in max3421_probe()
1873 retval = usb_add_hcd(hcd, 0, 0); in max3421_probe()
1880 IRQF_TRIGGER_LOW, "max3421", hcd); in max3421_probe()
1888 if (hcd) { in max3421_probe()
1893 usb_put_hcd(hcd); in max3421_probe()
1902 struct usb_hcd *hcd = NULL; in max3421_remove() local
1907 hcd = max3421_to_hcd(max3421_hcd); in max3421_remove()
1908 if (hcd->self.controller == &spi->dev) in max3421_remove()
1917 usb_remove_hcd(hcd); in max3421_remove()
1926 free_irq(spi->irq, hcd); in max3421_remove()
1928 usb_put_hcd(hcd); in max3421_remove()