/drivers/usb/musb/ |
D | musb_core.c | 105 static inline struct musb *dev_to_musb(struct device *dev) in dev_to_musb() 316 struct musb *musb = hw_ep->musb; in musb_default_write_fifo() local 324 dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n", in musb_default_write_fifo() 360 struct musb *musb = hw_ep->musb; in musb_default_read_fifo() local 366 dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n", in musb_default_read_fifo() 436 (*musb_dma_controller_create)(struct musb *musb, void __iomem *base); 448 return hw_ep->musb->io.read_fifo(hw_ep, len, dst); in musb_read_fifo() 453 return hw_ep->musb->io.write_fifo(hw_ep, len, src); in musb_write_fifo() 456 static u8 musb_read_devctl(struct musb *musb) in musb_read_devctl() argument 458 return musb_readb(musb->mregs, MUSB_DEVCTL); in musb_read_devctl() [all …]
|
D | musb_gadget_ep0.c | 21 #define next_ep0_request(musb) next_in_request(&(musb)->endpoints[0]) argument 51 struct musb *musb, in service_tx_status_request() argument 54 void __iomem *mbase = musb->mregs; in service_tx_status_request() 63 result[0] = musb->g.is_selfpowered << USB_DEVICE_SELF_POWERED; in service_tx_status_request() 64 result[0] |= musb->may_wakeup << USB_DEVICE_REMOTE_WAKEUP; in service_tx_status_request() 65 if (musb->g.is_otg) { in service_tx_status_request() 66 result[0] |= musb->g.b_hnp_enable in service_tx_status_request() 68 result[0] |= musb->g.a_alt_hnp_support in service_tx_status_request() 70 result[0] |= musb->g.a_hnp_support in service_tx_status_request() 99 ep = &musb->endpoints[epnum].ep_in; in service_tx_status_request() [all …]
|
D | musb_core.h | 27 struct musb; 106 #define MUSB_MODE(musb) ((musb)->is_host ? "Host" : "Peripheral") argument 158 int (*init)(struct musb *musb); 159 int (*exit)(struct musb *musb); 161 void (*enable)(struct musb *musb); 162 void (*disable)(struct musb *musb); 180 (*dma_init) (struct musb *musb, void __iomem *base); 182 int (*set_mode)(struct musb *musb, u8 mode); 183 void (*try_idle)(struct musb *musb, unsigned long timeout); 184 int (*recover)(struct musb *musb); [all …]
|
D | musb_virthub.c | 23 struct musb *musb; in musb_host_finish_resume() local 27 musb = container_of(work, struct musb, finish_resume_work.work); in musb_host_finish_resume() 29 spin_lock_irqsave(&musb->lock, flags); in musb_host_finish_resume() 31 power = musb_readb(musb->mregs, MUSB_POWER); in musb_host_finish_resume() 33 musb_dbg(musb, "root port resume stopped, power %02x", power); in musb_host_finish_resume() 34 musb_writeb(musb->mregs, MUSB_POWER, power); in musb_host_finish_resume() 41 musb->is_active = 1; in musb_host_finish_resume() 42 musb->port1_status &= ~(USB_PORT_STAT_SUSPEND | MUSB_PORT_STAT_RESUME); in musb_host_finish_resume() 43 musb->port1_status |= USB_PORT_STAT_C_SUSPEND << 16; in musb_host_finish_resume() 44 usb_hcd_poll_rh_status(musb->hcd); in musb_host_finish_resume() [all …]
|
D | musb_gadget.c | 33 struct musb *musb, struct musb_ep *musb_ep) in map_dma_buffer() argument 36 struct dma_controller *dma = musb->dma_controller; in map_dma_buffer() 59 musb->controller, in map_dma_buffer() 65 ret = dma_mapping_error(musb->controller, dma_addr); in map_dma_buffer() 72 dma_sync_single_for_device(musb->controller, in map_dma_buffer() 84 struct musb *musb) in unmap_dma_buffer() argument 92 dev_vdbg(musb->controller, in unmap_dma_buffer() 97 dma_unmap_single(musb->controller, in unmap_dma_buffer() 105 dma_sync_single_for_cpu(musb->controller, in unmap_dma_buffer() 126 __releases(ep->musb->lock) in musb_g_giveback() [all …]
|
D | omap2430.c | 32 struct platform_device *musb; member 40 #define glue_to_musb(g) platform_get_drvdata(g->musb) 44 static inline void omap2430_low_level_exit(struct musb *musb) in omap2430_low_level_exit() argument 49 l = musb_readl(musb->mregs, OTG_FORCESTDBY); in omap2430_low_level_exit() 51 musb_writel(musb->mregs, OTG_FORCESTDBY, l); in omap2430_low_level_exit() 54 static inline void omap2430_low_level_init(struct musb *musb) in omap2430_low_level_init() argument 58 l = musb_readl(musb->mregs, OTG_FORCESTDBY); in omap2430_low_level_init() 60 musb_writel(musb->mregs, OTG_FORCESTDBY, l); in omap2430_low_level_init() 92 struct musb *musb = glue_to_musb(glue); in omap_musb_set_mailbox() local 95 pm_runtime_get_sync(musb->controller); in omap_musb_set_mailbox() [all …]
|
D | tusb6010.c | 31 struct platform_device *musb; member 35 static void tusb_musb_set_vbus(struct musb *musb, int is_on); 44 static u8 tusb_get_revision(struct musb *musb) in tusb_get_revision() argument 46 void __iomem *tbase = musb->ctrl_base; in tusb_get_revision() 61 static void tusb_print_revision(struct musb *musb) in tusb_print_revision() argument 63 void __iomem *tbase = musb->ctrl_base; in tusb_print_revision() 66 rev = musb->tusb_revision; in tusb_print_revision() 94 static void tusb_wbus_quirk(struct musb *musb, int enabled) in tusb_wbus_quirk() argument 96 void __iomem *tbase = musb->ctrl_base; in tusb_wbus_quirk() 109 dev_dbg(musb->controller, "Enabled tusb wbus quirk ctrl %08x ena %08x\n", in tusb_wbus_quirk() [all …]
|
D | ux500.c | 29 struct platform_device *musb; member 32 #define glue_to_musb(g) platform_get_drvdata(g->musb) 34 static void ux500_musb_set_vbus(struct musb *musb, int is_on) in ux500_musb_set_vbus() argument 43 devctl = musb_readb(musb->mregs, MUSB_DEVCTL); in ux500_musb_set_vbus() 46 if (musb->xceiv->otg->state == OTG_STATE_A_IDLE) { in ux500_musb_set_vbus() 49 musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); in ux500_musb_set_vbus() 54 while (musb_readb(musb->mregs, MUSB_DEVCTL) & 0x80) { in ux500_musb_set_vbus() 57 dev_err(musb->controller, in ux500_musb_set_vbus() 64 musb->is_active = 1; in ux500_musb_set_vbus() 65 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; in ux500_musb_set_vbus() [all …]
|
D | musb_host.h | 55 extern struct musb *hcd_to_musb(struct usb_hcd *); 56 extern irqreturn_t musb_h_ep0_irq(struct musb *); 57 extern int musb_host_alloc(struct musb *); 58 extern int musb_host_setup(struct musb *, int); 59 extern void musb_host_cleanup(struct musb *); 60 extern void musb_host_tx(struct musb *, u8); 61 extern void musb_host_rx(struct musb *, u8); 62 extern void musb_root_disconnect(struct musb *musb); 63 extern void musb_host_free(struct musb *); 64 extern void musb_host_resume_root_hub(struct musb *musb); [all …]
|
D | davinci.c | 37 struct platform_device *musb; member 76 static void davinci_musb_enable(struct musb *musb) in davinci_musb_enable() argument 81 tmp = (musb->epmask & DAVINCI_USB_TX_ENDPTS_MASK) in davinci_musb_enable() 83 musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_SET_REG, tmp); in davinci_musb_enable() 85 tmp = (musb->epmask & (0xfffe & DAVINCI_USB_RX_ENDPTS_MASK)) in davinci_musb_enable() 87 musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_SET_REG, tmp); in davinci_musb_enable() 92 musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_SET_REG, tmp); in davinci_musb_enable() 101 musb_writel(musb->ctrl_base, DAVINCI_USB_INT_SET_REG, in davinci_musb_enable() 108 static void davinci_musb_disable(struct musb *musb) in davinci_musb_disable() argument 115 musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_CLR_REG, in davinci_musb_disable() [all …]
|
D | am35x.c | 72 struct platform_device *musb; member 81 static void am35x_musb_enable(struct musb *musb) in am35x_musb_enable() argument 83 void __iomem *reg_base = musb->ctrl_base; in am35x_musb_enable() 87 epmask = ((musb->epmask & AM35X_TX_EP_MASK) << AM35X_INTR_TX_SHIFT) | in am35x_musb_enable() 88 ((musb->epmask & AM35X_RX_EP_MASK) << AM35X_INTR_RX_SHIFT); in am35x_musb_enable() 101 static void am35x_musb_disable(struct musb *musb) in am35x_musb_disable() argument 103 void __iomem *reg_base = musb->ctrl_base; in am35x_musb_disable() 113 static void am35x_musb_set_vbus(struct musb *musb, int is_on) in am35x_musb_set_vbus() argument 115 WARN_ON(is_on && is_peripheral_active(musb)); in am35x_musb_set_vbus() 122 struct musb *musb = from_timer(musb, t, dev_timer); in otg_timer() local [all …]
|
D | musb_dsps.c | 104 struct platform_device *musb; /* child musb pdev */ member 136 struct musb *musb = platform_get_drvdata(glue->musb); in dsps_mod_timer() local 144 mod_timer(&musb->dev_timer, jiffies + wait); in dsps_mod_timer() 168 static void dsps_musb_enable(struct musb *musb) in dsps_musb_enable() argument 170 struct device *dev = musb->controller; in dsps_musb_enable() 173 void __iomem *reg_base = musb->ctrl_base; in dsps_musb_enable() 177 epmask = ((musb->epmask & wrp->txep_mask) << wrp->txep_shift) | in dsps_musb_enable() 178 ((musb->epmask & wrp->rxep_mask) << wrp->rxep_shift); in dsps_musb_enable() 187 if (musb->xceiv->otg->state == OTG_STATE_B_IDLE) in dsps_musb_enable() 194 static void dsps_musb_disable(struct musb *musb) in dsps_musb_disable() argument [all …]
|
D | da8xx.c | 68 struct platform_device *musb; member 84 static void da8xx_musb_enable(struct musb *musb) in da8xx_musb_enable() argument 86 void __iomem *reg_base = musb->ctrl_base; in da8xx_musb_enable() 90 mask = ((musb->epmask & DA8XX_USB_TX_EP_MASK) << DA8XX_INTR_TX_SHIFT) | in da8xx_musb_enable() 91 ((musb->epmask & DA8XX_USB_RX_EP_MASK) << DA8XX_INTR_RX_SHIFT) | in da8xx_musb_enable() 103 static void da8xx_musb_disable(struct musb *musb) in da8xx_musb_disable() argument 105 void __iomem *reg_base = musb->ctrl_base; in da8xx_musb_disable() 115 static void da8xx_musb_set_vbus(struct musb *musb, int is_on) in da8xx_musb_set_vbus() argument 117 WARN_ON(is_on && is_peripheral_active(musb)); in da8xx_musb_set_vbus() 124 struct musb *musb = from_timer(musb, t, dev_timer); in otg_timer() local [all …]
|
D | musb_gadget.h | 16 extern irqreturn_t musb_g_ep0_irq(struct musb *); 17 extern void musb_g_tx(struct musb *, u8); 18 extern void musb_g_rx(struct musb *, u8); 19 extern void musb_g_reset(struct musb *); 20 extern void musb_g_suspend(struct musb *); 21 extern void musb_g_resume(struct musb *); 22 extern void musb_g_wakeup(struct musb *); 23 extern void musb_g_disconnect(struct musb *); 24 extern void musb_gadget_cleanup(struct musb *); 25 extern int musb_gadget_setup(struct musb *); [all …]
|
D | musb_dma.h | 53 #define musb_dma_ux500(musb) (musb->ops->quirks & MUSB_DMA_UX500) argument 55 #define musb_dma_ux500(musb) 0 argument 59 #define musb_dma_cppi41(musb) (musb->ops->quirks & MUSB_DMA_CPPI41) argument 61 #define musb_dma_cppi41(musb) 0 argument 65 #define musb_dma_cppi(musb) (musb->ops->quirks & MUSB_DMA_CPPI) argument 67 #define musb_dma_cppi(musb) 0 argument 71 #define tusb_dma_omap(musb) (musb->ops->quirks & MUSB_DMA_TUSB_OMAP) argument 73 #define tusb_dma_omap(musb) 0 argument 77 #define musb_dma_inventra(musb) (musb->ops->quirks & MUSB_DMA_INVENTRA) argument 79 #define musb_dma_inventra(musb) 0 argument [all …]
|
D | musb_debugfs.c | 86 struct musb *musb = s->private; in musb_regdump_show() local 90 pm_runtime_get_sync(musb->controller); in musb_regdump_show() 96 musb_readb(musb->mregs, musb_regmap[i].offset)); in musb_regdump_show() 100 musb_readw(musb->mregs, musb_regmap[i].offset)); in musb_regdump_show() 104 musb_readl(musb->mregs, musb_regmap[i].offset)); in musb_regdump_show() 109 pm_runtime_mark_last_busy(musb->controller); in musb_regdump_show() 110 pm_runtime_put_autosuspend(musb->controller); in musb_regdump_show() 117 struct musb *musb = s->private; in musb_test_mode_show() local 120 pm_runtime_get_sync(musb->controller); in musb_test_mode_show() 121 test = musb_readb(musb->mregs, MUSB_TESTMODE); in musb_test_mode_show() [all …]
|
D | musb_regs.h | 282 static inline void musb_write_rxfunaddr(struct musb *musb, u8 epnum, in musb_write_rxfunaddr() argument 285 musb_writeb(musb->mregs, in musb_write_rxfunaddr() 286 musb->io.busctl_offset(epnum, MUSB_RXFUNCADDR), in musb_write_rxfunaddr() 290 static inline void musb_write_rxhubaddr(struct musb *musb, u8 epnum, in musb_write_rxhubaddr() argument 293 musb_writeb(musb->mregs, musb->io.busctl_offset(epnum, MUSB_RXHUBADDR), in musb_write_rxhubaddr() 297 static inline void musb_write_rxhubport(struct musb *musb, u8 epnum, in musb_write_rxhubport() argument 300 musb_writeb(musb->mregs, musb->io.busctl_offset(epnum, MUSB_RXHUBPORT), in musb_write_rxhubport() 304 static inline void musb_write_txfunaddr(struct musb *musb, u8 epnum, in musb_write_txfunaddr() argument 307 musb_writeb(musb->mregs, in musb_write_txfunaddr() 308 musb->io.busctl_offset(epnum, MUSB_TXFUNCADDR), in musb_write_txfunaddr() [all …]
|
D | musb_host.c | 73 struct musb *hcd_to_musb(struct usb_hcd *hcd) in hcd_to_musb() 75 return *(struct musb **) hcd->hcd_priv; in hcd_to_musb() 79 static void musb_ep_program(struct musb *musb, u8 epnum, 88 struct musb *musb = ep->musb; in musb_h_tx_flush_fifo() local 113 if (dev_WARN_ONCE(musb->controller, retries-- < 1, in musb_h_tx_flush_fifo() 171 if (is_cppi_enabled(ep->musb)) in musb_h_tx_dma_start() 196 musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) in musb_start_urb() argument 199 void __iomem *mbase = musb->mregs; in musb_start_urb() 215 musb->ep0_stage = MUSB_EP0_START; in musb_start_urb() 231 trace_musb_urb_start(musb, urb); in musb_start_urb() [all …]
|
D | jz4740.c | 22 struct musb *musb; member 31 struct musb *musb = __hci; in jz4740_musb_interrupt() local 33 if (IS_ENABLED(CONFIG_USB_INVENTRA_DMA) && musb->dma_controller) in jz4740_musb_interrupt() 34 retval_dma = dma_controller_irq(irq, musb->dma_controller); in jz4740_musb_interrupt() 36 spin_lock_irqsave(&musb->lock, flags); in jz4740_musb_interrupt() 38 musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB); in jz4740_musb_interrupt() 39 musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX); in jz4740_musb_interrupt() 40 musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX); in jz4740_musb_interrupt() 47 musb->int_usb &= MUSB_INTR_SUSPEND | MUSB_INTR_RESUME | in jz4740_musb_interrupt() 50 if (musb->int_usb || musb->int_tx || musb->int_rx) in jz4740_musb_interrupt() [all …]
|
D | mediatek.c | 41 struct musb *musb; member 120 struct musb *musb = glue->musb; in mtk_otg_switch_set() local 121 u8 devctl = readb(musb->mregs + MUSB_DEVCTL); in mtk_otg_switch_set() 129 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; in mtk_otg_switch_set() 136 musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); in mtk_otg_switch_set() 137 MUSB_HST_MODE(musb); in mtk_otg_switch_set() 140 musb->xceiv->otg->state = OTG_STATE_B_IDLE; in mtk_otg_switch_set() 144 musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); in mtk_otg_switch_set() 148 MUSB_DEV_MODE(musb); in mtk_otg_switch_set() 154 musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); in mtk_otg_switch_set() [all …]
|
D | sunxi.c | 71 static struct musb *sunxi_musb; 75 struct musb *musb; member 99 struct musb *musb = glue->musb; in sunxi_musb_work() local 103 spin_lock_irqsave(&musb->lock, flags); in sunxi_musb_work() 105 devctl = readb(musb->mregs + SUNXI_MUSB_DEVCTL); in sunxi_musb_work() 108 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; in sunxi_musb_work() 109 MUSB_HST_MODE(musb); in sunxi_musb_work() 113 musb->xceiv->otg->state = OTG_STATE_B_IDLE; in sunxi_musb_work() 114 MUSB_DEV_MODE(musb); in sunxi_musb_work() 117 writeb(devctl, musb->mregs + SUNXI_MUSB_DEVCTL); in sunxi_musb_work() [all …]
|
D | musb_cppi41.c | 61 if (!is_host_active(cppi41_channel->controller->controller.musb)) in save_rx_toggle() 73 struct musb *musb = hw_ep->musb; in update_rx_toggle() local 79 if (!is_host_active(musb)) in update_rx_toggle() 82 musb_ep_select(musb->mregs, hw_ep->epnum); in update_rx_toggle() 94 musb_dbg(musb, "Restoring DATA1 toggle."); in update_rx_toggle() 103 struct musb *musb = hw_ep->musb; in musb_is_tx_fifo_empty() local 104 void __iomem *epio = musb->endpoints[epnum].regs; in musb_is_tx_fifo_empty() 107 musb_ep_select(musb->mregs, hw_ep->epnum); in musb_is_tx_fifo_empty() 120 struct musb *musb = hw_ep->musb; in cppi41_trans_done() local 139 musb_ep_select(musb->mregs, hw_ep->epnum); in cppi41_trans_done() [all …]
|
D | musb_trace.h | 11 #define TRACE_SYSTEM musb 27 TP_PROTO(struct musb *musb, struct va_format *vaf), 28 TP_ARGS(musb, vaf), 30 __string(name, dev_name(musb->controller)) 34 __assign_str(name, dev_name(musb->controller)); 41 TP_PROTO(struct musb *musb, u8 devctl, const char *desc), 42 TP_ARGS(musb, devctl, desc), 44 __string(name, dev_name(musb->controller)) 49 __assign_str(name, dev_name(musb->controller)); 154 TP_PROTO(struct musb *musb), [all …]
|
D | tusb6010_omap.c | 30 struct musb *musb; member 66 dev_dbg(chdat->musb->controller, "ep%i dmareq0 is busy for ep%i\n", in tusb_omap_use_shared_dmareq() 102 struct musb *musb = chdat->musb; in tusb_omap_dma_cb() local 103 struct device *dev = musb->controller; in tusb_omap_dma_cb() 106 void __iomem *mbase = musb->mregs; in tusb_omap_dma_cb() 109 spin_lock_irqsave(&musb->lock, flags); in tusb_omap_dma_cb() 111 dev_dbg(musb->controller, "ep%i %s dma callback\n", in tusb_omap_dma_cb() 123 dev_dbg(musb->controller, "Corrupt %s XFR_SIZE: 0x%08lx\n", in tusb_omap_dma_cb() 131 dev_dbg(musb->controller, "DMA remaining %lu/%u\n", remaining, chdat->transfer_len); in tusb_omap_dma_cb() 137 dev_dbg(musb->controller, "Using PIO for remaining %lu bytes\n", pio); in tusb_omap_dma_cb() [all …]
|
D | musbhsdma.c | 78 struct musb *musb = controller->private_data; in dma_controller_stop() local 83 dev_err(musb->controller, in dma_controller_stop() 149 struct musb *musb = controller->private_data; in configure_channel() local 154 musb_dbg(musb, "%p, pkt_sz %d, addr %pad, len %d, mode %d", in configure_channel() 187 struct musb *musb = controller->private_data; in dma_channel_program() local 189 musb_dbg(musb, "ep%d-%s pkt_sz %d, dma_addr %pad length %d, mode %d", in dma_channel_program() 206 if ((musb->hwvers >= MUSB_HWVERS_1800) && (dma_addr % 4)) in dma_channel_program() 224 struct musb *musb = musb_channel->controller->private_data; in dma_channel_abort() local 232 offset = musb->io.ep_offset(musb_channel->epnum, in dma_channel_abort() 245 offset = musb->io.ep_offset(musb_channel->epnum, in dma_channel_abort() [all …]
|