Lines Matching refs:qmp
1927 struct qcom_qmp *qmp; member
2623 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_serdes_init() local
2676 dev_err(qmp->dev, in qcom_qmp_phy_serdes_init()
2912 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_com_init() local
2916 void __iomem *dp_com = qmp->dp_com; in qcom_qmp_phy_com_init()
2919 mutex_lock(&qmp->phy_mutex); in qcom_qmp_phy_com_init()
2920 if (qmp->init_count++) { in qcom_qmp_phy_com_init()
2921 mutex_unlock(&qmp->phy_mutex); in qcom_qmp_phy_com_init()
2926 ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs); in qcom_qmp_phy_com_init()
2928 dev_err(qmp->dev, "failed to enable regulators, err=%d\n", ret); in qcom_qmp_phy_com_init()
2933 ret = reset_control_assert(qmp->resets[i]); in qcom_qmp_phy_com_init()
2935 dev_err(qmp->dev, "%s reset assert failed\n", in qcom_qmp_phy_com_init()
2942 ret = reset_control_deassert(qmp->resets[i]); in qcom_qmp_phy_com_init()
2944 dev_err(qmp->dev, "%s reset deassert failed\n", in qcom_qmp_phy_com_init()
2950 ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); in qcom_qmp_phy_com_init()
2952 dev_err(qmp->dev, "failed to enable clks, err=%d\n", ret); in qcom_qmp_phy_com_init()
2992 mutex_unlock(&qmp->phy_mutex); in qcom_qmp_phy_com_init()
2998 reset_control_assert(qmp->resets[i]); in qcom_qmp_phy_com_init()
3000 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); in qcom_qmp_phy_com_init()
3002 mutex_unlock(&qmp->phy_mutex); in qcom_qmp_phy_com_init()
3009 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_com_exit() local
3014 mutex_lock(&qmp->phy_mutex); in qcom_qmp_phy_com_exit()
3015 if (--qmp->init_count) { in qcom_qmp_phy_com_exit()
3016 mutex_unlock(&qmp->phy_mutex); in qcom_qmp_phy_com_exit()
3020 reset_control_assert(qmp->ufs_reset); in qcom_qmp_phy_com_exit()
3031 reset_control_assert(qmp->resets[i]); in qcom_qmp_phy_com_exit()
3033 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qcom_qmp_phy_com_exit()
3035 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); in qcom_qmp_phy_com_exit()
3037 mutex_unlock(&qmp->phy_mutex); in qcom_qmp_phy_com_exit()
3045 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_init() local
3048 dev_vdbg(qmp->dev, "Initializing QMP phy\n"); in qcom_qmp_phy_init()
3056 if (!qmp->ufs_reset) { in qcom_qmp_phy_init()
3057 qmp->ufs_reset = in qcom_qmp_phy_init()
3058 devm_reset_control_get_exclusive(qmp->dev, in qcom_qmp_phy_init()
3061 if (IS_ERR(qmp->ufs_reset)) { in qcom_qmp_phy_init()
3062 ret = PTR_ERR(qmp->ufs_reset); in qcom_qmp_phy_init()
3063 dev_err(qmp->dev, in qcom_qmp_phy_init()
3067 qmp->ufs_reset = NULL; in qcom_qmp_phy_init()
3072 ret = reset_control_assert(qmp->ufs_reset); in qcom_qmp_phy_init()
3090 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_power_on() local
3105 dev_err(qmp->dev, "lane%d reset deassert failed\n", in qcom_qmp_phy_power_on()
3113 dev_err(qmp->dev, "pipe_clk enable failed err=%d\n", ret); in qcom_qmp_phy_power_on()
3142 ret = reset_control_deassert(qmp->ufs_reset); in qcom_qmp_phy_power_on()
3179 dev_err(qmp->dev, "phy initialization timed-out\n"); in qcom_qmp_phy_power_on()
3322 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qcom_qmp_phy_runtime_suspend() local
3323 struct qmp_phy *qphy = qmp->phys[0]; in qcom_qmp_phy_runtime_suspend()
3332 if (!qmp->init_count) { in qcom_qmp_phy_runtime_suspend()
3340 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qcom_qmp_phy_runtime_suspend()
3347 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qcom_qmp_phy_runtime_resume() local
3348 struct qmp_phy *qphy = qmp->phys[0]; in qcom_qmp_phy_runtime_resume()
3358 if (!qmp->init_count) { in qcom_qmp_phy_runtime_resume()
3363 ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); in qcom_qmp_phy_runtime_resume()
3365 dev_err(qmp->dev, "failed to enable clks, err=%d\n", ret); in qcom_qmp_phy_runtime_resume()
3372 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qcom_qmp_phy_runtime_resume()
3383 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qcom_qmp_phy_vreg_init() local
3387 qmp->vregs = devm_kcalloc(dev, num, sizeof(*qmp->vregs), GFP_KERNEL); in qcom_qmp_phy_vreg_init()
3388 if (!qmp->vregs) in qcom_qmp_phy_vreg_init()
3392 qmp->vregs[i].supply = cfg->vreg_list[i]; in qcom_qmp_phy_vreg_init()
3394 return devm_regulator_bulk_get(dev, num, qmp->vregs); in qcom_qmp_phy_vreg_init()
3399 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qcom_qmp_phy_reset_init() local
3402 qmp->resets = devm_kcalloc(dev, cfg->num_resets, in qcom_qmp_phy_reset_init()
3403 sizeof(*qmp->resets), GFP_KERNEL); in qcom_qmp_phy_reset_init()
3404 if (!qmp->resets) in qcom_qmp_phy_reset_init()
3416 qmp->resets[i] = rst; in qcom_qmp_phy_reset_init()
3424 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qcom_qmp_phy_clk_init() local
3428 qmp->clks = devm_kcalloc(dev, num, sizeof(*qmp->clks), GFP_KERNEL); in qcom_qmp_phy_clk_init()
3429 if (!qmp->clks) in qcom_qmp_phy_clk_init()
3433 qmp->clks[i].id = cfg->clk_list[i]; in qcom_qmp_phy_clk_init()
3435 return devm_clk_bulk_get(dev, num, qmp->clks); in qcom_qmp_phy_clk_init()
3461 static int phy_pipe_clk_register(struct qcom_qmp *qmp, struct device_node *np) in phy_pipe_clk_register() argument
3469 dev_err(qmp->dev, "%pOFn: No clock-output-names\n", np); in phy_pipe_clk_register()
3473 fixed = devm_kzalloc(qmp->dev, sizeof(*fixed), GFP_KERNEL); in phy_pipe_clk_register()
3483 ret = devm_clk_hw_register(qmp->dev, &fixed->hw); in phy_pipe_clk_register()
3495 ret = devm_add_action(qmp->dev, phy_clk_release_provider, np); in phy_pipe_clk_register()
3652 static int phy_dp_clks_register(struct qcom_qmp *qmp, struct qmp_phy *qphy, in phy_dp_clks_register() argument
3659 dp_clks = devm_kzalloc(qmp->dev, sizeof(*dp_clks), GFP_KERNEL); in phy_dp_clks_register()
3669 ret = devm_clk_hw_register(qmp->dev, &dp_clks->dp_link_hw); in phy_dp_clks_register()
3676 ret = devm_clk_hw_register(qmp->dev, &dp_clks->dp_pixel_hw); in phy_dp_clks_register()
3688 ret = devm_add_action(qmp->dev, phy_clk_release_provider, np); in phy_dp_clks_register()
3724 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qcom_qmp_phy_create() local
3832 qphy->qmp = qmp; in qcom_qmp_phy_create()
3833 qmp->phys[id] = qphy; in qcom_qmp_phy_create()
3923 struct qcom_qmp *qmp; in qcom_qmp_phy_probe() local
3937 qmp = devm_kzalloc(dev, sizeof(*qmp), GFP_KERNEL); in qcom_qmp_phy_probe()
3938 if (!qmp) in qcom_qmp_phy_probe()
3941 qmp->dev = dev; in qcom_qmp_phy_probe()
3942 dev_set_drvdata(dev, qmp); in qcom_qmp_phy_probe()
3968 qmp->dp_com = devm_platform_ioremap_resource(pdev, 1); in qcom_qmp_phy_probe()
3969 if (IS_ERR(qmp->dp_com)) in qcom_qmp_phy_probe()
3970 return PTR_ERR(qmp->dp_com); in qcom_qmp_phy_probe()
3985 mutex_init(&qmp->phy_mutex); in qcom_qmp_phy_probe()
4008 qmp->phys = devm_kcalloc(dev, num, sizeof(*qmp->phys), GFP_KERNEL); in qcom_qmp_phy_probe()
4009 if (!qmp->phys) in qcom_qmp_phy_probe()
4043 ret = phy_pipe_clk_register(qmp, child); in qcom_qmp_phy_probe()
4045 dev_err(qmp->dev, in qcom_qmp_phy_probe()
4050 ret = phy_dp_clks_register(qmp, qmp->phys[id], child); in qcom_qmp_phy_probe()
4052 dev_err(qmp->dev, in qcom_qmp_phy_probe()