Lines Matching +full:sun50i +full:- +full:h6 +full:- +full:usb +full:- +full:phy

1 // SPDX-License-Identifier: GPL-2.0
3 * dwc3-of-simple.c - OF glue layer for simple integrations
5 * Copyright (c) 2015 Texas Instruments Incorporated - https://www.ti.com
9 * This is a combination of the old dwc3-qcom.c by Ivan T. Ivanov
10 * <iivanov@mm-sol.com> and the original patch adding support for Xilinx' SoC
18 #include <linux/dma-mapping.h>
36 struct device *dev = &pdev->dev; in dwc3_of_simple_probe()
37 struct device_node *np = dev->of_node; in dwc3_of_simple_probe()
43 return -ENOMEM; in dwc3_of_simple_probe()
46 simple->dev = dev; in dwc3_of_simple_probe()
49 * Some controllers need to toggle the usb3-otg reset before trying to in dwc3_of_simple_probe()
50 * initialize the PHY, otherwise the PHY times out. in dwc3_of_simple_probe()
52 if (of_device_is_compatible(np, "rockchip,rk3399-dwc3")) in dwc3_of_simple_probe()
53 simple->need_reset = true; in dwc3_of_simple_probe()
55 simple->resets = of_reset_control_array_get(np, false, true, in dwc3_of_simple_probe()
57 if (IS_ERR(simple->resets)) { in dwc3_of_simple_probe()
58 ret = PTR_ERR(simple->resets); in dwc3_of_simple_probe()
63 ret = reset_control_deassert(simple->resets); in dwc3_of_simple_probe()
67 ret = clk_bulk_get_all(simple->dev, &simple->clks); in dwc3_of_simple_probe()
71 simple->num_clocks = ret; in dwc3_of_simple_probe()
72 ret = clk_bulk_prepare_enable(simple->num_clocks, simple->clks); in dwc3_of_simple_probe()
87 clk_bulk_disable_unprepare(simple->num_clocks, simple->clks); in dwc3_of_simple_probe()
88 clk_bulk_put_all(simple->num_clocks, simple->clks); in dwc3_of_simple_probe()
91 reset_control_assert(simple->resets); in dwc3_of_simple_probe()
94 reset_control_put(simple->resets); in dwc3_of_simple_probe()
100 of_platform_depopulate(simple->dev); in __dwc3_of_simple_teardown()
102 clk_bulk_disable_unprepare(simple->num_clocks, simple->clks); in __dwc3_of_simple_teardown()
103 clk_bulk_put_all(simple->num_clocks, simple->clks); in __dwc3_of_simple_teardown()
104 simple->num_clocks = 0; in __dwc3_of_simple_teardown()
106 reset_control_assert(simple->resets); in __dwc3_of_simple_teardown()
108 reset_control_put(simple->resets); in __dwc3_of_simple_teardown()
110 pm_runtime_disable(simple->dev); in __dwc3_of_simple_teardown()
111 pm_runtime_put_noidle(simple->dev); in __dwc3_of_simple_teardown()
112 pm_runtime_set_suspended(simple->dev); in __dwc3_of_simple_teardown()
135 clk_bulk_disable(simple->num_clocks, simple->clks); in dwc3_of_simple_runtime_suspend()
144 return clk_bulk_enable(simple->num_clocks, simple->clks); in dwc3_of_simple_runtime_resume()
151 if (simple->need_reset) in dwc3_of_simple_suspend()
152 reset_control_assert(simple->resets); in dwc3_of_simple_suspend()
161 if (simple->need_reset) in dwc3_of_simple_resume()
162 reset_control_deassert(simple->resets); in dwc3_of_simple_resume()
174 { .compatible = "rockchip,rk3399-dwc3" },
175 { .compatible = "xlnx,zynqmp-dwc3" },
176 { .compatible = "cavium,octeon-7130-usb-uctl" },
177 { .compatible = "sprd,sc9860-dwc3" },
178 { .compatible = "allwinner,sun50i-h6-dwc3" },
179 { .compatible = "hisilicon,hi3670-dwc3" },
180 { .compatible = "intel,keembay-dwc3" },
190 .name = "dwc3-of-simple",