Lines Matching full:glue

3  * Texas Instruments DSPS platforms "glue layer"
7 * Based on the am35x "glue layer" code.
99 * DSPS glue structure.
133 static void dsps_mod_timer(struct dsps_glue *glue, int wait_ms) in dsps_mod_timer() argument
135 struct musb *musb = platform_get_drvdata(glue->musb); in dsps_mod_timer()
139 wait = msecs_to_jiffies(glue->wrp->poll_timeout); in dsps_mod_timer()
149 static void dsps_mod_timer_optional(struct dsps_glue *glue) in dsps_mod_timer_optional() argument
151 if (glue->vbus_irq) in dsps_mod_timer_optional()
154 dsps_mod_timer(glue, -1); in dsps_mod_timer_optional()
170 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_musb_enable() local
171 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_musb_enable()
187 dsps_mod_timer(glue, -1); in dsps_musb_enable()
196 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_musb_disable() local
197 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_musb_disable()
211 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_check_status() local
212 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_check_status()
216 if (glue->vbus_irq) in dsps_check_status()
231 dsps_mod_timer_optional(glue); in dsps_check_status()
239 dsps_mod_timer_optional(glue); in dsps_check_status()
248 if (!glue->vbus_irq) { in dsps_check_status()
264 dsps_mod_timer_optional(glue); in dsps_check_status()
305 struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent); in dsps_musb_clear_ep_rxintr() local
306 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_musb_clear_ep_rxintr()
318 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_interrupt() local
319 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_interrupt()
367 dsps_mod_timer_optional(glue); in dsps_interrupt()
372 dsps_mod_timer_optional(glue); in dsps_interrupt()
395 dsps_mod_timer_optional(glue); in dsps_interrupt()
407 static int dsps_musb_dbg_init(struct musb *musb, struct dsps_glue *glue) in dsps_musb_dbg_init() argument
414 glue->dbgfs_root = root; in dsps_musb_dbg_init()
416 glue->regset.regs = dsps_musb_regs; in dsps_musb_dbg_init()
417 glue->regset.nregs = ARRAY_SIZE(dsps_musb_regs); in dsps_musb_dbg_init()
418 glue->regset.base = musb->ctrl_base; in dsps_musb_dbg_init()
420 debugfs_create_regset32("regdump", S_IRUGO, root, &glue->regset); in dsps_musb_dbg_init()
427 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_musb_init() local
429 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_musb_init()
486 glue->sw_babble_enabled = true; in dsps_musb_init()
491 dsps_mod_timer(glue, -1); in dsps_musb_init()
493 return dsps_musb_dbg_init(musb, glue); in dsps_musb_init()
499 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_musb_exit() local
504 debugfs_remove_recursive(glue->dbgfs_root); in dsps_musb_exit()
512 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_musb_set_mode() local
513 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_musb_set_mode()
549 dev_err(glue->dev, "unsupported mode %d\n", mode); in dsps_musb_set_mode()
610 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_musb_recover() local
613 if (glue->sw_babble_enabled) in dsps_musb_recover()
643 struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent); in dsps_dma_controller_callback() local
644 void __iomem *usbss_base = glue->usbss_base; in dsps_dma_controller_callback()
656 struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent); in dsps_dma_controller_create() local
657 void __iomem *usbss_base = glue->usbss_base; in dsps_dma_controller_create()
670 static void dsps_dma_controller_suspend(struct dsps_glue *glue) in dsps_dma_controller_suspend() argument
672 void __iomem *usbss_base = glue->usbss_base; in dsps_dma_controller_suspend()
677 static void dsps_dma_controller_resume(struct dsps_glue *glue) in dsps_dma_controller_resume() argument
679 void __iomem *usbss_base = glue->usbss_base; in dsps_dma_controller_resume()
686 static void dsps_dma_controller_suspend(struct dsps_glue *glue) {} in dsps_dma_controller_suspend() argument
687 static void dsps_dma_controller_resume(struct dsps_glue *glue) {} in dsps_dma_controller_resume() argument
721 static int dsps_create_musb_pdev(struct dsps_glue *glue, in dsps_create_musb_pdev() argument
763 glue->musb = musb; in dsps_create_musb_pdev()
824 struct dsps_glue *glue = priv; in dsps_vbus_threaded_irq() local
825 struct musb *musb = platform_get_drvdata(glue->musb); in dsps_vbus_threaded_irq()
830 dev_dbg(glue->dev, "VBUS interrupt\n"); in dsps_vbus_threaded_irq()
831 dsps_mod_timer(glue, 0); in dsps_vbus_threaded_irq()
837 struct dsps_glue *glue) in dsps_setup_optional_vbus_irq() argument
841 glue->vbus_irq = platform_get_irq_byname(pdev, "vbus"); in dsps_setup_optional_vbus_irq()
842 if (glue->vbus_irq == -EPROBE_DEFER) in dsps_setup_optional_vbus_irq()
845 if (glue->vbus_irq <= 0) { in dsps_setup_optional_vbus_irq()
846 glue->vbus_irq = 0; in dsps_setup_optional_vbus_irq()
850 error = devm_request_threaded_irq(glue->dev, glue->vbus_irq, in dsps_setup_optional_vbus_irq()
853 "vbus", glue); in dsps_setup_optional_vbus_irq()
855 glue->vbus_irq = 0; in dsps_setup_optional_vbus_irq()
858 dev_dbg(glue->dev, "VBUS irq %i configured\n", glue->vbus_irq); in dsps_setup_optional_vbus_irq()
867 struct dsps_glue *glue; in dsps_probe() local
883 /* allocate glue */ in dsps_probe()
884 glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL); in dsps_probe()
885 if (!glue) in dsps_probe()
888 glue->dev = &pdev->dev; in dsps_probe()
889 glue->wrp = wrp; in dsps_probe()
890 glue->usbss_base = of_iomap(pdev->dev.parent->of_node, 0); in dsps_probe()
891 if (!glue->usbss_base) in dsps_probe()
894 platform_set_drvdata(pdev, glue); in dsps_probe()
896 ret = dsps_create_musb_pdev(glue, pdev); in dsps_probe()
901 ret = dsps_setup_optional_vbus_irq(pdev, glue); in dsps_probe()
909 platform_device_unregister(glue->musb); in dsps_probe()
912 iounmap(glue->usbss_base); in dsps_probe()
918 struct dsps_glue *glue = platform_get_drvdata(pdev); in dsps_remove() local
920 platform_device_unregister(glue->musb); in dsps_remove()
923 iounmap(glue->usbss_base); in dsps_remove()
969 struct dsps_glue *glue = dev_get_drvdata(dev); in dsps_suspend() local
970 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_suspend()
971 struct musb *musb = platform_get_drvdata(glue->musb); in dsps_suspend()
988 glue->context.control = musb_readl(mbase, wrp->control); in dsps_suspend()
989 glue->context.epintr = musb_readl(mbase, wrp->epintr_set); in dsps_suspend()
990 glue->context.coreintr = musb_readl(mbase, wrp->coreintr_set); in dsps_suspend()
991 glue->context.phy_utmi = musb_readl(mbase, wrp->phy_utmi); in dsps_suspend()
992 glue->context.mode = musb_readl(mbase, wrp->mode); in dsps_suspend()
993 glue->context.tx_mode = musb_readl(mbase, wrp->tx_mode); in dsps_suspend()
994 glue->context.rx_mode = musb_readl(mbase, wrp->rx_mode); in dsps_suspend()
996 dsps_dma_controller_suspend(glue); in dsps_suspend()
1003 struct dsps_glue *glue = dev_get_drvdata(dev); in dsps_resume() local
1004 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_resume()
1005 struct musb *musb = platform_get_drvdata(glue->musb); in dsps_resume()
1011 dsps_dma_controller_resume(glue); in dsps_resume()
1014 musb_writel(mbase, wrp->control, glue->context.control); in dsps_resume()
1015 musb_writel(mbase, wrp->epintr_set, glue->context.epintr); in dsps_resume()
1016 musb_writel(mbase, wrp->coreintr_set, glue->context.coreintr); in dsps_resume()
1017 musb_writel(mbase, wrp->phy_utmi, glue->context.phy_utmi); in dsps_resume()
1018 musb_writel(mbase, wrp->mode, glue->context.mode); in dsps_resume()
1019 musb_writel(mbase, wrp->tx_mode, glue->context.tx_mode); in dsps_resume()
1020 musb_writel(mbase, wrp->rx_mode, glue->context.rx_mode); in dsps_resume()
1023 dsps_mod_timer(glue, -1); in dsps_resume()
1043 MODULE_DESCRIPTION("TI DSPS MUSB Glue Layer");