Lines Matching refs:qmp

2992 	struct qcom_qmp *qmp;  member
4153 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_serdes_init() local
4209 dev_err(qmp->dev, in qcom_qmp_phy_serdes_init()
4697 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_com_init() local
4701 void __iomem *dp_com = qmp->dp_com; in qcom_qmp_phy_com_init()
4704 mutex_lock(&qmp->phy_mutex); in qcom_qmp_phy_com_init()
4705 if (qmp->init_count++) { in qcom_qmp_phy_com_init()
4706 mutex_unlock(&qmp->phy_mutex); in qcom_qmp_phy_com_init()
4711 ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs); in qcom_qmp_phy_com_init()
4713 dev_err(qmp->dev, "failed to enable regulators, err=%d\n", ret); in qcom_qmp_phy_com_init()
4718 ret = reset_control_assert(qmp->resets[i]); in qcom_qmp_phy_com_init()
4720 dev_err(qmp->dev, "%s reset assert failed\n", in qcom_qmp_phy_com_init()
4727 ret = reset_control_deassert(qmp->resets[i]); in qcom_qmp_phy_com_init()
4729 dev_err(qmp->dev, "%s reset deassert failed\n", in qcom_qmp_phy_com_init()
4735 ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); in qcom_qmp_phy_com_init()
4775 mutex_unlock(&qmp->phy_mutex); in qcom_qmp_phy_com_init()
4781 reset_control_assert(qmp->resets[i]); in qcom_qmp_phy_com_init()
4783 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); in qcom_qmp_phy_com_init()
4785 mutex_unlock(&qmp->phy_mutex); in qcom_qmp_phy_com_init()
4792 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_com_exit() local
4797 mutex_lock(&qmp->phy_mutex); in qcom_qmp_phy_com_exit()
4798 if (--qmp->init_count) { in qcom_qmp_phy_com_exit()
4799 mutex_unlock(&qmp->phy_mutex); in qcom_qmp_phy_com_exit()
4803 reset_control_assert(qmp->ufs_reset); in qcom_qmp_phy_com_exit()
4814 reset_control_assert(qmp->resets[i]); in qcom_qmp_phy_com_exit()
4816 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qcom_qmp_phy_com_exit()
4818 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); in qcom_qmp_phy_com_exit()
4820 mutex_unlock(&qmp->phy_mutex); in qcom_qmp_phy_com_exit()
4828 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_init() local
4831 dev_vdbg(qmp->dev, "Initializing QMP phy\n"); in qcom_qmp_phy_init()
4839 if (!qmp->ufs_reset) { in qcom_qmp_phy_init()
4840 qmp->ufs_reset = in qcom_qmp_phy_init()
4841 devm_reset_control_get_exclusive(qmp->dev, in qcom_qmp_phy_init()
4844 if (IS_ERR(qmp->ufs_reset)) { in qcom_qmp_phy_init()
4845 ret = PTR_ERR(qmp->ufs_reset); in qcom_qmp_phy_init()
4846 dev_err(qmp->dev, in qcom_qmp_phy_init()
4850 qmp->ufs_reset = NULL; in qcom_qmp_phy_init()
4855 ret = reset_control_assert(qmp->ufs_reset); in qcom_qmp_phy_init()
4873 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_power_on() local
4888 dev_err(qmp->dev, "lane%d reset deassert failed\n", in qcom_qmp_phy_power_on()
4896 dev_err(qmp->dev, "pipe_clk enable failed err=%d\n", ret); in qcom_qmp_phy_power_on()
4946 ret = reset_control_deassert(qmp->ufs_reset); in qcom_qmp_phy_power_on()
4986 dev_err(qmp->dev, "phy initialization timed-out\n"); in qcom_qmp_phy_power_on()
5129 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qcom_qmp_phy_runtime_suspend() local
5130 struct qmp_phy *qphy = qmp->phys[0]; in qcom_qmp_phy_runtime_suspend()
5139 if (!qmp->init_count) { in qcom_qmp_phy_runtime_suspend()
5147 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qcom_qmp_phy_runtime_suspend()
5154 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qcom_qmp_phy_runtime_resume() local
5155 struct qmp_phy *qphy = qmp->phys[0]; in qcom_qmp_phy_runtime_resume()
5165 if (!qmp->init_count) { in qcom_qmp_phy_runtime_resume()
5170 ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); in qcom_qmp_phy_runtime_resume()
5177 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qcom_qmp_phy_runtime_resume()
5188 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qcom_qmp_phy_vreg_init() local
5192 qmp->vregs = devm_kcalloc(dev, num, sizeof(*qmp->vregs), GFP_KERNEL); in qcom_qmp_phy_vreg_init()
5193 if (!qmp->vregs) in qcom_qmp_phy_vreg_init()
5197 qmp->vregs[i].supply = cfg->vreg_list[i]; in qcom_qmp_phy_vreg_init()
5199 return devm_regulator_bulk_get(dev, num, qmp->vregs); in qcom_qmp_phy_vreg_init()
5204 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qcom_qmp_phy_reset_init() local
5207 qmp->resets = devm_kcalloc(dev, cfg->num_resets, in qcom_qmp_phy_reset_init()
5208 sizeof(*qmp->resets), GFP_KERNEL); in qcom_qmp_phy_reset_init()
5209 if (!qmp->resets) in qcom_qmp_phy_reset_init()
5221 qmp->resets[i] = rst; in qcom_qmp_phy_reset_init()
5229 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qcom_qmp_phy_clk_init() local
5233 qmp->clks = devm_kcalloc(dev, num, sizeof(*qmp->clks), GFP_KERNEL); in qcom_qmp_phy_clk_init()
5234 if (!qmp->clks) in qcom_qmp_phy_clk_init()
5238 qmp->clks[i].id = cfg->clk_list[i]; in qcom_qmp_phy_clk_init()
5240 return devm_clk_bulk_get(dev, num, qmp->clks); in qcom_qmp_phy_clk_init()
5266 static int phy_pipe_clk_register(struct qcom_qmp *qmp, struct device_node *np) in phy_pipe_clk_register() argument
5274 dev_err(qmp->dev, "%pOFn: No clock-output-names\n", np); in phy_pipe_clk_register()
5278 fixed = devm_kzalloc(qmp->dev, sizeof(*fixed), GFP_KERNEL); in phy_pipe_clk_register()
5288 ret = devm_clk_hw_register(qmp->dev, &fixed->hw); in phy_pipe_clk_register()
5300 return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np); in phy_pipe_clk_register()
5453 static int phy_dp_clks_register(struct qcom_qmp *qmp, struct qmp_phy *qphy, in phy_dp_clks_register() argument
5461 dp_clks = devm_kzalloc(qmp->dev, sizeof(*dp_clks), GFP_KERNEL); in phy_dp_clks_register()
5468 snprintf(name, sizeof(name), "%s::link_clk", dev_name(qmp->dev)); in phy_dp_clks_register()
5472 ret = devm_clk_hw_register(qmp->dev, &dp_clks->dp_link_hw); in phy_dp_clks_register()
5476 snprintf(name, sizeof(name), "%s::vco_div_clk", dev_name(qmp->dev)); in phy_dp_clks_register()
5480 ret = devm_clk_hw_register(qmp->dev, &dp_clks->dp_pixel_hw); in phy_dp_clks_register()
5492 return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np); in phy_dp_clks_register()
5524 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qcom_qmp_phy_create() local
5632 qphy->qmp = qmp; in qcom_qmp_phy_create()
5633 qmp->phys[id] = qphy; in qcom_qmp_phy_create()
5782 struct qcom_qmp *qmp; in qcom_qmp_phy_probe() local
5796 qmp = devm_kzalloc(dev, sizeof(*qmp), GFP_KERNEL); in qcom_qmp_phy_probe()
5797 if (!qmp) in qcom_qmp_phy_probe()
5800 qmp->dev = dev; in qcom_qmp_phy_probe()
5801 dev_set_drvdata(dev, qmp); in qcom_qmp_phy_probe()
5827 qmp->dp_com = devm_platform_ioremap_resource(pdev, 1); in qcom_qmp_phy_probe()
5828 if (IS_ERR(qmp->dp_com)) in qcom_qmp_phy_probe()
5829 return PTR_ERR(qmp->dp_com); in qcom_qmp_phy_probe()
5844 mutex_init(&qmp->phy_mutex); in qcom_qmp_phy_probe()
5867 qmp->phys = devm_kcalloc(dev, num, sizeof(*qmp->phys), GFP_KERNEL); in qcom_qmp_phy_probe()
5868 if (!qmp->phys) in qcom_qmp_phy_probe()
5902 ret = phy_pipe_clk_register(qmp, child); in qcom_qmp_phy_probe()
5904 dev_err(qmp->dev, in qcom_qmp_phy_probe()
5909 ret = phy_dp_clks_register(qmp, qmp->phys[id], child); in qcom_qmp_phy_probe()
5911 dev_err(qmp->dev, in qcom_qmp_phy_probe()