musb 2164 drivers/gpu/drm/bridge/sil-sii8620.c struct device_node *musb, *muic; musb 2168 drivers/gpu/drm/bridge/sil-sii8620.c musb = of_graph_get_remote_node(ctx->dev->of_node, 1, -1); musb 2170 drivers/gpu/drm/bridge/sil-sii8620.c muic = of_get_next_parent(musb); musb 72 drivers/usb/musb/am35x.c struct platform_device *musb; musb 81 drivers/usb/musb/am35x.c static void am35x_musb_enable(struct musb *musb) musb 83 drivers/usb/musb/am35x.c void __iomem *reg_base = musb->ctrl_base; musb 87 drivers/usb/musb/am35x.c epmask = ((musb->epmask & AM35X_TX_EP_MASK) << AM35X_INTR_TX_SHIFT) | musb 88 drivers/usb/musb/am35x.c ((musb->epmask & AM35X_RX_EP_MASK) << AM35X_INTR_RX_SHIFT); musb 101 drivers/usb/musb/am35x.c static void am35x_musb_disable(struct musb *musb) musb 103 drivers/usb/musb/am35x.c void __iomem *reg_base = musb->ctrl_base; musb 113 drivers/usb/musb/am35x.c static void am35x_musb_set_vbus(struct musb *musb, int is_on) musb 115 drivers/usb/musb/am35x.c WARN_ON(is_on && is_peripheral_active(musb)); musb 122 drivers/usb/musb/am35x.c struct musb *musb = from_timer(musb, t, dev_timer); musb 123 drivers/usb/musb/am35x.c void __iomem *mregs = musb->mregs; musb 132 drivers/usb/musb/am35x.c dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl, musb 133 drivers/usb/musb/am35x.c usb_otg_state_string(musb->xceiv->otg->state)); musb 135 drivers/usb/musb/am35x.c spin_lock_irqsave(&musb->lock, flags); musb 136 drivers/usb/musb/am35x.c switch (musb->xceiv->otg->state) { musb 139 drivers/usb/musb/am35x.c musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); musb 141 drivers/usb/musb/am35x.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 143 drivers/usb/musb/am35x.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 144 drivers/usb/musb/am35x.c MUSB_DEV_MODE(musb); musb 146 drivers/usb/musb/am35x.c musb->xceiv->otg->state = OTG_STATE_A_IDLE; musb 147 drivers/usb/musb/am35x.c MUSB_HST_MODE(musb); musb 151 drivers/usb/musb/am35x.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 152 drivers/usb/musb/am35x.c musb_writel(musb->ctrl_base, CORE_INTR_SRC_SET_REG, musb 158 drivers/usb/musb/am35x.c mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ); musb 160 drivers/usb/musb/am35x.c musb->xceiv->otg->state = OTG_STATE_A_IDLE; musb 165 drivers/usb/musb/am35x.c spin_unlock_irqrestore(&musb->lock, flags); musb 168 drivers/usb/musb/am35x.c static void am35x_musb_try_idle(struct musb *musb, unsigned long timeout) musb 176 drivers/usb/musb/am35x.c if (musb->is_active || (musb->a_wait_bcon == 0 && musb 177 drivers/usb/musb/am35x.c musb->xceiv->otg->state == OTG_STATE_A_WAIT_BCON)) { musb 178 drivers/usb/musb/am35x.c dev_dbg(musb->controller, "%s active, deleting timer\n", musb 179 drivers/usb/musb/am35x.c usb_otg_state_string(musb->xceiv->otg->state)); musb 180 drivers/usb/musb/am35x.c del_timer(&musb->dev_timer); musb 185 drivers/usb/musb/am35x.c if (time_after(last_timer, timeout) && timer_pending(&musb->dev_timer)) { musb 186 drivers/usb/musb/am35x.c dev_dbg(musb->controller, "Longer idle timer already pending, ignoring...\n"); musb 191 drivers/usb/musb/am35x.c dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n", musb 192 drivers/usb/musb/am35x.c usb_otg_state_string(musb->xceiv->otg->state), musb 194 drivers/usb/musb/am35x.c mod_timer(&musb->dev_timer, timeout); musb 199 drivers/usb/musb/am35x.c struct musb *musb = hci; musb 200 drivers/usb/musb/am35x.c void __iomem *reg_base = musb->ctrl_base; musb 201 drivers/usb/musb/am35x.c struct device *dev = musb->controller; musb 208 drivers/usb/musb/am35x.c spin_lock_irqsave(&musb->lock, flags); musb 216 drivers/usb/musb/am35x.c musb->int_rx = musb 218 drivers/usb/musb/am35x.c musb->int_tx = musb 230 drivers/usb/musb/am35x.c musb->int_usb = musb 243 drivers/usb/musb/am35x.c void __iomem *mregs = musb->mregs; musb 247 drivers/usb/musb/am35x.c err = musb->int_usb & MUSB_INTR_VBUSERROR; musb 260 drivers/usb/musb/am35x.c musb->int_usb &= ~MUSB_INTR_VBUSERROR; musb 261 drivers/usb/musb/am35x.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VFALL; musb 262 drivers/usb/musb/am35x.c mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ); musb 265 drivers/usb/musb/am35x.c MUSB_HST_MODE(musb); musb 266 drivers/usb/musb/am35x.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 267 drivers/usb/musb/am35x.c portstate(musb->port1_status |= USB_PORT_STAT_POWER); musb 268 drivers/usb/musb/am35x.c del_timer(&musb->dev_timer); musb 270 drivers/usb/musb/am35x.c musb->is_active = 0; musb 271 drivers/usb/musb/am35x.c MUSB_DEV_MODE(musb); musb 272 drivers/usb/musb/am35x.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 273 drivers/usb/musb/am35x.c portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); musb 277 drivers/usb/musb/am35x.c dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n", musb 279 drivers/usb/musb/am35x.c usb_otg_state_string(musb->xceiv->otg->state), musb 286 drivers/usb/musb/am35x.c if (musb->int_usb & MUSB_INTR_DISCONNECT) { musb 287 drivers/usb/musb/am35x.c musb->int_tx = 0; musb 288 drivers/usb/musb/am35x.c musb->int_rx = 0; musb 291 drivers/usb/musb/am35x.c if (musb->int_tx || musb->int_rx || musb->int_usb) musb 292 drivers/usb/musb/am35x.c ret |= musb_interrupt(musb); musb 305 drivers/usb/musb/am35x.c if (musb->xceiv->otg->state == OTG_STATE_B_IDLE) musb 306 drivers/usb/musb/am35x.c mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ); musb 308 drivers/usb/musb/am35x.c spin_unlock_irqrestore(&musb->lock, flags); musb 313 drivers/usb/musb/am35x.c static int am35x_musb_set_mode(struct musb *musb, u8 musb_mode) musb 315 drivers/usb/musb/am35x.c struct device *dev = musb->controller; musb 328 drivers/usb/musb/am35x.c static int am35x_musb_init(struct musb *musb) musb 330 drivers/usb/musb/am35x.c struct device *dev = musb->controller; musb 333 drivers/usb/musb/am35x.c void __iomem *reg_base = musb->ctrl_base; musb 336 drivers/usb/musb/am35x.c musb->mregs += USB_MENTOR_CORE_OFFSET; musb 343 drivers/usb/musb/am35x.c musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); musb 344 drivers/usb/musb/am35x.c if (IS_ERR_OR_NULL(musb->xceiv)) musb 347 drivers/usb/musb/am35x.c timer_setup(&musb->dev_timer, otg_timer, 0); musb 362 drivers/usb/musb/am35x.c musb->isr = am35x_musb_interrupt; musb 371 drivers/usb/musb/am35x.c static int am35x_musb_exit(struct musb *musb) musb 373 drivers/usb/musb/am35x.c struct device *dev = musb->controller; musb 377 drivers/usb/musb/am35x.c del_timer_sync(&musb->dev_timer); musb 383 drivers/usb/musb/am35x.c usb_put_phy(musb->xceiv); musb 446 drivers/usb/musb/am35x.c struct platform_device *musb; musb 504 drivers/usb/musb/am35x.c glue->musb = musb = platform_device_register_full(&pinfo); musb 505 drivers/usb/musb/am35x.c if (IS_ERR(musb)) { musb 506 drivers/usb/musb/am35x.c ret = PTR_ERR(musb); musb 539 drivers/usb/musb/am35x.c platform_device_unregister(glue->musb); musb 226 drivers/usb/musb/cppi_dma.c struct musb *musb; musb 228 drivers/usb/musb/cppi_dma.c musb = controller->controller.musb; musb 237 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "Tearing down RX and TX Channels"); musb 288 drivers/usb/musb/cppi_dma.c struct musb *musb; musb 292 drivers/usb/musb/cppi_dma.c musb = c->musb; musb 302 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "no %cX%d CPPI channel", 'T', index); musb 308 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "no %cX%d CPPI channel", 'R', index); musb 319 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "re-allocating DMA%d %cX channel %p", musb 325 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "Allocate CPPI%d %cX", index, transmit ? 'T' : 'R'); musb 340 drivers/usb/musb/cppi_dma.c musb_dbg(c->controller->controller.musb, musb 359 drivers/usb/musb/cppi_dma.c musb_dbg(c->controller->controller.musb, musb 389 drivers/usb/musb/cppi_dma.c musb_dbg(c->controller->controller.musb, musb 561 drivers/usb/musb/cppi_dma.c cppi_next_tx_segment(struct musb *musb, struct cppi_channel *tx) musb 594 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "TX DMA%d, pktSz %d %s bds %d dma 0x%llx len %u", musb 601 drivers/usb/musb/cppi_dma.c cppi_rndis_update(tx, 0, musb->ctrl_base, rndis); musb 651 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "TXBD %p: nxt %08x buf %08x len %04x opt %08x", musb 762 drivers/usb/musb/cppi_dma.c cppi_next_rx_segment(struct musb *musb, struct cppi_channel *rx, int onepacket) musb 770 drivers/usb/musb/cppi_dma.c void __iomem *tibase = musb->ctrl_base; musb 781 drivers/usb/musb/cppi_dma.c && is_peripheral_active(musb) musb 808 drivers/usb/musb/cppi_dma.c if (is_host_active(musb)) musb 811 drivers/usb/musb/cppi_dma.c cppi_rndis_update(rx, 1, musb->ctrl_base, is_rndis); musb 815 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "RX DMA%d seg, maxp %d %s bds %d (cnt %d) " musb 926 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "bufcnt%d underrun - %d (for %d)", musb 953 drivers/usb/musb/cppi_dma.c struct musb *musb; musb 957 drivers/usb/musb/cppi_dma.c musb = controller->controller.musb; musb 975 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "%cX DMA%d not allocated!", musb 994 drivers/usb/musb/cppi_dma.c cppi_next_tx_segment(musb, cppi_ch); musb 996 drivers/usb/musb/cppi_dma.c cppi_next_rx_segment(musb, cppi_ch, mode); musb 1012 drivers/usb/musb/cppi_dma.c struct musb *musb = cppi->controller.musb; musb 1031 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "C/RXBD %llx: nxt %08x buf %08x " musb 1053 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "rx short %d/%d (%d)", musb 1103 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "list%d %p/%p, last %llx%s, csr %04x", musb 1124 drivers/usb/musb/cppi_dma.c if (is_host_active(cppi->controller.musb) musb 1143 drivers/usb/musb/cppi_dma.c struct musb *musb = dev_id; musb 1151 drivers/usb/musb/cppi_dma.c cppi = container_of(musb->dma_controller, struct cppi, controller); musb 1153 drivers/usb/musb/cppi_dma.c spin_lock_irqsave(&musb->lock, flags); musb 1155 drivers/usb/musb/cppi_dma.c tibase = musb->ctrl_base; musb 1162 drivers/usb/musb/cppi_dma.c spin_unlock_irqrestore(&musb->lock, flags); musb 1166 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "CPPI IRQ Tx%x Rx%x", tx, rx); musb 1194 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "null BD"); musb 1209 drivers/usb/musb/cppi_dma.c musb_dbg(musb, "C/TXBD %p n %x b %x off %x opt %x", musb 1246 drivers/usb/musb/cppi_dma.c musb_dma_completion(musb, index + 1, 1); musb 1252 drivers/usb/musb/cppi_dma.c cppi_next_tx_segment(musb, tx_ch); musb 1274 drivers/usb/musb/cppi_dma.c cppi_next_rx_segment(musb, rx_ch, 1); musb 1284 drivers/usb/musb/cppi_dma.c musb_dma_completion(musb, index + 1, 0); musb 1292 drivers/usb/musb/cppi_dma.c spin_unlock_irqrestore(&musb->lock, flags); musb 1300 drivers/usb/musb/cppi_dma.c cppi_dma_controller_create(struct musb *musb, void __iomem *mregs) musb 1303 drivers/usb/musb/cppi_dma.c struct device *dev = musb->controller; musb 1314 drivers/usb/musb/cppi_dma.c controller->controller.musb = musb; musb 1326 drivers/usb/musb/cppi_dma.c controller->controller.musb->controller, musb 1335 drivers/usb/musb/cppi_dma.c if (request_irq(irq, cppi_interrupt, 0, "cppi-dma", musb)) { musb 1360 drivers/usb/musb/cppi_dma.c free_irq(cppi->irq, cppi->controller.musb); musb 1472 drivers/usb/musb/cppi_dma.c if (is_host_active(cppi_ch->controller->controller.musb)) { musb 1481 drivers/usb/musb/cppi_dma.c if (is_host_active(cppi_ch->controller->controller.musb)) { musb 68 drivers/usb/musb/da8xx.c struct platform_device *musb; musb 84 drivers/usb/musb/da8xx.c static void da8xx_musb_enable(struct musb *musb) musb 86 drivers/usb/musb/da8xx.c void __iomem *reg_base = musb->ctrl_base; musb 90 drivers/usb/musb/da8xx.c mask = ((musb->epmask & DA8XX_USB_TX_EP_MASK) << DA8XX_INTR_TX_SHIFT) | musb 91 drivers/usb/musb/da8xx.c ((musb->epmask & DA8XX_USB_RX_EP_MASK) << DA8XX_INTR_RX_SHIFT) | musb 103 drivers/usb/musb/da8xx.c static void da8xx_musb_disable(struct musb *musb) musb 105 drivers/usb/musb/da8xx.c void __iomem *reg_base = musb->ctrl_base; musb 115 drivers/usb/musb/da8xx.c static void da8xx_musb_set_vbus(struct musb *musb, int is_on) musb 117 drivers/usb/musb/da8xx.c WARN_ON(is_on && is_peripheral_active(musb)); musb 124 drivers/usb/musb/da8xx.c struct musb *musb = from_timer(musb, t, dev_timer); musb 125 drivers/usb/musb/da8xx.c void __iomem *mregs = musb->mregs; musb 134 drivers/usb/musb/da8xx.c dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl, musb 135 drivers/usb/musb/da8xx.c usb_otg_state_string(musb->xceiv->otg->state)); musb 137 drivers/usb/musb/da8xx.c spin_lock_irqsave(&musb->lock, flags); musb 138 drivers/usb/musb/da8xx.c switch (musb->xceiv->otg->state) { musb 141 drivers/usb/musb/da8xx.c musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); musb 143 drivers/usb/musb/da8xx.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 145 drivers/usb/musb/da8xx.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 146 drivers/usb/musb/da8xx.c MUSB_DEV_MODE(musb); musb 148 drivers/usb/musb/da8xx.c musb->xceiv->otg->state = OTG_STATE_A_IDLE; musb 149 drivers/usb/musb/da8xx.c MUSB_HST_MODE(musb); musb 160 drivers/usb/musb/da8xx.c mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ); musb 163 drivers/usb/musb/da8xx.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 164 drivers/usb/musb/da8xx.c musb_writel(musb->ctrl_base, DA8XX_USB_INTR_SRC_SET_REG, musb 183 drivers/usb/musb/da8xx.c mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ); musb 185 drivers/usb/musb/da8xx.c musb->xceiv->otg->state = OTG_STATE_A_IDLE; musb 190 drivers/usb/musb/da8xx.c spin_unlock_irqrestore(&musb->lock, flags); musb 193 drivers/usb/musb/da8xx.c static void da8xx_musb_try_idle(struct musb *musb, unsigned long timeout) musb 201 drivers/usb/musb/da8xx.c if (musb->is_active || (musb->a_wait_bcon == 0 && musb 202 drivers/usb/musb/da8xx.c musb->xceiv->otg->state == OTG_STATE_A_WAIT_BCON)) { musb 203 drivers/usb/musb/da8xx.c dev_dbg(musb->controller, "%s active, deleting timer\n", musb 204 drivers/usb/musb/da8xx.c usb_otg_state_string(musb->xceiv->otg->state)); musb 205 drivers/usb/musb/da8xx.c del_timer(&musb->dev_timer); musb 210 drivers/usb/musb/da8xx.c if (time_after(last_timer, timeout) && timer_pending(&musb->dev_timer)) { musb 211 drivers/usb/musb/da8xx.c dev_dbg(musb->controller, "Longer idle timer already pending, ignoring...\n"); musb 216 drivers/usb/musb/da8xx.c dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n", musb 217 drivers/usb/musb/da8xx.c usb_otg_state_string(musb->xceiv->otg->state), musb 219 drivers/usb/musb/da8xx.c mod_timer(&musb->dev_timer, timeout); musb 224 drivers/usb/musb/da8xx.c struct musb *musb = hci; musb 225 drivers/usb/musb/da8xx.c void __iomem *reg_base = musb->ctrl_base; musb 230 drivers/usb/musb/da8xx.c spin_lock_irqsave(&musb->lock, flags); musb 243 drivers/usb/musb/da8xx.c dev_dbg(musb->controller, "USB IRQ %08x\n", status); musb 245 drivers/usb/musb/da8xx.c musb->int_rx = (status & DA8XX_INTR_RX_MASK) >> DA8XX_INTR_RX_SHIFT; musb 246 drivers/usb/musb/da8xx.c musb->int_tx = (status & DA8XX_INTR_TX_MASK) >> DA8XX_INTR_TX_SHIFT; musb 247 drivers/usb/musb/da8xx.c musb->int_usb = (status & DA8XX_INTR_USB_MASK) >> DA8XX_INTR_USB_SHIFT; musb 259 drivers/usb/musb/da8xx.c void __iomem *mregs = musb->mregs; musb 263 drivers/usb/musb/da8xx.c err = musb->int_usb & MUSB_INTR_VBUSERROR; musb 276 drivers/usb/musb/da8xx.c musb->int_usb &= ~MUSB_INTR_VBUSERROR; musb 277 drivers/usb/musb/da8xx.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VFALL; musb 278 drivers/usb/musb/da8xx.c mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ); musb 281 drivers/usb/musb/da8xx.c MUSB_HST_MODE(musb); musb 282 drivers/usb/musb/da8xx.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 283 drivers/usb/musb/da8xx.c portstate(musb->port1_status |= USB_PORT_STAT_POWER); musb 284 drivers/usb/musb/da8xx.c del_timer(&musb->dev_timer); musb 285 drivers/usb/musb/da8xx.c } else if (!(musb->int_usb & MUSB_INTR_BABBLE)) { musb 294 drivers/usb/musb/da8xx.c musb->is_active = 0; musb 295 drivers/usb/musb/da8xx.c MUSB_DEV_MODE(musb); musb 296 drivers/usb/musb/da8xx.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 297 drivers/usb/musb/da8xx.c portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); musb 300 drivers/usb/musb/da8xx.c dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n", musb 302 drivers/usb/musb/da8xx.c usb_otg_state_string(musb->xceiv->otg->state), musb 308 drivers/usb/musb/da8xx.c if (musb->int_tx || musb->int_rx || musb->int_usb) musb 309 drivers/usb/musb/da8xx.c ret |= musb_interrupt(musb); musb 317 drivers/usb/musb/da8xx.c if (musb->xceiv->otg->state == OTG_STATE_B_IDLE) musb 318 drivers/usb/musb/da8xx.c mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ); musb 320 drivers/usb/musb/da8xx.c spin_unlock_irqrestore(&musb->lock, flags); musb 325 drivers/usb/musb/da8xx.c static int da8xx_musb_set_mode(struct musb *musb, u8 musb_mode) musb 327 drivers/usb/musb/da8xx.c struct da8xx_glue *glue = dev_get_drvdata(musb->controller->parent); musb 334 drivers/usb/musb/da8xx.c if (!musb->is_initialized) musb 354 drivers/usb/musb/da8xx.c static int da8xx_musb_init(struct musb *musb) musb 356 drivers/usb/musb/da8xx.c struct da8xx_glue *glue = dev_get_drvdata(musb->controller->parent); musb 357 drivers/usb/musb/da8xx.c void __iomem *reg_base = musb->ctrl_base; musb 361 drivers/usb/musb/da8xx.c musb->mregs += DA8XX_MENTOR_CORE_OFFSET; musb 374 drivers/usb/musb/da8xx.c musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); musb 375 drivers/usb/musb/da8xx.c if (IS_ERR_OR_NULL(musb->xceiv)) { musb 380 drivers/usb/musb/da8xx.c timer_setup(&musb->dev_timer, otg_timer, 0); musb 404 drivers/usb/musb/da8xx.c musb->isr = da8xx_musb_interrupt; musb 414 drivers/usb/musb/da8xx.c static int da8xx_musb_exit(struct musb *musb) musb 416 drivers/usb/musb/da8xx.c struct da8xx_glue *glue = dev_get_drvdata(musb->controller->parent); musb 418 drivers/usb/musb/da8xx.c del_timer_sync(&musb->dev_timer); musb 424 drivers/usb/musb/da8xx.c usb_put_phy(musb->xceiv); musb 447 drivers/usb/musb/da8xx.c struct musb *musb = c->musb; musb 448 drivers/usb/musb/da8xx.c void __iomem *reg_base = musb->ctrl_base; musb 454 drivers/usb/musb/da8xx.c da8xx_dma_controller_create(struct musb *musb, void __iomem *base) musb 458 drivers/usb/musb/da8xx.c controller = cppi41_dma_controller_create(musb, base); musb 581 drivers/usb/musb/da8xx.c glue->musb = platform_device_register_full(&pinfo); musb 582 drivers/usb/musb/da8xx.c ret = PTR_ERR_OR_ZERO(glue->musb); musb 595 drivers/usb/musb/da8xx.c platform_device_unregister(glue->musb); musb 41 drivers/usb/musb/davinci.c struct platform_device *musb; musb 77 drivers/usb/musb/davinci.c static void davinci_musb_enable(struct musb *musb) musb 82 drivers/usb/musb/davinci.c tmp = (musb->epmask & DAVINCI_USB_TX_ENDPTS_MASK) musb 84 drivers/usb/musb/davinci.c musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_SET_REG, tmp); musb 86 drivers/usb/musb/davinci.c tmp = (musb->epmask & (0xfffe & DAVINCI_USB_RX_ENDPTS_MASK)) musb 88 drivers/usb/musb/davinci.c musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_SET_REG, tmp); musb 93 drivers/usb/musb/davinci.c musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_SET_REG, tmp); musb 102 drivers/usb/musb/davinci.c musb_writel(musb->ctrl_base, DAVINCI_USB_INT_SET_REG, musb 109 drivers/usb/musb/davinci.c static void davinci_musb_disable(struct musb *musb) musb 116 drivers/usb/musb/davinci.c musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_CLR_REG, musb 120 drivers/usb/musb/davinci.c musb_writel(musb->ctrl_base, DAVINCI_USB_EOI_REG, 0); musb 154 drivers/usb/musb/davinci.c static void davinci_musb_source_power(struct musb *musb, int is_on, int immediate) musb 177 drivers/usb/musb/davinci.c static void davinci_musb_set_vbus(struct musb *musb, int is_on) musb 179 drivers/usb/musb/davinci.c WARN_ON(is_on && is_peripheral_active(musb)); musb 180 drivers/usb/musb/davinci.c davinci_musb_source_power(musb, is_on, 0); musb 188 drivers/usb/musb/davinci.c struct musb *musb = from_timer(musb, t, dev_timer); musb 189 drivers/usb/musb/davinci.c void __iomem *mregs = musb->mregs; musb 197 drivers/usb/musb/davinci.c dev_dbg(musb->controller, "poll devctl %02x (%s)\n", devctl, musb 198 drivers/usb/musb/davinci.c usb_otg_state_string(musb->xceiv->otg->state)); musb 200 drivers/usb/musb/davinci.c spin_lock_irqsave(&musb->lock, flags); musb 201 drivers/usb/musb/davinci.c switch (musb->xceiv->otg->state) { musb 209 drivers/usb/musb/davinci.c mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ); musb 212 drivers/usb/musb/davinci.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 213 drivers/usb/musb/davinci.c musb_writel(musb->ctrl_base, DAVINCI_USB_INT_SET_REG, musb 233 drivers/usb/musb/davinci.c mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ); musb 235 drivers/usb/musb/davinci.c musb->xceiv->otg->state = OTG_STATE_A_IDLE; musb 240 drivers/usb/musb/davinci.c spin_unlock_irqrestore(&musb->lock, flags); musb 247 drivers/usb/musb/davinci.c struct musb *musb = __hci; musb 248 drivers/usb/musb/davinci.c struct usb_otg *otg = musb->xceiv->otg; musb 249 drivers/usb/musb/davinci.c void __iomem *tibase = musb->ctrl_base; musb 253 drivers/usb/musb/davinci.c spin_lock_irqsave(&musb->lock, flags); musb 267 drivers/usb/musb/davinci.c cppi = container_of(musb->dma_controller, struct cppi, controller); musb 268 drivers/usb/musb/davinci.c if (is_cppi_enabled(musb) && musb->dma_controller && !cppi->irq) musb 274 drivers/usb/musb/davinci.c dev_dbg(musb->controller, "IRQ %08x\n", tmp); musb 276 drivers/usb/musb/davinci.c musb->int_rx = (tmp & DAVINCI_USB_RXINT_MASK) musb 278 drivers/usb/musb/davinci.c musb->int_tx = (tmp & DAVINCI_USB_TXINT_MASK) musb 280 drivers/usb/musb/davinci.c musb->int_usb = (tmp & DAVINCI_USB_USBINT_MASK) musb 292 drivers/usb/musb/davinci.c void __iomem *mregs = musb->mregs; musb 294 drivers/usb/musb/davinci.c int err = musb->int_usb & MUSB_INTR_VBUSERROR; musb 296 drivers/usb/musb/davinci.c err = musb->int_usb & MUSB_INTR_VBUSERROR; musb 308 drivers/usb/musb/davinci.c musb->int_usb &= ~MUSB_INTR_VBUSERROR; musb 309 drivers/usb/musb/davinci.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VFALL; musb 310 drivers/usb/musb/davinci.c mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ); musb 313 drivers/usb/musb/davinci.c MUSB_HST_MODE(musb); musb 314 drivers/usb/musb/davinci.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 315 drivers/usb/musb/davinci.c portstate(musb->port1_status |= USB_PORT_STAT_POWER); musb 316 drivers/usb/musb/davinci.c del_timer(&musb->dev_timer); musb 318 drivers/usb/musb/davinci.c musb->is_active = 0; musb 319 drivers/usb/musb/davinci.c MUSB_DEV_MODE(musb); musb 320 drivers/usb/musb/davinci.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 321 drivers/usb/musb/davinci.c portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); musb 327 drivers/usb/musb/davinci.c davinci_musb_source_power(musb, drvvbus, 0); musb 328 drivers/usb/musb/davinci.c dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n", musb 330 drivers/usb/musb/davinci.c usb_otg_state_string(musb->xceiv->otg->state), musb 336 drivers/usb/musb/davinci.c if (musb->int_tx || musb->int_rx || musb->int_usb) musb 337 drivers/usb/musb/davinci.c retval |= musb_interrupt(musb); musb 343 drivers/usb/musb/davinci.c if (musb->xceiv->otg->state == OTG_STATE_B_IDLE) musb 344 drivers/usb/musb/davinci.c mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ); musb 346 drivers/usb/musb/davinci.c spin_unlock_irqrestore(&musb->lock, flags); musb 351 drivers/usb/musb/davinci.c static int davinci_musb_set_mode(struct musb *musb, u8 mode) musb 357 drivers/usb/musb/davinci.c static int davinci_musb_init(struct musb *musb) musb 359 drivers/usb/musb/davinci.c void __iomem *tibase = musb->ctrl_base; musb 363 drivers/usb/musb/davinci.c musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); musb 364 drivers/usb/musb/davinci.c if (IS_ERR_OR_NULL(musb->xceiv)) { musb 369 drivers/usb/musb/davinci.c musb->mregs += DAVINCI_BASE_OFFSET; musb 376 drivers/usb/musb/davinci.c timer_setup(&musb->dev_timer, otg_timer, 0); musb 378 drivers/usb/musb/davinci.c davinci_musb_source_power(musb, 0, 1); musb 414 drivers/usb/musb/davinci.c musb->isr = davinci_musb_interrupt; musb 418 drivers/usb/musb/davinci.c usb_put_phy(musb->xceiv); musb 424 drivers/usb/musb/davinci.c static int davinci_musb_exit(struct musb *musb) musb 429 drivers/usb/musb/davinci.c del_timer_sync(&musb->dev_timer); musb 440 drivers/usb/musb/davinci.c davinci_musb_source_power(musb, 0 /*off*/, 1); musb 448 drivers/usb/musb/davinci.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 453 drivers/usb/musb/davinci.c dev_dbg(musb->controller, "VBUS %d\n", musb 462 drivers/usb/musb/davinci.c dev_dbg(musb->controller, "VBUS off timeout (devctl %02x)\n", devctl); musb 466 drivers/usb/musb/davinci.c usb_put_phy(musb->xceiv); musb 498 drivers/usb/musb/davinci.c struct platform_device *musb; musb 559 drivers/usb/musb/davinci.c glue->musb = musb = platform_device_register_full(&pinfo); musb 560 drivers/usb/musb/davinci.c if (IS_ERR(musb)) { musb 561 drivers/usb/musb/davinci.c ret = PTR_ERR(musb); musb 579 drivers/usb/musb/davinci.c platform_device_unregister(glue->musb); musb 21 drivers/usb/musb/jz4740.c struct platform_device *musb; musb 29 drivers/usb/musb/jz4740.c struct musb *musb = __hci; musb 31 drivers/usb/musb/jz4740.c spin_lock_irqsave(&musb->lock, flags); musb 33 drivers/usb/musb/jz4740.c musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB); musb 34 drivers/usb/musb/jz4740.c musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX); musb 35 drivers/usb/musb/jz4740.c musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX); musb 42 drivers/usb/musb/jz4740.c musb->int_usb &= MUSB_INTR_SUSPEND | MUSB_INTR_RESUME | musb 45 drivers/usb/musb/jz4740.c if (musb->int_usb || musb->int_tx || musb->int_rx) musb 46 drivers/usb/musb/jz4740.c retval = musb_interrupt(musb); musb 48 drivers/usb/musb/jz4740.c spin_unlock_irqrestore(&musb->lock, flags); musb 75 drivers/usb/musb/jz4740.c static int jz4740_musb_init(struct musb *musb) musb 77 drivers/usb/musb/jz4740.c struct device *dev = musb->controller->parent; musb 81 drivers/usb/musb/jz4740.c musb->xceiv = devm_usb_get_phy_by_phandle(dev, "phys", 0); musb 83 drivers/usb/musb/jz4740.c musb->xceiv = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); musb 84 drivers/usb/musb/jz4740.c if (IS_ERR(musb->xceiv)) { musb 85 drivers/usb/musb/jz4740.c err = PTR_ERR(musb->xceiv); musb 94 drivers/usb/musb/jz4740.c musb->dyn_fifo = true; musb 96 drivers/usb/musb/jz4740.c musb->isr = jz4740_musb_interrupt; musb 114 drivers/usb/musb/jz4740.c struct platform_device *musb; musb 123 drivers/usb/musb/jz4740.c musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO); musb 124 drivers/usb/musb/jz4740.c if (!musb) { musb 142 drivers/usb/musb/jz4740.c musb->dev.parent = &pdev->dev; musb 145 drivers/usb/musb/jz4740.c glue->musb = musb; musb 152 drivers/usb/musb/jz4740.c ret = platform_device_add_resources(musb, pdev->resource, musb 159 drivers/usb/musb/jz4740.c ret = platform_device_add_data(musb, pdata, sizeof(*pdata)); musb 165 drivers/usb/musb/jz4740.c ret = platform_device_add(musb); musb 176 drivers/usb/musb/jz4740.c platform_device_put(musb); musb 184 drivers/usb/musb/jz4740.c platform_device_unregister(glue->musb); musb 104 drivers/usb/musb/musb_core.c static inline struct musb *dev_to_musb(struct device *dev) musb 283 drivers/usb/musb/musb_core.c struct musb *musb = hw_ep->musb; musb 291 drivers/usb/musb/musb_core.c dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n", musb 327 drivers/usb/musb/musb_core.c struct musb *musb = hw_ep->musb; musb 333 drivers/usb/musb/musb_core.c dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n", musb 397 drivers/usb/musb/musb_core.c (*musb_dma_controller_create)(struct musb *musb, void __iomem *base); musb 409 drivers/usb/musb/musb_core.c return hw_ep->musb->io.read_fifo(hw_ep, len, dst); musb 414 drivers/usb/musb/musb_core.c return hw_ep->musb->io.write_fifo(hw_ep, len, src); musb 439 drivers/usb/musb/musb_core.c void musb_load_testpacket(struct musb *musb) musb 441 drivers/usb/musb/musb_core.c void __iomem *regs = musb->endpoints[0].regs; musb 443 drivers/usb/musb/musb_core.c musb_ep_select(musb->mregs, 0); musb 444 drivers/usb/musb/musb_core.c musb_write_fifo(musb->control_ep, musb 456 drivers/usb/musb/musb_core.c struct musb *musb = from_timer(musb, t, otg_timer); musb 459 drivers/usb/musb/musb_core.c spin_lock_irqsave(&musb->lock, flags); musb 460 drivers/usb/musb/musb_core.c switch (musb->xceiv->otg->state) { musb 462 drivers/usb/musb/musb_core.c musb_dbg(musb, musb 464 drivers/usb/musb/musb_core.c musb_g_disconnect(musb); musb 465 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; musb 466 drivers/usb/musb/musb_core.c musb->is_active = 0; musb 470 drivers/usb/musb/musb_core.c musb_dbg(musb, "HNP: %s timeout", musb 471 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 472 drivers/usb/musb/musb_core.c musb_platform_set_vbus(musb, 0); musb 473 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VFALL; musb 476 drivers/usb/musb/musb_core.c musb_dbg(musb, "HNP: Unhandled mode %s", musb 477 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 479 drivers/usb/musb/musb_core.c spin_unlock_irqrestore(&musb->lock, flags); musb 485 drivers/usb/musb/musb_core.c void musb_hnp_stop(struct musb *musb) musb 487 drivers/usb/musb/musb_core.c struct usb_hcd *hcd = musb->hcd; musb 488 drivers/usb/musb/musb_core.c void __iomem *mbase = musb->mregs; musb 491 drivers/usb/musb/musb_core.c musb_dbg(musb, "HNP: stop from %s", musb 492 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 494 drivers/usb/musb/musb_core.c switch (musb->xceiv->otg->state) { musb 496 drivers/usb/musb/musb_core.c musb_g_disconnect(musb); musb 497 drivers/usb/musb/musb_core.c musb_dbg(musb, "HNP: back to %s", musb 498 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 501 drivers/usb/musb/musb_core.c musb_dbg(musb, "HNP: Disabling HR"); musb 504 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; musb 505 drivers/usb/musb/musb_core.c MUSB_DEV_MODE(musb); musb 512 drivers/usb/musb/musb_core.c musb_dbg(musb, "HNP: Stopping in unknown state %s", musb 513 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 521 drivers/usb/musb/musb_core.c musb->port1_status &= ~(USB_PORT_STAT_C_CONNECTION << 16); musb 524 drivers/usb/musb/musb_core.c static void musb_recover_from_babble(struct musb *musb); musb 526 drivers/usb/musb/musb_core.c static void musb_handle_intr_resume(struct musb *musb, u8 devctl) musb 528 drivers/usb/musb/musb_core.c musb_dbg(musb, "RESUME (%s)", musb 529 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 532 drivers/usb/musb/musb_core.c switch (musb->xceiv->otg->state) { musb 535 drivers/usb/musb/musb_core.c musb->port1_status |= musb 538 drivers/usb/musb/musb_core.c musb->rh_timer = jiffies musb 540 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_A_HOST; musb 541 drivers/usb/musb/musb_core.c musb->is_active = 1; musb 542 drivers/usb/musb/musb_core.c musb_host_resume_root_hub(musb); musb 543 drivers/usb/musb/musb_core.c schedule_delayed_work(&musb->finish_resume_work, musb 547 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; musb 548 drivers/usb/musb/musb_core.c musb->is_active = 1; musb 549 drivers/usb/musb/musb_core.c MUSB_DEV_MODE(musb); musb 554 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 557 drivers/usb/musb/musb_core.c switch (musb->xceiv->otg->state) { musb 560 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_A_HOST; musb 561 drivers/usb/musb/musb_core.c musb_host_resume_root_hub(musb); musb 571 drivers/usb/musb/musb_core.c musb->int_usb |= MUSB_INTR_DISCONNECT; musb 572 drivers/usb/musb/musb_core.c musb->int_usb &= ~MUSB_INTR_SUSPEND; musb 575 drivers/usb/musb/musb_core.c musb_g_resume(musb); musb 578 drivers/usb/musb/musb_core.c musb->int_usb &= ~MUSB_INTR_SUSPEND; musb 583 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 589 drivers/usb/musb/musb_core.c static irqreturn_t musb_handle_intr_sessreq(struct musb *musb, u8 devctl) musb 591 drivers/usb/musb/musb_core.c void __iomem *mbase = musb->mregs; musb 595 drivers/usb/musb/musb_core.c musb_dbg(musb, "SessReq while on B state"); musb 599 drivers/usb/musb/musb_core.c musb_dbg(musb, "SESSION_REQUEST (%s)", musb 600 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 610 drivers/usb/musb/musb_core.c musb->ep0_stage = MUSB_EP0_START; musb 611 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_A_IDLE; musb 612 drivers/usb/musb/musb_core.c MUSB_HST_MODE(musb); musb 613 drivers/usb/musb/musb_core.c musb_platform_set_vbus(musb, 1); musb 618 drivers/usb/musb/musb_core.c static void musb_handle_intr_vbuserr(struct musb *musb, u8 devctl) musb 638 drivers/usb/musb/musb_core.c switch (musb->xceiv->otg->state) { musb 648 drivers/usb/musb/musb_core.c if (musb->vbuserr_retry) { musb 649 drivers/usb/musb/musb_core.c void __iomem *mbase = musb->mregs; musb 651 drivers/usb/musb/musb_core.c musb->vbuserr_retry--; musb 656 drivers/usb/musb/musb_core.c musb->port1_status |= musb 665 drivers/usb/musb/musb_core.c dev_printk(ignore ? KERN_DEBUG : KERN_ERR, musb->controller, musb 667 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state), musb 681 drivers/usb/musb/musb_core.c VBUSERR_RETRY_COUNT - musb->vbuserr_retry, musb 682 drivers/usb/musb/musb_core.c musb->port1_status); musb 686 drivers/usb/musb/musb_core.c musb_platform_set_vbus(musb, 0); musb 689 drivers/usb/musb/musb_core.c static void musb_handle_intr_suspend(struct musb *musb, u8 devctl) musb 691 drivers/usb/musb/musb_core.c musb_dbg(musb, "SUSPEND (%s) devctl %02x", musb 692 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state), devctl); musb 694 drivers/usb/musb/musb_core.c switch (musb->xceiv->otg->state) { musb 703 drivers/usb/musb/musb_core.c musb_hnp_stop(musb); musb 704 drivers/usb/musb/musb_core.c musb_host_resume_root_hub(musb); musb 705 drivers/usb/musb/musb_core.c musb_root_disconnect(musb); musb 706 drivers/usb/musb/musb_core.c musb_platform_try_idle(musb, jiffies musb 707 drivers/usb/musb/musb_core.c + msecs_to_jiffies(musb->a_wait_bcon musb 712 drivers/usb/musb/musb_core.c if (!musb->is_active) musb 716 drivers/usb/musb/musb_core.c musb_g_suspend(musb); musb 717 drivers/usb/musb/musb_core.c musb->is_active = musb->g.b_hnp_enable; musb 718 drivers/usb/musb/musb_core.c if (musb->is_active) { musb 719 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_B_WAIT_ACON; musb 720 drivers/usb/musb/musb_core.c musb_dbg(musb, "HNP: Setting timer for b_ase0_brst"); musb 721 drivers/usb/musb/musb_core.c mod_timer(&musb->otg_timer, jiffies musb 727 drivers/usb/musb/musb_core.c if (musb->a_wait_bcon != 0) musb 728 drivers/usb/musb/musb_core.c musb_platform_try_idle(musb, jiffies musb 729 drivers/usb/musb/musb_core.c + msecs_to_jiffies(musb->a_wait_bcon)); musb 732 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_A_SUSPEND; musb 733 drivers/usb/musb/musb_core.c musb->is_active = musb->hcd->self.b_hnp_enable; musb 737 drivers/usb/musb/musb_core.c musb_dbg(musb, "REVISIT: SUSPEND as B_HOST"); musb 741 drivers/usb/musb/musb_core.c musb->is_active = 0; musb 746 drivers/usb/musb/musb_core.c static void musb_handle_intr_connect(struct musb *musb, u8 devctl, u8 int_usb) musb 748 drivers/usb/musb/musb_core.c struct usb_hcd *hcd = musb->hcd; musb 750 drivers/usb/musb/musb_core.c musb->is_active = 1; musb 751 drivers/usb/musb/musb_core.c musb->ep0_stage = MUSB_EP0_START; musb 753 drivers/usb/musb/musb_core.c musb->intrtxe = musb->epmask; musb 754 drivers/usb/musb/musb_core.c musb_writew(musb->mregs, MUSB_INTRTXE, musb->intrtxe); musb 755 drivers/usb/musb/musb_core.c musb->intrrxe = musb->epmask & 0xfffe; musb 756 drivers/usb/musb/musb_core.c musb_writew(musb->mregs, MUSB_INTRRXE, musb->intrrxe); musb 757 drivers/usb/musb/musb_core.c musb_writeb(musb->mregs, MUSB_INTRUSBE, 0xf7); musb 758 drivers/usb/musb/musb_core.c musb->port1_status &= ~(USB_PORT_STAT_LOW_SPEED musb 762 drivers/usb/musb/musb_core.c musb->port1_status |= USB_PORT_STAT_CONNECTION musb 767 drivers/usb/musb/musb_core.c musb->port1_status |= USB_PORT_STAT_LOW_SPEED; musb 770 drivers/usb/musb/musb_core.c switch (musb->xceiv->otg->state) { musb 773 drivers/usb/musb/musb_core.c musb_dbg(musb, "HNP: SUSPEND+CONNECT, now b_host"); musb 777 drivers/usb/musb/musb_core.c musb_dbg(musb, "CONNECT as b_peripheral???"); musb 780 drivers/usb/musb/musb_core.c musb_dbg(musb, "HNP: CONNECT, now b_host"); musb 782 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_B_HOST; musb 783 drivers/usb/musb/musb_core.c if (musb->hcd) musb 784 drivers/usb/musb/musb_core.c musb->hcd->self.is_b_host = 1; musb 785 drivers/usb/musb/musb_core.c del_timer(&musb->otg_timer); musb 790 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_A_HOST; musb 797 drivers/usb/musb/musb_core.c musb_host_poke_root_hub(musb); musb 799 drivers/usb/musb/musb_core.c musb_dbg(musb, "CONNECT (%s) devctl %02x", musb 800 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state), devctl); musb 803 drivers/usb/musb/musb_core.c static void musb_handle_intr_disconnect(struct musb *musb, u8 devctl) musb 805 drivers/usb/musb/musb_core.c musb_dbg(musb, "DISCONNECT (%s) as %s, devctl %02x", musb 806 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state), musb 807 drivers/usb/musb/musb_core.c MUSB_MODE(musb), devctl); musb 809 drivers/usb/musb/musb_core.c switch (musb->xceiv->otg->state) { musb 812 drivers/usb/musb/musb_core.c musb_host_resume_root_hub(musb); musb 813 drivers/usb/musb/musb_core.c musb_root_disconnect(musb); musb 814 drivers/usb/musb/musb_core.c if (musb->a_wait_bcon != 0) musb 815 drivers/usb/musb/musb_core.c musb_platform_try_idle(musb, jiffies musb 816 drivers/usb/musb/musb_core.c + msecs_to_jiffies(musb->a_wait_bcon)); musb 824 drivers/usb/musb/musb_core.c musb_root_disconnect(musb); musb 825 drivers/usb/musb/musb_core.c if (musb->hcd) musb 826 drivers/usb/musb/musb_core.c musb->hcd->self.is_b_host = 0; musb 827 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; musb 828 drivers/usb/musb/musb_core.c MUSB_DEV_MODE(musb); musb 829 drivers/usb/musb/musb_core.c musb_g_disconnect(musb); musb 832 drivers/usb/musb/musb_core.c musb_hnp_stop(musb); musb 833 drivers/usb/musb/musb_core.c musb_root_disconnect(musb); musb 839 drivers/usb/musb/musb_core.c musb_g_disconnect(musb); musb 843 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 852 drivers/usb/musb/musb_core.c static void musb_handle_intr_reset(struct musb *musb) musb 854 drivers/usb/musb/musb_core.c if (is_host_active(musb)) { musb 863 drivers/usb/musb/musb_core.c dev_err(musb->controller, "Babble\n"); musb 864 drivers/usb/musb/musb_core.c musb_recover_from_babble(musb); musb 866 drivers/usb/musb/musb_core.c musb_dbg(musb, "BUS RESET as %s", musb 867 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 868 drivers/usb/musb/musb_core.c switch (musb->xceiv->otg->state) { musb 870 drivers/usb/musb/musb_core.c musb_g_reset(musb); musb 874 drivers/usb/musb/musb_core.c musb_dbg(musb, "HNP: in %s, %d msec timeout", musb 875 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state), musb 876 drivers/usb/musb/musb_core.c TA_WAIT_BCON(musb)); musb 877 drivers/usb/musb/musb_core.c mod_timer(&musb->otg_timer, jiffies musb 878 drivers/usb/musb/musb_core.c + msecs_to_jiffies(TA_WAIT_BCON(musb))); musb 881 drivers/usb/musb/musb_core.c del_timer(&musb->otg_timer); musb 882 drivers/usb/musb/musb_core.c musb_g_reset(musb); musb 885 drivers/usb/musb/musb_core.c musb_dbg(musb, "HNP: RESET (%s), to b_peripheral", musb 886 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 887 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; musb 888 drivers/usb/musb/musb_core.c musb_g_reset(musb); musb 891 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; musb 894 drivers/usb/musb/musb_core.c musb_g_reset(musb); musb 897 drivers/usb/musb/musb_core.c musb_dbg(musb, "Unhandled BUS RESET as %s", musb 898 drivers/usb/musb/musb_core.c usb_otg_state_string(musb->xceiv->otg->state)); musb 915 drivers/usb/musb/musb_core.c static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, musb 920 drivers/usb/musb/musb_core.c musb_dbg(musb, "<== DevCtl=%02x, int_usb=0x%x", devctl, int_usb); musb 927 drivers/usb/musb/musb_core.c musb_handle_intr_resume(musb, devctl); musb 933 drivers/usb/musb/musb_core.c if (musb_handle_intr_sessreq(musb, devctl)) musb 939 drivers/usb/musb/musb_core.c musb_handle_intr_vbuserr(musb, devctl); musb 944 drivers/usb/musb/musb_core.c musb_handle_intr_suspend(musb, devctl); musb 949 drivers/usb/musb/musb_core.c musb_handle_intr_connect(musb, devctl, int_usb); musb 954 drivers/usb/musb/musb_core.c musb_handle_intr_disconnect(musb, devctl); musb 959 drivers/usb/musb/musb_core.c musb_handle_intr_reset(musb); musb 976 drivers/usb/musb/musb_core.c void __iomem *mbase = musb->mregs; musb 981 drivers/usb/musb/musb_core.c dev_dbg(musb->controller, "START_OF_FRAME\n"); musb 986 drivers/usb/musb/musb_core.c ep = musb->endpoints; musb 987 drivers/usb/musb/musb_core.c for (epnum = 1; (epnum < musb->nr_endpoints) musb 988 drivers/usb/musb/musb_core.c && (musb->epmask >= (1 << epnum)); musb 1000 drivers/usb/musb/musb_core.c musb_h_tx_start(musb, epnum); musb 1002 drivers/usb/musb/musb_core.c cppi_hostdma_start(musb, epnum); musb 1008 drivers/usb/musb/musb_core.c schedule_delayed_work(&musb->irq_work, 0); musb 1015 drivers/usb/musb/musb_core.c static void musb_disable_interrupts(struct musb *musb) musb 1017 drivers/usb/musb/musb_core.c void __iomem *mbase = musb->mregs; musb 1022 drivers/usb/musb/musb_core.c musb->intrtxe = 0; musb 1024 drivers/usb/musb/musb_core.c musb->intrrxe = 0; musb 1033 drivers/usb/musb/musb_core.c static void musb_enable_interrupts(struct musb *musb) musb 1035 drivers/usb/musb/musb_core.c void __iomem *regs = musb->mregs; musb 1038 drivers/usb/musb/musb_core.c musb->intrtxe = musb->epmask; musb 1039 drivers/usb/musb/musb_core.c musb_writew(regs, MUSB_INTRTXE, musb->intrtxe); musb 1040 drivers/usb/musb/musb_core.c musb->intrrxe = musb->epmask & 0xfffe; musb 1041 drivers/usb/musb/musb_core.c musb_writew(regs, MUSB_INTRRXE, musb->intrrxe); musb 1049 drivers/usb/musb/musb_core.c void musb_start(struct musb *musb) musb 1051 drivers/usb/musb/musb_core.c void __iomem *regs = musb->mregs; musb 1055 drivers/usb/musb/musb_core.c musb_dbg(musb, "<== devctl %02x", devctl); musb 1057 drivers/usb/musb/musb_core.c musb_enable_interrupts(musb); musb 1065 drivers/usb/musb/musb_core.c if (musb->config->maximum_speed == USB_SPEED_HIGH || musb 1066 drivers/usb/musb/musb_core.c musb->config->maximum_speed == USB_SPEED_UNKNOWN) musb 1070 drivers/usb/musb/musb_core.c musb->is_active = 0; musb 1079 drivers/usb/musb/musb_core.c if (musb->port_mode != MUSB_HOST && musb 1080 drivers/usb/musb/musb_core.c musb->xceiv->otg->state != OTG_STATE_A_WAIT_BCON && musb 1082 drivers/usb/musb/musb_core.c musb->is_active = 1; musb 1087 drivers/usb/musb/musb_core.c musb_platform_enable(musb); musb 1098 drivers/usb/musb/musb_core.c void musb_stop(struct musb *musb) musb 1101 drivers/usb/musb/musb_core.c musb_platform_disable(musb); musb 1102 drivers/usb/musb/musb_core.c musb_disable_interrupts(musb); musb 1103 drivers/usb/musb/musb_core.c musb_writeb(musb->mregs, MUSB_DEVCTL, 0); musb 1112 drivers/usb/musb/musb_core.c musb_platform_try_idle(musb, 0); musb 1245 drivers/usb/musb/musb_core.c fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, musb 1248 drivers/usb/musb/musb_core.c void __iomem *mbase = musb->mregs; musb 1262 drivers/usb/musb/musb_core.c (1 << (musb->config->ram_bits + 2))) musb 1266 drivers/usb/musb/musb_core.c if ((offset + maxpacket) > (1 << (musb->config->ram_bits + 2))) musb 1277 drivers/usb/musb/musb_core.c musb->bulk_ep = hw_ep; musb 1310 drivers/usb/musb/musb_core.c musb->epmask |= (1 << hw_ep->epnum); musb 1319 drivers/usb/musb/musb_core.c static int ep_config_from_table(struct musb *musb) musb 1324 drivers/usb/musb/musb_core.c struct musb_hw_ep *hw_ep = musb->endpoints; musb 1326 drivers/usb/musb/musb_core.c if (musb->config->fifo_cfg) { musb 1327 drivers/usb/musb/musb_core.c cfg = musb->config->fifo_cfg; musb 1328 drivers/usb/musb/musb_core.c n = musb->config->fifo_cfg_size; musb 1366 drivers/usb/musb/musb_core.c offset = fifo_setup(musb, hw_ep, &ep0_cfg, 0); musb 1376 drivers/usb/musb/musb_core.c if (epn >= musb->config->num_eps) { musb 1381 drivers/usb/musb/musb_core.c offset = fifo_setup(musb, hw_ep + epn, cfg++, offset); musb 1388 drivers/usb/musb/musb_core.c musb->nr_endpoints = max(epn, musb->nr_endpoints); musb 1393 drivers/usb/musb/musb_core.c n + 1, musb->config->num_eps * 2 - 1, musb 1394 drivers/usb/musb/musb_core.c offset, (1 << (musb->config->ram_bits + 2))); musb 1396 drivers/usb/musb/musb_core.c if (!musb->bulk_ep) { musb 1409 drivers/usb/musb/musb_core.c static int ep_config_from_hw(struct musb *musb) musb 1413 drivers/usb/musb/musb_core.c void __iomem *mbase = musb->mregs; musb 1416 drivers/usb/musb/musb_core.c musb_dbg(musb, "<== static silicon ep config"); musb 1420 drivers/usb/musb/musb_core.c for (epnum = 1; epnum < musb->config->num_eps; epnum++) { musb 1422 drivers/usb/musb/musb_core.c hw_ep = musb->endpoints + epnum; musb 1424 drivers/usb/musb/musb_core.c ret = musb_read_fifosize(musb, hw_ep, epnum); musb 1438 drivers/usb/musb/musb_core.c if (musb->bulk_ep) musb 1440 drivers/usb/musb/musb_core.c musb->bulk_ep = hw_ep; musb 1443 drivers/usb/musb/musb_core.c if (!musb->bulk_ep) { musb 1456 drivers/usb/musb/musb_core.c static int musb_core_init(u16 musb_type, struct musb *musb) musb 1461 drivers/usb/musb/musb_core.c void __iomem *mbase = musb->mregs; musb 1471 drivers/usb/musb/musb_core.c musb->dyn_fifo = true; musb 1475 drivers/usb/musb/musb_core.c musb->bulk_combine = true; musb 1479 drivers/usb/musb/musb_core.c musb->bulk_split = true; musb 1483 drivers/usb/musb/musb_core.c musb->hb_iso_rx = true; musb 1487 drivers/usb/musb/musb_core.c musb->hb_iso_tx = true; musb 1495 drivers/usb/musb/musb_core.c musb->is_multipoint = 1; musb 1498 drivers/usb/musb/musb_core.c musb->is_multipoint = 0; musb 1508 drivers/usb/musb/musb_core.c musb->hwvers = musb_readw(mbase, MUSB_HWVERS); musb 1510 drivers/usb/musb/musb_core.c musb_driver_name, type, MUSB_HWVERS_MAJOR(musb->hwvers), musb 1511 drivers/usb/musb/musb_core.c MUSB_HWVERS_MINOR(musb->hwvers), musb 1512 drivers/usb/musb/musb_core.c (musb->hwvers & MUSB_HWVERS_RC) ? "RC" : ""); musb 1515 drivers/usb/musb/musb_core.c musb_configure_ep0(musb); musb 1518 drivers/usb/musb/musb_core.c musb->nr_endpoints = 1; musb 1519 drivers/usb/musb/musb_core.c musb->epmask = 1; musb 1521 drivers/usb/musb/musb_core.c if (musb->dyn_fifo) musb 1522 drivers/usb/musb/musb_core.c status = ep_config_from_table(musb); musb 1524 drivers/usb/musb/musb_core.c status = ep_config_from_hw(musb); musb 1530 drivers/usb/musb/musb_core.c for (i = 0; i < musb->nr_endpoints; i++) { musb 1531 drivers/usb/musb/musb_core.c struct musb_hw_ep *hw_ep = musb->endpoints + i; musb 1533 drivers/usb/musb/musb_core.c hw_ep->fifo = musb->io.fifo_offset(i) + mbase; musb 1535 drivers/usb/musb/musb_core.c if (musb->ops->quirks & MUSB_IN_TUSB) { musb 1536 drivers/usb/musb/musb_core.c hw_ep->fifo_async = musb->async + 0x400 + musb 1537 drivers/usb/musb/musb_core.c musb->io.fifo_offset(i); musb 1538 drivers/usb/musb/musb_core.c hw_ep->fifo_sync = musb->sync + 0x400 + musb 1539 drivers/usb/musb/musb_core.c musb->io.fifo_offset(i); musb 1541 drivers/usb/musb/musb_core.c musb->sync_va + 0x400 + musb->io.fifo_offset(i); musb 1551 drivers/usb/musb/musb_core.c hw_ep->regs = musb->io.ep_offset(i, 0) + mbase; musb 1556 drivers/usb/musb/musb_core.c musb_dbg(musb, "%s: hw_ep %d%s, %smax %d", musb 1564 drivers/usb/musb/musb_core.c musb_dbg(musb, "%s: hw_ep %d%s, %smax %d", musb 1572 drivers/usb/musb/musb_core.c musb_dbg(musb, "hw_ep %d not configured", i); musb 1587 drivers/usb/musb/musb_core.c irqreturn_t musb_interrupt(struct musb *musb) musb 1594 drivers/usb/musb/musb_core.c if (!musb->int_usb && !musb->int_tx && !musb->int_rx) musb 1597 drivers/usb/musb/musb_core.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 1599 drivers/usb/musb/musb_core.c trace_musb_isr(musb); musb 1621 drivers/usb/musb/musb_core.c if (musb->int_usb) musb 1622 drivers/usb/musb/musb_core.c retval |= musb_stage0_irq(musb, musb->int_usb, devctl); musb 1624 drivers/usb/musb/musb_core.c if (musb->int_tx & 1) { musb 1625 drivers/usb/musb/musb_core.c if (is_host_active(musb)) musb 1626 drivers/usb/musb/musb_core.c retval |= musb_h_ep0_irq(musb); musb 1628 drivers/usb/musb/musb_core.c retval |= musb_g_ep0_irq(musb); musb 1631 drivers/usb/musb/musb_core.c musb->int_tx &= ~BIT(0); musb 1634 drivers/usb/musb/musb_core.c status = musb->int_tx; musb 1638 drivers/usb/musb/musb_core.c if (is_host_active(musb)) musb 1639 drivers/usb/musb/musb_core.c musb_host_tx(musb, epnum); musb 1641 drivers/usb/musb/musb_core.c musb_g_tx(musb, epnum); musb 1644 drivers/usb/musb/musb_core.c status = musb->int_rx; musb 1648 drivers/usb/musb/musb_core.c if (is_host_active(musb)) musb 1649 drivers/usb/musb/musb_core.c musb_host_rx(musb, epnum); musb 1651 drivers/usb/musb/musb_core.c musb_g_rx(musb, epnum); musb 1665 drivers/usb/musb/musb_core.c void musb_dma_completion(struct musb *musb, u8 epnum, u8 transmit) musb 1670 drivers/usb/musb/musb_core.c if (!is_cppi_enabled(musb)) { musb 1672 drivers/usb/musb/musb_core.c if (is_host_active(musb)) musb 1673 drivers/usb/musb/musb_core.c musb_h_ep0_irq(musb); musb 1675 drivers/usb/musb/musb_core.c musb_g_ep0_irq(musb); musb 1680 drivers/usb/musb/musb_core.c if (is_host_active(musb)) musb 1681 drivers/usb/musb/musb_core.c musb_host_tx(musb, epnum); musb 1683 drivers/usb/musb/musb_core.c musb_g_tx(musb, epnum); musb 1686 drivers/usb/musb/musb_core.c if (is_host_active(musb)) musb 1687 drivers/usb/musb/musb_core.c musb_host_rx(musb, epnum); musb 1689 drivers/usb/musb/musb_core.c musb_g_rx(musb, epnum); musb 1722 drivers/usb/musb/musb_core.c struct musb *musb = dev_to_musb(dev); musb 1726 drivers/usb/musb/musb_core.c spin_lock_irqsave(&musb->lock, flags); musb 1727 drivers/usb/musb/musb_core.c ret = sprintf(buf, "%s\n", usb_otg_state_string(musb->xceiv->otg->state)); musb 1728 drivers/usb/musb/musb_core.c spin_unlock_irqrestore(&musb->lock, flags); musb 1737 drivers/usb/musb/musb_core.c struct musb *musb = dev_to_musb(dev); musb 1741 drivers/usb/musb/musb_core.c spin_lock_irqsave(&musb->lock, flags); musb 1743 drivers/usb/musb/musb_core.c status = musb_platform_set_mode(musb, MUSB_HOST); musb 1745 drivers/usb/musb/musb_core.c status = musb_platform_set_mode(musb, MUSB_PERIPHERAL); musb 1747 drivers/usb/musb/musb_core.c status = musb_platform_set_mode(musb, MUSB_OTG); musb 1750 drivers/usb/musb/musb_core.c spin_unlock_irqrestore(&musb->lock, flags); musb 1760 drivers/usb/musb/musb_core.c struct musb *musb = dev_to_musb(dev); musb 1769 drivers/usb/musb/musb_core.c spin_lock_irqsave(&musb->lock, flags); musb 1771 drivers/usb/musb/musb_core.c musb->a_wait_bcon = val ? max_t(int, val, OTG_TIME_A_WAIT_BCON) : 0 ; musb 1772 drivers/usb/musb/musb_core.c if (musb->xceiv->otg->state == OTG_STATE_A_WAIT_BCON) musb 1773 drivers/usb/musb/musb_core.c musb->is_active = 0; musb 1774 drivers/usb/musb/musb_core.c musb_platform_try_idle(musb, jiffies + msecs_to_jiffies(val)); musb 1775 drivers/usb/musb/musb_core.c spin_unlock_irqrestore(&musb->lock, flags); musb 1783 drivers/usb/musb/musb_core.c struct musb *musb = dev_to_musb(dev); musb 1790 drivers/usb/musb/musb_core.c spin_lock_irqsave(&musb->lock, flags); musb 1791 drivers/usb/musb/musb_core.c val = musb->a_wait_bcon; musb 1792 drivers/usb/musb/musb_core.c vbus = musb_platform_get_vbus_status(musb); musb 1795 drivers/usb/musb/musb_core.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 1802 drivers/usb/musb/musb_core.c spin_unlock_irqrestore(&musb->lock, flags); musb 1816 drivers/usb/musb/musb_core.c struct musb *musb = dev_to_musb(dev); musb 1826 drivers/usb/musb/musb_core.c musb_g_wakeup(musb); musb 1838 drivers/usb/musb/musb_core.c ATTRIBUTE_GROUPS(musb); musb 1857 drivers/usb/musb/musb_core.c static void musb_pm_runtime_check_session(struct musb *musb) musb 1862 drivers/usb/musb/musb_core.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 1869 drivers/usb/musb/musb_core.c musb_dbg(musb, "Poll devctl in case of suspend after disconnect\n"); musb 1870 drivers/usb/musb/musb_core.c schedule_delayed_work(&musb->irq_work, musb 1874 drivers/usb/musb/musb_core.c if (musb->quirk_retries && !musb->flush_irq_work) { musb 1875 drivers/usb/musb/musb_core.c musb_dbg(musb, musb 1877 drivers/usb/musb/musb_core.c schedule_delayed_work(&musb->irq_work, musb 1879 drivers/usb/musb/musb_core.c musb->quirk_retries--; musb 1884 drivers/usb/musb/musb_core.c if (musb->quirk_retries && !musb->flush_irq_work) { musb 1885 drivers/usb/musb/musb_core.c musb_dbg(musb, musb 1887 drivers/usb/musb/musb_core.c schedule_delayed_work(&musb->irq_work, musb 1889 drivers/usb/musb/musb_core.c musb->quirk_retries--; musb 1892 drivers/usb/musb/musb_core.c if (!musb->session) musb 1894 drivers/usb/musb/musb_core.c musb_dbg(musb, "Allow PM on possible host mode disconnect"); musb 1895 drivers/usb/musb/musb_core.c pm_runtime_mark_last_busy(musb->controller); musb 1896 drivers/usb/musb/musb_core.c pm_runtime_put_autosuspend(musb->controller); musb 1897 drivers/usb/musb/musb_core.c musb->session = false; musb 1905 drivers/usb/musb/musb_core.c if (s == musb->session) musb 1910 drivers/usb/musb/musb_core.c musb_dbg(musb, "Block PM on active session: %02x", devctl); musb 1911 drivers/usb/musb/musb_core.c error = pm_runtime_get_sync(musb->controller); musb 1913 drivers/usb/musb/musb_core.c dev_err(musb->controller, "Could not enable: %i\n", musb 1915 drivers/usb/musb/musb_core.c musb->quirk_retries = 3; musb 1917 drivers/usb/musb/musb_core.c musb_dbg(musb, "Allow PM with no session: %02x", devctl); musb 1918 drivers/usb/musb/musb_core.c pm_runtime_mark_last_busy(musb->controller); musb 1919 drivers/usb/musb/musb_core.c pm_runtime_put_autosuspend(musb->controller); musb 1922 drivers/usb/musb/musb_core.c musb->session = s; musb 1928 drivers/usb/musb/musb_core.c struct musb *musb = container_of(data, struct musb, irq_work.work); musb 1931 drivers/usb/musb/musb_core.c error = pm_runtime_get_sync(musb->controller); musb 1933 drivers/usb/musb/musb_core.c dev_err(musb->controller, "Could not enable: %i\n", error); musb 1938 drivers/usb/musb/musb_core.c musb_pm_runtime_check_session(musb); musb 1940 drivers/usb/musb/musb_core.c if (musb->xceiv->otg->state != musb->xceiv_old_state) { musb 1941 drivers/usb/musb/musb_core.c musb->xceiv_old_state = musb->xceiv->otg->state; musb 1942 drivers/usb/musb/musb_core.c sysfs_notify(&musb->controller->kobj, NULL, "mode"); musb 1945 drivers/usb/musb/musb_core.c pm_runtime_mark_last_busy(musb->controller); musb 1946 drivers/usb/musb/musb_core.c pm_runtime_put_autosuspend(musb->controller); musb 1949 drivers/usb/musb/musb_core.c static void musb_recover_from_babble(struct musb *musb) musb 1954 drivers/usb/musb/musb_core.c musb_disable_interrupts(musb); musb 1962 drivers/usb/musb/musb_core.c ret = musb_platform_recover(musb); musb 1964 drivers/usb/musb/musb_core.c musb_enable_interrupts(musb); musb 1969 drivers/usb/musb/musb_core.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 1971 drivers/usb/musb/musb_core.c musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); musb 1974 drivers/usb/musb/musb_core.c musb_root_disconnect(musb); musb 1980 drivers/usb/musb/musb_core.c if (musb->dyn_fifo) musb 1981 drivers/usb/musb/musb_core.c ret = ep_config_from_table(musb); musb 1983 drivers/usb/musb/musb_core.c ret = ep_config_from_hw(musb); musb 1987 drivers/usb/musb/musb_core.c musb_start(musb); musb 1994 drivers/usb/musb/musb_core.c static struct musb *allocate_instance(struct device *dev, musb 1997 drivers/usb/musb/musb_core.c struct musb *musb; musb 2002 drivers/usb/musb/musb_core.c musb = devm_kzalloc(dev, sizeof(*musb), GFP_KERNEL); musb 2003 drivers/usb/musb/musb_core.c if (!musb) musb 2006 drivers/usb/musb/musb_core.c INIT_LIST_HEAD(&musb->control); musb 2007 drivers/usb/musb/musb_core.c INIT_LIST_HEAD(&musb->in_bulk); musb 2008 drivers/usb/musb/musb_core.c INIT_LIST_HEAD(&musb->out_bulk); musb 2009 drivers/usb/musb/musb_core.c INIT_LIST_HEAD(&musb->pending_list); musb 2011 drivers/usb/musb/musb_core.c musb->vbuserr_retry = VBUSERR_RETRY_COUNT; musb 2012 drivers/usb/musb/musb_core.c musb->a_wait_bcon = OTG_TIME_A_WAIT_BCON; musb 2013 drivers/usb/musb/musb_core.c musb->mregs = mbase; musb 2014 drivers/usb/musb/musb_core.c musb->ctrl_base = mbase; musb 2015 drivers/usb/musb/musb_core.c musb->nIrq = -ENODEV; musb 2016 drivers/usb/musb/musb_core.c musb->config = config; musb 2017 drivers/usb/musb/musb_core.c BUG_ON(musb->config->num_eps > MUSB_C_NUM_EPS); musb 2018 drivers/usb/musb/musb_core.c for (epnum = 0, ep = musb->endpoints; musb 2019 drivers/usb/musb/musb_core.c epnum < musb->config->num_eps; musb 2021 drivers/usb/musb/musb_core.c ep->musb = musb; musb 2025 drivers/usb/musb/musb_core.c musb->controller = dev; musb 2027 drivers/usb/musb/musb_core.c ret = musb_host_alloc(musb); musb 2031 drivers/usb/musb/musb_core.c dev_set_drvdata(dev, musb); musb 2033 drivers/usb/musb/musb_core.c return musb; musb 2039 drivers/usb/musb/musb_core.c static void musb_free(struct musb *musb) musb 2046 drivers/usb/musb/musb_core.c if (musb->nIrq >= 0) { musb 2047 drivers/usb/musb/musb_core.c if (musb->irq_wake) musb 2048 drivers/usb/musb/musb_core.c disable_irq_wake(musb->nIrq); musb 2049 drivers/usb/musb/musb_core.c free_irq(musb->nIrq, musb); musb 2052 drivers/usb/musb/musb_core.c musb_host_free(musb); musb 2056 drivers/usb/musb/musb_core.c int (*callback)(struct musb *musb, void *data); musb 2066 drivers/usb/musb/musb_core.c static int musb_run_resume_work(struct musb *musb) musb 2072 drivers/usb/musb/musb_core.c spin_lock_irqsave(&musb->list_lock, flags); musb 2073 drivers/usb/musb/musb_core.c list_for_each_entry_safe(w, _w, &musb->pending_list, node) { musb 2075 drivers/usb/musb/musb_core.c error = w->callback(musb, w->data); musb 2077 drivers/usb/musb/musb_core.c dev_err(musb->controller, musb 2083 drivers/usb/musb/musb_core.c devm_kfree(musb->controller, w); musb 2085 drivers/usb/musb/musb_core.c spin_unlock_irqrestore(&musb->list_lock, flags); musb 2099 drivers/usb/musb/musb_core.c int musb_queue_resume_work(struct musb *musb, musb 2100 drivers/usb/musb/musb_core.c int (*callback)(struct musb *musb, void *data), musb 2110 drivers/usb/musb/musb_core.c if (pm_runtime_active(musb->controller)) musb 2111 drivers/usb/musb/musb_core.c return callback(musb, data); musb 2113 drivers/usb/musb/musb_core.c w = devm_kzalloc(musb->controller, sizeof(*w), GFP_ATOMIC); musb 2119 drivers/usb/musb/musb_core.c spin_lock_irqsave(&musb->list_lock, flags); musb 2120 drivers/usb/musb/musb_core.c if (musb->is_runtime_suspended) { musb 2121 drivers/usb/musb/musb_core.c list_add_tail(&w->node, &musb->pending_list); musb 2124 drivers/usb/musb/musb_core.c dev_err(musb->controller, "could not add resume work %p\n", musb 2126 drivers/usb/musb/musb_core.c devm_kfree(musb->controller, w); musb 2129 drivers/usb/musb/musb_core.c spin_unlock_irqrestore(&musb->list_lock, flags); musb 2137 drivers/usb/musb/musb_core.c struct musb *musb; musb 2140 drivers/usb/musb/musb_core.c musb = container_of(work, struct musb, deassert_reset_work.work); musb 2142 drivers/usb/musb/musb_core.c spin_lock_irqsave(&musb->lock, flags); musb 2144 drivers/usb/musb/musb_core.c if (musb->port1_status & USB_PORT_STAT_RESET) musb 2145 drivers/usb/musb/musb_core.c musb_port_reset(musb, false); musb 2147 drivers/usb/musb/musb_core.c spin_unlock_irqrestore(&musb->lock, flags); musb 2162 drivers/usb/musb/musb_core.c struct musb *musb; musb 2175 drivers/usb/musb/musb_core.c musb = allocate_instance(dev, plat->config, ctrl); musb 2176 drivers/usb/musb/musb_core.c if (!musb) { musb 2181 drivers/usb/musb/musb_core.c spin_lock_init(&musb->lock); musb 2182 drivers/usb/musb/musb_core.c spin_lock_init(&musb->list_lock); musb 2183 drivers/usb/musb/musb_core.c musb->board_set_power = plat->set_power; musb 2184 drivers/usb/musb/musb_core.c musb->min_power = plat->min_power; musb 2185 drivers/usb/musb/musb_core.c musb->ops = plat->platform_ops; musb 2186 drivers/usb/musb/musb_core.c musb->port_mode = plat->mode; musb 2210 drivers/usb/musb/musb_core.c status = musb_platform_init(musb); musb 2214 drivers/usb/musb/musb_core.c if (!musb->isr) { musb 2221 drivers/usb/musb/musb_core.c if (musb->ops->quirks & MUSB_INDEXED_EP) { musb 2222 drivers/usb/musb/musb_core.c musb->io.ep_offset = musb_indexed_ep_offset; musb 2223 drivers/usb/musb/musb_core.c musb->io.ep_select = musb_indexed_ep_select; musb 2225 drivers/usb/musb/musb_core.c musb->io.ep_offset = musb_flat_ep_offset; musb 2226 drivers/usb/musb/musb_core.c musb->io.ep_select = musb_flat_ep_select; musb 2229 drivers/usb/musb/musb_core.c if (musb->ops->quirks & MUSB_G_NO_SKB_RESERVE) musb 2230 drivers/usb/musb/musb_core.c musb->g.quirk_avoids_skb_reserve = 1; musb 2233 drivers/usb/musb/musb_core.c if (musb->ops->ep_offset) musb 2234 drivers/usb/musb/musb_core.c musb->io.ep_offset = musb->ops->ep_offset; musb 2235 drivers/usb/musb/musb_core.c if (musb->ops->ep_select) musb 2236 drivers/usb/musb/musb_core.c musb->io.ep_select = musb->ops->ep_select; musb 2238 drivers/usb/musb/musb_core.c if (musb->ops->fifo_mode) musb 2239 drivers/usb/musb/musb_core.c fifo_mode = musb->ops->fifo_mode; musb 2243 drivers/usb/musb/musb_core.c if (musb->ops->fifo_offset) musb 2244 drivers/usb/musb/musb_core.c musb->io.fifo_offset = musb->ops->fifo_offset; musb 2246 drivers/usb/musb/musb_core.c musb->io.fifo_offset = musb_default_fifo_offset; musb 2248 drivers/usb/musb/musb_core.c if (musb->ops->busctl_offset) musb 2249 drivers/usb/musb/musb_core.c musb->io.busctl_offset = musb->ops->busctl_offset; musb 2251 drivers/usb/musb/musb_core.c musb->io.busctl_offset = musb_default_busctl_offset; musb 2253 drivers/usb/musb/musb_core.c if (musb->ops->readb) musb 2254 drivers/usb/musb/musb_core.c musb_readb = musb->ops->readb; musb 2255 drivers/usb/musb/musb_core.c if (musb->ops->writeb) musb 2256 drivers/usb/musb/musb_core.c musb_writeb = musb->ops->writeb; musb 2257 drivers/usb/musb/musb_core.c if (musb->ops->readw) musb 2258 drivers/usb/musb/musb_core.c musb_readw = musb->ops->readw; musb 2259 drivers/usb/musb/musb_core.c if (musb->ops->writew) musb 2260 drivers/usb/musb/musb_core.c musb_writew = musb->ops->writew; musb 2263 drivers/usb/musb/musb_core.c if (!musb->ops->dma_init || !musb->ops->dma_exit) { musb 2268 drivers/usb/musb/musb_core.c musb_dma_controller_create = musb->ops->dma_init; musb 2269 drivers/usb/musb/musb_core.c musb_dma_controller_destroy = musb->ops->dma_exit; musb 2272 drivers/usb/musb/musb_core.c if (musb->ops->read_fifo) musb 2273 drivers/usb/musb/musb_core.c musb->io.read_fifo = musb->ops->read_fifo; musb 2275 drivers/usb/musb/musb_core.c musb->io.read_fifo = musb_default_read_fifo; musb 2277 drivers/usb/musb/musb_core.c if (musb->ops->write_fifo) musb 2278 drivers/usb/musb/musb_core.c musb->io.write_fifo = musb->ops->write_fifo; musb 2280 drivers/usb/musb/musb_core.c musb->io.write_fifo = musb_default_write_fifo; musb 2282 drivers/usb/musb/musb_core.c if (!musb->xceiv->io_ops) { musb 2283 drivers/usb/musb/musb_core.c musb->xceiv->io_dev = musb->controller; musb 2284 drivers/usb/musb/musb_core.c musb->xceiv->io_priv = musb->mregs; musb 2285 drivers/usb/musb/musb_core.c musb->xceiv->io_ops = &musb_ulpi_access; musb 2288 drivers/usb/musb/musb_core.c if (musb->ops->phy_callback) musb 2289 drivers/usb/musb/musb_core.c musb_phy_callback = musb->ops->phy_callback; musb 2298 drivers/usb/musb/musb_core.c pm_runtime_use_autosuspend(musb->controller); musb 2299 drivers/usb/musb/musb_core.c pm_runtime_set_autosuspend_delay(musb->controller, 500); musb 2300 drivers/usb/musb/musb_core.c pm_runtime_enable(musb->controller); musb 2301 drivers/usb/musb/musb_core.c pm_runtime_get_sync(musb->controller); musb 2303 drivers/usb/musb/musb_core.c status = usb_phy_init(musb->xceiv); musb 2308 drivers/usb/musb/musb_core.c musb->dma_controller = musb 2309 drivers/usb/musb/musb_core.c musb_dma_controller_create(musb, musb->mregs); musb 2310 drivers/usb/musb/musb_core.c if (IS_ERR(musb->dma_controller)) { musb 2311 drivers/usb/musb/musb_core.c status = PTR_ERR(musb->dma_controller); musb 2317 drivers/usb/musb/musb_core.c musb_platform_disable(musb); musb 2318 drivers/usb/musb/musb_core.c musb_disable_interrupts(musb); musb 2319 drivers/usb/musb/musb_core.c musb_writeb(musb->mregs, MUSB_DEVCTL, 0); musb 2322 drivers/usb/musb/musb_core.c musb_writeb(musb->mregs, MUSB_POWER, 0); musb 2325 drivers/usb/musb/musb_core.c INIT_DELAYED_WORK(&musb->irq_work, musb_irq_work); musb 2326 drivers/usb/musb/musb_core.c INIT_DELAYED_WORK(&musb->deassert_reset_work, musb_deassert_reset); musb 2327 drivers/usb/musb/musb_core.c INIT_DELAYED_WORK(&musb->finish_resume_work, musb_host_finish_resume); musb 2332 drivers/usb/musb/musb_core.c : MUSB_CONTROLLER_HDRC, musb); musb 2336 drivers/usb/musb/musb_core.c timer_setup(&musb->otg_timer, musb_otg_timer_func, 0); musb 2339 drivers/usb/musb/musb_core.c if (request_irq(nIrq, musb->isr, IRQF_SHARED, dev_name(dev), musb)) { musb 2344 drivers/usb/musb/musb_core.c musb->nIrq = nIrq; musb 2347 drivers/usb/musb/musb_core.c musb->irq_wake = 1; musb 2350 drivers/usb/musb/musb_core.c musb->irq_wake = 0; musb 2355 drivers/usb/musb/musb_core.c u8 busctl = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL); musb 2357 drivers/usb/musb/musb_core.c musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, busctl); musb 2360 drivers/usb/musb/musb_core.c MUSB_DEV_MODE(musb); musb 2361 drivers/usb/musb/musb_core.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 2363 drivers/usb/musb/musb_core.c switch (musb->port_mode) { musb 2365 drivers/usb/musb/musb_core.c status = musb_host_setup(musb, plat->power); musb 2368 drivers/usb/musb/musb_core.c status = musb_platform_set_mode(musb, MUSB_HOST); musb 2371 drivers/usb/musb/musb_core.c status = musb_gadget_setup(musb); musb 2374 drivers/usb/musb/musb_core.c status = musb_platform_set_mode(musb, MUSB_PERIPHERAL); musb 2377 drivers/usb/musb/musb_core.c status = musb_host_setup(musb, plat->power); musb 2380 drivers/usb/musb/musb_core.c status = musb_gadget_setup(musb); musb 2382 drivers/usb/musb/musb_core.c musb_host_cleanup(musb); musb 2385 drivers/usb/musb/musb_core.c status = musb_platform_set_mode(musb, MUSB_OTG); musb 2388 drivers/usb/musb/musb_core.c dev_err(dev, "unsupported port mode %d\n", musb->port_mode); musb 2395 drivers/usb/musb/musb_core.c musb_init_debugfs(musb); musb 2397 drivers/usb/musb/musb_core.c musb->is_initialized = 1; musb 2398 drivers/usb/musb/musb_core.c pm_runtime_mark_last_busy(musb->controller); musb 2399 drivers/usb/musb/musb_core.c pm_runtime_put_autosuspend(musb->controller); musb 2404 drivers/usb/musb/musb_core.c cancel_delayed_work_sync(&musb->irq_work); musb 2405 drivers/usb/musb/musb_core.c cancel_delayed_work_sync(&musb->finish_resume_work); musb 2406 drivers/usb/musb/musb_core.c cancel_delayed_work_sync(&musb->deassert_reset_work); musb 2407 drivers/usb/musb/musb_core.c if (musb->dma_controller) musb 2408 drivers/usb/musb/musb_core.c musb_dma_controller_destroy(musb->dma_controller); musb 2411 drivers/usb/musb/musb_core.c usb_phy_shutdown(musb->xceiv); musb 2414 drivers/usb/musb/musb_core.c pm_runtime_dont_use_autosuspend(musb->controller); musb 2415 drivers/usb/musb/musb_core.c pm_runtime_put_sync(musb->controller); musb 2416 drivers/usb/musb/musb_core.c pm_runtime_disable(musb->controller); musb 2419 drivers/usb/musb/musb_core.c if (musb->irq_wake) musb 2421 drivers/usb/musb/musb_core.c musb_platform_exit(musb); musb 2425 drivers/usb/musb/musb_core.c dev_err(musb->controller, musb 2428 drivers/usb/musb/musb_core.c musb_free(musb); musb 2462 drivers/usb/musb/musb_core.c struct musb *musb = dev_to_musb(dev); musb 2470 drivers/usb/musb/musb_core.c musb_exit_debugfs(musb); musb 2472 drivers/usb/musb/musb_core.c cancel_delayed_work_sync(&musb->irq_work); musb 2473 drivers/usb/musb/musb_core.c cancel_delayed_work_sync(&musb->finish_resume_work); musb 2474 drivers/usb/musb/musb_core.c cancel_delayed_work_sync(&musb->deassert_reset_work); musb 2475 drivers/usb/musb/musb_core.c pm_runtime_get_sync(musb->controller); musb 2476 drivers/usb/musb/musb_core.c musb_host_cleanup(musb); musb 2477 drivers/usb/musb/musb_core.c musb_gadget_cleanup(musb); musb 2479 drivers/usb/musb/musb_core.c musb_platform_disable(musb); musb 2480 drivers/usb/musb/musb_core.c spin_lock_irqsave(&musb->lock, flags); musb 2481 drivers/usb/musb/musb_core.c musb_disable_interrupts(musb); musb 2482 drivers/usb/musb/musb_core.c musb_writeb(musb->mregs, MUSB_DEVCTL, 0); musb 2483 drivers/usb/musb/musb_core.c spin_unlock_irqrestore(&musb->lock, flags); musb 2484 drivers/usb/musb/musb_core.c musb_platform_exit(musb); musb 2486 drivers/usb/musb/musb_core.c pm_runtime_dont_use_autosuspend(musb->controller); musb 2487 drivers/usb/musb/musb_core.c pm_runtime_put_sync(musb->controller); musb 2488 drivers/usb/musb/musb_core.c pm_runtime_disable(musb->controller); musb 2490 drivers/usb/musb/musb_core.c if (musb->dma_controller) musb 2491 drivers/usb/musb/musb_core.c musb_dma_controller_destroy(musb->dma_controller); musb 2492 drivers/usb/musb/musb_core.c usb_phy_shutdown(musb->xceiv); musb 2493 drivers/usb/musb/musb_core.c musb_free(musb); musb 2500 drivers/usb/musb/musb_core.c static void musb_save_context(struct musb *musb) musb 2503 drivers/usb/musb/musb_core.c void __iomem *musb_base = musb->mregs; musb 2506 drivers/usb/musb/musb_core.c musb->context.frame = musb_readw(musb_base, MUSB_FRAME); musb 2507 drivers/usb/musb/musb_core.c musb->context.testmode = musb_readb(musb_base, MUSB_TESTMODE); musb 2508 drivers/usb/musb/musb_core.c musb->context.busctl = musb_readb(musb_base, MUSB_ULPI_BUSCONTROL); musb 2509 drivers/usb/musb/musb_core.c musb->context.power = musb_readb(musb_base, MUSB_POWER); musb 2510 drivers/usb/musb/musb_core.c musb->context.intrusbe = musb_readb(musb_base, MUSB_INTRUSBE); musb 2511 drivers/usb/musb/musb_core.c musb->context.index = musb_readb(musb_base, MUSB_INDEX); musb 2512 drivers/usb/musb/musb_core.c musb->context.devctl = musb_readb(musb_base, MUSB_DEVCTL); musb 2514 drivers/usb/musb/musb_core.c for (i = 0; i < musb->config->num_eps; ++i) { musb 2517 drivers/usb/musb/musb_core.c hw_ep = &musb->endpoints[i]; musb 2526 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txmaxp = musb 2528 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txcsr = musb 2530 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxmaxp = musb 2532 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxcsr = musb 2535 drivers/usb/musb/musb_core.c if (musb->dyn_fifo) { musb 2536 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txfifoadd = musb 2538 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxfifoadd = musb 2540 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txfifosz = musb 2542 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxfifosz = musb 2546 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txtype = musb 2548 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txinterval = musb 2550 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxtype = musb 2552 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxinterval = musb 2555 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txfunaddr = musb 2556 drivers/usb/musb/musb_core.c musb_read_txfunaddr(musb, i); musb 2557 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txhubaddr = musb 2558 drivers/usb/musb/musb_core.c musb_read_txhubaddr(musb, i); musb 2559 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txhubport = musb 2560 drivers/usb/musb/musb_core.c musb_read_txhubport(musb, i); musb 2562 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxfunaddr = musb 2563 drivers/usb/musb/musb_core.c musb_read_rxfunaddr(musb, i); musb 2564 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxhubaddr = musb 2565 drivers/usb/musb/musb_core.c musb_read_rxhubaddr(musb, i); musb 2566 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxhubport = musb 2567 drivers/usb/musb/musb_core.c musb_read_rxhubport(musb, i); musb 2571 drivers/usb/musb/musb_core.c static void musb_restore_context(struct musb *musb) musb 2574 drivers/usb/musb/musb_core.c void __iomem *musb_base = musb->mregs; musb 2578 drivers/usb/musb/musb_core.c musb_writew(musb_base, MUSB_FRAME, musb->context.frame); musb 2579 drivers/usb/musb/musb_core.c musb_writeb(musb_base, MUSB_TESTMODE, musb->context.testmode); musb 2580 drivers/usb/musb/musb_core.c musb_writeb(musb_base, MUSB_ULPI_BUSCONTROL, musb->context.busctl); musb 2585 drivers/usb/musb/musb_core.c musb->context.power &= ~(MUSB_POWER_SUSPENDM | MUSB_POWER_RESUME); musb 2586 drivers/usb/musb/musb_core.c power |= musb->context.power; musb 2589 drivers/usb/musb/musb_core.c musb_writew(musb_base, MUSB_INTRTXE, musb->intrtxe); musb 2590 drivers/usb/musb/musb_core.c musb_writew(musb_base, MUSB_INTRRXE, musb->intrrxe); musb 2591 drivers/usb/musb/musb_core.c musb_writeb(musb_base, MUSB_INTRUSBE, musb->context.intrusbe); musb 2592 drivers/usb/musb/musb_core.c if (musb->context.devctl & MUSB_DEVCTL_SESSION) musb 2593 drivers/usb/musb/musb_core.c musb_writeb(musb_base, MUSB_DEVCTL, musb->context.devctl); musb 2595 drivers/usb/musb/musb_core.c for (i = 0; i < musb->config->num_eps; ++i) { musb 2598 drivers/usb/musb/musb_core.c hw_ep = &musb->endpoints[i]; musb 2608 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txmaxp); musb 2610 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txcsr); musb 2612 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxmaxp); musb 2614 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxcsr); musb 2616 drivers/usb/musb/musb_core.c if (musb->dyn_fifo) { musb 2618 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txfifosz); musb 2620 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxfifosz); musb 2622 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txfifoadd); musb 2624 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxfifoadd); musb 2628 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txtype); musb 2630 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txinterval); musb 2632 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxtype); musb 2635 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxinterval); musb 2636 drivers/usb/musb/musb_core.c musb_write_txfunaddr(musb, i, musb 2637 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txfunaddr); musb 2638 drivers/usb/musb/musb_core.c musb_write_txhubaddr(musb, i, musb 2639 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txhubaddr); musb 2640 drivers/usb/musb/musb_core.c musb_write_txhubport(musb, i, musb 2641 drivers/usb/musb/musb_core.c musb->context.index_regs[i].txhubport); musb 2643 drivers/usb/musb/musb_core.c musb_write_rxfunaddr(musb, i, musb 2644 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxfunaddr); musb 2645 drivers/usb/musb/musb_core.c musb_write_rxhubaddr(musb, i, musb 2646 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxhubaddr); musb 2647 drivers/usb/musb/musb_core.c musb_write_rxhubport(musb, i, musb 2648 drivers/usb/musb/musb_core.c musb->context.index_regs[i].rxhubport); musb 2650 drivers/usb/musb/musb_core.c musb_writeb(musb_base, MUSB_INDEX, musb->context.index); musb 2655 drivers/usb/musb/musb_core.c struct musb *musb = dev_to_musb(dev); musb 2665 drivers/usb/musb/musb_core.c musb_platform_disable(musb); musb 2666 drivers/usb/musb/musb_core.c musb_disable_interrupts(musb); musb 2668 drivers/usb/musb/musb_core.c musb->flush_irq_work = true; musb 2669 drivers/usb/musb/musb_core.c while (flush_delayed_work(&musb->irq_work)) musb 2671 drivers/usb/musb/musb_core.c musb->flush_irq_work = false; musb 2673 drivers/usb/musb/musb_core.c if (!(musb->ops->quirks & MUSB_PRESERVE_SESSION)) musb 2674 drivers/usb/musb/musb_core.c musb_writeb(musb->mregs, MUSB_DEVCTL, 0); musb 2676 drivers/usb/musb/musb_core.c WARN_ON(!list_empty(&musb->pending_list)); musb 2678 drivers/usb/musb/musb_core.c spin_lock_irqsave(&musb->lock, flags); musb 2680 drivers/usb/musb/musb_core.c if (is_peripheral_active(musb)) { musb 2684 drivers/usb/musb/musb_core.c } else if (is_host_active(musb)) { musb 2690 drivers/usb/musb/musb_core.c musb_save_context(musb); musb 2692 drivers/usb/musb/musb_core.c spin_unlock_irqrestore(&musb->lock, flags); musb 2698 drivers/usb/musb/musb_core.c struct musb *musb = dev_to_musb(dev); musb 2714 drivers/usb/musb/musb_core.c musb_restore_context(musb); musb 2716 drivers/usb/musb/musb_core.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 2718 drivers/usb/musb/musb_core.c if ((devctl & mask) != (musb->context.devctl & mask)) musb 2719 drivers/usb/musb/musb_core.c musb->port1_status = 0; musb 2721 drivers/usb/musb/musb_core.c musb_enable_interrupts(musb); musb 2722 drivers/usb/musb/musb_core.c musb_platform_enable(musb); musb 2725 drivers/usb/musb/musb_core.c if (musb->port_mode == MUSB_HOST && musb 2726 drivers/usb/musb/musb_core.c !(musb->ops->quirks & MUSB_PRESERVE_SESSION)) { musb 2728 drivers/usb/musb/musb_core.c musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); musb 2731 drivers/usb/musb/musb_core.c spin_lock_irqsave(&musb->lock, flags); musb 2732 drivers/usb/musb/musb_core.c error = musb_run_resume_work(musb); musb 2734 drivers/usb/musb/musb_core.c dev_err(musb->controller, "resume work failed with %i\n", musb 2736 drivers/usb/musb/musb_core.c spin_unlock_irqrestore(&musb->lock, flags); musb 2746 drivers/usb/musb/musb_core.c struct musb *musb = dev_to_musb(dev); musb 2748 drivers/usb/musb/musb_core.c musb_save_context(musb); musb 2749 drivers/usb/musb/musb_core.c musb->is_runtime_suspended = 1; musb 2756 drivers/usb/musb/musb_core.c struct musb *musb = dev_to_musb(dev); musb 2769 drivers/usb/musb/musb_core.c if (!musb->is_initialized) musb 2772 drivers/usb/musb/musb_core.c musb_restore_context(musb); musb 2774 drivers/usb/musb/musb_core.c spin_lock_irqsave(&musb->lock, flags); musb 2775 drivers/usb/musb/musb_core.c error = musb_run_resume_work(musb); musb 2777 drivers/usb/musb/musb_core.c dev_err(musb->controller, "resume work failed with %i\n", musb 2779 drivers/usb/musb/musb_core.c musb->is_runtime_suspended = 0; musb 2780 drivers/usb/musb/musb_core.c spin_unlock_irqrestore(&musb->lock, flags); musb 27 drivers/usb/musb/musb_core.h struct musb; musb 105 drivers/usb/musb/musb_core.h #define MUSB_MODE(musb) ((musb)->is_host ? "Host" : "Peripheral") musb 153 drivers/usb/musb/musb_core.h int (*init)(struct musb *musb); musb 154 drivers/usb/musb/musb_core.h int (*exit)(struct musb *musb); musb 156 drivers/usb/musb/musb_core.h void (*enable)(struct musb *musb); musb 157 drivers/usb/musb/musb_core.h void (*disable)(struct musb *musb); musb 171 drivers/usb/musb/musb_core.h (*dma_init) (struct musb *musb, void __iomem *base); musb 173 drivers/usb/musb/musb_core.h int (*set_mode)(struct musb *musb, u8 mode); musb 174 drivers/usb/musb/musb_core.h void (*try_idle)(struct musb *musb, unsigned long timeout); musb 175 drivers/usb/musb/musb_core.h int (*recover)(struct musb *musb); musb 177 drivers/usb/musb/musb_core.h int (*vbus_status)(struct musb *musb); musb 178 drivers/usb/musb/musb_core.h void (*set_vbus)(struct musb *musb, int on); musb 180 drivers/usb/musb/musb_core.h void (*pre_root_reset_end)(struct musb *musb); musb 181 drivers/usb/musb/musb_core.h void (*post_root_reset_end)(struct musb *musb); musb 183 drivers/usb/musb/musb_core.h void (*clear_ep_rxintr)(struct musb *musb, int epnum); musb 192 drivers/usb/musb/musb_core.h struct musb *musb; musb 369 drivers/usb/musb/musb_core.h #define can_bulk_split(musb,type) \ musb 370 drivers/usb/musb/musb_core.h (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_split) musb 373 drivers/usb/musb/musb_core.h #define can_bulk_combine(musb,type) \ musb 374 drivers/usb/musb/musb_core.h (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_combine) musb 414 drivers/usb/musb/musb_core.h static inline struct musb *gadget_to_musb(struct usb_gadget *g) musb 416 drivers/usb/musb/musb_core.h return container_of(g, struct musb, g); musb 443 drivers/usb/musb/musb_core.h static inline int musb_read_fifosize(struct musb *musb, musb 446 drivers/usb/musb/musb_core.h void __iomem *mbase = musb->mregs; musb 450 drivers/usb/musb/musb_core.h reg = musb_readb(mbase, musb->io.ep_offset(epnum, MUSB_FIFOSIZE)); musb 455 drivers/usb/musb/musb_core.h musb->nr_endpoints++; musb 456 drivers/usb/musb/musb_core.h musb->epmask |= (1 << epnum); musb 473 drivers/usb/musb/musb_core.h static inline void musb_configure_ep0(struct musb *musb) musb 475 drivers/usb/musb/musb_core.h musb->endpoints[0].max_packet_sz_tx = MUSB_EP0_FIFOSIZE; musb 476 drivers/usb/musb/musb_core.h musb->endpoints[0].max_packet_sz_rx = MUSB_EP0_FIFOSIZE; musb 477 drivers/usb/musb/musb_core.h musb->endpoints[0].is_shared_fifo = true; musb 484 drivers/usb/musb/musb_core.h extern void musb_stop(struct musb *musb); musb 485 drivers/usb/musb/musb_core.h extern void musb_start(struct musb *musb); musb 490 drivers/usb/musb/musb_core.h extern void musb_load_testpacket(struct musb *); musb 492 drivers/usb/musb/musb_core.h extern irqreturn_t musb_interrupt(struct musb *); musb 494 drivers/usb/musb/musb_core.h extern void musb_hnp_stop(struct musb *musb); musb 496 drivers/usb/musb/musb_core.h int musb_queue_resume_work(struct musb *musb, musb 497 drivers/usb/musb/musb_core.h int (*callback)(struct musb *musb, void *data), musb 500 drivers/usb/musb/musb_core.h static inline void musb_platform_set_vbus(struct musb *musb, int is_on) musb 502 drivers/usb/musb/musb_core.h if (musb->ops->set_vbus) musb 503 drivers/usb/musb/musb_core.h musb->ops->set_vbus(musb, is_on); musb 506 drivers/usb/musb/musb_core.h static inline void musb_platform_enable(struct musb *musb) musb 508 drivers/usb/musb/musb_core.h if (musb->ops->enable) musb 509 drivers/usb/musb/musb_core.h musb->ops->enable(musb); musb 512 drivers/usb/musb/musb_core.h static inline void musb_platform_disable(struct musb *musb) musb 514 drivers/usb/musb/musb_core.h if (musb->ops->disable) musb 515 drivers/usb/musb/musb_core.h musb->ops->disable(musb); musb 518 drivers/usb/musb/musb_core.h static inline int musb_platform_set_mode(struct musb *musb, u8 mode) musb 520 drivers/usb/musb/musb_core.h if (!musb->ops->set_mode) musb 523 drivers/usb/musb/musb_core.h return musb->ops->set_mode(musb, mode); musb 526 drivers/usb/musb/musb_core.h static inline void musb_platform_try_idle(struct musb *musb, musb 529 drivers/usb/musb/musb_core.h if (musb->ops->try_idle) musb 530 drivers/usb/musb/musb_core.h musb->ops->try_idle(musb, timeout); musb 533 drivers/usb/musb/musb_core.h static inline int musb_platform_recover(struct musb *musb) musb 535 drivers/usb/musb/musb_core.h if (!musb->ops->recover) musb 538 drivers/usb/musb/musb_core.h return musb->ops->recover(musb); musb 541 drivers/usb/musb/musb_core.h static inline int musb_platform_get_vbus_status(struct musb *musb) musb 543 drivers/usb/musb/musb_core.h if (!musb->ops->vbus_status) musb 546 drivers/usb/musb/musb_core.h return musb->ops->vbus_status(musb); musb 549 drivers/usb/musb/musb_core.h static inline int musb_platform_init(struct musb *musb) musb 551 drivers/usb/musb/musb_core.h if (!musb->ops->init) musb 554 drivers/usb/musb/musb_core.h return musb->ops->init(musb); musb 557 drivers/usb/musb/musb_core.h static inline int musb_platform_exit(struct musb *musb) musb 559 drivers/usb/musb/musb_core.h if (!musb->ops->exit) musb 562 drivers/usb/musb/musb_core.h return musb->ops->exit(musb); musb 565 drivers/usb/musb/musb_core.h static inline void musb_platform_pre_root_reset_end(struct musb *musb) musb 567 drivers/usb/musb/musb_core.h if (musb->ops->pre_root_reset_end) musb 568 drivers/usb/musb/musb_core.h musb->ops->pre_root_reset_end(musb); musb 571 drivers/usb/musb/musb_core.h static inline void musb_platform_post_root_reset_end(struct musb *musb) musb 573 drivers/usb/musb/musb_core.h if (musb->ops->post_root_reset_end) musb 574 drivers/usb/musb/musb_core.h musb->ops->post_root_reset_end(musb); musb 577 drivers/usb/musb/musb_core.h static inline void musb_platform_clear_ep_rxintr(struct musb *musb, int epnum) musb 579 drivers/usb/musb/musb_core.h if (musb->ops->clear_ep_rxintr) musb 580 drivers/usb/musb/musb_core.h musb->ops->clear_ep_rxintr(musb, epnum); musb 61 drivers/usb/musb/musb_cppi41.c if (!is_host_active(cppi41_channel->controller->controller.musb)) musb 73 drivers/usb/musb/musb_cppi41.c struct musb *musb = hw_ep->musb; musb 79 drivers/usb/musb/musb_cppi41.c if (!is_host_active(musb)) musb 82 drivers/usb/musb/musb_cppi41.c musb_ep_select(musb->mregs, hw_ep->epnum); musb 94 drivers/usb/musb/musb_cppi41.c musb_dbg(musb, "Restoring DATA1 toggle."); musb 103 drivers/usb/musb/musb_cppi41.c struct musb *musb = hw_ep->musb; musb 104 drivers/usb/musb/musb_cppi41.c void __iomem *epio = musb->endpoints[epnum].regs; musb 107 drivers/usb/musb/musb_cppi41.c musb_ep_select(musb->mregs, hw_ep->epnum); musb 120 drivers/usb/musb/musb_cppi41.c struct musb *musb = hw_ep->musb; musb 139 drivers/usb/musb/musb_cppi41.c musb_ep_select(musb->mregs, hw_ep->epnum); musb 145 drivers/usb/musb/musb_cppi41.c musb_dma_completion(musb, hw_ep->epnum, cppi41_channel->is_tx); musb 177 drivers/usb/musb/musb_cppi41.c musb_ep_select(musb->mregs, hw_ep->epnum); musb 189 drivers/usb/musb/musb_cppi41.c struct musb *musb; musb 195 drivers/usb/musb/musb_cppi41.c musb = controller->controller.musb; musb 197 drivers/usb/musb/musb_cppi41.c spin_lock_irqsave(&musb->lock, flags); musb 216 drivers/usb/musb/musb_cppi41.c spin_unlock_irqrestore(&musb->lock, flags); musb 227 drivers/usb/musb/musb_cppi41.c struct musb *musb = hw_ep->musb; musb 241 drivers/usb/musb/musb_cppi41.c spin_lock_irqsave(&musb->lock, flags); musb 258 drivers/usb/musb/musb_cppi41.c if (is_host_active(musb)) musb 292 drivers/usb/musb/musb_cppi41.c if (is_host_active(musb)) { musb 293 drivers/usb/musb/musb_cppi41.c if (musb->port1_status & USB_PORT_STAT_HIGH_SPEED) musb 296 drivers/usb/musb/musb_cppi41.c if (musb->g.speed == USB_SPEED_HIGH) musb 326 drivers/usb/musb/musb_cppi41.c spin_unlock_irqrestore(&musb->lock, flags); musb 343 drivers/usb/musb/musb_cppi41.c struct musb *musb = controller->controller.musb; musb 359 drivers/usb/musb/musb_cppi41.c musb_writel(musb->ctrl_base, USB_CTRL_TX_MODE, new_mode); musb 362 drivers/usb/musb/musb_cppi41.c musb_writel(musb->ctrl_base, USB_CTRL_RX_MODE, new_mode); musb 370 drivers/usb/musb/musb_cppi41.c struct musb *musb = controller->controller.musb; musb 388 drivers/usb/musb/musb_cppi41.c musb_writel(musb->ctrl_base, DA8XX_USB_MODE, new_mode); musb 407 drivers/usb/musb/musb_cppi41.c musb_writel(controller->controller.musb->ctrl_base, musb 420 drivers/usb/musb/musb_cppi41.c struct musb *musb = cppi41_channel->controller->controller.musb; musb 439 drivers/usb/musb/musb_cppi41.c musb_writel(musb->ctrl_base, musb 449 drivers/usb/musb/musb_cppi41.c musb_writel(musb->ctrl_base, musb 534 drivers/usb/musb/musb_cppi41.c if (is_host_active(cppi41_channel->controller->controller.musb)) { musb 559 drivers/usb/musb/musb_cppi41.c struct musb *musb = controller->controller.musb; musb 561 drivers/usb/musb/musb_cppi41.c if (is_host_active(musb)) { musb 577 drivers/usb/musb/musb_cppi41.c struct musb *musb = controller->controller.musb; musb 617 drivers/usb/musb/musb_cppi41.c if (musb->ops->quirks & MUSB_DA8XX) musb 626 drivers/usb/musb/musb_cppi41.c musb_writel(musb->ctrl_base, controller->tdown_reg, musb 632 drivers/usb/musb/musb_cppi41.c musb_writel(musb->ctrl_base, controller->tdown_reg, tdbit); musb 667 drivers/usb/musb/musb_cppi41.c struct musb *musb = controller->controller.musb; musb 668 drivers/usb/musb/musb_cppi41.c struct device *dev = musb->controller; musb 750 drivers/usb/musb/musb_cppi41.c cppi41_dma_controller_create(struct musb *musb, void __iomem *base) musb 756 drivers/usb/musb/musb_cppi41.c if (!musb->controller->parent->of_node) { musb 757 drivers/usb/musb/musb_cppi41.c dev_err(musb->controller, "Need DT for the DMA engine.\n"); musb 774 drivers/usb/musb/musb_cppi41.c controller->controller.musb = musb; musb 776 drivers/usb/musb/musb_cppi41.c if (musb->ops->quirks & MUSB_DA8XX) { musb 20 drivers/usb/musb/musb_debug.h void musb_dbg(struct musb *musb, const char *fmt, ...); musb 23 drivers/usb/musb/musb_debug.h void musb_init_debugfs(struct musb *musb); musb 24 drivers/usb/musb/musb_debug.h void musb_exit_debugfs(struct musb *musb); musb 26 drivers/usb/musb/musb_debug.h static inline void musb_init_debugfs(struct musb *musb) musb 29 drivers/usb/musb/musb_debug.h static inline void musb_exit_debugfs(struct musb *musb) musb 86 drivers/usb/musb/musb_debugfs.c struct musb *musb = s->private; musb 90 drivers/usb/musb/musb_debugfs.c pm_runtime_get_sync(musb->controller); musb 96 drivers/usb/musb/musb_debugfs.c musb_readb(musb->mregs, musb_regmap[i].offset)); musb 100 drivers/usb/musb/musb_debugfs.c musb_readw(musb->mregs, musb_regmap[i].offset)); musb 104 drivers/usb/musb/musb_debugfs.c musb_readl(musb->mregs, musb_regmap[i].offset)); musb 109 drivers/usb/musb/musb_debugfs.c pm_runtime_mark_last_busy(musb->controller); musb 110 drivers/usb/musb/musb_debugfs.c pm_runtime_put_autosuspend(musb->controller); musb 117 drivers/usb/musb/musb_debugfs.c struct musb *musb = s->private; musb 120 drivers/usb/musb/musb_debugfs.c pm_runtime_get_sync(musb->controller); musb 121 drivers/usb/musb/musb_debugfs.c test = musb_readb(musb->mregs, MUSB_TESTMODE); musb 122 drivers/usb/musb/musb_debugfs.c pm_runtime_mark_last_busy(musb->controller); musb 123 drivers/usb/musb/musb_debugfs.c pm_runtime_put_autosuspend(musb->controller); musb 167 drivers/usb/musb/musb_debugfs.c struct musb *musb = s->private; musb 176 drivers/usb/musb/musb_debugfs.c pm_runtime_get_sync(musb->controller); musb 177 drivers/usb/musb/musb_debugfs.c test = musb_readb(musb->mregs, MUSB_TESTMODE); musb 179 drivers/usb/musb/musb_debugfs.c dev_err(musb->controller, "Error: test mode is already set. " musb 204 drivers/usb/musb/musb_debugfs.c musb_load_testpacket(musb); musb 216 drivers/usb/musb/musb_debugfs.c musb_writeb(musb->mregs, MUSB_TESTMODE, test); musb 219 drivers/usb/musb/musb_debugfs.c pm_runtime_mark_last_busy(musb->controller); musb 220 drivers/usb/musb/musb_debugfs.c pm_runtime_put_autosuspend(musb->controller); musb 234 drivers/usb/musb/musb_debugfs.c struct musb *musb = s->private; musb 238 drivers/usb/musb/musb_debugfs.c switch (musb->xceiv->otg->state) { musb 241 drivers/usb/musb/musb_debugfs.c pm_runtime_get_sync(musb->controller); musb 243 drivers/usb/musb/musb_debugfs.c reg = musb_readb(musb->mregs, MUSB_DEVCTL); musb 246 drivers/usb/musb/musb_debugfs.c pm_runtime_mark_last_busy(musb->controller); musb 247 drivers/usb/musb/musb_debugfs.c pm_runtime_put_autosuspend(musb->controller); musb 267 drivers/usb/musb/musb_debugfs.c struct musb *musb = s->private; musb 276 drivers/usb/musb/musb_debugfs.c pm_runtime_get_sync(musb->controller); musb 278 drivers/usb/musb/musb_debugfs.c switch (musb->xceiv->otg->state) { musb 280 drivers/usb/musb/musb_debugfs.c musb_root_disconnect(musb); musb 281 drivers/usb/musb/musb_debugfs.c reg = musb_readb(musb->mregs, MUSB_DEVCTL); musb 283 drivers/usb/musb/musb_debugfs.c musb_writeb(musb->mregs, MUSB_DEVCTL, reg); musb 289 drivers/usb/musb/musb_debugfs.c switch (musb->xceiv->otg->state) { musb 297 drivers/usb/musb/musb_debugfs.c musb->context.devctl |= MUSB_DEVCTL_SESSION; musb 298 drivers/usb/musb/musb_debugfs.c reg = musb_readb(musb->mregs, MUSB_DEVCTL); musb 300 drivers/usb/musb/musb_debugfs.c musb_writeb(musb->mregs, MUSB_DEVCTL, reg); musb 307 drivers/usb/musb/musb_debugfs.c pm_runtime_mark_last_busy(musb->controller); musb 308 drivers/usb/musb/musb_debugfs.c pm_runtime_put_autosuspend(musb->controller); musb 324 drivers/usb/musb/musb_debugfs.c void musb_init_debugfs(struct musb *musb) musb 328 drivers/usb/musb/musb_debugfs.c root = debugfs_create_dir(dev_name(musb->controller), NULL); musb 329 drivers/usb/musb/musb_debugfs.c musb->debugfs_root = root; musb 331 drivers/usb/musb/musb_debugfs.c debugfs_create_file("regdump", S_IRUGO, root, musb, &musb_regdump_fops); musb 332 drivers/usb/musb/musb_debugfs.c debugfs_create_file("testmode", S_IRUGO | S_IWUSR, root, musb, musb 334 drivers/usb/musb/musb_debugfs.c debugfs_create_file("softconnect", S_IRUGO | S_IWUSR, root, musb, musb 338 drivers/usb/musb/musb_debugfs.c void /* __init_or_exit */ musb_exit_debugfs(struct musb *musb) musb 340 drivers/usb/musb/musb_debugfs.c debugfs_remove_recursive(musb->debugfs_root); musb 47 drivers/usb/musb/musb_dma.h #define musb_dma_ux500(musb) (musb->ops->quirks & MUSB_DMA_UX500) musb 49 drivers/usb/musb/musb_dma.h #define musb_dma_ux500(musb) 0 musb 53 drivers/usb/musb/musb_dma.h #define musb_dma_cppi41(musb) (musb->ops->quirks & MUSB_DMA_CPPI41) musb 55 drivers/usb/musb/musb_dma.h #define musb_dma_cppi41(musb) 0 musb 59 drivers/usb/musb/musb_dma.h #define musb_dma_cppi(musb) (musb->ops->quirks & MUSB_DMA_CPPI) musb 61 drivers/usb/musb/musb_dma.h #define musb_dma_cppi(musb) 0 musb 65 drivers/usb/musb/musb_dma.h #define tusb_dma_omap(musb) (musb->ops->quirks & MUSB_DMA_TUSB_OMAP) musb 67 drivers/usb/musb/musb_dma.h #define tusb_dma_omap(musb) 0 musb 71 drivers/usb/musb/musb_dma.h #define musb_dma_inventra(musb) (musb->ops->quirks & MUSB_DMA_INVENTRA) musb 73 drivers/usb/musb/musb_dma.h #define musb_dma_inventra(musb) 0 musb 77 drivers/usb/musb/musb_dma.h #define is_cppi_enabled(musb) \ musb 78 drivers/usb/musb/musb_dma.h (musb_dma_cppi(musb) || musb_dma_cppi41(musb)) musb 80 drivers/usb/musb/musb_dma.h #define is_cppi_enabled(musb) 0 musb 155 drivers/usb/musb/musb_dma.h struct musb *musb; musb 171 drivers/usb/musb/musb_dma.h extern void musb_dma_completion(struct musb *musb, u8 epnum, u8 transmit); musb 175 drivers/usb/musb/musb_dma.h musb_dma_controller_create(struct musb *m, void __iomem *io) musb 185 drivers/usb/musb/musb_dma.h (*musb_dma_controller_create)(struct musb *, void __iomem *); musb 192 drivers/usb/musb/musb_dma.h musbhs_dma_controller_create(struct musb *musb, void __iomem *base); musb 196 drivers/usb/musb/musb_dma.h tusb_dma_controller_create(struct musb *musb, void __iomem *base); musb 200 drivers/usb/musb/musb_dma.h cppi_dma_controller_create(struct musb *musb, void __iomem *base); musb 204 drivers/usb/musb/musb_dma.h cppi41_dma_controller_create(struct musb *musb, void __iomem *base); musb 208 drivers/usb/musb/musb_dma.h ux500_dma_controller_create(struct musb *musb, void __iomem *base); musb 104 drivers/usb/musb/musb_dsps.c struct platform_device *musb; /* child musb pdev */ musb 136 drivers/usb/musb/musb_dsps.c struct musb *musb = platform_get_drvdata(glue->musb); musb 144 drivers/usb/musb/musb_dsps.c mod_timer(&musb->dev_timer, jiffies + wait); musb 168 drivers/usb/musb/musb_dsps.c static void dsps_musb_enable(struct musb *musb) musb 170 drivers/usb/musb/musb_dsps.c struct device *dev = musb->controller; musb 173 drivers/usb/musb/musb_dsps.c void __iomem *reg_base = musb->ctrl_base; musb 177 drivers/usb/musb/musb_dsps.c epmask = ((musb->epmask & wrp->txep_mask) << wrp->txep_shift) | musb 178 drivers/usb/musb/musb_dsps.c ((musb->epmask & wrp->rxep_mask) << wrp->rxep_shift); musb 187 drivers/usb/musb/musb_dsps.c if (musb->xceiv->otg->state == OTG_STATE_B_IDLE) musb 194 drivers/usb/musb/musb_dsps.c static void dsps_musb_disable(struct musb *musb) musb 196 drivers/usb/musb/musb_dsps.c struct device *dev = musb->controller; musb 199 drivers/usb/musb/musb_dsps.c void __iomem *reg_base = musb->ctrl_base; musb 204 drivers/usb/musb/musb_dsps.c del_timer_sync(&musb->dev_timer); musb 208 drivers/usb/musb/musb_dsps.c static int dsps_check_status(struct musb *musb, void *unused) musb 210 drivers/usb/musb/musb_dsps.c void __iomem *mregs = musb->mregs; musb 211 drivers/usb/musb/musb_dsps.c struct device *dev = musb->controller; musb 218 drivers/usb/musb/musb_dsps.c del_timer(&musb->dev_timer); musb 225 drivers/usb/musb/musb_dsps.c dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl, musb 226 drivers/usb/musb/musb_dsps.c usb_otg_state_string(musb->xceiv->otg->state)); musb 228 drivers/usb/musb/musb_dsps.c switch (musb->xceiv->otg->state) { musb 230 drivers/usb/musb/musb_dsps.c if (musb->port_mode == MUSB_HOST) { musb 231 drivers/usb/musb/musb_dsps.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_BCON; musb 239 drivers/usb/musb/musb_dsps.c if (musb->port_mode == MUSB_HOST) { musb 243 drivers/usb/musb/musb_dsps.c musb_writeb(musb->mregs, MUSB_DEVCTL, 0); musb 251 drivers/usb/musb/musb_dsps.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 252 drivers/usb/musb/musb_dsps.c MUSB_DEV_MODE(musb); musb 254 drivers/usb/musb/musb_dsps.c musb->xceiv->otg->state = OTG_STATE_A_IDLE; musb 255 drivers/usb/musb/musb_dsps.c MUSB_HST_MODE(musb); musb 258 drivers/usb/musb/musb_dsps.c if (musb->port_mode == MUSB_PERIPHERAL) musb 268 drivers/usb/musb/musb_dsps.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 269 drivers/usb/musb/musb_dsps.c musb_writel(musb->ctrl_base, wrp->coreintr_set, musb 281 drivers/usb/musb/musb_dsps.c struct musb *musb = from_timer(musb, t, dev_timer); musb 282 drivers/usb/musb/musb_dsps.c struct device *dev = musb->controller; musb 294 drivers/usb/musb/musb_dsps.c spin_lock_irqsave(&musb->lock, flags); musb 295 drivers/usb/musb/musb_dsps.c err = musb_queue_resume_work(musb, dsps_check_status, NULL); musb 298 drivers/usb/musb/musb_dsps.c spin_unlock_irqrestore(&musb->lock, flags); musb 303 drivers/usb/musb/musb_dsps.c static void dsps_musb_clear_ep_rxintr(struct musb *musb, int epnum) musb 306 drivers/usb/musb/musb_dsps.c struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent); musb 311 drivers/usb/musb/musb_dsps.c musb_writel(musb->ctrl_base, wrp->epintr_status, epintr); musb 316 drivers/usb/musb/musb_dsps.c struct musb *musb = hci; musb 317 drivers/usb/musb/musb_dsps.c void __iomem *reg_base = musb->ctrl_base; musb 318 drivers/usb/musb/musb_dsps.c struct device *dev = musb->controller; musb 325 drivers/usb/musb/musb_dsps.c spin_lock_irqsave(&musb->lock, flags); musb 329 drivers/usb/musb/musb_dsps.c musb->int_rx = (epintr & wrp->rxep_bitmap) >> wrp->rxep_shift; musb 330 drivers/usb/musb/musb_dsps.c musb->int_tx = (epintr & wrp->txep_bitmap) >> wrp->txep_shift; musb 340 drivers/usb/musb/musb_dsps.c musb->int_usb = (usbintr & wrp->usb_bitmap) >> wrp->usb_shift; musb 344 drivers/usb/musb/musb_dsps.c dev_dbg(musb->controller, "usbintr (%x) epintr(%x)\n", musb 349 drivers/usb/musb/musb_dsps.c void __iomem *mregs = musb->mregs; musb 353 drivers/usb/musb/musb_dsps.c err = musb->int_usb & MUSB_INTR_VBUSERROR; musb 366 drivers/usb/musb/musb_dsps.c musb->int_usb &= ~MUSB_INTR_VBUSERROR; musb 367 drivers/usb/musb/musb_dsps.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VFALL; musb 371 drivers/usb/musb/musb_dsps.c MUSB_HST_MODE(musb); musb 372 drivers/usb/musb/musb_dsps.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 375 drivers/usb/musb/musb_dsps.c musb->is_active = 0; musb 376 drivers/usb/musb/musb_dsps.c MUSB_DEV_MODE(musb); musb 377 drivers/usb/musb/musb_dsps.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 381 drivers/usb/musb/musb_dsps.c dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n", musb 383 drivers/usb/musb/musb_dsps.c usb_otg_state_string(musb->xceiv->otg->state), musb 389 drivers/usb/musb/musb_dsps.c if (musb->int_tx || musb->int_rx || musb->int_usb) musb 390 drivers/usb/musb/musb_dsps.c ret |= musb_interrupt(musb); musb 393 drivers/usb/musb/musb_dsps.c switch (musb->xceiv->otg->state) { musb 403 drivers/usb/musb/musb_dsps.c spin_unlock_irqrestore(&musb->lock, flags); musb 408 drivers/usb/musb/musb_dsps.c static int dsps_musb_dbg_init(struct musb *musb, struct dsps_glue *glue) musb 413 drivers/usb/musb/musb_dsps.c sprintf(buf, "%s.dsps", dev_name(musb->controller)); musb 419 drivers/usb/musb/musb_dsps.c glue->regset.base = musb->ctrl_base; musb 425 drivers/usb/musb/musb_dsps.c static int dsps_musb_init(struct musb *musb) musb 427 drivers/usb/musb/musb_dsps.c struct device *dev = musb->controller; musb 440 drivers/usb/musb/musb_dsps.c musb->ctrl_base = reg_base; musb 443 drivers/usb/musb/musb_dsps.c musb->xceiv = devm_usb_get_phy_by_phandle(dev->parent, "phys", 0); musb 444 drivers/usb/musb/musb_dsps.c if (IS_ERR(musb->xceiv)) musb 445 drivers/usb/musb/musb_dsps.c return PTR_ERR(musb->xceiv); musb 447 drivers/usb/musb/musb_dsps.c musb->phy = devm_phy_get(dev->parent, "usb2-phy"); musb 454 drivers/usb/musb/musb_dsps.c if (IS_ERR(musb->phy)) { musb 455 drivers/usb/musb/musb_dsps.c musb->phy = NULL; musb 457 drivers/usb/musb/musb_dsps.c ret = phy_init(musb->phy); musb 460 drivers/usb/musb/musb_dsps.c ret = phy_power_on(musb->phy); musb 462 drivers/usb/musb/musb_dsps.c phy_exit(musb->phy); musb 467 drivers/usb/musb/musb_dsps.c timer_setup(&musb->dev_timer, otg_timer, 0); musb 472 drivers/usb/musb/musb_dsps.c musb->isr = dsps_interrupt; musb 477 drivers/usb/musb/musb_dsps.c musb_writel(musb->ctrl_base, wrp->phy_utmi, val); musb 485 drivers/usb/musb/musb_dsps.c val = musb_readb(musb->mregs, MUSB_BABBLE_CTL); musb 489 drivers/usb/musb/musb_dsps.c musb_writeb(musb->mregs, MUSB_BABBLE_CTL, val); musb 494 drivers/usb/musb/musb_dsps.c return dsps_musb_dbg_init(musb, glue); musb 497 drivers/usb/musb/musb_dsps.c static int dsps_musb_exit(struct musb *musb) musb 499 drivers/usb/musb/musb_dsps.c struct device *dev = musb->controller; musb 502 drivers/usb/musb/musb_dsps.c del_timer_sync(&musb->dev_timer); musb 503 drivers/usb/musb/musb_dsps.c phy_power_off(musb->phy); musb 504 drivers/usb/musb/musb_dsps.c phy_exit(musb->phy); musb 510 drivers/usb/musb/musb_dsps.c static int dsps_musb_set_mode(struct musb *musb, u8 mode) musb 512 drivers/usb/musb/musb_dsps.c struct device *dev = musb->controller; musb 515 drivers/usb/musb/musb_dsps.c void __iomem *ctrl_base = musb->ctrl_base; musb 557 drivers/usb/musb/musb_dsps.c static bool dsps_sw_babble_control(struct musb *musb) musb 562 drivers/usb/musb/musb_dsps.c babble_ctl = musb_readb(musb->mregs, MUSB_BABBLE_CTL); musb 563 drivers/usb/musb/musb_dsps.c dev_dbg(musb->controller, "babble: MUSB_BABBLE_CTL value %x\n", musb 569 drivers/usb/musb/musb_dsps.c dev_dbg(musb->controller, "STUCK_J is %s\n", musb 579 drivers/usb/musb/musb_dsps.c babble_ctl = musb_readb(musb->mregs, MUSB_BABBLE_CTL); musb 581 drivers/usb/musb/musb_dsps.c musb_writeb(musb->mregs, MUSB_BABBLE_CTL, babble_ctl); musb 584 drivers/usb/musb/musb_dsps.c dev_dbg(musb->controller, "Set TXIDLE, wait J to clear\n"); musb 586 drivers/usb/musb/musb_dsps.c babble_ctl = musb_readb(musb->mregs, MUSB_BABBLE_CTL); musb 597 drivers/usb/musb/musb_dsps.c dev_dbg(musb->controller, "J not cleared, misc (%x)\n", musb 608 drivers/usb/musb/musb_dsps.c static int dsps_musb_recover(struct musb *musb) musb 610 drivers/usb/musb/musb_dsps.c struct device *dev = musb->controller; musb 615 drivers/usb/musb/musb_dsps.c session_restart = dsps_sw_babble_control(musb); musb 643 drivers/usb/musb/musb_dsps.c struct musb *musb = c->musb; musb 644 drivers/usb/musb/musb_dsps.c struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent); musb 654 drivers/usb/musb/musb_dsps.c dsps_dma_controller_create(struct musb *musb, void __iomem *base) musb 657 drivers/usb/musb/musb_dsps.c struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent); musb 660 drivers/usb/musb/musb_dsps.c controller = cppi41_dma_controller_create(musb, base); musb 730 drivers/usb/musb/musb_dsps.c struct platform_device *musb; musb 750 drivers/usb/musb/musb_dsps.c musb = platform_device_alloc("musb-hdrc", musb 752 drivers/usb/musb/musb_dsps.c if (!musb) { musb 757 drivers/usb/musb/musb_dsps.c musb->dev.parent = dev; musb 758 drivers/usb/musb/musb_dsps.c musb->dev.dma_mask = &musb_dmamask; musb 759 drivers/usb/musb/musb_dsps.c musb->dev.coherent_dma_mask = musb_dmamask; musb 760 drivers/usb/musb/musb_dsps.c device_set_of_node_from_dev(&musb->dev, &parent->dev); musb 762 drivers/usb/musb/musb_dsps.c glue->musb = musb; musb 764 drivers/usb/musb/musb_dsps.c ret = platform_device_add_resources(musb, resources, musb 803 drivers/usb/musb/musb_dsps.c ret = platform_device_add_data(musb, &pdata, sizeof(pdata)); musb 809 drivers/usb/musb/musb_dsps.c ret = platform_device_add(musb); musb 817 drivers/usb/musb/musb_dsps.c platform_device_put(musb); musb 824 drivers/usb/musb/musb_dsps.c struct musb *musb = platform_get_drvdata(glue->musb); musb 826 drivers/usb/musb/musb_dsps.c if (!musb) musb 918 drivers/usb/musb/musb_dsps.c platform_device_unregister(glue->musb); musb 971 drivers/usb/musb/musb_dsps.c struct musb *musb = platform_get_drvdata(glue->musb); musb 975 drivers/usb/musb/musb_dsps.c if (!musb) musb 985 drivers/usb/musb/musb_dsps.c del_timer_sync(&musb->dev_timer); musb 987 drivers/usb/musb/musb_dsps.c mbase = musb->ctrl_base; musb 1005 drivers/usb/musb/musb_dsps.c struct musb *musb = platform_get_drvdata(glue->musb); musb 1008 drivers/usb/musb/musb_dsps.c if (!musb) musb 1013 drivers/usb/musb/musb_dsps.c mbase = musb->ctrl_base; musb 1021 drivers/usb/musb/musb_dsps.c if (musb->xceiv->otg->state == OTG_STATE_B_IDLE && musb 1022 drivers/usb/musb/musb_dsps.c musb->port_mode == MUSB_OTG) musb 33 drivers/usb/musb/musb_gadget.c struct musb *musb, struct musb_ep *musb_ep) musb 36 drivers/usb/musb/musb_gadget.c struct dma_controller *dma = musb->dma_controller; musb 59 drivers/usb/musb/musb_gadget.c musb->controller, musb 65 drivers/usb/musb/musb_gadget.c ret = dma_mapping_error(musb->controller, dma_addr); musb 72 drivers/usb/musb/musb_gadget.c dma_sync_single_for_device(musb->controller, musb 84 drivers/usb/musb/musb_gadget.c struct musb *musb) musb 92 drivers/usb/musb/musb_gadget.c dev_vdbg(musb->controller, musb 97 drivers/usb/musb/musb_gadget.c dma_unmap_single(musb->controller, musb 105 drivers/usb/musb/musb_gadget.c dma_sync_single_for_cpu(musb->controller, musb 126 drivers/usb/musb/musb_gadget.c __releases(ep->musb->lock) musb 127 drivers/usb/musb/musb_gadget.c __acquires(ep->musb->lock) musb 130 drivers/usb/musb/musb_gadget.c struct musb *musb; musb 138 drivers/usb/musb/musb_gadget.c musb = req->musb; musb 141 drivers/usb/musb/musb_gadget.c spin_unlock(&musb->lock); musb 143 drivers/usb/musb/musb_gadget.c if (!dma_mapping_error(&musb->g.dev, request->dma)) musb 144 drivers/usb/musb/musb_gadget.c unmap_dma_buffer(req, musb); musb 148 drivers/usb/musb/musb_gadget.c spin_lock(&musb->lock); musb 160 drivers/usb/musb/musb_gadget.c struct musb *musb = ep->musb; musb 162 drivers/usb/musb/musb_gadget.c void __iomem *epio = ep->musb->endpoints[ep->current_epnum].regs; musb 167 drivers/usb/musb/musb_gadget.c struct dma_controller *c = ep->musb->dma_controller; musb 188 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s: abort DMA --> %d", ep->name, value); musb 208 drivers/usb/musb/musb_gadget.c static inline int max_ep_writesize(struct musb *musb, struct musb_ep *ep) musb 210 drivers/usb/musb/musb_gadget.c if (can_bulk_split(musb, ep->type)) musb 223 drivers/usb/musb/musb_gadget.c static void txstate(struct musb *musb, struct musb_request *req) musb 227 drivers/usb/musb/musb_gadget.c void __iomem *epio = musb->endpoints[epnum].regs; musb 236 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "ep:%s disabled - ignore request", musb 243 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "dma pending..."); musb 251 drivers/usb/musb/musb_gadget.c fifo_count = min(max_ep_writesize(musb, musb_ep), musb 255 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s old packet still ready , txcsr %03x", musb 261 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s stalling, txcsr %03x", musb 266 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "hw_ep%d, maxpacket %d, fifo count %d, txcsr %03x", musb 272 drivers/usb/musb/musb_gadget.c struct dma_controller *c = musb->dma_controller; musb 283 drivers/usb/musb/musb_gadget.c if (musb_dma_inventra(musb) || musb_dma_ux500(musb)) { musb 323 drivers/usb/musb/musb_gadget.c can_bulk_split(musb, musb 333 drivers/usb/musb/musb_gadget.c if (is_cppi_enabled(musb)) { musb 369 drivers/usb/musb/musb_gadget.c } else if (tusb_dma_omap(musb)) musb 383 drivers/usb/musb/musb_gadget.c unmap_dma_buffer(req, musb); musb 394 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s TX/IN %s len %d/%d, txcsr %04x, fifo %d/%d", musb 406 drivers/usb/musb/musb_gadget.c void musb_g_tx(struct musb *musb, u8 epnum) musb 411 drivers/usb/musb/musb_gadget.c u8 __iomem *mbase = musb->mregs; musb 412 drivers/usb/musb/musb_gadget.c struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_in; musb 413 drivers/usb/musb/musb_gadget.c void __iomem *epio = musb->endpoints[epnum].regs; musb 421 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "<== %s, txcsr %04x", musb_ep->end_point.name, csr); musb 441 drivers/usb/musb/musb_gadget.c dev_vdbg(musb->controller, "underrun on ep%d, req %p\n", musb 450 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s dma still busy?", musb_ep->end_point.name); musb 466 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "TXCSR%d %04x, DMA off, len %zu, req %p", musb 503 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s idle now", musb 509 drivers/usb/musb/musb_gadget.c txstate(musb, req); musb 518 drivers/usb/musb/musb_gadget.c static void rxstate(struct musb *musb, struct musb_request *req) musb 523 drivers/usb/musb/musb_gadget.c void __iomem *epio = musb->endpoints[epnum].regs; musb 527 drivers/usb/musb/musb_gadget.c struct musb_hw_ep *hw_ep = &musb->endpoints[epnum]; musb 539 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "ep:%s disabled - ignore request", musb 546 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "DMA pending..."); musb 551 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s stalling, RXCSR %04x", musb 556 drivers/usb/musb/musb_gadget.c if (is_cppi_enabled(musb) && is_buffer_mapped(req)) { musb 557 drivers/usb/musb/musb_gadget.c struct dma_controller *c = musb->dma_controller; musb 601 drivers/usb/musb/musb_gadget.c if (musb_dma_inventra(musb)) { musb 607 drivers/usb/musb/musb_gadget.c c = musb->dma_controller; musb 676 drivers/usb/musb/musb_gadget.c if ((musb_dma_ux500(musb)) && musb 683 drivers/usb/musb/musb_gadget.c c = musb->dma_controller; musb 726 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s OUT/RX pio fifo %d/%d, maxpacket %d", musb 733 drivers/usb/musb/musb_gadget.c if (tusb_dma_omap(musb)) { musb 734 drivers/usb/musb/musb_gadget.c struct dma_controller *c = musb->dma_controller; musb 753 drivers/usb/musb/musb_gadget.c unmap_dma_buffer(req, musb); musb 787 drivers/usb/musb/musb_gadget.c void musb_g_rx(struct musb *musb, u8 epnum) musb 792 drivers/usb/musb/musb_gadget.c void __iomem *mbase = musb->mregs; musb 794 drivers/usb/musb/musb_gadget.c void __iomem *epio = musb->endpoints[epnum].regs; musb 796 drivers/usb/musb/musb_gadget.c struct musb_hw_ep *hw_ep = &musb->endpoints[epnum]; musb 815 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "<== %s, rxcsr %04x%s %p", musb_ep->end_point.name, musb 830 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s iso overrun on %p", musb_ep->name, request); musb 836 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s, incomprx", musb_ep->end_point.name); musb 841 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s busy, csr %04x", musb 900 drivers/usb/musb/musb_gadget.c rxstate(musb, req); musb 912 drivers/usb/musb/musb_gadget.c struct musb *musb; musb 925 drivers/usb/musb/musb_gadget.c musb = musb_ep->musb; musb 926 drivers/usb/musb/musb_gadget.c mbase = musb->mregs; musb 929 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, flags); musb 947 drivers/usb/musb/musb_gadget.c ok = musb->hb_iso_tx; musb 949 drivers/usb/musb/musb_gadget.c ok = musb->hb_iso_rx; musb 952 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "no support for high bandwidth ISO"); musb 975 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "packet size beyond hardware FIFO size"); musb 979 drivers/usb/musb/musb_gadget.c musb->intrtxe |= (1 << epnum); musb 980 drivers/usb/musb/musb_gadget.c musb_writew(mbase, MUSB_INTRTXE, musb->intrtxe); musb 988 drivers/usb/musb/musb_gadget.c if (can_bulk_split(musb, musb_ep->type)) musb 1014 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "packet size beyond hardware FIFO size"); musb 1018 drivers/usb/musb/musb_gadget.c musb->intrrxe |= (1 << epnum); musb 1019 drivers/usb/musb/musb_gadget.c musb_writew(mbase, MUSB_INTRRXE, musb->intrrxe); musb 1051 drivers/usb/musb/musb_gadget.c if (is_dma_capable() && musb->dma_controller) { musb 1052 drivers/usb/musb/musb_gadget.c struct dma_controller *c = musb->dma_controller; musb 1071 drivers/usb/musb/musb_gadget.c schedule_delayed_work(&musb->irq_work, 0); musb 1074 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&musb->lock, flags); musb 1084 drivers/usb/musb/musb_gadget.c struct musb *musb; musb 1091 drivers/usb/musb/musb_gadget.c musb = musb_ep->musb; musb 1093 drivers/usb/musb/musb_gadget.c epio = musb->endpoints[epnum].regs; musb 1095 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, flags); musb 1096 drivers/usb/musb/musb_gadget.c musb_ep_select(musb->mregs, epnum); musb 1100 drivers/usb/musb/musb_gadget.c musb->intrtxe &= ~(1 << epnum); musb 1101 drivers/usb/musb/musb_gadget.c musb_writew(musb->mregs, MUSB_INTRTXE, musb->intrtxe); musb 1104 drivers/usb/musb/musb_gadget.c musb->intrrxe &= ~(1 << epnum); musb 1105 drivers/usb/musb/musb_gadget.c musb_writew(musb->mregs, MUSB_INTRRXE, musb->intrrxe); musb 1115 drivers/usb/musb/musb_gadget.c schedule_delayed_work(&musb->irq_work, 0); musb 1117 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&(musb->lock), flags); musb 1119 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s", musb_ep->end_point.name); musb 1169 drivers/usb/musb/musb_gadget.c void musb_ep_restart(struct musb *musb, struct musb_request *req) musb 1172 drivers/usb/musb/musb_gadget.c musb_ep_select(musb->mregs, req->epnum); musb 1174 drivers/usb/musb/musb_gadget.c txstate(musb, req); musb 1176 drivers/usb/musb/musb_gadget.c rxstate(musb, req); musb 1179 drivers/usb/musb/musb_gadget.c static int musb_ep_restart_resume_work(struct musb *musb, void *data) musb 1183 drivers/usb/musb/musb_gadget.c musb_ep_restart(musb, req); musb 1193 drivers/usb/musb/musb_gadget.c struct musb *musb; musb 1203 drivers/usb/musb/musb_gadget.c musb = musb_ep->musb; musb 1206 drivers/usb/musb/musb_gadget.c request->musb = musb; musb 1211 drivers/usb/musb/musb_gadget.c status = pm_runtime_get(musb->controller); musb 1213 drivers/usb/musb/musb_gadget.c dev_err(musb->controller, musb 1216 drivers/usb/musb/musb_gadget.c pm_runtime_put_noidle(musb->controller); musb 1230 drivers/usb/musb/musb_gadget.c map_dma_buffer(request, musb, musb_ep); musb 1232 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, lockflags); musb 1236 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "req %p queued to %s while ep %s", musb 1239 drivers/usb/musb/musb_gadget.c unmap_dma_buffer(request, musb); musb 1248 drivers/usb/musb/musb_gadget.c status = musb_queue_resume_work(musb, musb 1252 drivers/usb/musb/musb_gadget.c dev_err(musb->controller, "%s resume work: %i\n", musb 1257 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&musb->lock, lockflags); musb 1258 drivers/usb/musb/musb_gadget.c pm_runtime_mark_last_busy(musb->controller); musb 1259 drivers/usb/musb/musb_gadget.c pm_runtime_put_autosuspend(musb->controller); musb 1271 drivers/usb/musb/musb_gadget.c struct musb *musb = musb_ep->musb; musb 1278 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, flags); musb 1285 drivers/usb/musb/musb_gadget.c dev_err(musb->controller, "request %p not queued to %s\n", musb 1297 drivers/usb/musb/musb_gadget.c struct dma_controller *c = musb->dma_controller; musb 1299 drivers/usb/musb/musb_gadget.c musb_ep_select(musb->mregs, musb_ep->current_epnum); musb 1314 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&musb->lock, flags); musb 1328 drivers/usb/musb/musb_gadget.c struct musb *musb = musb_ep->musb; musb 1329 drivers/usb/musb/musb_gadget.c void __iomem *epio = musb->endpoints[epnum].regs; musb 1338 drivers/usb/musb/musb_gadget.c mbase = musb->mregs; musb 1340 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, flags); musb 1352 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "request in progress, cannot halt %s", musb 1361 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "FIFO busy, cannot halt %s", musb 1371 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "%s: %s stall", ep->name, value ? "set" : "clear"); musb 1398 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "restarting the request"); musb 1399 drivers/usb/musb/musb_gadget.c musb_ep_restart(musb, request); musb 1403 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&musb->lock, flags); musb 1429 drivers/usb/musb/musb_gadget.c struct musb *musb = musb_ep->musb; musb 1431 drivers/usb/musb/musb_gadget.c void __iomem *mbase = musb->mregs; musb 1434 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, flags); musb 1440 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&musb->lock, flags); musb 1448 drivers/usb/musb/musb_gadget.c struct musb *musb = musb_ep->musb; musb 1450 drivers/usb/musb/musb_gadget.c void __iomem *epio = musb->endpoints[epnum].regs; musb 1455 drivers/usb/musb/musb_gadget.c mbase = musb->mregs; musb 1457 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, flags); musb 1461 drivers/usb/musb/musb_gadget.c musb_writew(mbase, MUSB_INTRTXE, musb->intrtxe & ~(1 << epnum)); musb 1485 drivers/usb/musb/musb_gadget.c musb_writew(mbase, MUSB_INTRTXE, musb->intrtxe); musb 1486 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&musb->lock, flags); musb 1506 drivers/usb/musb/musb_gadget.c struct musb *musb = gadget_to_musb(gadget); musb 1508 drivers/usb/musb/musb_gadget.c return (int)musb_readw(musb->mregs, MUSB_FRAME); musb 1513 drivers/usb/musb/musb_gadget.c struct musb *musb = gadget_to_musb(gadget); musb 1514 drivers/usb/musb/musb_gadget.c void __iomem *mregs = musb->mregs; musb 1520 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, flags); musb 1522 drivers/usb/musb/musb_gadget.c switch (musb->xceiv->otg->state) { musb 1528 drivers/usb/musb/musb_gadget.c if (musb->may_wakeup && musb->is_suspended) musb 1534 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "Sending SRP: devctl: %02x", devctl); musb 1551 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&musb->lock, flags); musb 1552 drivers/usb/musb/musb_gadget.c otg_start_srp(musb->xceiv->otg); musb 1553 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, flags); musb 1556 drivers/usb/musb/musb_gadget.c musb_platform_try_idle(musb, musb 1562 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "Unhandled wake: %s", musb 1563 drivers/usb/musb/musb_gadget.c usb_otg_state_string(musb->xceiv->otg->state)); musb 1572 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "issue wakeup"); musb 1581 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&musb->lock, flags); musb 1592 drivers/usb/musb/musb_gadget.c static void musb_pullup(struct musb *musb, int is_on) musb 1596 drivers/usb/musb/musb_gadget.c power = musb_readb(musb->mregs, MUSB_POWER); musb 1604 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "gadget D+ pullup %s", musb 1606 drivers/usb/musb/musb_gadget.c musb_writeb(musb->mregs, MUSB_POWER, power); musb 1612 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "<= %s =>\n", __func__); musb 1625 drivers/usb/musb/musb_gadget.c struct musb *musb = gadget_to_musb(gadget); musb 1627 drivers/usb/musb/musb_gadget.c if (!musb->xceiv->set_power) musb 1629 drivers/usb/musb/musb_gadget.c return usb_phy_set_power(musb->xceiv, mA); musb 1634 drivers/usb/musb/musb_gadget.c struct musb *musb; musb 1637 drivers/usb/musb/musb_gadget.c musb = container_of(work, struct musb, gadget_work.work); musb 1638 drivers/usb/musb/musb_gadget.c pm_runtime_get_sync(musb->controller); musb 1639 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, flags); musb 1640 drivers/usb/musb/musb_gadget.c musb_pullup(musb, musb->softconnect); musb 1641 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&musb->lock, flags); musb 1642 drivers/usb/musb/musb_gadget.c pm_runtime_mark_last_busy(musb->controller); musb 1643 drivers/usb/musb/musb_gadget.c pm_runtime_put_autosuspend(musb->controller); musb 1648 drivers/usb/musb/musb_gadget.c struct musb *musb = gadget_to_musb(gadget); musb 1656 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, flags); musb 1657 drivers/usb/musb/musb_gadget.c if (is_on != musb->softconnect) { musb 1658 drivers/usb/musb/musb_gadget.c musb->softconnect = is_on; musb 1659 drivers/usb/musb/musb_gadget.c schedule_delayed_work(&musb->gadget_work, 0); musb 1661 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&musb->lock, flags); musb 1691 drivers/usb/musb/musb_gadget.c init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) musb 1693 drivers/usb/musb/musb_gadget.c struct musb_hw_ep *hw_ep = musb->endpoints + epnum; musb 1698 drivers/usb/musb/musb_gadget.c ep->musb = musb; musb 1713 drivers/usb/musb/musb_gadget.c musb->g.ep0 = &ep->end_point; musb 1723 drivers/usb/musb/musb_gadget.c list_add_tail(&ep->end_point.ep_list, &musb->g.ep_list); musb 1739 drivers/usb/musb/musb_gadget.c static inline void musb_g_init_endpoints(struct musb *musb) musb 1746 drivers/usb/musb/musb_gadget.c INIT_LIST_HEAD(&(musb->g.ep_list)); musb 1748 drivers/usb/musb/musb_gadget.c for (epnum = 0, hw_ep = musb->endpoints; musb 1749 drivers/usb/musb/musb_gadget.c epnum < musb->nr_endpoints; musb 1752 drivers/usb/musb/musb_gadget.c init_peripheral_ep(musb, &hw_ep->ep_in, epnum, 0); musb 1756 drivers/usb/musb/musb_gadget.c init_peripheral_ep(musb, &hw_ep->ep_in, musb 1761 drivers/usb/musb/musb_gadget.c init_peripheral_ep(musb, &hw_ep->ep_out, musb 1772 drivers/usb/musb/musb_gadget.c int musb_gadget_setup(struct musb *musb) musb 1781 drivers/usb/musb/musb_gadget.c musb->g.ops = &musb_gadget_operations; musb 1782 drivers/usb/musb/musb_gadget.c musb->g.max_speed = USB_SPEED_HIGH; musb 1783 drivers/usb/musb/musb_gadget.c musb->g.speed = USB_SPEED_UNKNOWN; musb 1785 drivers/usb/musb/musb_gadget.c MUSB_DEV_MODE(musb); musb 1786 drivers/usb/musb/musb_gadget.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 1789 drivers/usb/musb/musb_gadget.c musb->g.name = musb_driver_name; musb 1791 drivers/usb/musb/musb_gadget.c musb->g.is_otg = 0; musb 1792 drivers/usb/musb/musb_gadget.c INIT_DELAYED_WORK(&musb->gadget_work, musb_gadget_work); musb 1793 drivers/usb/musb/musb_gadget.c musb_g_init_endpoints(musb); musb 1795 drivers/usb/musb/musb_gadget.c musb->is_active = 0; musb 1796 drivers/usb/musb/musb_gadget.c musb_platform_try_idle(musb, 0); musb 1798 drivers/usb/musb/musb_gadget.c status = usb_add_gadget_udc(musb->controller, &musb->g); musb 1804 drivers/usb/musb/musb_gadget.c musb->g.dev.parent = NULL; musb 1805 drivers/usb/musb/musb_gadget.c device_unregister(&musb->g.dev); musb 1809 drivers/usb/musb/musb_gadget.c void musb_gadget_cleanup(struct musb *musb) musb 1811 drivers/usb/musb/musb_gadget.c if (musb->port_mode == MUSB_HOST) musb 1814 drivers/usb/musb/musb_gadget.c cancel_delayed_work_sync(&musb->gadget_work); musb 1815 drivers/usb/musb/musb_gadget.c usb_del_gadget_udc(&musb->g); musb 1832 drivers/usb/musb/musb_gadget.c struct musb *musb = gadget_to_musb(g); musb 1833 drivers/usb/musb/musb_gadget.c struct usb_otg *otg = musb->xceiv->otg; musb 1842 drivers/usb/musb/musb_gadget.c pm_runtime_get_sync(musb->controller); musb 1844 drivers/usb/musb/musb_gadget.c musb->softconnect = 0; musb 1845 drivers/usb/musb/musb_gadget.c musb->gadget_driver = driver; musb 1847 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, flags); musb 1848 drivers/usb/musb/musb_gadget.c musb->is_active = 1; musb 1850 drivers/usb/musb/musb_gadget.c otg_set_peripheral(otg, &musb->g); musb 1851 drivers/usb/musb/musb_gadget.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 1852 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&musb->lock, flags); musb 1854 drivers/usb/musb/musb_gadget.c musb_start(musb); musb 1860 drivers/usb/musb/musb_gadget.c if (musb->xceiv->last_event == USB_EVENT_ID) musb 1861 drivers/usb/musb/musb_gadget.c musb_platform_set_vbus(musb, 1); musb 1863 drivers/usb/musb/musb_gadget.c pm_runtime_mark_last_busy(musb->controller); musb 1864 drivers/usb/musb/musb_gadget.c pm_runtime_put_autosuspend(musb->controller); musb 1880 drivers/usb/musb/musb_gadget.c struct musb *musb = gadget_to_musb(g); musb 1883 drivers/usb/musb/musb_gadget.c pm_runtime_get_sync(musb->controller); musb 1890 drivers/usb/musb/musb_gadget.c spin_lock_irqsave(&musb->lock, flags); musb 1892 drivers/usb/musb/musb_gadget.c musb_hnp_stop(musb); musb 1894 drivers/usb/musb/musb_gadget.c (void) musb_gadget_vbus_draw(&musb->g, 0); musb 1896 drivers/usb/musb/musb_gadget.c musb->xceiv->otg->state = OTG_STATE_UNDEFINED; musb 1897 drivers/usb/musb/musb_gadget.c musb_stop(musb); musb 1898 drivers/usb/musb/musb_gadget.c otg_set_peripheral(musb->xceiv->otg, NULL); musb 1900 drivers/usb/musb/musb_gadget.c musb->is_active = 0; musb 1901 drivers/usb/musb/musb_gadget.c musb->gadget_driver = NULL; musb 1902 drivers/usb/musb/musb_gadget.c musb_platform_try_idle(musb, 0); musb 1903 drivers/usb/musb/musb_gadget.c spin_unlock_irqrestore(&musb->lock, flags); musb 1912 drivers/usb/musb/musb_gadget.c schedule_delayed_work(&musb->irq_work, 0); musb 1914 drivers/usb/musb/musb_gadget.c pm_runtime_mark_last_busy(musb->controller); musb 1915 drivers/usb/musb/musb_gadget.c pm_runtime_put_autosuspend(musb->controller); musb 1924 drivers/usb/musb/musb_gadget.c void musb_g_resume(struct musb *musb) musb 1926 drivers/usb/musb/musb_gadget.c musb->is_suspended = 0; musb 1927 drivers/usb/musb/musb_gadget.c switch (musb->xceiv->otg->state) { musb 1932 drivers/usb/musb/musb_gadget.c musb->is_active = 1; musb 1933 drivers/usb/musb/musb_gadget.c if (musb->gadget_driver && musb->gadget_driver->resume) { musb 1934 drivers/usb/musb/musb_gadget.c spin_unlock(&musb->lock); musb 1935 drivers/usb/musb/musb_gadget.c musb->gadget_driver->resume(&musb->g); musb 1936 drivers/usb/musb/musb_gadget.c spin_lock(&musb->lock); musb 1941 drivers/usb/musb/musb_gadget.c usb_otg_state_string(musb->xceiv->otg->state)); musb 1946 drivers/usb/musb/musb_gadget.c void musb_g_suspend(struct musb *musb) musb 1950 drivers/usb/musb/musb_gadget.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 1951 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "musb_g_suspend: devctl %02x", devctl); musb 1953 drivers/usb/musb/musb_gadget.c switch (musb->xceiv->otg->state) { musb 1956 drivers/usb/musb/musb_gadget.c musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; musb 1959 drivers/usb/musb/musb_gadget.c musb->is_suspended = 1; musb 1960 drivers/usb/musb/musb_gadget.c if (musb->gadget_driver && musb->gadget_driver->suspend) { musb 1961 drivers/usb/musb/musb_gadget.c spin_unlock(&musb->lock); musb 1962 drivers/usb/musb/musb_gadget.c musb->gadget_driver->suspend(&musb->g); musb 1963 drivers/usb/musb/musb_gadget.c spin_lock(&musb->lock); musb 1971 drivers/usb/musb/musb_gadget.c usb_otg_state_string(musb->xceiv->otg->state)); musb 1976 drivers/usb/musb/musb_gadget.c void musb_g_wakeup(struct musb *musb) musb 1978 drivers/usb/musb/musb_gadget.c musb_gadget_wakeup(&musb->g); musb 1982 drivers/usb/musb/musb_gadget.c void musb_g_disconnect(struct musb *musb) musb 1984 drivers/usb/musb/musb_gadget.c void __iomem *mregs = musb->mregs; musb 1987 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "musb_g_disconnect: devctl %02x", devctl); musb 1993 drivers/usb/musb/musb_gadget.c (void) musb_gadget_vbus_draw(&musb->g, 0); musb 1995 drivers/usb/musb/musb_gadget.c musb->g.speed = USB_SPEED_UNKNOWN; musb 1996 drivers/usb/musb/musb_gadget.c if (musb->gadget_driver && musb->gadget_driver->disconnect) { musb 1997 drivers/usb/musb/musb_gadget.c spin_unlock(&musb->lock); musb 1998 drivers/usb/musb/musb_gadget.c musb->gadget_driver->disconnect(&musb->g); musb 1999 drivers/usb/musb/musb_gadget.c spin_lock(&musb->lock); musb 2002 drivers/usb/musb/musb_gadget.c switch (musb->xceiv->otg->state) { musb 2004 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "Unhandled disconnect %s, setting a_idle", musb 2005 drivers/usb/musb/musb_gadget.c usb_otg_state_string(musb->xceiv->otg->state)); musb 2006 drivers/usb/musb/musb_gadget.c musb->xceiv->otg->state = OTG_STATE_A_IDLE; musb 2007 drivers/usb/musb/musb_gadget.c MUSB_HST_MODE(musb); musb 2010 drivers/usb/musb/musb_gadget.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_BCON; musb 2011 drivers/usb/musb/musb_gadget.c MUSB_HST_MODE(musb); musb 2017 drivers/usb/musb/musb_gadget.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 2023 drivers/usb/musb/musb_gadget.c musb->is_active = 0; musb 2026 drivers/usb/musb/musb_gadget.c void musb_g_reset(struct musb *musb) musb 2027 drivers/usb/musb/musb_gadget.c __releases(musb->lock) musb 2028 drivers/usb/musb/musb_gadget.c __acquires(musb->lock) musb 2030 drivers/usb/musb/musb_gadget.c void __iomem *mbase = musb->mregs; musb 2034 drivers/usb/musb/musb_gadget.c musb_dbg(musb, "<== %s driver '%s'", musb 2037 drivers/usb/musb/musb_gadget.c musb->gadget_driver musb 2038 drivers/usb/musb/musb_gadget.c ? musb->gadget_driver->driver.name musb 2043 drivers/usb/musb/musb_gadget.c if (musb->gadget_driver && musb->g.speed != USB_SPEED_UNKNOWN) { musb 2044 drivers/usb/musb/musb_gadget.c spin_unlock(&musb->lock); musb 2045 drivers/usb/musb/musb_gadget.c usb_gadget_udc_reset(&musb->g, musb->gadget_driver); musb 2046 drivers/usb/musb/musb_gadget.c spin_lock(&musb->lock); musb 2056 drivers/usb/musb/musb_gadget.c musb->g.speed = (power & MUSB_POWER_HSMODE) musb 2060 drivers/usb/musb/musb_gadget.c musb->is_active = 1; musb 2061 drivers/usb/musb/musb_gadget.c musb->is_suspended = 0; musb 2062 drivers/usb/musb/musb_gadget.c MUSB_DEV_MODE(musb); musb 2063 drivers/usb/musb/musb_gadget.c musb->address = 0; musb 2064 drivers/usb/musb/musb_gadget.c musb->ep0_state = MUSB_EP0_STAGE_SETUP; musb 2066 drivers/usb/musb/musb_gadget.c musb->may_wakeup = 0; musb 2067 drivers/usb/musb/musb_gadget.c musb->g.b_hnp_enable = 0; musb 2068 drivers/usb/musb/musb_gadget.c musb->g.a_alt_hnp_support = 0; musb 2069 drivers/usb/musb/musb_gadget.c musb->g.a_hnp_support = 0; musb 2070 drivers/usb/musb/musb_gadget.c musb->g.quirk_zlp_not_supp = 1; musb 2075 drivers/usb/musb/musb_gadget.c if (!musb->g.is_otg) { musb 2081 drivers/usb/musb/musb_gadget.c musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; musb 2082 drivers/usb/musb/musb_gadget.c musb->g.is_a_peripheral = 0; musb 2084 drivers/usb/musb/musb_gadget.c musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; musb 2085 drivers/usb/musb/musb_gadget.c musb->g.is_a_peripheral = 0; musb 2087 drivers/usb/musb/musb_gadget.c musb->xceiv->otg->state = OTG_STATE_A_PERIPHERAL; musb 2088 drivers/usb/musb/musb_gadget.c musb->g.is_a_peripheral = 1; musb 2092 drivers/usb/musb/musb_gadget.c (void) musb_gadget_vbus_draw(&musb->g, 8); musb 16 drivers/usb/musb/musb_gadget.h extern irqreturn_t musb_g_ep0_irq(struct musb *); musb 17 drivers/usb/musb/musb_gadget.h extern void musb_g_tx(struct musb *, u8); musb 18 drivers/usb/musb/musb_gadget.h extern void musb_g_rx(struct musb *, u8); musb 19 drivers/usb/musb/musb_gadget.h extern void musb_g_reset(struct musb *); musb 20 drivers/usb/musb/musb_gadget.h extern void musb_g_suspend(struct musb *); musb 21 drivers/usb/musb/musb_gadget.h extern void musb_g_resume(struct musb *); musb 22 drivers/usb/musb/musb_gadget.h extern void musb_g_wakeup(struct musb *); musb 23 drivers/usb/musb/musb_gadget.h extern void musb_g_disconnect(struct musb *); musb 24 drivers/usb/musb/musb_gadget.h extern void musb_gadget_cleanup(struct musb *); musb 25 drivers/usb/musb/musb_gadget.h extern int musb_gadget_setup(struct musb *); musb 28 drivers/usb/musb/musb_gadget.h static inline irqreturn_t musb_g_ep0_irq(struct musb *musb) musb 33 drivers/usb/musb/musb_gadget.h static inline void musb_g_tx(struct musb *musb, u8 epnum) {} musb 34 drivers/usb/musb/musb_gadget.h static inline void musb_g_rx(struct musb *musb, u8 epnum) {} musb 35 drivers/usb/musb/musb_gadget.h static inline void musb_g_reset(struct musb *musb) {} musb 36 drivers/usb/musb/musb_gadget.h static inline void musb_g_suspend(struct musb *musb) {} musb 37 drivers/usb/musb/musb_gadget.h static inline void musb_g_resume(struct musb *musb) {} musb 38 drivers/usb/musb/musb_gadget.h static inline void musb_g_wakeup(struct musb *musb) {} musb 39 drivers/usb/musb/musb_gadget.h static inline void musb_g_disconnect(struct musb *musb) {} musb 40 drivers/usb/musb/musb_gadget.h static inline void musb_gadget_cleanup(struct musb *musb) {} musb 41 drivers/usb/musb/musb_gadget.h static inline int musb_gadget_setup(struct musb *musb) musb 57 drivers/usb/musb/musb_gadget.h struct musb *musb; musb 78 drivers/usb/musb/musb_gadget.h struct musb *musb; musb 114 drivers/usb/musb/musb_gadget.h extern void musb_ep_restart(struct musb *, struct musb_request *); musb 21 drivers/usb/musb/musb_gadget_ep0.c #define next_ep0_request(musb) next_in_request(&(musb)->endpoints[0]) musb 51 drivers/usb/musb/musb_gadget_ep0.c struct musb *musb, musb 54 drivers/usb/musb/musb_gadget_ep0.c void __iomem *mbase = musb->mregs; musb 63 drivers/usb/musb/musb_gadget_ep0.c result[0] = musb->g.is_selfpowered << USB_DEVICE_SELF_POWERED; musb 64 drivers/usb/musb/musb_gadget_ep0.c result[0] |= musb->may_wakeup << USB_DEVICE_REMOTE_WAKEUP; musb 65 drivers/usb/musb/musb_gadget_ep0.c if (musb->g.is_otg) { musb 66 drivers/usb/musb/musb_gadget_ep0.c result[0] |= musb->g.b_hnp_enable musb 68 drivers/usb/musb/musb_gadget_ep0.c result[0] |= musb->g.a_alt_hnp_support musb 70 drivers/usb/musb/musb_gadget_ep0.c result[0] |= musb->g.a_hnp_support musb 99 drivers/usb/musb/musb_gadget_ep0.c ep = &musb->endpoints[epnum].ep_in; musb 101 drivers/usb/musb/musb_gadget_ep0.c ep = &musb->endpoints[epnum].ep_out; musb 102 drivers/usb/musb/musb_gadget_ep0.c regs = musb->endpoints[epnum].regs; musb 133 drivers/usb/musb/musb_gadget_ep0.c musb_write_fifo(&musb->endpoints[0], len, result); musb 151 drivers/usb/musb/musb_gadget_ep0.c service_in_request(struct musb *musb, const struct usb_ctrlrequest *ctrlrequest) musb 159 drivers/usb/musb/musb_gadget_ep0.c handled = service_tx_status_request(musb, musb 175 drivers/usb/musb/musb_gadget_ep0.c static void musb_g_ep0_giveback(struct musb *musb, struct usb_request *req) musb 177 drivers/usb/musb/musb_gadget_ep0.c musb_g_giveback(&musb->endpoints[0].ep_in, req, 0); musb 183 drivers/usb/musb/musb_gadget_ep0.c static inline void musb_try_b_hnp_enable(struct musb *musb) musb 185 drivers/usb/musb/musb_gadget_ep0.c void __iomem *mbase = musb->mregs; musb 188 drivers/usb/musb/musb_gadget_ep0.c musb_dbg(musb, "HNP: Setting HR"); musb 204 drivers/usb/musb/musb_gadget_ep0.c service_zero_data_request(struct musb *musb, musb 206 drivers/usb/musb/musb_gadget_ep0.c __releases(musb->lock) musb 207 drivers/usb/musb/musb_gadget_ep0.c __acquires(musb->lock) musb 210 drivers/usb/musb/musb_gadget_ep0.c void __iomem *mbase = musb->mregs; musb 219 drivers/usb/musb/musb_gadget_ep0.c musb->set_address = true; musb 220 drivers/usb/musb/musb_gadget_ep0.c musb->address = (u8) (ctrlrequest->wValue & 0x7f); musb 230 drivers/usb/musb/musb_gadget_ep0.c musb->may_wakeup = 0; musb 249 drivers/usb/musb/musb_gadget_ep0.c ep = musb->endpoints + epnum; musb 285 drivers/usb/musb/musb_gadget_ep0.c musb_dbg(musb, "restarting the request"); musb 286 drivers/usb/musb/musb_gadget_ep0.c musb_ep_restart(musb, request); musb 305 drivers/usb/musb/musb_gadget_ep0.c musb->may_wakeup = 1; musb 308 drivers/usb/musb/musb_gadget_ep0.c if (musb->g.speed != USB_SPEED_HIGH) musb 317 drivers/usb/musb/musb_gadget_ep0.c musb->test_mode_nr = musb 323 drivers/usb/musb/musb_gadget_ep0.c musb->test_mode_nr = musb 329 drivers/usb/musb/musb_gadget_ep0.c musb->test_mode_nr = musb 335 drivers/usb/musb/musb_gadget_ep0.c musb->test_mode_nr = musb 342 drivers/usb/musb/musb_gadget_ep0.c musb->test_mode_nr = musb 348 drivers/usb/musb/musb_gadget_ep0.c musb->test_mode_nr = musb 354 drivers/usb/musb/musb_gadget_ep0.c musb->test_mode_nr = musb 360 drivers/usb/musb/musb_gadget_ep0.c musb->test_mode_nr = musb 369 drivers/usb/musb/musb_gadget_ep0.c musb->test_mode = true; musb 372 drivers/usb/musb/musb_gadget_ep0.c if (!musb->g.is_otg) musb 374 drivers/usb/musb/musb_gadget_ep0.c musb->g.b_hnp_enable = 1; musb 375 drivers/usb/musb/musb_gadget_ep0.c musb_try_b_hnp_enable(musb); musb 378 drivers/usb/musb/musb_gadget_ep0.c if (!musb->g.is_otg) musb 380 drivers/usb/musb/musb_gadget_ep0.c musb->g.a_hnp_support = 1; musb 383 drivers/usb/musb/musb_gadget_ep0.c if (!musb->g.is_otg) musb 385 drivers/usb/musb/musb_gadget_ep0.c musb->g.a_alt_hnp_support = 1; musb 413 drivers/usb/musb/musb_gadget_ep0.c ep = musb->endpoints + epnum; musb 464 drivers/usb/musb/musb_gadget_ep0.c static void ep0_rxstate(struct musb *musb) musb 466 drivers/usb/musb/musb_gadget_ep0.c void __iomem *regs = musb->control_ep->regs; musb 471 drivers/usb/musb/musb_gadget_ep0.c request = next_ep0_request(musb); musb 488 drivers/usb/musb/musb_gadget_ep0.c musb_read_fifo(&musb->endpoints[0], count, buf); musb 493 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_STATUSIN; musb 505 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend = csr; musb 506 drivers/usb/musb/musb_gadget_ep0.c musb_g_ep0_giveback(musb, req); musb 507 drivers/usb/musb/musb_gadget_ep0.c if (!musb->ackpend) musb 509 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend = 0; musb 511 drivers/usb/musb/musb_gadget_ep0.c musb_ep_select(musb->mregs, 0); musb 521 drivers/usb/musb/musb_gadget_ep0.c static void ep0_txstate(struct musb *musb) musb 523 drivers/usb/musb/musb_gadget_ep0.c void __iomem *regs = musb->control_ep->regs; musb 524 drivers/usb/musb/musb_gadget_ep0.c struct musb_request *req = next_ep0_request(musb); musb 532 drivers/usb/musb/musb_gadget_ep0.c musb_dbg(musb, "odd; csr0 %04x", musb_readw(regs, MUSB_CSR0)); musb 542 drivers/usb/musb/musb_gadget_ep0.c musb_write_fifo(&musb->endpoints[0], fifo_count, fifo_src); musb 549 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_STATUSOUT; musb 560 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend = csr; musb 561 drivers/usb/musb/musb_gadget_ep0.c musb_g_ep0_giveback(musb, request); musb 562 drivers/usb/musb/musb_gadget_ep0.c if (!musb->ackpend) musb 564 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend = 0; musb 568 drivers/usb/musb/musb_gadget_ep0.c musb_ep_select(musb->mregs, 0); musb 579 drivers/usb/musb/musb_gadget_ep0.c musb_read_setup(struct musb *musb, struct usb_ctrlrequest *req) musb 582 drivers/usb/musb/musb_gadget_ep0.c void __iomem *regs = musb->control_ep->regs; musb 584 drivers/usb/musb/musb_gadget_ep0.c musb_read_fifo(&musb->endpoints[0], sizeof *req, (u8 *)req); musb 589 drivers/usb/musb/musb_gadget_ep0.c musb_dbg(musb, "SETUP req%02x.%02x v%04x i%04x l%d", musb 597 drivers/usb/musb/musb_gadget_ep0.c r = next_ep0_request(musb); musb 599 drivers/usb/musb/musb_gadget_ep0.c musb_g_ep0_giveback(musb, &r->request); musb 609 drivers/usb/musb/musb_gadget_ep0.c musb->set_address = false; musb 610 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend = MUSB_CSR0_P_SVDRXPKTRDY; musb 613 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend |= MUSB_CSR0_TXPKTRDY; musb 614 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_ACKWAIT; musb 616 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_TX; musb 621 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend = 0; musb 623 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_RX; musb 627 drivers/usb/musb/musb_gadget_ep0.c forward_to_driver(struct musb *musb, const struct usb_ctrlrequest *ctrlrequest) musb 628 drivers/usb/musb/musb_gadget_ep0.c __releases(musb->lock) musb 629 drivers/usb/musb/musb_gadget_ep0.c __acquires(musb->lock) musb 632 drivers/usb/musb/musb_gadget_ep0.c if (!musb->gadget_driver) musb 634 drivers/usb/musb/musb_gadget_ep0.c spin_unlock(&musb->lock); musb 635 drivers/usb/musb/musb_gadget_ep0.c retval = musb->gadget_driver->setup(&musb->g, ctrlrequest); musb 636 drivers/usb/musb/musb_gadget_ep0.c spin_lock(&musb->lock); musb 645 drivers/usb/musb/musb_gadget_ep0.c irqreturn_t musb_g_ep0_irq(struct musb *musb) musb 649 drivers/usb/musb/musb_gadget_ep0.c void __iomem *mbase = musb->mregs; musb 650 drivers/usb/musb/musb_gadget_ep0.c void __iomem *regs = musb->endpoints[0].regs; musb 657 drivers/usb/musb/musb_gadget_ep0.c musb_dbg(musb, "csr %04x, count %d, ep0stage %s", musb 658 drivers/usb/musb/musb_gadget_ep0.c csr, len, decode_ep0stage(musb->ep0_state)); musb 673 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_IDLE; musb 682 drivers/usb/musb/musb_gadget_ep0.c switch (musb->ep0_state) { musb 684 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_STATUSOUT; musb 687 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_STATUSIN; musb 691 drivers/usb/musb/musb_gadget_ep0.c decode_ep0stage(musb->ep0_state)); musb 701 drivers/usb/musb/musb_gadget_ep0.c switch (musb->ep0_state) { musb 706 drivers/usb/musb/musb_gadget_ep0.c ep0_txstate(musb); musb 714 drivers/usb/musb/musb_gadget_ep0.c ep0_rxstate(musb); musb 727 drivers/usb/musb/musb_gadget_ep0.c if (musb->set_address) { musb 728 drivers/usb/musb/musb_gadget_ep0.c musb->set_address = false; musb 729 drivers/usb/musb/musb_gadget_ep0.c musb_writeb(mbase, MUSB_FADDR, musb->address); musb 733 drivers/usb/musb/musb_gadget_ep0.c else if (musb->test_mode) { musb 734 drivers/usb/musb/musb_gadget_ep0.c musb_dbg(musb, "entering TESTMODE"); musb 736 drivers/usb/musb/musb_gadget_ep0.c if (MUSB_TEST_PACKET == musb->test_mode_nr) musb 737 drivers/usb/musb/musb_gadget_ep0.c musb_load_testpacket(musb); musb 740 drivers/usb/musb/musb_gadget_ep0.c musb->test_mode_nr); musb 749 drivers/usb/musb/musb_gadget_ep0.c req = next_ep0_request(musb); musb 751 drivers/usb/musb/musb_gadget_ep0.c musb_g_ep0_giveback(musb, &req->request); musb 762 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_IDLE; musb 773 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_SETUP; musb 786 drivers/usb/musb/musb_gadget_ep0.c musb_read_setup(musb, &setup); musb 790 drivers/usb/musb/musb_gadget_ep0.c if (unlikely(musb->g.speed == USB_SPEED_UNKNOWN)) { musb 797 drivers/usb/musb/musb_gadget_ep0.c musb->g.speed = (power & MUSB_POWER_HSMODE) musb 802 drivers/usb/musb/musb_gadget_ep0.c switch (musb->ep0_state) { musb 811 drivers/usb/musb/musb_gadget_ep0.c musb, &setup); musb 819 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend |= MUSB_CSR0_P_DATAEND; musb 823 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = musb 832 drivers/usb/musb/musb_gadget_ep0.c handled = service_in_request(musb, &setup); musb 834 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend = MUSB_CSR0_TXPKTRDY musb 836 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = musb 846 drivers/usb/musb/musb_gadget_ep0.c musb_dbg(musb, "handled %d, csr %04x, ep0stage %s", musb 848 drivers/usb/musb/musb_gadget_ep0.c decode_ep0stage(musb->ep0_state)); musb 859 drivers/usb/musb/musb_gadget_ep0.c handled = forward_to_driver(musb, &setup); musb 863 drivers/usb/musb/musb_gadget_ep0.c musb_dbg(musb, "stall (%d)", handled); musb 864 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend |= MUSB_CSR0_P_SENDSTALL; musb 865 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_IDLE; musb 868 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend); musb 869 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend = 0; musb 885 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_IDLE; musb 911 drivers/usb/musb/musb_gadget_ep0.c struct musb *musb; musb 920 drivers/usb/musb/musb_gadget_ep0.c musb = ep->musb; musb 921 drivers/usb/musb/musb_gadget_ep0.c regs = musb->control_ep->regs; musb 924 drivers/usb/musb/musb_gadget_ep0.c req->musb = musb; musb 929 drivers/usb/musb/musb_gadget_ep0.c spin_lock_irqsave(&musb->lock, lockflags); musb 936 drivers/usb/musb/musb_gadget_ep0.c switch (musb->ep0_state) { musb 943 drivers/usb/musb/musb_gadget_ep0.c musb_dbg(musb, "ep0 request queued in state %d", musb 944 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state); musb 952 drivers/usb/musb/musb_gadget_ep0.c musb_dbg(musb, "queue to %s (%s), length=%d", musb 956 drivers/usb/musb/musb_gadget_ep0.c musb_ep_select(musb->mregs, 0); musb 959 drivers/usb/musb/musb_gadget_ep0.c if (musb->ep0_state == MUSB_EP0_STAGE_TX) musb 960 drivers/usb/musb/musb_gadget_ep0.c ep0_txstate(musb); musb 963 drivers/usb/musb/musb_gadget_ep0.c else if (musb->ep0_state == MUSB_EP0_STAGE_ACKWAIT) { musb 967 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_STATUSIN; musb 969 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend | MUSB_CSR0_P_DATAEND); musb 970 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend = 0; musb 971 drivers/usb/musb/musb_gadget_ep0.c musb_g_ep0_giveback(ep->musb, r); musb 978 drivers/usb/musb/musb_gadget_ep0.c } else if (musb->ackpend) { musb 979 drivers/usb/musb/musb_gadget_ep0.c musb_writew(regs, MUSB_CSR0, musb->ackpend); musb 980 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend = 0; musb 984 drivers/usb/musb/musb_gadget_ep0.c spin_unlock_irqrestore(&musb->lock, lockflags); musb 997 drivers/usb/musb/musb_gadget_ep0.c struct musb *musb; musb 1007 drivers/usb/musb/musb_gadget_ep0.c musb = ep->musb; musb 1008 drivers/usb/musb/musb_gadget_ep0.c base = musb->mregs; musb 1009 drivers/usb/musb/musb_gadget_ep0.c regs = musb->control_ep->regs; musb 1012 drivers/usb/musb/musb_gadget_ep0.c spin_lock_irqsave(&musb->lock, flags); musb 1020 drivers/usb/musb/musb_gadget_ep0.c csr = musb->ackpend; musb 1022 drivers/usb/musb/musb_gadget_ep0.c switch (musb->ep0_state) { musb 1041 drivers/usb/musb/musb_gadget_ep0.c musb->ep0_state = MUSB_EP0_STAGE_IDLE; musb 1042 drivers/usb/musb/musb_gadget_ep0.c musb->ackpend = 0; musb 1045 drivers/usb/musb/musb_gadget_ep0.c musb_dbg(musb, "ep0 can't halt in state %d", musb->ep0_state); musb 1050 drivers/usb/musb/musb_gadget_ep0.c spin_unlock_irqrestore(&musb->lock, flags); musb 73 drivers/usb/musb/musb_host.c struct musb *hcd_to_musb(struct usb_hcd *hcd) musb 75 drivers/usb/musb/musb_host.c return *(struct musb **) hcd->hcd_priv; musb 79 drivers/usb/musb/musb_host.c static void musb_ep_program(struct musb *musb, u8 epnum, musb 88 drivers/usb/musb/musb_host.c struct musb *musb = ep->musb; musb 113 drivers/usb/musb/musb_host.c if (dev_WARN_ONCE(musb->controller, retries-- < 1, musb 171 drivers/usb/musb/musb_host.c if (is_cppi_enabled(ep->musb)) musb 196 drivers/usb/musb/musb_host.c musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) musb 199 drivers/usb/musb/musb_host.c void __iomem *mbase = musb->mregs; musb 215 drivers/usb/musb/musb_host.c musb->ep0_stage = MUSB_EP0_START; musb 231 drivers/usb/musb/musb_host.c trace_musb_urb_start(musb, urb); musb 235 drivers/usb/musb/musb_host.c musb_ep_program(musb, epnum, urb, !is_in, buf, offset, len); musb 245 drivers/usb/musb/musb_host.c musb_dbg(musb, "check whether there's still time for periodic Tx"); musb 258 drivers/usb/musb/musb_host.c musb_dbg(musb, "SOF for %d", epnum); musb 266 drivers/usb/musb/musb_host.c musb_dbg(musb, "Start TX%d %s", epnum, musb 271 drivers/usb/musb/musb_host.c else if (is_cppi_enabled(musb) || tusb_dma_omap(musb)) musb 277 drivers/usb/musb/musb_host.c static void musb_giveback(struct musb *musb, struct urb *urb, int status) musb 278 drivers/usb/musb/musb_host.c __releases(musb->lock) musb 279 drivers/usb/musb/musb_host.c __acquires(musb->lock) musb 281 drivers/usb/musb/musb_host.c trace_musb_urb_gb(musb, urb); musb 283 drivers/usb/musb/musb_host.c usb_hcd_unlink_urb_from_ep(musb->hcd, urb); musb 284 drivers/usb/musb/musb_host.c spin_unlock(&musb->lock); musb 285 drivers/usb/musb/musb_host.c usb_hcd_giveback_urb(musb->hcd, urb, status); musb 286 drivers/usb/musb/musb_host.c spin_lock(&musb->lock); musb 316 drivers/usb/musb/musb_host.c static void musb_advance_schedule(struct musb *musb, struct urb *urb, musb 339 drivers/usb/musb/musb_host.c musb_giveback(musb, urb, status); musb 347 drivers/usb/musb/musb_host.c struct dma_controller *dma = musb->dma_controller; musb 396 drivers/usb/musb/musb_host.c musb_dbg(musb, "... next ep%d %cX urb %p", musb 398 drivers/usb/musb/musb_host.c musb_start_urb(musb, is_in, qh); musb 425 drivers/usb/musb/musb_host.c musb_host_packet_rx(struct musb *musb, struct urb *urb, u8 epnum, u8 iso_err) musb 433 drivers/usb/musb/musb_host.c struct musb_hw_ep *hw_ep = musb->endpoints + epnum; musb 441 drivers/usb/musb/musb_host.c musb_dbg(musb, "RX%d count %d, buffer %p len %d/%d", epnum, rx_count, musb 463 drivers/usb/musb/musb_host.c musb_dbg(musb, "OVERFLOW %d into %d", rx_count, length); musb 481 drivers/usb/musb/musb_host.c musb_dbg(musb, "OVERFLOW %d into %d", rx_count, length); musb 526 drivers/usb/musb/musb_host.c musb_rx_reinit(struct musb *musb, struct musb_qh *qh, u8 epnum) musb 528 drivers/usb/musb/musb_host.c struct musb_hw_ep *ep = musb->endpoints + epnum; musb 564 drivers/usb/musb/musb_host.c if (musb->is_multipoint) { musb 565 drivers/usb/musb/musb_host.c musb_write_rxfunaddr(musb, epnum, qh->addr_reg); musb 566 drivers/usb/musb/musb_host.c musb_write_rxhubaddr(musb, epnum, qh->h_addr_reg); musb 567 drivers/usb/musb/musb_host.c musb_write_rxhubport(musb, epnum, qh->h_port_reg); musb 569 drivers/usb/musb/musb_host.c musb_writeb(musb->mregs, MUSB_FADDR, qh->addr_reg); musb 612 drivers/usb/musb/musb_host.c can_bulk_split(hw_ep->musb, qh->type))) musb 650 drivers/usb/musb/musb_host.c if (musb_dma_inventra(hw_ep->musb) || musb_dma_ux500(hw_ep->musb)) musb 653 drivers/usb/musb/musb_host.c else if (is_cppi_enabled(hw_ep->musb) || tusb_dma_omap(hw_ep->musb)) musb 687 drivers/usb/musb/musb_host.c static void musb_ep_program(struct musb *musb, u8 epnum, musb 694 drivers/usb/musb/musb_host.c void __iomem *mbase = musb->mregs; musb 695 drivers/usb/musb/musb_host.c struct musb_hw_ep *hw_ep = musb->endpoints + epnum; musb 702 drivers/usb/musb/musb_host.c musb_dbg(musb, "%s hw%d urb %p spd%d dev%d ep%d%s " musb 721 drivers/usb/musb/musb_host.c dma_controller = musb->dma_controller; musb 746 drivers/usb/musb/musb_host.c int_txe = musb->intrtxe; musb 794 drivers/usb/musb/musb_host.c if (musb->is_multipoint) { musb 795 drivers/usb/musb/musb_host.c musb_write_txfunaddr(musb, epnum, qh->addr_reg); musb 796 drivers/usb/musb/musb_host.c musb_write_txhubaddr(musb, epnum, qh->h_addr_reg); musb 797 drivers/usb/musb/musb_host.c musb_write_txhubport(musb, epnum, qh->h_port_reg); musb 805 drivers/usb/musb/musb_host.c if (can_bulk_split(musb, qh->type)) { musb 818 drivers/usb/musb/musb_host.c if (musb->is_multipoint) musb 823 drivers/usb/musb/musb_host.c if (can_bulk_split(musb, qh->type)) musb 841 drivers/usb/musb/musb_host.c dev_err(musb->controller, musb 866 drivers/usb/musb/musb_host.c musb_rx_reinit(musb, qh, epnum); musb 892 drivers/usb/musb/musb_host.c if ((is_cppi_enabled(musb) || tusb_dma_omap(musb)) && dma_channel) { musb 918 drivers/usb/musb/musb_host.c musb_dbg(musb, "RXCSR%d := %04x", epnum, csr); musb 927 drivers/usb/musb/musb_host.c static void musb_bulk_nak_timeout(struct musb *musb, struct musb_hw_ep *ep, musb 932 drivers/usb/musb/musb_host.c void __iomem *mbase = musb->mregs; musb 953 drivers/usb/musb/musb_host.c cur_qh = first_qh(&musb->in_bulk); musb 963 drivers/usb/musb/musb_host.c cur_qh = first_qh(&musb->out_bulk); musb 969 drivers/usb/musb/musb_host.c musb->dma_controller->channel_abort(dma); musb 977 drivers/usb/musb/musb_host.c list_move_tail(&cur_qh->ring, &musb->in_bulk); musb 980 drivers/usb/musb/musb_host.c next_qh = first_qh(&musb->in_bulk); musb 986 drivers/usb/musb/musb_host.c list_move_tail(&cur_qh->ring, &musb->out_bulk); musb 989 drivers/usb/musb/musb_host.c next_qh = first_qh(&musb->out_bulk); musb 996 drivers/usb/musb/musb_host.c musb_start_urb(musb, is_in, next_qh); musb 1004 drivers/usb/musb/musb_host.c static bool musb_h_ep0_continue(struct musb *musb, u16 len, struct urb *urb) musb 1009 drivers/usb/musb/musb_host.c struct musb_hw_ep *hw_ep = musb->control_ep; musb 1013 drivers/usb/musb/musb_host.c switch (musb->ep0_stage) { musb 1036 drivers/usb/musb/musb_host.c musb_dbg(musb, "start no-DATA"); musb 1039 drivers/usb/musb/musb_host.c musb_dbg(musb, "start IN-DATA"); musb 1040 drivers/usb/musb/musb_host.c musb->ep0_stage = MUSB_EP0_IN; musb 1044 drivers/usb/musb/musb_host.c musb_dbg(musb, "start OUT-DATA"); musb 1045 drivers/usb/musb/musb_host.c musb->ep0_stage = MUSB_EP0_OUT; musb 1056 drivers/usb/musb/musb_host.c musb_dbg(musb, "Sending %d byte%s to ep0 fifo %p", musb 1067 drivers/usb/musb/musb_host.c ERR("bogus ep0 stage %d\n", musb->ep0_stage); musb 1080 drivers/usb/musb/musb_host.c irqreturn_t musb_h_ep0_irq(struct musb *musb) musb 1085 drivers/usb/musb/musb_host.c void __iomem *mbase = musb->mregs; musb 1086 drivers/usb/musb/musb_host.c struct musb_hw_ep *hw_ep = musb->control_ep; musb 1101 drivers/usb/musb/musb_host.c musb_dbg(musb, "<== csr0 %04x, qh %p, count %d, urb %p, stage %d", musb 1102 drivers/usb/musb/musb_host.c csr, qh, len, urb, musb->ep0_stage); musb 1105 drivers/usb/musb/musb_host.c if (MUSB_EP0_STATUS == musb->ep0_stage) { musb 1112 drivers/usb/musb/musb_host.c musb_dbg(musb, "STALLING ENDPOINT"); musb 1116 drivers/usb/musb/musb_host.c musb_dbg(musb, "no response, csr0 %04x", csr); musb 1120 drivers/usb/musb/musb_host.c musb_dbg(musb, "control NAK timeout"); musb 1135 drivers/usb/musb/musb_host.c musb_dbg(musb, "aborting"); musb 1168 drivers/usb/musb/musb_host.c if (musb_h_ep0_continue(musb, len, urb)) { musb 1170 drivers/usb/musb/musb_host.c csr = (MUSB_EP0_IN == musb->ep0_stage) musb 1186 drivers/usb/musb/musb_host.c musb->ep0_stage = MUSB_EP0_STATUS; musb 1188 drivers/usb/musb/musb_host.c musb_dbg(musb, "ep0 STATUS, csr %04x", csr); musb 1194 drivers/usb/musb/musb_host.c musb->ep0_stage = MUSB_EP0_IDLE; musb 1198 drivers/usb/musb/musb_host.c musb_advance_schedule(musb, urb, hw_ep, 1); musb 1221 drivers/usb/musb/musb_host.c void musb_host_tx(struct musb *musb, u8 epnum) musb 1228 drivers/usb/musb/musb_host.c struct musb_hw_ep *hw_ep = musb->endpoints + epnum; musb 1233 drivers/usb/musb/musb_host.c void __iomem *mbase = musb->mregs; musb 1242 drivers/usb/musb/musb_host.c musb_dbg(musb, "extra TX%d ready, csr %04x", epnum, tx_csr); musb 1248 drivers/usb/musb/musb_host.c trace_musb_urb_tx(musb, urb); musb 1249 drivers/usb/musb/musb_host.c musb_dbg(musb, "OUT/TX%d end, csr %04x%s", epnum, tx_csr, musb 1255 drivers/usb/musb/musb_host.c musb_dbg(musb, "TX end %d stall", epnum); musb 1262 drivers/usb/musb/musb_host.c musb_dbg(musb, "TX 3strikes on ep=%d", epnum); musb 1268 drivers/usb/musb/musb_host.c && !list_is_singular(&musb->out_bulk)) { musb 1269 drivers/usb/musb/musb_host.c musb_dbg(musb, "NAK timeout on TX%d ep", epnum); musb 1270 drivers/usb/musb/musb_host.c musb_bulk_nak_timeout(musb, hw_ep, 0); musb 1272 drivers/usb/musb/musb_host.c musb_dbg(musb, "TX ep%d device not responding", epnum); musb 1293 drivers/usb/musb/musb_host.c musb->dma_controller->channel_abort(dma); musb 1318 drivers/usb/musb/musb_host.c musb_dbg(musb, "extra TX%d ready, csr %04x", epnum, tx_csr); musb 1377 drivers/usb/musb/musb_host.c musb_dbg(musb, musb 1435 drivers/usb/musb/musb_host.c musb_advance_schedule(musb, urb, hw_ep, USB_DIR_OUT); musb 1438 drivers/usb/musb/musb_host.c if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb, musb 1440 drivers/usb/musb/musb_host.c if (is_cppi_enabled(musb) || tusb_dma_omap(musb)) musb 1445 drivers/usb/musb/musb_host.c musb_dbg(musb, "not complete, but DMA enabled?"); musb 1459 drivers/usb/musb/musb_host.c usb_hcd_unmap_urb_for_dma(musb->hcd, urb); musb 1468 drivers/usb/musb/musb_host.c dev_err(musb->controller, "error: sg list empty\n"); musb 1591 drivers/usb/musb/musb_host.c if (musb_dma_cppi41(hw_ep->musb)) musb 1638 drivers/usb/musb/musb_host.c struct musb *musb = hw_ep->musb; musb 1663 drivers/usb/musb/musb_host.c musb_dbg(musb, "** OVERFLOW %d into %d", musb 1755 drivers/usb/musb/musb_host.c void musb_host_rx(struct musb *musb, u8 epnum) musb 1758 drivers/usb/musb/musb_host.c struct musb_hw_ep *hw_ep = musb->endpoints + epnum; musb 1759 drivers/usb/musb/musb_host.c struct dma_controller *c = musb->dma_controller; musb 1763 drivers/usb/musb/musb_host.c void __iomem *mbase = musb->mregs; musb 1786 drivers/usb/musb/musb_host.c musb_dbg(musb, "BOGUS RX%d ready, csr %04x, count %d", musb 1792 drivers/usb/musb/musb_host.c trace_musb_urb_rx(musb, urb); musb 1797 drivers/usb/musb/musb_host.c musb_dbg(musb, "RX end %d STALL", epnum); musb 1803 drivers/usb/musb/musb_host.c musb_dbg(musb, "end %d RX proto error", epnum); musb 1814 drivers/usb/musb/musb_host.c musb_dbg(musb, "RX end %d NAK timeout", epnum); musb 1826 drivers/usb/musb/musb_host.c && !list_is_singular(&musb->in_bulk)) { musb 1827 drivers/usb/musb/musb_host.c musb_bulk_nak_timeout(musb, hw_ep, 1); musb 1837 drivers/usb/musb/musb_host.c musb_dbg(musb, "RX end %d ISO data error", epnum); musb 1842 drivers/usb/musb/musb_host.c musb_dbg(musb, "end %d high bandwidth incomplete ISO packet RX", musb 1852 drivers/usb/musb/musb_host.c musb->dma_controller->channel_abort(dma); musb 1873 drivers/usb/musb/musb_host.c if (!musb_dma_inventra(musb) && !musb_dma_ux500(musb) && musb 1882 drivers/usb/musb/musb_host.c musb->dma_controller->channel_abort(dma); musb 1887 drivers/usb/musb/musb_host.c musb_dbg(musb, "RXCSR%d %04x, reqpkt, len %zu%s", epnum, rx_csr, musb 1905 drivers/usb/musb/musb_host.c if (musb_dma_inventra(musb) || musb_dma_ux500(musb) || musb 1906 drivers/usb/musb/musb_host.c musb_dma_cppi41(musb)) { musb 1908 drivers/usb/musb/musb_host.c musb_dbg(hw_ep->musb, musb 1934 drivers/usb/musb/musb_host.c if ((musb_dma_inventra(musb) || musb_dma_ux500(musb) || musb 1935 drivers/usb/musb/musb_host.c musb_dma_cppi41(musb)) && dma) { musb 1936 drivers/usb/musb/musb_host.c musb_dbg(hw_ep->musb, musb 1948 drivers/usb/musb/musb_host.c dev_err(musb->controller, "error: rx_dma failed\n"); musb 1955 drivers/usb/musb/musb_host.c usb_hcd_unmap_urb_for_dma(musb->hcd, urb); musb 1969 drivers/usb/musb/musb_host.c dev_err(musb->controller, "error: sg list empty\n"); musb 1978 drivers/usb/musb/musb_host.c done = musb_host_packet_rx(musb, urb, epnum, musb 1986 drivers/usb/musb/musb_host.c done = musb_host_packet_rx(musb, urb, musb 1989 drivers/usb/musb/musb_host.c musb_dbg(musb, "read %spacket", done ? "last " : ""); musb 2004 drivers/usb/musb/musb_host.c musb_advance_schedule(musb, urb, hw_ep, USB_DIR_IN); musb 2014 drivers/usb/musb/musb_host.c struct musb *musb, musb 2029 drivers/usb/musb/musb_host.c head = &musb->control; musb 2030 drivers/usb/musb/musb_host.c hw_ep = musb->control_ep; musb 2046 drivers/usb/musb/musb_host.c for (epnum = 1, hw_ep = musb->endpoints + 1; musb 2047 drivers/usb/musb/musb_host.c epnum < musb->nr_endpoints; musb 2054 drivers/usb/musb/musb_host.c if (hw_ep == musb->bulk_ep) musb 2077 drivers/usb/musb/musb_host.c hw_ep = musb->endpoints + epnum; musb 2091 drivers/usb/musb/musb_host.c hw_ep = musb->bulk_ep; musb 2093 drivers/usb/musb/musb_host.c head = &musb->in_bulk; musb 2095 drivers/usb/musb/musb_host.c head = &musb->out_bulk; musb 2109 drivers/usb/musb/musb_host.c dev_err(musb->controller, musb 2118 drivers/usb/musb/musb_host.c hw_ep = musb->endpoints + best_end; musb 2119 drivers/usb/musb/musb_host.c musb_dbg(musb, "qh %p periodic slot %d", qh, best_end); musb 2129 drivers/usb/musb/musb_host.c musb_start_urb(musb, is_in, qh); musb 2139 drivers/usb/musb/musb_host.c struct musb *musb = hcd_to_musb(hcd); musb 2148 drivers/usb/musb/musb_host.c if (!is_host_active(musb) || !musb->is_active) musb 2151 drivers/usb/musb/musb_host.c trace_musb_urb_enq(musb, urb); musb 2153 drivers/usb/musb/musb_host.c spin_lock_irqsave(&musb->lock, flags); musb 2158 drivers/usb/musb/musb_host.c spin_unlock_irqrestore(&musb->lock, flags); musb 2179 drivers/usb/musb/musb_host.c spin_lock_irqsave(&musb->lock, flags); musb 2181 drivers/usb/musb/musb_host.c spin_unlock_irqrestore(&musb->lock, flags); musb 2202 drivers/usb/musb/musb_host.c ok = (usb_pipein(urb->pipe) && musb->hb_iso_rx) musb 2203 drivers/usb/musb/musb_host.c || (usb_pipeout(urb->pipe) && musb->hb_iso_tx); musb 2205 drivers/usb/musb/musb_host.c dev_err(musb->controller, musb 2270 drivers/usb/musb/musb_host.c if (musb->is_multipoint) { musb 2292 drivers/usb/musb/musb_host.c spin_lock_irqsave(&musb->lock, flags); musb 2301 drivers/usb/musb/musb_host.c ret = musb_schedule(musb, qh, musb 2310 drivers/usb/musb/musb_host.c spin_unlock_irqrestore(&musb->lock, flags); musb 2314 drivers/usb/musb/musb_host.c spin_lock_irqsave(&musb->lock, flags); musb 2316 drivers/usb/musb/musb_host.c spin_unlock_irqrestore(&musb->lock, flags); musb 2331 drivers/usb/musb/musb_host.c struct musb *musb = ep->musb; musb 2334 drivers/usb/musb/musb_host.c void __iomem *regs = ep->musb->mregs; musb 2345 drivers/usb/musb/musb_host.c status = ep->musb->dma_controller->channel_abort(dma); musb 2346 drivers/usb/musb/musb_host.c musb_dbg(musb, "abort %cX%d DMA for urb %p --> %d", musb 2360 drivers/usb/musb/musb_host.c musb_platform_clear_ep_rxintr(musb, ep->epnum); musb 2379 drivers/usb/musb/musb_host.c musb_advance_schedule(ep->musb, urb, ep, is_in); musb 2385 drivers/usb/musb/musb_host.c struct musb *musb = hcd_to_musb(hcd); musb 2391 drivers/usb/musb/musb_host.c trace_musb_urb_deq(musb, urb); musb 2393 drivers/usb/musb/musb_host.c spin_lock_irqsave(&musb->lock, flags); musb 2420 drivers/usb/musb/musb_host.c musb_giveback(musb, urb, 0); musb 2434 drivers/usb/musb/musb_host.c spin_unlock_irqrestore(&musb->lock, flags); musb 2444 drivers/usb/musb/musb_host.c struct musb *musb = hcd_to_musb(hcd); musb 2448 drivers/usb/musb/musb_host.c spin_lock_irqsave(&musb->lock, flags); musb 2474 drivers/usb/musb/musb_host.c musb_advance_schedule(musb, urb, qh->hw_ep, is_in); musb 2482 drivers/usb/musb/musb_host.c musb_giveback(musb, next_urb(qh), -ESHUTDOWN); musb 2489 drivers/usb/musb/musb_host.c spin_unlock_irqrestore(&musb->lock, flags); musb 2494 drivers/usb/musb/musb_host.c struct musb *musb = hcd_to_musb(hcd); musb 2496 drivers/usb/musb/musb_host.c return musb_readw(musb->mregs, MUSB_FRAME); musb 2501 drivers/usb/musb/musb_host.c struct musb *musb = hcd_to_musb(hcd); musb 2507 drivers/usb/musb/musb_host.c musb->port1_status = 0; musb 2519 drivers/usb/musb/musb_host.c struct musb *musb = hcd_to_musb(hcd); musb 2523 drivers/usb/musb/musb_host.c ret = musb_port_suspend(musb, true); musb 2527 drivers/usb/musb/musb_host.c if (!is_host_active(musb)) musb 2530 drivers/usb/musb/musb_host.c switch (musb->xceiv->otg->state) { musb 2538 drivers/usb/musb/musb_host.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 2540 drivers/usb/musb/musb_host.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_BCON; musb 2546 drivers/usb/musb/musb_host.c if (musb->is_active) { musb 2548 drivers/usb/musb/musb_host.c usb_otg_state_string(musb->xceiv->otg->state)); musb 2556 drivers/usb/musb/musb_host.c struct musb *musb = hcd_to_musb(hcd); musb 2558 drivers/usb/musb/musb_host.c if (musb->config && musb 2559 drivers/usb/musb/musb_host.c musb->config->host_port_deassert_reset_at_resume) musb 2560 drivers/usb/musb/musb_host.c musb_port_reset(musb, false); musb 2644 drivers/usb/musb/musb_host.c struct musb *musb = hcd_to_musb(hcd); musb 2653 drivers/usb/musb/musb_host.c if (musb->hwvers < MUSB_HWVERS_1800) musb 2669 drivers/usb/musb/musb_host.c struct musb *musb = hcd_to_musb(hcd); musb 2674 drivers/usb/musb/musb_host.c if (musb->hwvers < MUSB_HWVERS_1800) musb 2684 drivers/usb/musb/musb_host.c .hcd_priv_size = sizeof(struct musb *), musb 2713 drivers/usb/musb/musb_host.c int musb_host_alloc(struct musb *musb) musb 2715 drivers/usb/musb/musb_host.c struct device *dev = musb->controller; musb 2718 drivers/usb/musb/musb_host.c musb->hcd = usb_create_hcd(&musb_hc_driver, dev, dev_name(dev)); musb 2719 drivers/usb/musb/musb_host.c if (!musb->hcd) musb 2722 drivers/usb/musb/musb_host.c *musb->hcd->hcd_priv = (unsigned long) musb; musb 2723 drivers/usb/musb/musb_host.c musb->hcd->self.uses_pio_for_control = 1; musb 2724 drivers/usb/musb/musb_host.c musb->hcd->uses_new_polling = 1; musb 2725 drivers/usb/musb/musb_host.c musb->hcd->has_tt = 1; musb 2730 drivers/usb/musb/musb_host.c void musb_host_cleanup(struct musb *musb) musb 2732 drivers/usb/musb/musb_host.c if (musb->port_mode == MUSB_PERIPHERAL) musb 2734 drivers/usb/musb/musb_host.c usb_remove_hcd(musb->hcd); musb 2737 drivers/usb/musb/musb_host.c void musb_host_free(struct musb *musb) musb 2739 drivers/usb/musb/musb_host.c usb_put_hcd(musb->hcd); musb 2742 drivers/usb/musb/musb_host.c int musb_host_setup(struct musb *musb, int power_budget) musb 2745 drivers/usb/musb/musb_host.c struct usb_hcd *hcd = musb->hcd; musb 2747 drivers/usb/musb/musb_host.c if (musb->port_mode == MUSB_HOST) { musb 2748 drivers/usb/musb/musb_host.c MUSB_HST_MODE(musb); musb 2749 drivers/usb/musb/musb_host.c musb->xceiv->otg->state = OTG_STATE_A_IDLE; musb 2751 drivers/usb/musb/musb_host.c otg_set_host(musb->xceiv->otg, &hcd->self); musb 2754 drivers/usb/musb/musb_host.c musb->xceiv->otg->host = &hcd->self; musb 2766 drivers/usb/musb/musb_host.c void musb_host_resume_root_hub(struct musb *musb) musb 2768 drivers/usb/musb/musb_host.c usb_hcd_resume_root_hub(musb->hcd); musb 2771 drivers/usb/musb/musb_host.c void musb_host_poke_root_hub(struct musb *musb) musb 2773 drivers/usb/musb/musb_host.c MUSB_HST_MODE(musb); musb 2774 drivers/usb/musb/musb_host.c if (musb->hcd->status_urb) musb 2775 drivers/usb/musb/musb_host.c usb_hcd_poll_rh_status(musb->hcd); musb 2777 drivers/usb/musb/musb_host.c usb_hcd_resume_root_hub(musb->hcd); musb 55 drivers/usb/musb/musb_host.h extern struct musb *hcd_to_musb(struct usb_hcd *); musb 56 drivers/usb/musb/musb_host.h extern irqreturn_t musb_h_ep0_irq(struct musb *); musb 57 drivers/usb/musb/musb_host.h extern int musb_host_alloc(struct musb *); musb 58 drivers/usb/musb/musb_host.h extern int musb_host_setup(struct musb *, int); musb 59 drivers/usb/musb/musb_host.h extern void musb_host_cleanup(struct musb *); musb 60 drivers/usb/musb/musb_host.h extern void musb_host_tx(struct musb *, u8); musb 61 drivers/usb/musb/musb_host.h extern void musb_host_rx(struct musb *, u8); musb 62 drivers/usb/musb/musb_host.h extern void musb_root_disconnect(struct musb *musb); musb 63 drivers/usb/musb/musb_host.h extern void musb_host_free(struct musb *); musb 64 drivers/usb/musb/musb_host.h extern void musb_host_cleanup(struct musb *); musb 65 drivers/usb/musb/musb_host.h extern void musb_host_tx(struct musb *, u8); musb 66 drivers/usb/musb/musb_host.h extern void musb_host_rx(struct musb *, u8); musb 67 drivers/usb/musb/musb_host.h extern void musb_root_disconnect(struct musb *musb); musb 68 drivers/usb/musb/musb_host.h extern void musb_host_resume_root_hub(struct musb *musb); musb 69 drivers/usb/musb/musb_host.h extern void musb_host_poke_root_hub(struct musb *musb); musb 70 drivers/usb/musb/musb_host.h extern int musb_port_suspend(struct musb *musb, bool do_suspend); musb 71 drivers/usb/musb/musb_host.h extern void musb_port_reset(struct musb *musb, bool do_reset); musb 74 drivers/usb/musb/musb_host.h static inline struct musb *hcd_to_musb(struct usb_hcd *hcd) musb 79 drivers/usb/musb/musb_host.h static inline irqreturn_t musb_h_ep0_irq(struct musb *musb) musb 84 drivers/usb/musb/musb_host.h static inline int musb_host_alloc(struct musb *musb) musb 89 drivers/usb/musb/musb_host.h static inline int musb_host_setup(struct musb *musb, int power_budget) musb 94 drivers/usb/musb/musb_host.h static inline void musb_host_cleanup(struct musb *musb) {} musb 95 drivers/usb/musb/musb_host.h static inline void musb_host_free(struct musb *musb) {} musb 96 drivers/usb/musb/musb_host.h static inline void musb_host_tx(struct musb *musb, u8 epnum) {} musb 97 drivers/usb/musb/musb_host.h static inline void musb_host_rx(struct musb *musb, u8 epnum) {} musb 98 drivers/usb/musb/musb_host.h static inline void musb_root_disconnect(struct musb *musb) {} musb 99 drivers/usb/musb/musb_host.h static inline void musb_host_resume_root_hub(struct musb *musb) {} musb 100 drivers/usb/musb/musb_host.h static inline void musb_host_poll_rh_status(struct musb *musb) {} musb 101 drivers/usb/musb/musb_host.h static inline void musb_host_poke_root_hub(struct musb *musb) {} musb 102 drivers/usb/musb/musb_host.h static inline int musb_port_suspend(struct musb *musb, bool do_suspend) musb 106 drivers/usb/musb/musb_host.h static inline void musb_port_reset(struct musb *musb, bool do_reset) {} musb 15 drivers/usb/musb/musb_io.h #define musb_ep_select(_mbase, _epnum) musb->io.ep_select((_mbase), (_epnum)) musb 282 drivers/usb/musb/musb_regs.h static inline void musb_write_rxfunaddr(struct musb *musb, u8 epnum, musb 285 drivers/usb/musb/musb_regs.h musb_writeb(musb->mregs, musb 286 drivers/usb/musb/musb_regs.h musb->io.busctl_offset(epnum, MUSB_RXFUNCADDR), musb 290 drivers/usb/musb/musb_regs.h static inline void musb_write_rxhubaddr(struct musb *musb, u8 epnum, musb 293 drivers/usb/musb/musb_regs.h musb_writeb(musb->mregs, musb->io.busctl_offset(epnum, MUSB_RXHUBADDR), musb 297 drivers/usb/musb/musb_regs.h static inline void musb_write_rxhubport(struct musb *musb, u8 epnum, musb 300 drivers/usb/musb/musb_regs.h musb_writeb(musb->mregs, musb->io.busctl_offset(epnum, MUSB_RXHUBPORT), musb 304 drivers/usb/musb/musb_regs.h static inline void musb_write_txfunaddr(struct musb *musb, u8 epnum, musb 307 drivers/usb/musb/musb_regs.h musb_writeb(musb->mregs, musb 308 drivers/usb/musb/musb_regs.h musb->io.busctl_offset(epnum, MUSB_TXFUNCADDR), musb 312 drivers/usb/musb/musb_regs.h static inline void musb_write_txhubaddr(struct musb *musb, u8 epnum, musb 315 drivers/usb/musb/musb_regs.h musb_writeb(musb->mregs, musb->io.busctl_offset(epnum, MUSB_TXHUBADDR), musb 319 drivers/usb/musb/musb_regs.h static inline void musb_write_txhubport(struct musb *musb, u8 epnum, musb 322 drivers/usb/musb/musb_regs.h musb_writeb(musb->mregs, musb->io.busctl_offset(epnum, MUSB_TXHUBPORT), musb 326 drivers/usb/musb/musb_regs.h static inline u8 musb_read_rxfunaddr(struct musb *musb, u8 epnum) musb 328 drivers/usb/musb/musb_regs.h return musb_readb(musb->mregs, musb 329 drivers/usb/musb/musb_regs.h musb->io.busctl_offset(epnum, MUSB_RXFUNCADDR)); musb 332 drivers/usb/musb/musb_regs.h static inline u8 musb_read_rxhubaddr(struct musb *musb, u8 epnum) musb 334 drivers/usb/musb/musb_regs.h return musb_readb(musb->mregs, musb 335 drivers/usb/musb/musb_regs.h musb->io.busctl_offset(epnum, MUSB_RXHUBADDR)); musb 338 drivers/usb/musb/musb_regs.h static inline u8 musb_read_rxhubport(struct musb *musb, u8 epnum) musb 340 drivers/usb/musb/musb_regs.h return musb_readb(musb->mregs, musb 341 drivers/usb/musb/musb_regs.h musb->io.busctl_offset(epnum, MUSB_RXHUBPORT)); musb 344 drivers/usb/musb/musb_regs.h static inline u8 musb_read_txfunaddr(struct musb *musb, u8 epnum) musb 346 drivers/usb/musb/musb_regs.h return musb_readb(musb->mregs, musb 347 drivers/usb/musb/musb_regs.h musb->io.busctl_offset(epnum, MUSB_TXFUNCADDR)); musb 350 drivers/usb/musb/musb_regs.h static inline u8 musb_read_txhubaddr(struct musb *musb, u8 epnum) musb 352 drivers/usb/musb/musb_regs.h return musb_readb(musb->mregs, musb 353 drivers/usb/musb/musb_regs.h musb->io.busctl_offset(epnum, MUSB_TXHUBADDR)); musb 356 drivers/usb/musb/musb_regs.h static inline u8 musb_read_txhubport(struct musb *musb, u8 epnum) musb 358 drivers/usb/musb/musb_regs.h return musb_readb(musb->mregs, musb 359 drivers/usb/musb/musb_regs.h musb->io.busctl_offset(epnum, MUSB_TXHUBPORT)); musb 13 drivers/usb/musb/musb_trace.c void musb_dbg(struct musb *musb, const char *fmt, ...) musb 22 drivers/usb/musb/musb_trace.c trace_musb_log(musb, &vaf); musb 11 drivers/usb/musb/musb_trace.h #define TRACE_SYSTEM musb musb 27 drivers/usb/musb/musb_trace.h TP_PROTO(struct musb *musb, struct va_format *vaf), musb 28 drivers/usb/musb/musb_trace.h TP_ARGS(musb, vaf), musb 30 drivers/usb/musb/musb_trace.h __string(name, dev_name(musb->controller)) musb 34 drivers/usb/musb/musb_trace.h __assign_str(name, dev_name(musb->controller)); musb 128 drivers/usb/musb/musb_trace.h TP_PROTO(struct musb *musb), musb 129 drivers/usb/musb/musb_trace.h TP_ARGS(musb), musb 131 drivers/usb/musb/musb_trace.h __string(name, dev_name(musb->controller)) musb 137 drivers/usb/musb/musb_trace.h __assign_str(name, dev_name(musb->controller)); musb 138 drivers/usb/musb/musb_trace.h __entry->int_usb = musb->int_usb; musb 139 drivers/usb/musb/musb_trace.h __entry->int_tx = musb->int_tx; musb 140 drivers/usb/musb/musb_trace.h __entry->int_rx = musb->int_rx; musb 149 drivers/usb/musb/musb_trace.h TP_PROTO(struct musb *musb, struct urb *urb), musb 150 drivers/usb/musb/musb_trace.h TP_ARGS(musb, urb), musb 152 drivers/usb/musb/musb_trace.h __string(name, dev_name(musb->controller)) musb 161 drivers/usb/musb/musb_trace.h __assign_str(name, dev_name(musb->controller)); musb 181 drivers/usb/musb/musb_trace.h TP_PROTO(struct musb *musb, struct urb *urb), musb 182 drivers/usb/musb/musb_trace.h TP_ARGS(musb, urb) musb 186 drivers/usb/musb/musb_trace.h TP_PROTO(struct musb *musb, struct urb *urb), musb 187 drivers/usb/musb/musb_trace.h TP_ARGS(musb, urb) musb 191 drivers/usb/musb/musb_trace.h TP_PROTO(struct musb *musb, struct urb *urb), musb 192 drivers/usb/musb/musb_trace.h TP_ARGS(musb, urb) musb 196 drivers/usb/musb/musb_trace.h TP_PROTO(struct musb *musb, struct urb *urb), musb 197 drivers/usb/musb/musb_trace.h TP_ARGS(musb, urb) musb 201 drivers/usb/musb/musb_trace.h TP_PROTO(struct musb *musb, struct urb *urb), musb 202 drivers/usb/musb/musb_trace.h TP_ARGS(musb, urb) musb 206 drivers/usb/musb/musb_trace.h TP_PROTO(struct musb *musb, struct urb *urb), musb 207 drivers/usb/musb/musb_trace.h TP_ARGS(musb, urb) musb 292 drivers/usb/musb/musb_trace.h __string(name, dev_name(ch->hw_ep->musb->controller)) musb 302 drivers/usb/musb/musb_trace.h __assign_str(name, dev_name(ch->hw_ep->musb->controller)); musb 23 drivers/usb/musb/musb_virthub.c struct musb *musb; musb 27 drivers/usb/musb/musb_virthub.c musb = container_of(work, struct musb, finish_resume_work.work); musb 29 drivers/usb/musb/musb_virthub.c spin_lock_irqsave(&musb->lock, flags); musb 31 drivers/usb/musb/musb_virthub.c power = musb_readb(musb->mregs, MUSB_POWER); musb 33 drivers/usb/musb/musb_virthub.c musb_dbg(musb, "root port resume stopped, power %02x", power); musb 34 drivers/usb/musb/musb_virthub.c musb_writeb(musb->mregs, MUSB_POWER, power); musb 41 drivers/usb/musb/musb_virthub.c musb->is_active = 1; musb 42 drivers/usb/musb/musb_virthub.c musb->port1_status &= ~(USB_PORT_STAT_SUSPEND | MUSB_PORT_STAT_RESUME); musb 43 drivers/usb/musb/musb_virthub.c musb->port1_status |= USB_PORT_STAT_C_SUSPEND << 16; musb 44 drivers/usb/musb/musb_virthub.c usb_hcd_poll_rh_status(musb->hcd); musb 46 drivers/usb/musb/musb_virthub.c musb->xceiv->otg->state = OTG_STATE_A_HOST; musb 48 drivers/usb/musb/musb_virthub.c spin_unlock_irqrestore(&musb->lock, flags); musb 51 drivers/usb/musb/musb_virthub.c int musb_port_suspend(struct musb *musb, bool do_suspend) musb 53 drivers/usb/musb/musb_virthub.c struct usb_otg *otg = musb->xceiv->otg; musb 55 drivers/usb/musb/musb_virthub.c void __iomem *mbase = musb->mregs; musb 57 drivers/usb/musb/musb_virthub.c if (!is_host_active(musb)) musb 85 drivers/usb/musb/musb_virthub.c musb_dbg(musb, "Root port suspended, power %02x", power); musb 87 drivers/usb/musb/musb_virthub.c musb->port1_status |= USB_PORT_STAT_SUSPEND; musb 88 drivers/usb/musb/musb_virthub.c switch (musb->xceiv->otg->state) { musb 90 drivers/usb/musb/musb_virthub.c musb->xceiv->otg->state = OTG_STATE_A_SUSPEND; musb 91 drivers/usb/musb/musb_virthub.c musb->is_active = otg->host->b_hnp_enable; musb 92 drivers/usb/musb/musb_virthub.c if (musb->is_active) musb 93 drivers/usb/musb/musb_virthub.c mod_timer(&musb->otg_timer, jiffies musb 96 drivers/usb/musb/musb_virthub.c musb_platform_try_idle(musb, 0); musb 99 drivers/usb/musb/musb_virthub.c musb->xceiv->otg->state = OTG_STATE_B_WAIT_ACON; musb 100 drivers/usb/musb/musb_virthub.c musb->is_active = otg->host->b_hnp_enable; musb 101 drivers/usb/musb/musb_virthub.c musb_platform_try_idle(musb, 0); musb 104 drivers/usb/musb/musb_virthub.c musb_dbg(musb, "bogus rh suspend? %s", musb 105 drivers/usb/musb/musb_virthub.c usb_otg_state_string(musb->xceiv->otg->state)); musb 112 drivers/usb/musb/musb_virthub.c musb_dbg(musb, "Root port resuming, power %02x", power); musb 114 drivers/usb/musb/musb_virthub.c musb->port1_status |= MUSB_PORT_STAT_RESUME; musb 115 drivers/usb/musb/musb_virthub.c schedule_delayed_work(&musb->finish_resume_work, musb 121 drivers/usb/musb/musb_virthub.c void musb_port_reset(struct musb *musb, bool do_reset) musb 124 drivers/usb/musb/musb_virthub.c void __iomem *mbase = musb->mregs; musb 126 drivers/usb/musb/musb_virthub.c if (musb->xceiv->otg->state == OTG_STATE_B_IDLE) { musb 127 drivers/usb/musb/musb_virthub.c musb_dbg(musb, "HNP: Returning from HNP; no hub reset from b_idle"); musb 128 drivers/usb/musb/musb_virthub.c musb->port1_status &= ~USB_PORT_STAT_RESET; musb 132 drivers/usb/musb/musb_virthub.c if (!is_host_active(musb)) musb 148 drivers/usb/musb/musb_virthub.c long remain = (unsigned long) musb->rh_timer - jiffies; musb 150 drivers/usb/musb/musb_virthub.c if (musb->rh_timer > 0 && remain > 0) { musb 153 drivers/usb/musb/musb_virthub.c &musb->deassert_reset_work, remain); musb 161 drivers/usb/musb/musb_virthub.c schedule_delayed_work(&musb->deassert_reset_work, musb 170 drivers/usb/musb/musb_virthub.c musb->port1_status |= USB_PORT_STAT_RESET; musb 171 drivers/usb/musb/musb_virthub.c musb->port1_status &= ~USB_PORT_STAT_ENABLE; musb 172 drivers/usb/musb/musb_virthub.c schedule_delayed_work(&musb->deassert_reset_work, musb 175 drivers/usb/musb/musb_virthub.c musb_dbg(musb, "root port reset stopped"); musb 176 drivers/usb/musb/musb_virthub.c musb_platform_pre_root_reset_end(musb); musb 179 drivers/usb/musb/musb_virthub.c musb_platform_post_root_reset_end(musb); musb 183 drivers/usb/musb/musb_virthub.c musb_dbg(musb, "high-speed device connected"); musb 184 drivers/usb/musb/musb_virthub.c musb->port1_status |= USB_PORT_STAT_HIGH_SPEED; musb 187 drivers/usb/musb/musb_virthub.c musb->port1_status &= ~USB_PORT_STAT_RESET; musb 188 drivers/usb/musb/musb_virthub.c musb->port1_status |= USB_PORT_STAT_ENABLE musb 191 drivers/usb/musb/musb_virthub.c usb_hcd_poll_rh_status(musb->hcd); musb 193 drivers/usb/musb/musb_virthub.c musb->vbuserr_retry = VBUSERR_RETRY_COUNT; musb 197 drivers/usb/musb/musb_virthub.c void musb_root_disconnect(struct musb *musb) musb 199 drivers/usb/musb/musb_virthub.c struct usb_otg *otg = musb->xceiv->otg; musb 201 drivers/usb/musb/musb_virthub.c musb->port1_status = USB_PORT_STAT_POWER musb 204 drivers/usb/musb/musb_virthub.c usb_hcd_poll_rh_status(musb->hcd); musb 205 drivers/usb/musb/musb_virthub.c musb->is_active = 0; musb 207 drivers/usb/musb/musb_virthub.c switch (musb->xceiv->otg->state) { musb 210 drivers/usb/musb/musb_virthub.c musb->xceiv->otg->state = OTG_STATE_A_PERIPHERAL; musb 211 drivers/usb/musb/musb_virthub.c musb->g.is_a_peripheral = 1; musb 216 drivers/usb/musb/musb_virthub.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_BCON; musb 217 drivers/usb/musb/musb_virthub.c musb->is_active = 0; musb 220 drivers/usb/musb/musb_virthub.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 223 drivers/usb/musb/musb_virthub.c musb_dbg(musb, "host disconnect (%s)", musb 224 drivers/usb/musb/musb_virthub.c usb_otg_state_string(musb->xceiv->otg->state)); musb 235 drivers/usb/musb/musb_virthub.c struct musb *musb = hcd_to_musb(hcd); musb 239 drivers/usb/musb/musb_virthub.c if (musb->port1_status & 0xffff0000) { musb 246 drivers/usb/musb/musb_virthub.c static int musb_has_gadget(struct musb *musb) musb 257 drivers/usb/musb/musb_virthub.c return musb->port_mode == MUSB_HOST; musb 269 drivers/usb/musb/musb_virthub.c struct musb *musb = hcd_to_musb(hcd); musb 275 drivers/usb/musb/musb_virthub.c spin_lock_irqsave(&musb->lock, flags); musb 278 drivers/usb/musb/musb_virthub.c spin_unlock_irqrestore(&musb->lock, flags); musb 305 drivers/usb/musb/musb_virthub.c musb_port_suspend(musb, false); musb 309 drivers/usb/musb/musb_virthub.c musb_platform_set_vbus(musb, 0); musb 320 drivers/usb/musb/musb_virthub.c musb_dbg(musb, "clear feature %d", wValue); musb 321 drivers/usb/musb/musb_virthub.c musb->port1_status &= ~(1 << wValue); musb 350 drivers/usb/musb/musb_virthub.c put_unaligned(cpu_to_le32(musb->port1_status musb 355 drivers/usb/musb/musb_virthub.c musb_dbg(musb, "port status %08x", musb->port1_status); musb 373 drivers/usb/musb/musb_virthub.c if (!hcd->self.is_b_host && musb_has_gadget(musb)) musb 377 drivers/usb/musb/musb_virthub.c musb_port_reset(musb, true); musb 380 drivers/usb/musb/musb_virthub.c musb_port_suspend(musb, true); musb 383 drivers/usb/musb/musb_virthub.c if (unlikely(is_host_active(musb))) musb 403 drivers/usb/musb/musb_virthub.c musb_load_testpacket(musb); musb 410 drivers/usb/musb/musb_virthub.c musb_writeb(musb->mregs, MUSB_DEVCTL, musb 420 drivers/usb/musb/musb_virthub.c musb_writeb(musb->mregs, MUSB_TESTMODE, temp); musb 425 drivers/usb/musb/musb_virthub.c musb_dbg(musb, "set feature %d", wValue); musb 426 drivers/usb/musb/musb_virthub.c musb->port1_status |= 1 << wValue; musb 434 drivers/usb/musb/musb_virthub.c spin_unlock_irqrestore(&musb->lock, flags); musb 437 drivers/usb/musb/musb_virthub.c musb_start(musb); musb 83 drivers/usb/musb/musbhsdma.c struct musb *musb = controller->private_data; musb 88 drivers/usb/musb/musbhsdma.c dev_err(musb->controller, musb 154 drivers/usb/musb/musbhsdma.c struct musb *musb = controller->private_data; musb 159 drivers/usb/musb/musbhsdma.c musb_dbg(musb, "%p, pkt_sz %d, addr %pad, len %d, mode %d", musb 192 drivers/usb/musb/musbhsdma.c struct musb *musb = controller->private_data; musb 194 drivers/usb/musb/musbhsdma.c musb_dbg(musb, "ep%d-%s pkt_sz %d, dma_addr %pad length %d, mode %d", musb 211 drivers/usb/musb/musbhsdma.c if ((musb->hwvers >= MUSB_HWVERS_1800) && (dma_addr % 4)) musb 229 drivers/usb/musb/musbhsdma.c struct musb *musb = musb_channel->controller->private_data; musb 237 drivers/usb/musb/musbhsdma.c offset = musb->io.ep_offset(musb_channel->epnum, musb 250 drivers/usb/musb/musbhsdma.c offset = musb->io.ep_offset(musb_channel->epnum, musb 274 drivers/usb/musb/musbhsdma.c struct musb *musb = controller->private_data; musb 290 drivers/usb/musb/musbhsdma.c spin_lock_irqsave(&musb->lock, flags); musb 295 drivers/usb/musb/musbhsdma.c musb_dbg(musb, "spurious DMA irq"); musb 309 drivers/usb/musb/musbhsdma.c musb_dbg(musb, "int_hsdma = 0x%x", int_hsdma); musb 336 drivers/usb/musb/musbhsdma.c musb_dbg(musb, "ch %p, 0x%x -> 0x%x (%zu / %d) %s", musb 354 drivers/usb/musb/musbhsdma.c int offset = musb->io.ep_offset(epnum, musb 375 drivers/usb/musb/musbhsdma.c musb_dma_completion(musb, musb_channel->epnum, musb 383 drivers/usb/musb/musbhsdma.c spin_unlock_irqrestore(&musb->lock, flags); musb 401 drivers/usb/musb/musbhsdma.c struct dma_controller *musbhs_dma_controller_create(struct musb *musb, musb 405 drivers/usb/musb/musbhsdma.c struct device *dev = musb->controller; musb 419 drivers/usb/musb/musbhsdma.c controller->private_data = musb; musb 428 drivers/usb/musb/musbhsdma.c dev_name(musb->controller), controller)) { musb 32 drivers/usb/musb/omap2430.c struct platform_device *musb; musb 37 drivers/usb/musb/omap2430.c #define glue_to_musb(g) platform_get_drvdata(g->musb) musb 41 drivers/usb/musb/omap2430.c static void omap2430_musb_set_vbus(struct musb *musb, int is_on) musb 43 drivers/usb/musb/omap2430.c struct usb_otg *otg = musb->xceiv->otg; musb 51 drivers/usb/musb/omap2430.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 54 drivers/usb/musb/omap2430.c if (musb->xceiv->otg->state == OTG_STATE_A_IDLE) { musb 58 drivers/usb/musb/omap2430.c musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); musb 63 drivers/usb/musb/omap2430.c while (musb_readb(musb->mregs, MUSB_DEVCTL) & musb 71 drivers/usb/musb/omap2430.c dev_err(musb->controller, musb 79 drivers/usb/musb/omap2430.c musb->is_active = 1; musb 80 drivers/usb/musb/omap2430.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 82 drivers/usb/musb/omap2430.c MUSB_HST_MODE(musb); musb 85 drivers/usb/musb/omap2430.c musb->is_active = 0; musb 91 drivers/usb/musb/omap2430.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 94 drivers/usb/musb/omap2430.c MUSB_DEV_MODE(musb); musb 96 drivers/usb/musb/omap2430.c musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); musb 98 drivers/usb/musb/omap2430.c dev_dbg(musb->controller, "VBUS %s, devctl %02x " musb 100 drivers/usb/musb/omap2430.c usb_otg_state_string(musb->xceiv->otg->state), musb 101 drivers/usb/musb/omap2430.c musb_readb(musb->mregs, MUSB_DEVCTL)); musb 104 drivers/usb/musb/omap2430.c static inline void omap2430_low_level_exit(struct musb *musb) musb 109 drivers/usb/musb/omap2430.c l = musb_readl(musb->mregs, OTG_FORCESTDBY); musb 111 drivers/usb/musb/omap2430.c musb_writel(musb->mregs, OTG_FORCESTDBY, l); musb 114 drivers/usb/musb/omap2430.c static inline void omap2430_low_level_init(struct musb *musb) musb 118 drivers/usb/musb/omap2430.c l = musb_readl(musb->mregs, OTG_FORCESTDBY); musb 120 drivers/usb/musb/omap2430.c musb_writel(musb->mregs, OTG_FORCESTDBY, l); musb 145 drivers/usb/musb/omap2430.c struct musb *musb = glue_to_musb(glue); musb 147 drivers/usb/musb/omap2430.c dev_get_platdata(musb->controller); musb 150 drivers/usb/musb/omap2430.c pm_runtime_get_sync(musb->controller); musb 153 drivers/usb/musb/omap2430.c dev_dbg(musb->controller, "ID GND\n"); musb 155 drivers/usb/musb/omap2430.c musb->xceiv->otg->state = OTG_STATE_A_IDLE; musb 156 drivers/usb/musb/omap2430.c musb->xceiv->last_event = USB_EVENT_ID; musb 157 drivers/usb/musb/omap2430.c if (musb->gadget_driver) { musb 160 drivers/usb/musb/omap2430.c omap2430_musb_set_vbus(musb, 1); musb 165 drivers/usb/musb/omap2430.c dev_dbg(musb->controller, "VBUS Connect\n"); musb 167 drivers/usb/musb/omap2430.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 168 drivers/usb/musb/omap2430.c musb->xceiv->last_event = USB_EVENT_VBUS; musb 174 drivers/usb/musb/omap2430.c dev_dbg(musb->controller, "VBUS Disconnect\n"); musb 176 drivers/usb/musb/omap2430.c musb->xceiv->last_event = USB_EVENT_NONE; musb 177 drivers/usb/musb/omap2430.c if (musb->gadget_driver) musb 178 drivers/usb/musb/omap2430.c omap2430_musb_set_vbus(musb, 0); musb 181 drivers/usb/musb/omap2430.c otg_set_vbus(musb->xceiv->otg, 0); musb 187 drivers/usb/musb/omap2430.c dev_dbg(musb->controller, "ID float\n"); musb 189 drivers/usb/musb/omap2430.c pm_runtime_mark_last_busy(musb->controller); musb 190 drivers/usb/musb/omap2430.c pm_runtime_put_autosuspend(musb->controller); musb 191 drivers/usb/musb/omap2430.c atomic_notifier_call_chain(&musb->xceiv->notifier, musb 192 drivers/usb/musb/omap2430.c musb->xceiv->last_event, NULL); musb 208 drivers/usb/musb/omap2430.c struct musb *musb = __hci; musb 210 drivers/usb/musb/omap2430.c spin_lock_irqsave(&musb->lock, flags); musb 212 drivers/usb/musb/omap2430.c musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB); musb 213 drivers/usb/musb/omap2430.c musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX); musb 214 drivers/usb/musb/omap2430.c musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX); musb 216 drivers/usb/musb/omap2430.c if (musb->int_usb || musb->int_tx || musb->int_rx) musb 217 drivers/usb/musb/omap2430.c retval = musb_interrupt(musb); musb 219 drivers/usb/musb/omap2430.c spin_unlock_irqrestore(&musb->lock, flags); musb 224 drivers/usb/musb/omap2430.c static int omap2430_musb_init(struct musb *musb) musb 228 drivers/usb/musb/omap2430.c struct device *dev = musb->controller; musb 237 drivers/usb/musb/omap2430.c musb->phy = devm_phy_get(dev->parent, "usb2-phy"); musb 245 drivers/usb/musb/omap2430.c musb->xceiv = devm_usb_get_phy_by_phandle(dev->parent, "usb-phy", 0); musb 247 drivers/usb/musb/omap2430.c if (IS_ERR(musb->xceiv)) { musb 248 drivers/usb/musb/omap2430.c status = PTR_ERR(musb->xceiv); musb 257 drivers/usb/musb/omap2430.c if (IS_ERR(musb->phy)) { musb 259 drivers/usb/musb/omap2430.c return PTR_ERR(musb->phy); musb 261 drivers/usb/musb/omap2430.c musb->isr = omap2430_musb_interrupt; musb 262 drivers/usb/musb/omap2430.c phy_init(musb->phy); musb 263 drivers/usb/musb/omap2430.c phy_power_on(musb->phy); musb 265 drivers/usb/musb/omap2430.c l = musb_readl(musb->mregs, OTG_INTERFSEL); musb 275 drivers/usb/musb/omap2430.c musb_writel(musb->mregs, OTG_INTERFSEL, l); musb 279 drivers/usb/musb/omap2430.c musb_readl(musb->mregs, OTG_REVISION), musb 280 drivers/usb/musb/omap2430.c musb_readl(musb->mregs, OTG_SYSCONFIG), musb 281 drivers/usb/musb/omap2430.c musb_readl(musb->mregs, OTG_SYSSTATUS), musb 282 drivers/usb/musb/omap2430.c musb_readl(musb->mregs, OTG_INTERFSEL), musb 283 drivers/usb/musb/omap2430.c musb_readl(musb->mregs, OTG_SIMENABLE)); musb 291 drivers/usb/musb/omap2430.c static void omap2430_musb_enable(struct musb *musb) musb 295 drivers/usb/musb/omap2430.c struct device *dev = musb->controller; musb 307 drivers/usb/musb/omap2430.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 310 drivers/usb/musb/omap2430.c musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); musb 311 drivers/usb/musb/omap2430.c while (musb_readb(musb->mregs, MUSB_DEVCTL) & musb 331 drivers/usb/musb/omap2430.c static void omap2430_musb_disable(struct musb *musb) musb 333 drivers/usb/musb/omap2430.c struct device *dev = musb->controller; musb 341 drivers/usb/musb/omap2430.c static int omap2430_musb_exit(struct musb *musb) musb 343 drivers/usb/musb/omap2430.c struct device *dev = musb->controller; musb 346 drivers/usb/musb/omap2430.c omap2430_low_level_exit(musb); musb 347 drivers/usb/musb/omap2430.c phy_power_off(musb->phy); musb 348 drivers/usb/musb/omap2430.c phy_exit(musb->phy); musb 349 drivers/usb/musb/omap2430.c musb->phy = NULL; musb 377 drivers/usb/musb/omap2430.c struct platform_device *musb; musb 392 drivers/usb/musb/omap2430.c musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO); musb 393 drivers/usb/musb/omap2430.c if (!musb) { musb 398 drivers/usb/musb/omap2430.c musb->dev.parent = &pdev->dev; musb 399 drivers/usb/musb/omap2430.c musb->dev.dma_mask = &omap2430_dmamask; musb 400 drivers/usb/musb/omap2430.c musb->dev.coherent_dma_mask = omap2430_dmamask; musb 403 drivers/usb/musb/omap2430.c glue->musb = musb; musb 474 drivers/usb/musb/omap2430.c ret = platform_device_add_resources(musb, musb_resources, musb 481 drivers/usb/musb/omap2430.c ret = platform_device_add_data(musb, pdata, sizeof(*pdata)); musb 489 drivers/usb/musb/omap2430.c ret = platform_device_add(musb); musb 501 drivers/usb/musb/omap2430.c platform_device_put(musb); musb 511 drivers/usb/musb/omap2430.c platform_device_unregister(glue->musb); musb 522 drivers/usb/musb/omap2430.c struct musb *musb = glue_to_musb(glue); musb 524 drivers/usb/musb/omap2430.c if (!musb) musb 527 drivers/usb/musb/omap2430.c musb->context.otg_interfsel = musb_readl(musb->mregs, musb 530 drivers/usb/musb/omap2430.c omap2430_low_level_exit(musb); musb 532 drivers/usb/musb/omap2430.c phy_power_off(musb->phy); musb 533 drivers/usb/musb/omap2430.c phy_exit(musb->phy); musb 541 drivers/usb/musb/omap2430.c struct musb *musb = glue_to_musb(glue); musb 543 drivers/usb/musb/omap2430.c if (!musb) musb 546 drivers/usb/musb/omap2430.c phy_init(musb->phy); musb 547 drivers/usb/musb/omap2430.c phy_power_on(musb->phy); musb 549 drivers/usb/musb/omap2430.c omap2430_low_level_init(musb); musb 550 drivers/usb/musb/omap2430.c musb_writel(musb->mregs, OTG_INTERFSEL, musb 551 drivers/usb/musb/omap2430.c musb->context.otg_interfsel); musb 71 drivers/usb/musb/sunxi.c static struct musb *sunxi_musb; musb 75 drivers/usb/musb/sunxi.c struct musb *musb; musb 99 drivers/usb/musb/sunxi.c struct musb *musb = glue->musb; musb 103 drivers/usb/musb/sunxi.c spin_lock_irqsave(&musb->lock, flags); musb 105 drivers/usb/musb/sunxi.c devctl = readb(musb->mregs + SUNXI_MUSB_DEVCTL); musb 108 drivers/usb/musb/sunxi.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 109 drivers/usb/musb/sunxi.c MUSB_HST_MODE(musb); musb 113 drivers/usb/musb/sunxi.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 114 drivers/usb/musb/sunxi.c MUSB_DEV_MODE(musb); musb 117 drivers/usb/musb/sunxi.c writeb(devctl, musb->mregs + SUNXI_MUSB_DEVCTL); musb 119 drivers/usb/musb/sunxi.c spin_unlock_irqrestore(&musb->lock, flags); musb 139 drivers/usb/musb/sunxi.c static void sunxi_musb_set_vbus(struct musb *musb, int is_on) musb 141 drivers/usb/musb/sunxi.c struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); musb 145 drivers/usb/musb/sunxi.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 153 drivers/usb/musb/sunxi.c static void sunxi_musb_pre_root_reset_end(struct musb *musb) musb 155 drivers/usb/musb/sunxi.c struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); musb 160 drivers/usb/musb/sunxi.c static void sunxi_musb_post_root_reset_end(struct musb *musb) musb 162 drivers/usb/musb/sunxi.c struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); musb 169 drivers/usb/musb/sunxi.c struct musb *musb = __hci; musb 172 drivers/usb/musb/sunxi.c spin_lock_irqsave(&musb->lock, flags); musb 174 drivers/usb/musb/sunxi.c musb->int_usb = readb(musb->mregs + SUNXI_MUSB_INTRUSB); musb 175 drivers/usb/musb/sunxi.c if (musb->int_usb) musb 176 drivers/usb/musb/sunxi.c writeb(musb->int_usb, musb->mregs + SUNXI_MUSB_INTRUSB); musb 178 drivers/usb/musb/sunxi.c if ((musb->int_usb & MUSB_INTR_RESET) && !is_host_active(musb)) { musb 180 drivers/usb/musb/sunxi.c musb_ep_select(musb->mregs, 0); musb 181 drivers/usb/musb/sunxi.c musb_writeb(musb->mregs, MUSB_FADDR, 0); musb 184 drivers/usb/musb/sunxi.c musb->int_tx = readw(musb->mregs + SUNXI_MUSB_INTRTX); musb 185 drivers/usb/musb/sunxi.c if (musb->int_tx) musb 186 drivers/usb/musb/sunxi.c writew(musb->int_tx, musb->mregs + SUNXI_MUSB_INTRTX); musb 188 drivers/usb/musb/sunxi.c musb->int_rx = readw(musb->mregs + SUNXI_MUSB_INTRRX); musb 189 drivers/usb/musb/sunxi.c if (musb->int_rx) musb 190 drivers/usb/musb/sunxi.c writew(musb->int_rx, musb->mregs + SUNXI_MUSB_INTRRX); musb 192 drivers/usb/musb/sunxi.c musb_interrupt(musb); musb 194 drivers/usb/musb/sunxi.c spin_unlock_irqrestore(&musb->lock, flags); musb 215 drivers/usb/musb/sunxi.c static int sunxi_musb_init(struct musb *musb) musb 217 drivers/usb/musb/sunxi.c struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); musb 220 drivers/usb/musb/sunxi.c sunxi_musb = musb; musb 221 drivers/usb/musb/sunxi.c musb->phy = glue->phy; musb 222 drivers/usb/musb/sunxi.c musb->xceiv = glue->xceiv; musb 225 drivers/usb/musb/sunxi.c ret = sunxi_sram_claim(musb->controller->parent); musb 240 drivers/usb/musb/sunxi.c writeb(SUNXI_MUSB_VEND0_PIO_MODE, musb->mregs + SUNXI_MUSB_VEND0); musb 252 drivers/usb/musb/sunxi.c musb->isr = sunxi_musb_interrupt; musb 255 drivers/usb/musb/sunxi.c pm_runtime_get(musb->controller); musb 266 drivers/usb/musb/sunxi.c sunxi_sram_release(musb->controller->parent); musb 270 drivers/usb/musb/sunxi.c static int sunxi_musb_exit(struct musb *musb) musb 272 drivers/usb/musb/sunxi.c struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); musb 274 drivers/usb/musb/sunxi.c pm_runtime_put(musb->controller); musb 287 drivers/usb/musb/sunxi.c sunxi_sram_release(musb->controller->parent); musb 294 drivers/usb/musb/sunxi.c static void sunxi_musb_enable(struct musb *musb) musb 296 drivers/usb/musb/sunxi.c struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); musb 298 drivers/usb/musb/sunxi.c glue->musb = musb; musb 307 drivers/usb/musb/sunxi.c static void sunxi_musb_disable(struct musb *musb) musb 309 drivers/usb/musb/sunxi.c struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); musb 315 drivers/usb/musb/sunxi.c sunxi_musb_dma_controller_create(struct musb *musb, void __iomem *base) musb 324 drivers/usb/musb/sunxi.c static int sunxi_musb_set_mode(struct musb *musb, u8 mode) musb 326 drivers/usb/musb/sunxi.c struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); musb 340 drivers/usb/musb/sunxi.c dev_err(musb->controller->parent, musb 348 drivers/usb/musb/sunxi.c if (musb->port_mode != MUSB_OTG) { musb 349 drivers/usb/musb/sunxi.c dev_err(musb->controller->parent, musb 354 drivers/usb/musb/sunxi.c if (musb->port1_status & USB_PORT_STAT_ENABLE) musb 355 drivers/usb/musb/sunxi.c musb_root_disconnect(musb); musb 368 drivers/usb/musb/sunxi.c static int sunxi_musb_recover(struct musb *musb) musb 370 drivers/usb/musb/sunxi.c struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); musb 31 drivers/usb/musb/tusb6010.c struct platform_device *musb; musb 35 drivers/usb/musb/tusb6010.c static void tusb_musb_set_vbus(struct musb *musb, int is_on); musb 44 drivers/usb/musb/tusb6010.c static u8 tusb_get_revision(struct musb *musb) musb 46 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 61 drivers/usb/musb/tusb6010.c static void tusb_print_revision(struct musb *musb) musb 63 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 66 drivers/usb/musb/tusb6010.c rev = musb->tusb_revision; musb 94 drivers/usb/musb/tusb6010.c static void tusb_wbus_quirk(struct musb *musb, int enabled) musb 96 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 109 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "Enabled tusb wbus quirk ctrl %08x ena %08x\n", musb 118 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "Disabled tusb wbus quirk ctrl %08x ena %08x\n", musb 221 drivers/usb/musb/tusb6010.c struct musb *musb = hw_ep->musb; musb 228 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n", musb 271 drivers/usb/musb/tusb6010.c struct musb *musb = hw_ep->musb; musb 276 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n", musb 316 drivers/usb/musb/tusb6010.c static struct musb *the_musb; musb 326 drivers/usb/musb/tusb6010.c struct musb *musb = the_musb; musb 327 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 340 drivers/usb/musb/tusb6010.c if (x->otg->default_a || mA < (musb->min_power << 1)) musb 345 drivers/usb/musb/tusb6010.c musb->is_bus_powered = 1; musb 348 drivers/usb/musb/tusb6010.c musb->is_bus_powered = 0; musb 353 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "draw max %d mA VBUS\n", mA); musb 361 drivers/usb/musb/tusb6010.c static void tusb_set_clock_source(struct musb *musb, unsigned mode) musb 363 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 388 drivers/usb/musb/tusb6010.c static void tusb_allow_idle(struct musb *musb, u32 wakeup_enables) musb 390 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 394 drivers/usb/musb/tusb6010.c && (musb->tusb_revision == TUSB_REV_30)) musb 395 drivers/usb/musb/tusb6010.c tusb_wbus_quirk(musb, 1); musb 397 drivers/usb/musb/tusb6010.c tusb_set_clock_source(musb, 0); musb 409 drivers/usb/musb/tusb6010.c if (is_host_active(musb)) { musb 419 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "idle, wake on %02x\n", wakeup_enables); musb 425 drivers/usb/musb/tusb6010.c static int tusb_musb_vbus_status(struct musb *musb) musb 427 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 454 drivers/usb/musb/tusb6010.c struct musb *musb = from_timer(musb, t, dev_timer); musb 457 drivers/usb/musb/tusb6010.c spin_lock_irqsave(&musb->lock, flags); musb 459 drivers/usb/musb/tusb6010.c switch (musb->xceiv->otg->state) { musb 461 drivers/usb/musb/tusb6010.c if ((musb->a_wait_bcon != 0) musb 462 drivers/usb/musb/tusb6010.c && (musb->idle_timeout == 0 musb 463 drivers/usb/musb/tusb6010.c || time_after(jiffies, musb->idle_timeout))) { musb 464 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "Nothing connected %s, turning off VBUS\n", musb 465 drivers/usb/musb/tusb6010.c usb_otg_state_string(musb->xceiv->otg->state)); musb 469 drivers/usb/musb/tusb6010.c tusb_musb_set_vbus(musb, 0); musb 474 drivers/usb/musb/tusb6010.c if (!musb->is_active) { musb 478 drivers/usb/musb/tusb6010.c if (is_host_active(musb) && (musb->port1_status >> 16)) musb 481 drivers/usb/musb/tusb6010.c if (!musb->gadget_driver) { musb 489 drivers/usb/musb/tusb6010.c tusb_allow_idle(musb, wakeups); musb 492 drivers/usb/musb/tusb6010.c spin_unlock_irqrestore(&musb->lock, flags); musb 508 drivers/usb/musb/tusb6010.c static void tusb_musb_try_idle(struct musb *musb, unsigned long timeout) musb 517 drivers/usb/musb/tusb6010.c if (musb->is_active || ((musb->a_wait_bcon == 0) musb 518 drivers/usb/musb/tusb6010.c && (musb->xceiv->otg->state == OTG_STATE_A_WAIT_BCON))) { musb 519 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "%s active, deleting timer\n", musb 520 drivers/usb/musb/tusb6010.c usb_otg_state_string(musb->xceiv->otg->state)); musb 521 drivers/usb/musb/tusb6010.c del_timer(&musb->dev_timer); musb 527 drivers/usb/musb/tusb6010.c if (!timer_pending(&musb->dev_timer)) musb 530 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "Longer idle timer already pending, ignoring\n"); musb 536 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "%s inactive, for idle timer for %lu ms\n", musb 537 drivers/usb/musb/tusb6010.c usb_otg_state_string(musb->xceiv->otg->state), musb 539 drivers/usb/musb/tusb6010.c mod_timer(&musb->dev_timer, timeout); musb 549 drivers/usb/musb/tusb6010.c static void tusb_musb_set_vbus(struct musb *musb, int is_on) musb 551 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 554 drivers/usb/musb/tusb6010.c struct usb_otg *otg = musb->xceiv->otg; musb 563 drivers/usb/musb/tusb6010.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 568 drivers/usb/musb/tusb6010.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 572 drivers/usb/musb/tusb6010.c MUSB_HST_MODE(musb); musb 581 drivers/usb/musb/tusb6010.c switch (musb->xceiv->otg->state) { musb 584 drivers/usb/musb/tusb6010.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VFALL; musb 587 drivers/usb/musb/tusb6010.c musb->xceiv->otg->state = OTG_STATE_A_IDLE; musb 590 drivers/usb/musb/tusb6010.c musb->xceiv->otg->state = OTG_STATE_A_IDLE; musb 592 drivers/usb/musb/tusb6010.c musb->is_active = 0; musb 594 drivers/usb/musb/tusb6010.c MUSB_HST_MODE(musb); musb 596 drivers/usb/musb/tusb6010.c musb->is_active = 0; musb 598 drivers/usb/musb/tusb6010.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 599 drivers/usb/musb/tusb6010.c MUSB_DEV_MODE(musb); musb 610 drivers/usb/musb/tusb6010.c musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); musb 612 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "VBUS %s, devctl %02x otg %3x conf %08x prcm %08x\n", musb 613 drivers/usb/musb/tusb6010.c usb_otg_state_string(musb->xceiv->otg->state), musb 614 drivers/usb/musb/tusb6010.c musb_readb(musb->mregs, MUSB_DEVCTL), musb 626 drivers/usb/musb/tusb6010.c static int tusb_musb_set_mode(struct musb *musb, u8 musb_mode) musb 628 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 656 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "Trying to set mode %i\n", musb_mode); musb 676 drivers/usb/musb/tusb6010.c tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase) musb 680 drivers/usb/musb/tusb6010.c struct usb_otg *otg = musb->xceiv->otg; musb 687 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "Default-%c\n", default_a ? 'A' : 'B'); musb 689 drivers/usb/musb/tusb6010.c tusb_musb_set_vbus(musb, default_a); musb 702 drivers/usb/musb/tusb6010.c musb->port1_status &= musb 711 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "Forcing disconnect (no interrupt)\n"); musb 712 drivers/usb/musb/tusb6010.c if (musb->xceiv->otg->state != OTG_STATE_B_IDLE) { musb 714 drivers/usb/musb/tusb6010.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 715 drivers/usb/musb/tusb6010.c musb->int_usb |= MUSB_INTR_DISCONNECT; musb 717 drivers/usb/musb/tusb6010.c musb->is_active = 0; musb 719 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "vbus change, %s, otg %03x\n", musb 720 drivers/usb/musb/tusb6010.c usb_otg_state_string(musb->xceiv->otg->state), otg_stat); musb 722 drivers/usb/musb/tusb6010.c schedule_delayed_work(&musb->irq_work, 0); musb 725 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "vbus change, %s, otg %03x\n", musb 726 drivers/usb/musb/tusb6010.c usb_otg_state_string(musb->xceiv->otg->state), otg_stat); musb 728 drivers/usb/musb/tusb6010.c switch (musb->xceiv->otg->state) { musb 730 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "Got SRP, turning on VBUS\n"); musb 731 drivers/usb/musb/tusb6010.c musb_platform_set_vbus(musb, 1); musb 734 drivers/usb/musb/tusb6010.c if (musb->a_wait_bcon != 0) musb 735 drivers/usb/musb/tusb6010.c musb->is_active = 0; musb 737 drivers/usb/musb/tusb6010.c musb->is_active = 1; musb 755 drivers/usb/musb/tusb6010.c if (musb->vbuserr_retry) { musb 756 drivers/usb/musb/tusb6010.c musb->vbuserr_retry--; musb 757 drivers/usb/musb/tusb6010.c tusb_musb_set_vbus(musb, 1); musb 759 drivers/usb/musb/tusb6010.c musb->vbuserr_retry musb 761 drivers/usb/musb/tusb6010.c tusb_musb_set_vbus(musb, 0); musb 774 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "%s timer, %03x\n", musb 775 drivers/usb/musb/tusb6010.c usb_otg_state_string(musb->xceiv->otg->state), otg_stat); musb 777 drivers/usb/musb/tusb6010.c switch (musb->xceiv->otg->state) { musb 782 drivers/usb/musb/tusb6010.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 786 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "devctl %02x\n", devctl); musb 789 drivers/usb/musb/tusb6010.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_BCON; musb 790 drivers/usb/musb/tusb6010.c musb->is_active = 0; musb 792 drivers/usb/musb/tusb6010.c + msecs_to_jiffies(musb->a_wait_bcon); musb 796 drivers/usb/musb/tusb6010.c tusb_musb_set_vbus(musb, 0); musb 800 drivers/usb/musb/tusb6010.c if (musb->a_wait_bcon != 0) musb 802 drivers/usb/musb/tusb6010.c + msecs_to_jiffies(musb->a_wait_bcon); musb 812 drivers/usb/musb/tusb6010.c schedule_delayed_work(&musb->irq_work, 0); musb 819 drivers/usb/musb/tusb6010.c struct musb *musb = __hci; musb 820 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 824 drivers/usb/musb/tusb6010.c spin_lock_irqsave(&musb->lock, flags); musb 831 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "TUSB IRQ %08x\n", int_src); musb 833 drivers/usb/musb/tusb6010.c musb->int_usb = (u8) int_src; musb 840 drivers/usb/musb/tusb6010.c if (musb->tusb_revision == TUSB_REV_30) musb 841 drivers/usb/musb/tusb6010.c tusb_wbus_quirk(musb, 0); musb 852 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "TUSB NOR not ready\n"); musb 856 drivers/usb/musb/tusb6010.c tusb_set_clock_source(musb, 1); musb 861 drivers/usb/musb/tusb6010.c musb->is_active = 1; musb 862 drivers/usb/musb/tusb6010.c schedule_delayed_work(&musb->irq_work, 0); musb 864 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "wake %sactive %02x\n", musb 865 drivers/usb/musb/tusb6010.c musb->is_active ? "" : "in", reg); musb 871 drivers/usb/musb/tusb6010.c del_timer(&musb->dev_timer); musb 877 drivers/usb/musb/tusb6010.c idle_timeout = tusb_otg_ints(musb, int_src, tbase); musb 886 drivers/usb/musb/tusb6010.c dev_dbg(musb->controller, "DMA IRQ %08x\n", dma_src); musb 895 drivers/usb/musb/tusb6010.c musb->int_rx = (((musb_src >> 16) & 0xffff) << 1); musb 896 drivers/usb/musb/tusb6010.c musb->int_tx = (musb_src & 0xffff); musb 898 drivers/usb/musb/tusb6010.c musb->int_rx = 0; musb 899 drivers/usb/musb/tusb6010.c musb->int_tx = 0; musb 903 drivers/usb/musb/tusb6010.c musb_interrupt(musb); musb 909 drivers/usb/musb/tusb6010.c tusb_musb_try_idle(musb, idle_timeout); musb 912 drivers/usb/musb/tusb6010.c spin_unlock_irqrestore(&musb->lock, flags); musb 924 drivers/usb/musb/tusb6010.c static void tusb_musb_enable(struct musb *musb) musb 926 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 950 drivers/usb/musb/tusb6010.c irq_set_irq_type(musb->nIrq, IRQ_TYPE_LEVEL_LOW); musb 968 drivers/usb/musb/tusb6010.c static void tusb_musb_disable(struct musb *musb) musb 970 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 980 drivers/usb/musb/tusb6010.c del_timer(&musb->dev_timer); musb 993 drivers/usb/musb/tusb6010.c static void tusb_setup_cpu_interface(struct musb *musb) musb 995 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 1020 drivers/usb/musb/tusb6010.c static int tusb_musb_start(struct musb *musb) musb 1022 drivers/usb/musb/tusb6010.c void __iomem *tbase = musb->ctrl_base; musb 1027 drivers/usb/musb/tusb6010.c if (musb->board_set_power) musb 1028 drivers/usb/musb/tusb6010.c ret = musb->board_set_power(1); musb 1034 drivers/usb/musb/tusb6010.c spin_lock_irqsave(&musb->lock, flags); musb 1042 drivers/usb/musb/tusb6010.c musb->tusb_revision = tusb_get_revision(musb); musb 1043 drivers/usb/musb/tusb6010.c tusb_print_revision(musb); musb 1044 drivers/usb/musb/tusb6010.c if (musb->tusb_revision < 2) { musb 1046 drivers/usb/musb/tusb6010.c musb->tusb_revision); musb 1055 drivers/usb/musb/tusb6010.c tusb_set_clock_source(musb, 1); musb 1066 drivers/usb/musb/tusb6010.c tusb_setup_cpu_interface(musb); musb 1077 drivers/usb/musb/tusb6010.c spin_unlock_irqrestore(&musb->lock, flags); musb 1082 drivers/usb/musb/tusb6010.c spin_unlock_irqrestore(&musb->lock, flags); musb 1084 drivers/usb/musb/tusb6010.c if (musb->board_set_power) musb 1085 drivers/usb/musb/tusb6010.c musb->board_set_power(0); musb 1090 drivers/usb/musb/tusb6010.c static int tusb_musb_init(struct musb *musb) musb 1097 drivers/usb/musb/tusb6010.c musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); musb 1098 drivers/usb/musb/tusb6010.c if (IS_ERR_OR_NULL(musb->xceiv)) musb 1101 drivers/usb/musb/tusb6010.c pdev = to_platform_device(musb->controller); musb 1105 drivers/usb/musb/tusb6010.c musb->async = mem->start; musb 1114 drivers/usb/musb/tusb6010.c musb->sync = mem->start; musb 1122 drivers/usb/musb/tusb6010.c musb->sync_va = sync; musb 1127 drivers/usb/musb/tusb6010.c musb->mregs += TUSB_BASE_OFFSET; musb 1129 drivers/usb/musb/tusb6010.c ret = tusb_musb_start(musb); musb 1135 drivers/usb/musb/tusb6010.c musb->isr = tusb_musb_interrupt; musb 1137 drivers/usb/musb/tusb6010.c musb->xceiv->set_power = tusb_draw_power; musb 1138 drivers/usb/musb/tusb6010.c the_musb = musb; musb 1140 drivers/usb/musb/tusb6010.c timer_setup(&musb->dev_timer, musb_do_idle, 0); musb 1147 drivers/usb/musb/tusb6010.c usb_put_phy(musb->xceiv); musb 1152 drivers/usb/musb/tusb6010.c static int tusb_musb_exit(struct musb *musb) musb 1154 drivers/usb/musb/tusb6010.c del_timer_sync(&musb->dev_timer); musb 1157 drivers/usb/musb/tusb6010.c if (musb->board_set_power) musb 1158 drivers/usb/musb/tusb6010.c musb->board_set_power(0); musb 1160 drivers/usb/musb/tusb6010.c iounmap(musb->sync_va); musb 1162 drivers/usb/musb/tusb6010.c usb_put_phy(musb->xceiv); musb 1203 drivers/usb/musb/tusb6010.c struct platform_device *musb; musb 1244 drivers/usb/musb/tusb6010.c glue->musb = musb = platform_device_register_full(&pinfo); musb 1245 drivers/usb/musb/tusb6010.c if (IS_ERR(musb)) { musb 1246 drivers/usb/musb/tusb6010.c ret = PTR_ERR(musb); musb 1258 drivers/usb/musb/tusb6010.c platform_device_unregister(glue->musb); musb 30 drivers/usb/musb/tusb6010_omap.c struct musb *musb; musb 66 drivers/usb/musb/tusb6010_omap.c dev_dbg(chdat->musb->controller, "ep%i dmareq0 is busy for ep%i\n", musb 102 drivers/usb/musb/tusb6010_omap.c struct musb *musb = chdat->musb; musb 103 drivers/usb/musb/tusb6010_omap.c struct device *dev = musb->controller; musb 106 drivers/usb/musb/tusb6010_omap.c void __iomem *mbase = musb->mregs; musb 109 drivers/usb/musb/tusb6010_omap.c spin_lock_irqsave(&musb->lock, flags); musb 111 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, "ep%i %s dma callback\n", musb 123 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, "Corrupt %s XFR_SIZE: 0x%08lx\n", musb 131 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, "DMA remaining %lu/%u\n", remaining, chdat->transfer_len); musb 137 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, "Using PIO for remaining %lu bytes\n", pio); musb 158 drivers/usb/musb/tusb6010_omap.c musb_dma_completion(musb, chdat->epnum, chdat->tx); musb 169 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, "terminating short tx packet\n"); musb 178 drivers/usb/musb/tusb6010_omap.c spin_unlock_irqrestore(&musb->lock, flags); musb 186 drivers/usb/musb/tusb6010_omap.c struct musb *musb = chdat->musb; musb 187 drivers/usb/musb/tusb6010_omap.c struct device *dev = musb->controller; musb 189 drivers/usb/musb/tusb6010_omap.c void __iomem *mbase = musb->mregs; musb 226 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, "Busy %s dma, not using: %08x\n", musb 241 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, "could not get dma for ep%i\n", chdat->epnum); musb 285 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, musb 299 drivers/usb/musb/tusb6010_omap.c dev_err(musb->controller, "DMA slave config failed: %d\n", ret); musb 307 drivers/usb/musb/tusb6010_omap.c dev_err(musb->controller, "DMA prep_slave_single failed\n"); musb 315 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, musb 428 drivers/usb/musb/tusb6010_omap.c struct musb *musb; musb 434 drivers/usb/musb/tusb6010_omap.c musb = tusb_dma->controller.musb; musb 438 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, "Not allowing DMA for ep0 %s\n", tx ? "tx" : "rx"); musb 455 drivers/usb/musb/tusb6010_omap.c chdat->musb = tusb_dma->controller.musb; musb 482 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, "ep%i %s dma: %s dmareq%i\n", musb 493 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, "ep%i: Could not get a DMA channel\n", chdat->epnum); musb 502 drivers/usb/musb/tusb6010_omap.c struct musb *musb = chdat->musb; musb 504 drivers/usb/musb/tusb6010_omap.c dev_dbg(musb->controller, "Release for ep%i\n", chdat->epnum); musb 538 drivers/usb/musb/tusb6010_omap.c struct musb *musb = tusb_dma->controller.musb; musb 554 drivers/usb/musb/tusb6010_omap.c dma_data->chan = dma_request_chan(musb->controller, musb 557 drivers/usb/musb/tusb6010_omap.c dev_err(musb->controller, musb 583 drivers/usb/musb/tusb6010_omap.c tusb_dma_controller_create(struct musb *musb, void __iomem *base) musb 585 drivers/usb/musb/tusb6010_omap.c void __iomem *tbase = musb->ctrl_base; musb 591 drivers/usb/musb/tusb6010_omap.c musb_writel(musb->ctrl_base, TUSB_DMA_INT_MASK, 0x7fffffff); musb 592 drivers/usb/musb/tusb6010_omap.c musb_writel(musb->ctrl_base, TUSB_DMA_EP_MAP, 0); musb 603 drivers/usb/musb/tusb6010_omap.c tusb_dma->controller.musb = musb; musb 604 drivers/usb/musb/tusb6010_omap.c tusb_dma->tbase = musb->ctrl_base; musb 611 drivers/usb/musb/tusb6010_omap.c if (musb->tusb_revision >= TUSB_REV_30) musb 29 drivers/usb/musb/ux500.c struct platform_device *musb; musb 32 drivers/usb/musb/ux500.c #define glue_to_musb(g) platform_get_drvdata(g->musb) musb 34 drivers/usb/musb/ux500.c static void ux500_musb_set_vbus(struct musb *musb, int is_on) musb 43 drivers/usb/musb/ux500.c devctl = musb_readb(musb->mregs, MUSB_DEVCTL); musb 46 drivers/usb/musb/ux500.c if (musb->xceiv->otg->state == OTG_STATE_A_IDLE) { musb 49 drivers/usb/musb/ux500.c musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); musb 54 drivers/usb/musb/ux500.c while (musb_readb(musb->mregs, MUSB_DEVCTL) & 0x80) { musb 57 drivers/usb/musb/ux500.c dev_err(musb->controller, musb 64 drivers/usb/musb/ux500.c musb->is_active = 1; musb 65 drivers/usb/musb/ux500.c musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; musb 67 drivers/usb/musb/ux500.c MUSB_HST_MODE(musb); musb 70 drivers/usb/musb/ux500.c musb->is_active = 0; musb 76 drivers/usb/musb/ux500.c MUSB_DEV_MODE(musb); musb 78 drivers/usb/musb/ux500.c musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); musb 89 drivers/usb/musb/ux500.c dev_dbg(musb->controller, "VBUS %s, devctl %02x\n", musb 90 drivers/usb/musb/ux500.c usb_otg_state_string(musb->xceiv->otg->state), musb 91 drivers/usb/musb/ux500.c musb_readb(musb->mregs, MUSB_DEVCTL)); musb 97 drivers/usb/musb/ux500.c struct musb *musb = container_of(nb, struct musb, nb); musb 99 drivers/usb/musb/ux500.c dev_dbg(musb->controller, "musb_otg_notifications %ld %s\n", musb 100 drivers/usb/musb/ux500.c event, usb_otg_state_string(musb->xceiv->otg->state)); musb 104 drivers/usb/musb/ux500.c dev_dbg(musb->controller, "ID GND\n"); musb 105 drivers/usb/musb/ux500.c ux500_musb_set_vbus(musb, 1); musb 108 drivers/usb/musb/ux500.c dev_dbg(musb->controller, "VBUS Connect\n"); musb 111 drivers/usb/musb/ux500.c dev_dbg(musb->controller, "VBUS Disconnect\n"); musb 112 drivers/usb/musb/ux500.c if (is_host_active(musb)) musb 113 drivers/usb/musb/ux500.c ux500_musb_set_vbus(musb, 0); musb 115 drivers/usb/musb/ux500.c musb->xceiv->otg->state = OTG_STATE_B_IDLE; musb 118 drivers/usb/musb/ux500.c dev_dbg(musb->controller, "ID float\n"); musb 128 drivers/usb/musb/ux500.c struct musb *musb = __hci; musb 130 drivers/usb/musb/ux500.c spin_lock_irqsave(&musb->lock, flags); musb 132 drivers/usb/musb/ux500.c musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB); musb 133 drivers/usb/musb/ux500.c musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX); musb 134 drivers/usb/musb/ux500.c musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX); musb 136 drivers/usb/musb/ux500.c if (musb->int_usb || musb->int_tx || musb->int_rx) musb 137 drivers/usb/musb/ux500.c retval = musb_interrupt(musb); musb 139 drivers/usb/musb/ux500.c spin_unlock_irqrestore(&musb->lock, flags); musb 144 drivers/usb/musb/ux500.c static int ux500_musb_init(struct musb *musb) musb 148 drivers/usb/musb/ux500.c musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); musb 149 drivers/usb/musb/ux500.c if (IS_ERR_OR_NULL(musb->xceiv)) { musb 154 drivers/usb/musb/ux500.c musb->nb.notifier_call = musb_otg_notifications; musb 155 drivers/usb/musb/ux500.c status = usb_register_notifier(musb->xceiv, &musb->nb); musb 157 drivers/usb/musb/ux500.c dev_dbg(musb->controller, "notification register failed\n"); musb 161 drivers/usb/musb/ux500.c musb->isr = ux500_musb_interrupt; musb 166 drivers/usb/musb/ux500.c static int ux500_musb_exit(struct musb *musb) musb 168 drivers/usb/musb/ux500.c usb_unregister_notifier(musb->xceiv, &musb->nb); musb 170 drivers/usb/musb/ux500.c usb_put_phy(musb->xceiv); musb 222 drivers/usb/musb/ux500.c struct platform_device *musb; musb 244 drivers/usb/musb/ux500.c musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO); musb 245 drivers/usb/musb/ux500.c if (!musb) { musb 263 drivers/usb/musb/ux500.c musb->dev.parent = &pdev->dev; musb 264 drivers/usb/musb/ux500.c musb->dev.dma_mask = &pdev->dev.coherent_dma_mask; musb 265 drivers/usb/musb/ux500.c musb->dev.coherent_dma_mask = pdev->dev.coherent_dma_mask; musb 268 drivers/usb/musb/ux500.c glue->musb = musb; musb 289 drivers/usb/musb/ux500.c ret = platform_device_add_resources(musb, musb_resources, musb 296 drivers/usb/musb/ux500.c ret = platform_device_add_data(musb, pdata, sizeof(*pdata)); musb 302 drivers/usb/musb/ux500.c ret = platform_device_add(musb); musb 314 drivers/usb/musb/ux500.c platform_device_put(musb); musb 324 drivers/usb/musb/ux500.c platform_device_unregister(glue->musb); musb 334 drivers/usb/musb/ux500.c struct musb *musb = glue_to_musb(glue); musb 336 drivers/usb/musb/ux500.c if (musb) musb 337 drivers/usb/musb/ux500.c usb_phy_set_suspend(musb->xceiv, 1); musb 347 drivers/usb/musb/ux500.c struct musb *musb = glue_to_musb(glue); musb 356 drivers/usb/musb/ux500.c if (musb) musb 357 drivers/usb/musb/ux500.c usb_phy_set_suspend(musb->xceiv, 0); musb 56 drivers/usb/musb/ux500_dma.c struct musb *musb = hw_ep->musb; musb 59 drivers/usb/musb/ux500_dma.c dev_dbg(musb->controller, "DMA rx transfer done on hw_ep=%d\n", musb 62 drivers/usb/musb/ux500_dma.c spin_lock_irqsave(&musb->lock, flags); musb 65 drivers/usb/musb/ux500_dma.c musb_dma_completion(musb, hw_ep->epnum, ux500_channel->is_tx); musb 66 drivers/usb/musb/ux500_dma.c spin_unlock_irqrestore(&musb->lock, flags); musb 82 drivers/usb/musb/ux500_dma.c struct musb *musb = ux500_channel->controller->private_data; musb 83 drivers/usb/musb/ux500_dma.c dma_addr_t usb_fifo_addr = (musb->io.fifo_offset(hw_ep->epnum) + musb 86 drivers/usb/musb/ux500_dma.c dev_dbg(musb->controller, musb 134 drivers/usb/musb/ux500_dma.c struct musb *musb = controller->private_data; musb 157 drivers/usb/musb/ux500_dma.c dev_dbg(musb->controller, "hw_ep=%d, is_tx=0x%x, channel=%d\n", musb 166 drivers/usb/musb/ux500_dma.c struct musb *musb = ux500_channel->controller->private_data; musb 168 drivers/usb/musb/ux500_dma.c dev_dbg(musb->controller, "channel=%d\n", ux500_channel->ch_num); musb 211 drivers/usb/musb/ux500_dma.c struct musb *musb = controller->private_data; musb 212 drivers/usb/musb/ux500_dma.c void __iomem *epio = musb->endpoints[ux500_channel->hw_ep->epnum].regs; musb 215 drivers/usb/musb/ux500_dma.c dev_dbg(musb->controller, "channel=%d, is_tx=%d\n", musb 269 drivers/usb/musb/ux500_dma.c struct musb *musb = controller->private_data; musb 270 drivers/usb/musb/ux500_dma.c struct device *dev = musb->controller; musb 284 drivers/usb/musb/ux500_dma.c dev_err(musb->controller, "No platform data\n"); musb 358 drivers/usb/musb/ux500_dma.c ux500_dma_controller_create(struct musb *musb, void __iomem *base) musb 361 drivers/usb/musb/ux500_dma.c struct platform_device *pdev = to_platform_device(musb->controller); musb 369 drivers/usb/musb/ux500_dma.c controller->private_data = musb; musb 374 drivers/usb/musb/ux500_dma.c dev_err(musb->controller, "no memory resource defined\n");