Lines Matching +full:imx8qm +full:- +full:usb3
1 // SPDX-License-Identifier: GPL-2.0
3 * cdns3-imx.c - NXP i.MX specific Glue layer for Cadence USB Controller
14 #include <linux/dma-mapping.h>
99 return readl(data->noncore + offset); in cdns_imx_readl()
104 writel(value, data->noncore + offset); in cdns_imx_writel()
119 struct device *dev = data->dev; in cdns_imx_noncore_init()
123 ret = readl_poll_timeout(data->noncore + USB3_SSPHY_STATUS, value, in cdns_imx_noncore_init()
159 .compatible = "cdns,usb3",
167 struct device *dev = &pdev->dev; in cdns_imx_probe()
168 struct device_node *node = dev->of_node; in cdns_imx_probe()
173 return -ENODEV; in cdns_imx_probe()
177 return -ENOMEM; in cdns_imx_probe()
180 data->dev = dev; in cdns_imx_probe()
181 data->noncore = devm_platform_ioremap_resource(pdev, 0); in cdns_imx_probe()
182 if (IS_ERR(data->noncore)) { in cdns_imx_probe()
184 return PTR_ERR(data->noncore); in cdns_imx_probe()
187 data->num_clks = ARRAY_SIZE(imx_cdns3_core_clks); in cdns_imx_probe()
188 data->clks = devm_kmemdup(dev, imx_cdns3_core_clks, in cdns_imx_probe()
190 if (!data->clks) in cdns_imx_probe()
191 return -ENOMEM; in cdns_imx_probe()
193 ret = devm_clk_bulk_get(dev, data->num_clks, data->clks); in cdns_imx_probe()
197 ret = clk_bulk_prepare_enable(data->num_clks, data->clks); in cdns_imx_probe()
217 clk_bulk_disable_unprepare(data->num_clks, data->clks); in cdns_imx_probe()
223 struct device *dev = &pdev->dev; in cdns_imx_remove()
228 clk_bulk_disable_unprepare(data->num_clks, data->clks); in cdns_imx_remove()
252 struct device *parent = dev->parent; in cdns_imx_platform_suspend()
254 void __iomem *otg_regs = (void __iomem *)(cdns->otg_regs); in cdns_imx_platform_suspend()
255 void __iomem *xhci_regs = cdns->xhci_regs; in cdns_imx_platform_suspend()
259 if (cdns->role != USB_ROLE_HOST) in cdns_imx_platform_suspend()
276 ret = readl_poll_timeout(data->noncore + USB3_CORE_STATUS, value, in cdns_imx_platform_suspend()
284 ret = readl_poll_timeout(data->noncore + USB3_INT_REG, value, in cdns_imx_platform_suspend()
292 ret = readl_poll_timeout(data->noncore + USB3_SSPHY_STATUS, value, in cdns_imx_platform_suspend()
320 ret = readl_poll_timeout(data->noncore + USB3_INT_REG, value, in cdns_imx_platform_suspend()
328 ret = readl_poll_timeout(data->noncore + USB3_CORE_STATUS, value, in cdns_imx_platform_suspend()
351 return clk_bulk_prepare_enable(data->num_clks, data->clks); in cdns_imx_resume()
358 clk_bulk_disable_unprepare(data->num_clks, data->clks); in cdns_imx_suspend()
418 { .compatible = "fsl,imx8qm-usb3", },
427 .name = "cdns3-imx",
434 MODULE_ALIAS("platform:cdns3-imx");
437 MODULE_DESCRIPTION("Cadence USB3 i.MX Glue Layer");