Lines Matching full:qmp
25 #include "phy-qcom-qmp.h"
1491 * @qmp: QMP phy to which this lane belongs
1506 struct qcom_qmp *qmp; member
1511 * struct qcom_qmp - structure holding QMP phy block attributes
2115 struct qcom_qmp *qmp = qphy->qmp; in qmp_usb_init() local
2118 void __iomem *dp_com = qmp->dp_com; in qmp_usb_init()
2122 ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs); in qmp_usb_init()
2124 dev_err(qmp->dev, "failed to enable regulators, err=%d\n", ret); in qmp_usb_init()
2128 ret = reset_control_bulk_assert(cfg->num_resets, qmp->resets); in qmp_usb_init()
2130 dev_err(qmp->dev, "reset assert failed\n"); in qmp_usb_init()
2134 ret = reset_control_bulk_deassert(cfg->num_resets, qmp->resets); in qmp_usb_init()
2136 dev_err(qmp->dev, "reset deassert failed\n"); in qmp_usb_init()
2140 ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); in qmp_usb_init()
2147 /* override hardware control for reset of qmp phy */ in qmp_usb_init()
2158 /* bring both QMP USB and QMP DP PHYs PCS block out of reset */ in qmp_usb_init()
2178 reset_control_bulk_assert(cfg->num_resets, qmp->resets); in qmp_usb_init()
2180 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); in qmp_usb_init()
2188 struct qcom_qmp *qmp = qphy->qmp; in qmp_usb_exit() local
2191 reset_control_bulk_assert(cfg->num_resets, qmp->resets); in qmp_usb_exit()
2193 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qmp_usb_exit()
2195 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); in qmp_usb_exit()
2203 struct qcom_qmp *qmp = qphy->qmp; in qmp_usb_power_on() local
2216 dev_err(qmp->dev, "pipe_clk enable failed err=%d\n", ret); in qmp_usb_power_on()
2254 dev_err(qmp->dev, "phy initialization timed-out\n"); in qmp_usb_power_on()
2374 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_usb_runtime_suspend() local
2375 struct qmp_phy *qphy = qmp->phys[0]; in qmp_usb_runtime_suspend()
2378 dev_vdbg(dev, "Suspending QMP phy, mode:%d\n", qphy->mode); in qmp_usb_runtime_suspend()
2388 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qmp_usb_runtime_suspend()
2395 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_usb_runtime_resume() local
2396 struct qmp_phy *qphy = qmp->phys[0]; in qmp_usb_runtime_resume()
2400 dev_vdbg(dev, "Resuming QMP phy, mode:%d\n", qphy->mode); in qmp_usb_runtime_resume()
2407 ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); in qmp_usb_runtime_resume()
2414 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qmp_usb_runtime_resume()
2425 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_usb_vreg_init() local
2429 qmp->vregs = devm_kcalloc(dev, num, sizeof(*qmp->vregs), GFP_KERNEL); in qmp_usb_vreg_init()
2430 if (!qmp->vregs) in qmp_usb_vreg_init()
2434 qmp->vregs[i].supply = cfg->vreg_list[i]; in qmp_usb_vreg_init()
2436 return devm_regulator_bulk_get(dev, num, qmp->vregs); in qmp_usb_vreg_init()
2441 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_usb_reset_init() local
2445 qmp->resets = devm_kcalloc(dev, cfg->num_resets, in qmp_usb_reset_init()
2446 sizeof(*qmp->resets), GFP_KERNEL); in qmp_usb_reset_init()
2447 if (!qmp->resets) in qmp_usb_reset_init()
2451 qmp->resets[i].id = cfg->reset_list[i]; in qmp_usb_reset_init()
2453 ret = devm_reset_control_bulk_get_exclusive(dev, cfg->num_resets, qmp->resets); in qmp_usb_reset_init()
2462 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_usb_clk_init() local
2466 qmp->clks = devm_kcalloc(dev, num, sizeof(*qmp->clks), GFP_KERNEL); in qmp_usb_clk_init()
2467 if (!qmp->clks) in qmp_usb_clk_init()
2471 qmp->clks[i].id = cfg->clk_list[i]; in qmp_usb_clk_init()
2473 return devm_clk_bulk_get(dev, num, qmp->clks); in qmp_usb_clk_init()
2499 static int phy_pipe_clk_register(struct qcom_qmp *qmp, struct device_node *np) in phy_pipe_clk_register() argument
2507 dev_err(qmp->dev, "%pOFn: No clock-output-names\n", np); in phy_pipe_clk_register()
2511 fixed = devm_kzalloc(qmp->dev, sizeof(*fixed), GFP_KERNEL); in phy_pipe_clk_register()
2517 /* controllers using QMP phys use 125MHz pipe clock interface */ in phy_pipe_clk_register()
2521 ret = devm_clk_hw_register(qmp->dev, &fixed->hw); in phy_pipe_clk_register()
2533 return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np); in phy_pipe_clk_register()
2562 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_usb_create() local
2572 if (of_device_is_compatible(dev->of_node, "qcom,sdx65-qmp-usb3-uni-phy")) in qmp_usb_create()
2574 if (of_device_is_compatible(dev->of_node, "qcom,sm8350-qmp-usb3-uni-phy")) in qmp_usb_create()
2637 qphy->qmp = qmp; in qmp_usb_create()
2638 qmp->phys[id] = qphy; in qmp_usb_create()
2646 .compatible = "qcom,ipq8074-qmp-usb3-phy",
2649 .compatible = "qcom,msm8996-qmp-usb3-phy",
2652 .compatible = "qcom,ipq6018-qmp-usb3-phy",
2655 .compatible = "qcom,sc7180-qmp-usb3-phy",
2658 .compatible = "qcom,sc8180x-qmp-usb3-phy",
2661 .compatible = "qcom,sc8280xp-qmp-usb3-uni-phy",
2664 .compatible = "qcom,sdm845-qmp-usb3-phy",
2667 .compatible = "qcom,sdm845-qmp-usb3-uni-phy",
2670 .compatible = "qcom,msm8998-qmp-usb3-phy",
2673 .compatible = "qcom,sm8150-qmp-usb3-phy",
2676 .compatible = "qcom,sm8150-qmp-usb3-uni-phy",
2679 .compatible = "qcom,sm8250-qmp-usb3-phy",
2682 .compatible = "qcom,sm8250-qmp-usb3-uni-phy",
2685 .compatible = "qcom,sdx55-qmp-usb3-uni-phy",
2688 .compatible = "qcom,sdx65-qmp-usb3-uni-phy",
2691 .compatible = "qcom,sm8350-qmp-usb3-phy",
2694 .compatible = "qcom,sm8350-qmp-usb3-uni-phy",
2697 .compatible = "qcom,sm8450-qmp-usb3-phy",
2700 .compatible = "qcom,qcm2290-qmp-usb3-phy",
2714 struct qcom_qmp *qmp; in qmp_usb_probe() local
2723 qmp = devm_kzalloc(dev, sizeof(*qmp), GFP_KERNEL); in qmp_usb_probe()
2724 if (!qmp) in qmp_usb_probe()
2727 qmp->dev = dev; in qmp_usb_probe()
2728 dev_set_drvdata(dev, qmp); in qmp_usb_probe()
2730 /* Get the specific init parameters of QMP phy */ in qmp_usb_probe()
2742 qmp->dp_com = devm_platform_ioremap_resource(pdev, 1); in qmp_usb_probe()
2743 if (IS_ERR(qmp->dp_com)) in qmp_usb_probe()
2744 return PTR_ERR(qmp->dp_com); in qmp_usb_probe()
2765 qmp->phys = devm_kcalloc(dev, num, sizeof(*qmp->phys), GFP_KERNEL); in qmp_usb_probe()
2766 if (!qmp->phys) in qmp_usb_probe()
2793 ret = phy_pipe_clk_register(qmp, child); in qmp_usb_probe()
2795 dev_err(qmp->dev, in qmp_usb_probe()
2815 .name = "qcom-qmp-usb-phy",
2824 MODULE_DESCRIPTION("Qualcomm QMP USB PHY driver");