• Home
  • Raw
  • Download

Lines Matching full:hcd

18  *		For USB HCD implementation.
63 #include <linux/usb/hcd.h>
66 #include <linux/platform_data/max3421-hcd.h>
140 * SPI-thread without acquiring the HCD lock:
339 hcd_to_max3421(struct usb_hcd *hcd) in hcd_to_max3421() argument
341 return (struct max3421_hcd *) hcd->hcd_priv; in hcd_to_max3421()
351 spi_rd8(struct usb_hcd *hcd, unsigned int reg) in spi_rd8() argument
353 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in spi_rd8()
354 struct spi_device *spi = to_spi_device(hcd->self.controller); in spi_rd8()
377 spi_wr8(struct usb_hcd *hcd, unsigned int reg, u8 val) in spi_wr8() argument
379 struct spi_device *spi = to_spi_device(hcd->self.controller); in spi_wr8()
380 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in spi_wr8()
401 spi_rd_buf(struct usb_hcd *hcd, unsigned int reg, void *buf, size_t len) in spi_rd_buf() argument
403 struct spi_device *spi = to_spi_device(hcd->self.controller); in spi_rd_buf()
404 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in spi_rd_buf()
427 spi_wr_buf(struct usb_hcd *hcd, unsigned int reg, void *buf, size_t len) in spi_wr_buf() argument
429 struct spi_device *spi = to_spi_device(hcd->self.controller); in spi_wr_buf()
430 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in spi_wr_buf()
467 max3421_set_speed(struct usb_hcd *hcd, struct usb_device *dev) in max3421_set_speed() argument
469 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_set_speed()
484 spi_wr8(hcd, MAX3421_REG_MODE, max3421_hcd->mode); in max3421_set_speed()
490 * Caller must NOT hold HCD spinlock.
493 max3421_set_address(struct usb_hcd *hcd, struct usb_device *dev, int epnum) in max3421_set_address() argument
504 spi_wr8(hcd, MAX3421_REG_HCTL, hctl); in max3421_set_address()
511 spi_wr8(hcd, MAX3421_REG_PERADDR, dev->devnum); in max3421_set_address()
515 max3421_ctrl_setup(struct usb_hcd *hcd, struct urb *urb) in max3421_ctrl_setup() argument
517 spi_wr_buf(hcd, MAX3421_REG_SUDFIFO, urb->setup_packet, 8); in max3421_ctrl_setup()
522 max3421_transfer_in(struct usb_hcd *hcd, struct urb *urb) in max3421_transfer_in() argument
524 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_transfer_in()
533 max3421_transfer_out(struct usb_hcd *hcd, struct urb *urb, int fast_retransmit) in max3421_transfer_out() argument
535 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_transfer_out()
536 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_transfer_out()
546 spi_wr8(hcd, MAX3421_REG_SNDBC, 0); in max3421_transfer_out()
547 spi_wr8(hcd, MAX3421_REG_SNDFIFO, ((u8 *) src)[0]); in max3421_transfer_out()
548 spi_wr8(hcd, MAX3421_REG_SNDBC, max3421_hcd->curr_len); in max3421_transfer_out()
569 spi_wr_buf(hcd, MAX3421_REG_SNDFIFO, src, max3421_hcd->curr_len); in max3421_transfer_out()
570 spi_wr8(hcd, MAX3421_REG_SNDBC, max3421_hcd->curr_len); in max3421_transfer_out()
576 * Caller must NOT hold HCD spinlock.
579 max3421_next_transfer(struct usb_hcd *hcd, int fast_retransmit) in max3421_next_transfer() argument
581 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_next_transfer()
593 cmd = max3421_ctrl_setup(hcd, urb); in max3421_next_transfer()
598 cmd = max3421_transfer_in(hcd, urb); in max3421_next_transfer()
600 cmd = max3421_transfer_out(hcd, urb, fast_retransmit); in max3421_next_transfer()
620 spi_wr8(hcd, MAX3421_REG_HXFR, cmd); in max3421_next_transfer()
634 * o Caller must NOT hold HCD spinlock.
639 max3421_select_and_start_urb(struct usb_hcd *hcd) in max3421_select_and_start_urb() argument
641 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_select_and_start_urb()
642 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_select_and_start_urb()
762 max3421_set_address(hcd, urb->dev, epnum); in max3421_select_and_start_urb()
763 max3421_set_speed(hcd, urb->dev); in max3421_select_and_start_urb()
764 max3421_next_transfer(hcd, 0); in max3421_select_and_start_urb()
771 * Caller must NOT hold HCD spinlock.
774 max3421_check_unlink(struct usb_hcd *hcd) in max3421_check_unlink() argument
776 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_check_unlink()
777 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_check_unlink()
792 usb_hcd_unlink_urb_from_ep(hcd, urb); in max3421_check_unlink()
795 usb_hcd_giveback_urb(hcd, urb, 0); in max3421_check_unlink()
805 * Caller must NOT hold HCD spinlock.
808 max3421_slow_retransmit(struct usb_hcd *hcd) in max3421_slow_retransmit() argument
810 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_slow_retransmit()
820 * Caller must NOT hold HCD spinlock.
823 max3421_recv_data_available(struct usb_hcd *hcd) in max3421_recv_data_available() argument
825 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_recv_data_available()
830 rcvbc = spi_rd8(hcd, MAX3421_REG_RCVBC); in max3421_recv_data_available()
844 spi_rd_buf(hcd, MAX3421_REG_RCVFIFO, dst, transfer_size); in max3421_recv_data_available()
850 spi_wr8(hcd, MAX3421_REG_HIRQ, BIT(MAX3421_HI_RCVDAV_BIT)); in max3421_recv_data_available()
854 max3421_handle_error(struct usb_hcd *hcd, u8 hrsl) in max3421_handle_error() argument
856 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_handle_error()
857 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_handle_error()
899 spi_wr8(hcd, MAX3421_REG_HCTL, in max3421_handle_error()
911 max3421_slow_retransmit(hcd); in max3421_handle_error()
932 max3421_next_transfer(hcd, 1); in max3421_handle_error()
935 max3421_slow_retransmit(hcd); in max3421_handle_error()
939 spi_wr8(hcd, MAX3421_REG_SNDBC, 0); in max3421_handle_error()
943 * Caller must NOT hold HCD spinlock.
946 max3421_transfer_in_done(struct usb_hcd *hcd, struct urb *urb) in max3421_transfer_in_done() argument
948 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_transfer_in_done()
949 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_transfer_in_done()
987 * Caller must NOT hold HCD spinlock.
990 max3421_transfer_out_done(struct usb_hcd *hcd, struct urb *urb) in max3421_transfer_out_done() argument
992 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_transfer_out_done()
1014 * Caller must NOT hold HCD spinlock.
1017 max3421_host_transfer_done(struct usb_hcd *hcd) in max3421_host_transfer_done() argument
1019 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_host_transfer_done()
1028 hrsl = spi_rd8(hcd, MAX3421_REG_HRSL); in max3421_host_transfer_done()
1038 max3421_handle_error(hcd, hrsl); in max3421_host_transfer_done()
1055 urb_done = max3421_transfer_in_done(hcd, urb); in max3421_host_transfer_done()
1057 urb_done = max3421_transfer_out_done(hcd, urb); in max3421_host_transfer_done()
1076 max3421_next_transfer(hcd, 0); in max3421_host_transfer_done()
1080 * Caller must NOT hold HCD spinlock.
1083 max3421_detect_conn(struct usb_hcd *hcd) in max3421_detect_conn() argument
1085 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_detect_conn()
1091 hrsl = spi_rd8(hcd, MAX3421_REG_HRSL); in max3421_detect_conn()
1122 spi_wr8(hcd, MAX3421_REG_MODE, max3421_hcd->mode); in max3421_detect_conn()
1142 struct usb_hcd *hcd = dev_id; in max3421_irq_handler() local
1143 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_irq_handler()
1144 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_irq_handler()
1157 dump_eps(struct usb_hcd *hcd) in dump_eps() argument
1159 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in dump_eps()
1198 max3421_handle_irqs(struct usb_hcd *hcd) in max3421_handle_irqs() argument
1200 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_handle_irqs()
1210 hirq = spi_rd8(hcd, MAX3421_REG_HIRQ); in max3421_handle_irqs()
1215 spi_wr8(hcd, MAX3421_REG_HIRQ, in max3421_handle_irqs()
1226 max3421_recv_data_available(hcd); in max3421_handle_irqs()
1229 max3421_host_transfer_done(hcd); in max3421_handle_irqs()
1232 max3421_detect_conn(hcd); in max3421_handle_irqs()
1235 * Now process interrupts that may affect HCD state in max3421_handle_irqs()
1283 dump_eps(hcd); in max3421_handle_irqs()
1291 max3421_reset_hcd(struct usb_hcd *hcd) in max3421_reset_hcd() argument
1293 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_reset_hcd()
1294 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_reset_hcd()
1298 spi_wr8(hcd, MAX3421_REG_USBCTL, BIT(MAX3421_USBCTL_CHIPRES_BIT)); in max3421_reset_hcd()
1300 spi_wr8(hcd, MAX3421_REG_USBCTL, 0); in max3421_reset_hcd()
1303 if (spi_rd8(hcd, MAX3421_REG_USBIRQ) in max3421_reset_hcd()
1322 spi_wr8(hcd, MAX3421_REG_MODE, max3421_hcd->mode); in max3421_reset_hcd()
1326 spi_wr8(hcd, MAX3421_REG_HCTL, BIT(MAX3421_HCTL_FRMRST_BIT)); in max3421_reset_hcd()
1329 spi_wr8(hcd, MAX3421_REG_HCTL, BIT(MAX3421_HCTL_SAMPLEBUS_BIT)); in max3421_reset_hcd()
1330 max3421_detect_conn(hcd); in max3421_reset_hcd()
1336 spi_wr8(hcd, MAX3421_REG_HIEN, max3421_hcd->hien); in max3421_reset_hcd()
1339 spi_wr8(hcd, MAX3421_REG_CPUCTL, BIT(MAX3421_CPUCTL_IE_BIT)); in max3421_reset_hcd()
1344 max3421_urb_done(struct usb_hcd *hcd) in max3421_urb_done() argument
1346 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_urb_done()
1358 u8 hrsl = spi_rd8(hcd, MAX3421_REG_HRSL); in max3421_urb_done()
1363 /* no locking: HCD (i.e., we) own toggles, don't we? */ in max3421_urb_done()
1369 usb_hcd_unlink_urb_from_ep(hcd, urb); in max3421_urb_done()
1372 /* must be called without the HCD spinlock: */ in max3421_urb_done()
1373 usb_hcd_giveback_urb(hcd, urb, status); in max3421_urb_done()
1381 struct usb_hcd *hcd = dev_id; in max3421_spi_thread() local
1382 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_spi_thread()
1383 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_spi_thread()
1387 spi_wr8(hcd, MAX3421_REG_PINCTL, in max3421_spi_thread()
1392 max3421_hcd->rev = spi_rd8(hcd, MAX3421_REG_REVISION); in max3421_spi_thread()
1409 spi_wr8(hcd, MAX3421_REG_HIEN, max3421_hcd->hien); in max3421_spi_thread()
1421 i_worked |= max3421_urb_done(hcd); in max3421_spi_thread()
1422 else if (max3421_handle_irqs(hcd)) in max3421_spi_thread()
1425 i_worked |= max3421_select_and_start_urb(hcd); in max3421_spi_thread()
1428 /* reset the HCD: */ in max3421_spi_thread()
1429 i_worked |= max3421_reset_hcd(hcd); in max3421_spi_thread()
1432 spi_wr8(hcd, MAX3421_REG_HCTL, in max3421_spi_thread()
1437 i_worked |= max3421_check_unlink(hcd); in max3421_spi_thread()
1444 u8 val = spi_rd8(hcd, MAX3421_REG_IOPINS1); in max3421_spi_thread()
1448 spi_wr8(hcd, MAX3421_REG_IOPINS1 + i, val); in max3421_spi_thread()
1460 max3421_reset_port(struct usb_hcd *hcd) in max3421_reset_port() argument
1462 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_reset_port()
1473 max3421_reset(struct usb_hcd *hcd) in max3421_reset() argument
1475 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_reset()
1477 hcd->self.sg_tablesize = 0; in max3421_reset()
1478 hcd->speed = HCD_USB2; in max3421_reset()
1479 hcd->self.root_hub->speed = USB_SPEED_FULL; in max3421_reset()
1486 max3421_start(struct usb_hcd *hcd) in max3421_start() argument
1488 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_start()
1495 hcd->power_budget = POWER_BUDGET; in max3421_start()
1496 hcd->state = HC_STATE_RUNNING; in max3421_start()
1497 hcd->uses_new_polling = 1; in max3421_start()
1502 max3421_stop(struct usb_hcd *hcd) in max3421_stop() argument
1507 max3421_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) in max3421_urb_enqueue() argument
1509 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_urb_enqueue()
1510 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_urb_enqueue()
1545 retval = usb_hcd_link_urb_to_ep(hcd, urb); in max3421_urb_enqueue()
1558 max3421_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) in max3421_urb_dequeue() argument
1560 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_urb_dequeue()
1570 retval = usb_hcd_check_unlink_urb(hcd, urb, status); in max3421_urb_dequeue()
1580 max3421_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *ep) in max3421_endpoint_disable() argument
1582 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_endpoint_disable()
1601 max3421_get_frame_number(struct usb_hcd *hcd) in max3421_get_frame_number() argument
1603 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_get_frame_number()
1612 max3421_hub_status_data(struct usb_hcd *hcd, char *buf) in max3421_hub_status_data() argument
1614 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_hub_status_data()
1619 if (!HCD_HW_ACCESSIBLE(hcd)) in max3421_hub_status_data()
1625 dev_dbg(hcd->self.controller, in max3421_hub_status_data()
1630 usb_hcd_resume_root_hub(hcd); in max3421_hub_status_data()
1657 max3421_gpout_set_value(struct usb_hcd *hcd, u8 pin_number, u8 value) in max3421_gpout_set_value() argument
1659 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_gpout_set_value()
1678 max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index, in max3421_hub_control() argument
1681 struct spi_device *spi = to_spi_device(hcd->self.controller); in max3421_hub_control()
1682 struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); in max3421_hub_control()
1699 dev_dbg(hcd->self.controller, "power-off\n"); in max3421_hub_control()
1700 max3421_gpout_set_value(hcd, pdata->vbus_gpout, in max3421_hub_control()
1748 dev_dbg(hcd->self.controller, "power-on\n"); in max3421_hub_control()
1750 max3421_gpout_set_value(hcd, pdata->vbus_gpout, in max3421_hub_control()
1754 max3421_reset_port(hcd); in max3421_hub_control()
1764 dev_dbg(hcd->self.controller, in max3421_hub_control()
1776 max3421_bus_suspend(struct usb_hcd *hcd) in max3421_bus_suspend() argument
1782 max3421_bus_resume(struct usb_hcd *hcd) in max3421_bus_resume() argument
1792 max3421_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) in max3421_map_urb_for_dma() argument
1798 max3421_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) in max3421_unmap_urb_for_dma() argument
1849 struct usb_hcd *hcd = NULL; in max3421_probe() local
1893 hcd = usb_create_hcd(&max3421_hcd_desc, &spi->dev, in max3421_probe()
1895 if (!hcd) { in max3421_probe()
1896 dev_err(&spi->dev, "failed to create HCD structure\n"); in max3421_probe()
1899 set_bit(HCD_FLAG_POLL_RH, &hcd->flags); in max3421_probe()
1900 max3421_hcd = hcd_to_max3421(hcd); in max3421_probe()
1912 max3421_hcd->spi_thread = kthread_run(max3421_spi_thread, hcd, in max3421_probe()
1920 retval = usb_add_hcd(hcd, 0, 0); in max3421_probe()
1922 dev_err(&spi->dev, "failed to add HCD\n"); in max3421_probe()
1927 IRQF_TRIGGER_LOW, "max3421", hcd); in max3421_probe()
1940 if (hcd) { in max3421_probe()
1945 usb_put_hcd(hcd); in max3421_probe()
1954 struct usb_hcd *hcd = NULL; in max3421_remove() local
1959 hcd = max3421_to_hcd(max3421_hcd); in max3421_remove()
1960 if (hcd->self.controller == &spi->dev) in max3421_remove()
1964 dev_err(&spi->dev, "no MAX3421 HCD found for SPI device %p\n", in max3421_remove()
1969 usb_remove_hcd(hcd); in max3421_remove()
1978 free_irq(spi->irq, hcd); in max3421_remove()
1980 usb_put_hcd(hcd); in max3421_remove()
1994 .name = "max3421-hcd",