Lines Matching +full:exynos4210 +full:- +full:ohci
1 // SPDX-License-Identifier: GPL-2.0+
3 * SAMSUNG EXYNOS USB HOST OHCI Controller
10 #include <linux/dma-mapping.h>
20 #include "ohci.h"
22 #define DRIVER_DESC "OHCI Exynos driver"
26 #define to_exynos_ohci(hcd) (struct exynos_ohci_hcd *)(hcd_to_ohci(hcd)->priv)
45 num_phys = of_count_phandle_with_args(dev->of_node, "phys", in exynos_ohci_get_phy()
46 "#phy-cells"); in exynos_ohci_get_phy()
48 phy = devm_of_phy_get_by_index(dev, dev->of_node, phy_number); in exynos_ohci_get_phy()
51 exynos_ohci->phy[phy_number] = phy; in exynos_ohci_get_phy()
57 for_each_available_child_of_node_scoped(dev->of_node, child) { in exynos_ohci_get_phy()
66 return -EINVAL; in exynos_ohci_get_phy()
70 exynos_ohci->phy[phy_number] = phy; in exynos_ohci_get_phy()
75 exynos_ohci->legacy_phy = true; in exynos_ohci_get_phy()
87 ret = phy_power_on(exynos_ohci->phy[i]); in exynos_ohci_phy_enable()
89 for (i--; i >= 0; i--) in exynos_ohci_phy_enable()
90 phy_power_off(exynos_ohci->phy[i]); in exynos_ohci_phy_enable()
102 phy_power_off(exynos_ohci->phy[i]); in exynos_ohci_phy_disable()
114 * Right now device-tree probed devices don't get dma_mask set. in exynos_ohci_probe()
118 err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); in exynos_ohci_probe()
123 &pdev->dev, dev_name(&pdev->dev)); in exynos_ohci_probe()
125 dev_err(&pdev->dev, "Unable to create HCD\n"); in exynos_ohci_probe()
126 return -ENOMEM; in exynos_ohci_probe()
131 err = exynos_ohci_get_phy(&pdev->dev, exynos_ohci); in exynos_ohci_probe()
135 exynos_ohci->clk = devm_clk_get_enabled(&pdev->dev, "usbhost"); in exynos_ohci_probe()
137 if (IS_ERR(exynos_ohci->clk)) { in exynos_ohci_probe()
138 dev_err(&pdev->dev, "Failed to get usbhost clock\n"); in exynos_ohci_probe()
139 err = PTR_ERR(exynos_ohci->clk); in exynos_ohci_probe()
143 hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res); in exynos_ohci_probe()
144 if (IS_ERR(hcd->regs)) { in exynos_ohci_probe()
145 err = PTR_ERR(hcd->regs); in exynos_ohci_probe()
148 hcd->rsrc_start = res->start; in exynos_ohci_probe()
149 hcd->rsrc_len = resource_size(res); in exynos_ohci_probe()
159 err = exynos_ohci_phy_enable(&pdev->dev); in exynos_ohci_probe()
161 dev_err(&pdev->dev, "Failed to enable USB phy\n"); in exynos_ohci_probe()
167 * Exynos OHCI port subnodes and generic USB device bindings in exynos_ohci_probe()
169 exynos_ohci->of_node = pdev->dev.of_node; in exynos_ohci_probe()
170 if (exynos_ohci->legacy_phy) in exynos_ohci_probe()
171 pdev->dev.of_node = NULL; in exynos_ohci_probe()
175 dev_err(&pdev->dev, "Failed to add USB HCD\n"); in exynos_ohci_probe()
178 device_wakeup_enable(hcd->self.controller); in exynos_ohci_probe()
182 exynos_ohci_phy_disable(&pdev->dev); in exynos_ohci_probe()
183 pdev->dev.of_node = exynos_ohci->of_node; in exynos_ohci_probe()
194 pdev->dev.of_node = exynos_ohci->of_node; in exynos_ohci_remove()
198 exynos_ohci_phy_disable(&pdev->dev); in exynos_ohci_remove()
207 if (hcd->driver->shutdown) in exynos_ohci_shutdown()
208 hcd->driver->shutdown(hcd); in exynos_ohci_shutdown()
223 clk_disable_unprepare(exynos_ohci->clk); in exynos_ohci_suspend()
234 clk_prepare_enable(exynos_ohci->clk); in exynos_ohci_resume()
239 clk_disable_unprepare(exynos_ohci->clk); in exynos_ohci_resume()
257 { .compatible = "samsung,exynos4210-ohci" },
268 .name = "exynos-ohci",
276 return -ENODEV; in ohci_exynos_init()
289 MODULE_ALIAS("platform:exynos-ohci");
291 MODULE_DESCRIPTION("OHCI support for Samsung S5P/Exynos SoC Series");