Lines Matching refs:musb
71 static struct musb *sunxi_musb;
75 struct musb *musb; member
99 struct musb *musb = glue->musb; in sunxi_musb_work() local
103 spin_lock_irqsave(&musb->lock, flags); in sunxi_musb_work()
105 devctl = readb(musb->mregs + SUNXI_MUSB_DEVCTL); in sunxi_musb_work()
108 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; in sunxi_musb_work()
109 MUSB_HST_MODE(musb); in sunxi_musb_work()
113 musb->xceiv->otg->state = OTG_STATE_B_IDLE; in sunxi_musb_work()
114 MUSB_DEV_MODE(musb); in sunxi_musb_work()
117 writeb(devctl, musb->mregs + SUNXI_MUSB_DEVCTL); in sunxi_musb_work()
119 spin_unlock_irqrestore(&musb->lock, flags); in sunxi_musb_work()
139 static void sunxi_musb_set_vbus(struct musb *musb, int is_on) in sunxi_musb_set_vbus() argument
141 struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); in sunxi_musb_set_vbus()
145 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; in sunxi_musb_set_vbus()
153 static void sunxi_musb_pre_root_reset_end(struct musb *musb) in sunxi_musb_pre_root_reset_end() argument
155 struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); in sunxi_musb_pre_root_reset_end()
160 static void sunxi_musb_post_root_reset_end(struct musb *musb) in sunxi_musb_post_root_reset_end() argument
162 struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); in sunxi_musb_post_root_reset_end()
169 struct musb *musb = __hci; in sunxi_musb_interrupt() local
172 spin_lock_irqsave(&musb->lock, flags); in sunxi_musb_interrupt()
174 musb->int_usb = readb(musb->mregs + SUNXI_MUSB_INTRUSB); in sunxi_musb_interrupt()
175 if (musb->int_usb) in sunxi_musb_interrupt()
176 writeb(musb->int_usb, musb->mregs + SUNXI_MUSB_INTRUSB); in sunxi_musb_interrupt()
178 if ((musb->int_usb & MUSB_INTR_RESET) && !is_host_active(musb)) { in sunxi_musb_interrupt()
180 musb_ep_select(musb->mregs, 0); in sunxi_musb_interrupt()
181 musb_writeb(musb->mregs, MUSB_FADDR, 0); in sunxi_musb_interrupt()
184 musb->int_tx = readw(musb->mregs + SUNXI_MUSB_INTRTX); in sunxi_musb_interrupt()
185 if (musb->int_tx) in sunxi_musb_interrupt()
186 writew(musb->int_tx, musb->mregs + SUNXI_MUSB_INTRTX); in sunxi_musb_interrupt()
188 musb->int_rx = readw(musb->mregs + SUNXI_MUSB_INTRRX); in sunxi_musb_interrupt()
189 if (musb->int_rx) in sunxi_musb_interrupt()
190 writew(musb->int_rx, musb->mregs + SUNXI_MUSB_INTRRX); in sunxi_musb_interrupt()
192 musb_interrupt(musb); in sunxi_musb_interrupt()
194 spin_unlock_irqrestore(&musb->lock, flags); in sunxi_musb_interrupt()
215 static int sunxi_musb_init(struct musb *musb) in sunxi_musb_init() argument
217 struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); in sunxi_musb_init()
220 sunxi_musb = musb; in sunxi_musb_init()
221 musb->phy = glue->phy; in sunxi_musb_init()
222 musb->xceiv = glue->xceiv; in sunxi_musb_init()
225 ret = sunxi_sram_claim(musb->controller->parent); in sunxi_musb_init()
240 writeb(SUNXI_MUSB_VEND0_PIO_MODE, musb->mregs + SUNXI_MUSB_VEND0); in sunxi_musb_init()
252 musb->isr = sunxi_musb_interrupt; in sunxi_musb_init()
255 pm_runtime_get(musb->controller); in sunxi_musb_init()
266 sunxi_sram_release(musb->controller->parent); in sunxi_musb_init()
270 static int sunxi_musb_exit(struct musb *musb) in sunxi_musb_exit() argument
272 struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); in sunxi_musb_exit()
274 pm_runtime_put(musb->controller); in sunxi_musb_exit()
287 sunxi_sram_release(musb->controller->parent); in sunxi_musb_exit()
294 static void sunxi_musb_enable(struct musb *musb) in sunxi_musb_enable() argument
296 struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); in sunxi_musb_enable()
298 glue->musb = musb; in sunxi_musb_enable()
307 static void sunxi_musb_disable(struct musb *musb) in sunxi_musb_disable() argument
309 struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); in sunxi_musb_disable()
315 sunxi_musb_dma_controller_create(struct musb *musb, void __iomem *base) in sunxi_musb_dma_controller_create() argument
324 static int sunxi_musb_set_mode(struct musb *musb, u8 mode) in sunxi_musb_set_mode() argument
326 struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); in sunxi_musb_set_mode()
340 dev_err(musb->controller->parent, in sunxi_musb_set_mode()
348 if (musb->port_mode != MUSB_OTG) { in sunxi_musb_set_mode()
349 dev_err(musb->controller->parent, in sunxi_musb_set_mode()
354 if (musb->port1_status & USB_PORT_STAT_ENABLE) in sunxi_musb_set_mode()
355 musb_root_disconnect(musb); in sunxi_musb_set_mode()
368 static int sunxi_musb_recover(struct musb *musb) in sunxi_musb_recover() argument
370 struct sunxi_glue *glue = dev_get_drvdata(musb->controller->parent); in sunxi_musb_recover()