Lines Matching +full:usb +full:- +full:hsic +full:- +full:phy
1 // SPDX-License-Identifier: GPL-2.0
7 #include <linux/usb/chipidea.h>
13 #include <linux/reset-controller.h>
44 bool hsic; member
52 void __iomem *addr = ci_msm->base; in ci_hdrc_msm_por_reset()
81 struct device *dev = ci->dev->parent; in ci_hdrc_msm_notify_event()
90 if (msm_ci->secondary_phy) { in ci_hdrc_msm_notify_event()
91 u32 val = readl_relaxed(msm_ci->base + HS_PHY_SEC_CTRL); in ci_hdrc_msm_notify_event()
93 writel_relaxed(val, msm_ci->base + HS_PHY_SEC_CTRL); in ci_hdrc_msm_notify_event()
96 ret = phy_init(ci->phy); in ci_hdrc_msm_notify_event()
100 ret = phy_power_on(ci->phy); in ci_hdrc_msm_notify_event()
102 phy_exit(ci->phy); in ci_hdrc_msm_notify_event()
113 if (!msm_ci->hsic) in ci_hdrc_msm_notify_event()
117 if (!IS_ERR(ci->platdata->vbus_extcon.edev) || ci->role_switch) { in ci_hdrc_msm_notify_event()
128 phy_power_off(ci->phy); in ci_hdrc_msm_notify_event()
129 phy_exit(ci->phy); in ci_hdrc_msm_notify_event()
143 struct device *dev = &pdev->dev; in ci_hdrc_msm_mux_phy()
148 ret = of_parse_phandle_with_fixed_args(dev->of_node, "phy-select", 2, 0, in ci_hdrc_msm_mux_phy()
162 ci->secondary_phy = !!args.args[1]; in ci_hdrc_msm_mux_phy()
163 if (ci->secondary_phy) { in ci_hdrc_msm_mux_phy()
164 val = readl_relaxed(ci->base + HS_PHY_SEC_CTRL); in ci_hdrc_msm_mux_phy()
166 writel_relaxed(val, ci->base + HS_PHY_SEC_CTRL); in ci_hdrc_msm_mux_phy()
181 dev_dbg(&pdev->dev, "ci_hdrc_msm_probe\n"); in ci_hdrc_msm_probe()
183 ci = devm_kzalloc(&pdev->dev, sizeof(*ci), GFP_KERNEL); in ci_hdrc_msm_probe()
185 return -ENOMEM; in ci_hdrc_msm_probe()
188 ci->pdata.name = "ci_hdrc_msm"; in ci_hdrc_msm_probe()
189 ci->pdata.capoffset = DEF_CAPOFFSET; in ci_hdrc_msm_probe()
190 ci->pdata.flags = CI_HDRC_REGS_SHARED | CI_HDRC_DISABLE_STREAMING | in ci_hdrc_msm_probe()
193 ci->pdata.notify_event = ci_hdrc_msm_notify_event; in ci_hdrc_msm_probe()
195 reset = devm_reset_control_get(&pdev->dev, "core"); in ci_hdrc_msm_probe()
199 ci->core_clk = clk = devm_clk_get(&pdev->dev, "core"); in ci_hdrc_msm_probe()
203 ci->iface_clk = clk = devm_clk_get(&pdev->dev, "iface"); in ci_hdrc_msm_probe()
207 ci->fs_clk = clk = devm_clk_get_optional(&pdev->dev, "fs"); in ci_hdrc_msm_probe()
211 ci->base = devm_platform_ioremap_resource(pdev, 1); in ci_hdrc_msm_probe()
212 if (IS_ERR(ci->base)) in ci_hdrc_msm_probe()
213 return PTR_ERR(ci->base); in ci_hdrc_msm_probe()
215 ci->rcdev.owner = THIS_MODULE; in ci_hdrc_msm_probe()
216 ci->rcdev.ops = &ci_hdrc_msm_reset_ops; in ci_hdrc_msm_probe()
217 ci->rcdev.of_node = pdev->dev.of_node; in ci_hdrc_msm_probe()
218 ci->rcdev.nr_resets = 2; in ci_hdrc_msm_probe()
219 ret = devm_reset_controller_register(&pdev->dev, &ci->rcdev); in ci_hdrc_msm_probe()
223 ret = clk_prepare_enable(ci->fs_clk); in ci_hdrc_msm_probe()
231 clk_disable_unprepare(ci->fs_clk); in ci_hdrc_msm_probe()
233 ret = clk_prepare_enable(ci->core_clk); in ci_hdrc_msm_probe()
237 ret = clk_prepare_enable(ci->iface_clk); in ci_hdrc_msm_probe()
245 ulpi_node = of_get_child_by_name(pdev->dev.of_node, "ulpi"); in ci_hdrc_msm_probe()
248 ci->hsic = of_device_is_compatible(phy_node, "qcom,usb-hsic-phy"); in ci_hdrc_msm_probe()
253 plat_ci = ci_hdrc_add_device(&pdev->dev, pdev->resource, in ci_hdrc_msm_probe()
254 pdev->num_resources, &ci->pdata); in ci_hdrc_msm_probe()
257 if (ret != -EPROBE_DEFER) in ci_hdrc_msm_probe()
258 dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n"); in ci_hdrc_msm_probe()
262 ci->ci = plat_ci; in ci_hdrc_msm_probe()
264 pm_runtime_set_active(&pdev->dev); in ci_hdrc_msm_probe()
265 pm_runtime_no_callbacks(&pdev->dev); in ci_hdrc_msm_probe()
266 pm_runtime_enable(&pdev->dev); in ci_hdrc_msm_probe()
271 clk_disable_unprepare(ci->iface_clk); in ci_hdrc_msm_probe()
273 clk_disable_unprepare(ci->core_clk); in ci_hdrc_msm_probe()
281 pm_runtime_disable(&pdev->dev); in ci_hdrc_msm_remove()
282 ci_hdrc_remove_device(ci->ci); in ci_hdrc_msm_remove()
283 clk_disable_unprepare(ci->iface_clk); in ci_hdrc_msm_remove()
284 clk_disable_unprepare(ci->core_clk); in ci_hdrc_msm_remove()
288 { .compatible = "qcom,ci-hdrc", },