Lines Matching +full:keystone +full:- +full:dwc3
1 // SPDX-License-Identifier: GPL-2.0
3 * dwc3-keystone.c - Keystone Specific Glue layer
5 * Copyright (C) 2010-2013 Texas Instruments Incorporated - https://www.ti.com
7 * Author: WingMan Kwok <w-kwok2@ti.com>
14 #include <linux/dma-mapping.h>
56 val = kdwc3_readl(kdwc->usbss, USBSS_IRQENABLE_SET_0); in kdwc3_enable_irqs()
58 kdwc3_writel(kdwc->usbss, USBSS_IRQENABLE_SET_0, val); in kdwc3_enable_irqs()
65 val = kdwc3_readl(kdwc->usbss, USBSS_IRQENABLE_SET_0); in kdwc3_disable_irqs()
67 kdwc3_writel(kdwc->usbss, USBSS_IRQENABLE_SET_0, val); in kdwc3_disable_irqs()
74 kdwc3_writel(kdwc->usbss, USBSS_IRQENABLE_CLR_0, USBSS_IRQ_COREIRQ_CLR); in dwc3_keystone_interrupt()
75 kdwc3_writel(kdwc->usbss, USBSS_IRQSTATUS_0, USBSS_IRQ_EVENT_ST); in dwc3_keystone_interrupt()
76 kdwc3_writel(kdwc->usbss, USBSS_IRQENABLE_SET_0, USBSS_IRQ_COREIRQ_EN); in dwc3_keystone_interrupt()
77 kdwc3_writel(kdwc->usbss, USBSS_IRQ_EOI, USBSS_IRQ_EOI_LINE(0)); in dwc3_keystone_interrupt()
84 struct device *dev = &pdev->dev; in kdwc3_probe()
85 struct device_node *node = pdev->dev.of_node; in kdwc3_probe()
91 return -ENOMEM; in kdwc3_probe()
95 kdwc->dev = dev; in kdwc3_probe()
97 kdwc->usbss = devm_platform_ioremap_resource(pdev, 0); in kdwc3_probe()
98 if (IS_ERR(kdwc->usbss)) in kdwc3_probe()
99 return PTR_ERR(kdwc->usbss); in kdwc3_probe()
102 kdwc->usb3_phy = devm_phy_optional_get(dev, "usb3-phy"); in kdwc3_probe()
103 if (IS_ERR(kdwc->usb3_phy)) in kdwc3_probe()
104 return dev_err_probe(dev, PTR_ERR(kdwc->usb3_phy), "couldn't get usb3 phy\n"); in kdwc3_probe()
106 phy_pm_runtime_get_sync(kdwc->usb3_phy); in kdwc3_probe()
108 error = phy_reset(kdwc->usb3_phy); in kdwc3_probe()
114 error = phy_init(kdwc->usb3_phy); in kdwc3_probe()
120 error = phy_power_on(kdwc->usb3_phy); in kdwc3_probe()
123 phy_exit(kdwc->usb3_phy); in kdwc3_probe()
127 pm_runtime_enable(kdwc->dev); in kdwc3_probe()
128 error = pm_runtime_get_sync(kdwc->dev); in kdwc3_probe()
130 dev_err(kdwc->dev, "pm_runtime_get_sync failed, error %d\n", in kdwc3_probe()
136 if (of_device_is_compatible(node, "ti,am654-dwc3")) in kdwc3_probe()
148 dev_err(dev, "failed to request IRQ #%d --> %d\n", in kdwc3_probe()
158 dev_err(&pdev->dev, "failed to create dwc3 core\n"); in kdwc3_probe()
167 pm_runtime_put_sync(kdwc->dev); in kdwc3_probe()
168 pm_runtime_disable(kdwc->dev); in kdwc3_probe()
169 phy_power_off(kdwc->usb3_phy); in kdwc3_probe()
170 phy_exit(kdwc->usb3_phy); in kdwc3_probe()
171 phy_pm_runtime_put_sync(kdwc->usb3_phy); in kdwc3_probe()
188 struct device_node *node = pdev->dev.of_node; in kdwc3_remove()
190 if (!of_device_is_compatible(node, "ti,am654-dwc3")) in kdwc3_remove()
193 device_for_each_child(&pdev->dev, NULL, kdwc3_remove_core); in kdwc3_remove()
194 pm_runtime_put_sync(kdwc->dev); in kdwc3_remove()
195 pm_runtime_disable(kdwc->dev); in kdwc3_remove()
197 phy_power_off(kdwc->usb3_phy); in kdwc3_remove()
198 phy_exit(kdwc->usb3_phy); in kdwc3_remove()
199 phy_pm_runtime_put_sync(kdwc->usb3_phy); in kdwc3_remove()
203 { .compatible = "ti,keystone-dwc3", },
204 { .compatible = "ti,am654-dwc3" },
213 .name = "keystone-dwc3",
220 MODULE_ALIAS("platform:keystone-dwc3");
221 MODULE_AUTHOR("WingMan Kwok <w-kwok2@ti.com>");
223 MODULE_DESCRIPTION("DesignWare USB3 KEYSTONE Glue Layer");