Lines Matching full:glue
3 * Texas Instruments DSPS platforms "glue layer"
7 * Based on the am35x "glue layer" code.
101 * DSPS glue structure.
135 static void dsps_mod_timer(struct dsps_glue *glue, int wait_ms) in dsps_mod_timer() argument
137 struct musb *musb = platform_get_drvdata(glue->musb); in dsps_mod_timer()
141 wait = msecs_to_jiffies(glue->wrp->poll_timeout); in dsps_mod_timer()
151 static void dsps_mod_timer_optional(struct dsps_glue *glue) in dsps_mod_timer_optional() argument
153 if (glue->vbus_irq) in dsps_mod_timer_optional()
156 dsps_mod_timer(glue, -1); in dsps_mod_timer_optional()
172 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_musb_enable() local
173 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_musb_enable()
189 dsps_mod_timer(glue, -1); in dsps_musb_enable()
198 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_musb_disable() local
199 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_musb_disable()
213 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_check_status() local
214 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_check_status()
218 if (glue->vbus_irq) in dsps_check_status()
233 dsps_mod_timer_optional(glue); in dsps_check_status()
241 dsps_mod_timer_optional(glue); in dsps_check_status()
250 if (!glue->vbus_irq) { in dsps_check_status()
266 dsps_mod_timer_optional(glue); in dsps_check_status()
307 struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent); in dsps_musb_clear_ep_rxintr() local
308 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_musb_clear_ep_rxintr()
320 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_interrupt() local
321 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_interrupt()
369 dsps_mod_timer_optional(glue); in dsps_interrupt()
374 dsps_mod_timer_optional(glue); in dsps_interrupt()
397 dsps_mod_timer_optional(glue); in dsps_interrupt()
409 static int dsps_musb_dbg_init(struct musb *musb, struct dsps_glue *glue) in dsps_musb_dbg_init() argument
416 glue->dbgfs_root = root; in dsps_musb_dbg_init()
418 glue->regset.regs = dsps_musb_regs; in dsps_musb_dbg_init()
419 glue->regset.nregs = ARRAY_SIZE(dsps_musb_regs); in dsps_musb_dbg_init()
420 glue->regset.base = musb->ctrl_base; in dsps_musb_dbg_init()
422 debugfs_create_regset32("regdump", S_IRUGO, root, &glue->regset); in dsps_musb_dbg_init()
429 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_musb_init() local
431 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_musb_init()
488 glue->sw_babble_enabled = true; in dsps_musb_init()
493 dsps_mod_timer(glue, -1); in dsps_musb_init()
495 return dsps_musb_dbg_init(musb, glue); in dsps_musb_init()
501 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_musb_exit() local
506 debugfs_remove_recursive(glue->dbgfs_root); in dsps_musb_exit()
514 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_musb_set_mode() local
515 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_musb_set_mode()
551 dev_err(glue->dev, "unsupported mode %d\n", mode); in dsps_musb_set_mode()
612 struct dsps_glue *glue = dev_get_drvdata(dev->parent); in dsps_musb_recover() local
615 if (glue->sw_babble_enabled) in dsps_musb_recover()
645 struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent); in dsps_dma_controller_callback() local
646 void __iomem *usbss_base = glue->usbss_base; in dsps_dma_controller_callback()
658 struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent); in dsps_dma_controller_create() local
659 void __iomem *usbss_base = glue->usbss_base; in dsps_dma_controller_create()
672 static void dsps_dma_controller_suspend(struct dsps_glue *glue) in dsps_dma_controller_suspend() argument
674 void __iomem *usbss_base = glue->usbss_base; in dsps_dma_controller_suspend()
679 static void dsps_dma_controller_resume(struct dsps_glue *glue) in dsps_dma_controller_resume() argument
681 void __iomem *usbss_base = glue->usbss_base; in dsps_dma_controller_resume()
688 static void dsps_dma_controller_suspend(struct dsps_glue *glue) {} in dsps_dma_controller_suspend() argument
689 static void dsps_dma_controller_resume(struct dsps_glue *glue) {} in dsps_dma_controller_resume() argument
723 static int dsps_create_musb_pdev(struct dsps_glue *glue, in dsps_create_musb_pdev() argument
765 glue->musb = musb; in dsps_create_musb_pdev()
826 struct dsps_glue *glue = priv; in dsps_vbus_threaded_irq() local
827 struct musb *musb = platform_get_drvdata(glue->musb); in dsps_vbus_threaded_irq()
832 dev_dbg(glue->dev, "VBUS interrupt\n"); in dsps_vbus_threaded_irq()
833 dsps_mod_timer(glue, 0); in dsps_vbus_threaded_irq()
839 struct dsps_glue *glue) in dsps_setup_optional_vbus_irq() argument
843 glue->vbus_irq = platform_get_irq_byname(pdev, "vbus"); in dsps_setup_optional_vbus_irq()
844 if (glue->vbus_irq == -EPROBE_DEFER) in dsps_setup_optional_vbus_irq()
847 if (glue->vbus_irq <= 0) { in dsps_setup_optional_vbus_irq()
848 glue->vbus_irq = 0; in dsps_setup_optional_vbus_irq()
852 error = devm_request_threaded_irq(glue->dev, glue->vbus_irq, in dsps_setup_optional_vbus_irq()
855 "vbus", glue); in dsps_setup_optional_vbus_irq()
857 glue->vbus_irq = 0; in dsps_setup_optional_vbus_irq()
860 dev_dbg(glue->dev, "VBUS irq %i configured\n", glue->vbus_irq); in dsps_setup_optional_vbus_irq()
869 struct dsps_glue *glue; in dsps_probe() local
885 /* allocate glue */ in dsps_probe()
886 glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL); in dsps_probe()
887 if (!glue) in dsps_probe()
890 glue->dev = &pdev->dev; in dsps_probe()
891 glue->wrp = wrp; in dsps_probe()
892 glue->usbss_base = of_iomap(pdev->dev.parent->of_node, 0); in dsps_probe()
893 if (!glue->usbss_base) in dsps_probe()
896 platform_set_drvdata(pdev, glue); in dsps_probe()
898 ret = dsps_create_musb_pdev(glue, pdev); in dsps_probe()
903 ret = dsps_setup_optional_vbus_irq(pdev, glue); in dsps_probe()
911 platform_device_unregister(glue->musb); in dsps_probe()
914 iounmap(glue->usbss_base); in dsps_probe()
920 struct dsps_glue *glue = platform_get_drvdata(pdev); in dsps_remove() local
922 platform_device_unregister(glue->musb); in dsps_remove()
925 iounmap(glue->usbss_base); in dsps_remove()
973 struct dsps_glue *glue = dev_get_drvdata(dev); in dsps_suspend() local
974 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_suspend()
975 struct musb *musb = platform_get_drvdata(glue->musb); in dsps_suspend()
992 glue->context.control = musb_readl(mbase, wrp->control); in dsps_suspend()
993 glue->context.epintr = musb_readl(mbase, wrp->epintr_set); in dsps_suspend()
994 glue->context.coreintr = musb_readl(mbase, wrp->coreintr_set); in dsps_suspend()
995 glue->context.phy_utmi = musb_readl(mbase, wrp->phy_utmi); in dsps_suspend()
996 glue->context.mode = musb_readl(mbase, wrp->mode); in dsps_suspend()
997 glue->context.tx_mode = musb_readl(mbase, wrp->tx_mode); in dsps_suspend()
998 glue->context.rx_mode = musb_readl(mbase, wrp->rx_mode); in dsps_suspend()
1000 dsps_dma_controller_suspend(glue); in dsps_suspend()
1007 struct dsps_glue *glue = dev_get_drvdata(dev); in dsps_resume() local
1008 const struct dsps_musb_wrapper *wrp = glue->wrp; in dsps_resume()
1009 struct musb *musb = platform_get_drvdata(glue->musb); in dsps_resume()
1015 dsps_dma_controller_resume(glue); in dsps_resume()
1018 musb_writel(mbase, wrp->control, glue->context.control); in dsps_resume()
1019 musb_writel(mbase, wrp->epintr_set, glue->context.epintr); in dsps_resume()
1020 musb_writel(mbase, wrp->coreintr_set, glue->context.coreintr); in dsps_resume()
1021 musb_writel(mbase, wrp->phy_utmi, glue->context.phy_utmi); in dsps_resume()
1022 musb_writel(mbase, wrp->mode, glue->context.mode); in dsps_resume()
1023 musb_writel(mbase, wrp->tx_mode, glue->context.tx_mode); in dsps_resume()
1024 musb_writel(mbase, wrp->rx_mode, glue->context.rx_mode); in dsps_resume()
1027 dsps_mod_timer(glue, -1); in dsps_resume()
1047 MODULE_DESCRIPTION("TI DSPS MUSB Glue Layer");