Lines Matching refs:qmp

251 	struct qcom_qmp *qmp;  member
382 struct qcom_qmp *qmp = qphy->qmp; in qmp_pcie_msm8996_serdes_init() local
403 dev_err(qmp->dev, in qmp_pcie_msm8996_serdes_init()
413 struct qcom_qmp *qmp = qphy->qmp; in qmp_pcie_msm8996_com_init() local
418 mutex_lock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_init()
419 if (qmp->init_count++) { in qmp_pcie_msm8996_com_init()
420 mutex_unlock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_init()
425 ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs); in qmp_pcie_msm8996_com_init()
427 dev_err(qmp->dev, "failed to enable regulators, err=%d\n", ret); in qmp_pcie_msm8996_com_init()
431 ret = reset_control_bulk_assert(cfg->num_resets, qmp->resets); in qmp_pcie_msm8996_com_init()
433 dev_err(qmp->dev, "reset assert failed\n"); in qmp_pcie_msm8996_com_init()
437 ret = reset_control_bulk_deassert(cfg->num_resets, qmp->resets); in qmp_pcie_msm8996_com_init()
439 dev_err(qmp->dev, "reset deassert failed\n"); in qmp_pcie_msm8996_com_init()
443 ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); in qmp_pcie_msm8996_com_init()
450 mutex_unlock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_init()
455 reset_control_bulk_assert(cfg->num_resets, qmp->resets); in qmp_pcie_msm8996_com_init()
457 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); in qmp_pcie_msm8996_com_init()
459 mutex_unlock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_init()
466 struct qcom_qmp *qmp = qphy->qmp; in qmp_pcie_msm8996_com_exit() local
470 mutex_lock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_exit()
471 if (--qmp->init_count) { in qmp_pcie_msm8996_com_exit()
472 mutex_unlock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_exit()
483 reset_control_bulk_assert(cfg->num_resets, qmp->resets); in qmp_pcie_msm8996_com_exit()
485 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qmp_pcie_msm8996_com_exit()
487 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); in qmp_pcie_msm8996_com_exit()
489 mutex_unlock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_exit()
497 struct qcom_qmp *qmp = qphy->qmp; in qmp_pcie_msm8996_init() local
499 dev_vdbg(qmp->dev, "Initializing QMP phy\n"); in qmp_pcie_msm8996_init()
511 struct qcom_qmp *qmp = qphy->qmp; in qmp_pcie_msm8996_power_on() local
524 dev_err(qmp->dev, "lane%d reset deassert failed\n", in qmp_pcie_msm8996_power_on()
531 dev_err(qmp->dev, "pipe_clk enable failed err=%d\n", ret); in qmp_pcie_msm8996_power_on()
566 dev_err(qmp->dev, "phy initialization timed-out\n"); in qmp_pcie_msm8996_power_on()
643 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_pcie_msm8996_vreg_init() local
647 qmp->vregs = devm_kcalloc(dev, num, sizeof(*qmp->vregs), GFP_KERNEL); in qmp_pcie_msm8996_vreg_init()
648 if (!qmp->vregs) in qmp_pcie_msm8996_vreg_init()
652 qmp->vregs[i].supply = cfg->vreg_list[i]; in qmp_pcie_msm8996_vreg_init()
654 return devm_regulator_bulk_get(dev, num, qmp->vregs); in qmp_pcie_msm8996_vreg_init()
659 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_pcie_msm8996_reset_init() local
663 qmp->resets = devm_kcalloc(dev, cfg->num_resets, in qmp_pcie_msm8996_reset_init()
664 sizeof(*qmp->resets), GFP_KERNEL); in qmp_pcie_msm8996_reset_init()
665 if (!qmp->resets) in qmp_pcie_msm8996_reset_init()
669 qmp->resets[i].id = cfg->reset_list[i]; in qmp_pcie_msm8996_reset_init()
671 ret = devm_reset_control_bulk_get_exclusive(dev, cfg->num_resets, qmp->resets); in qmp_pcie_msm8996_reset_init()
680 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_pcie_msm8996_clk_init() local
684 qmp->clks = devm_kcalloc(dev, num, sizeof(*qmp->clks), GFP_KERNEL); in qmp_pcie_msm8996_clk_init()
685 if (!qmp->clks) in qmp_pcie_msm8996_clk_init()
689 qmp->clks[i].id = cfg->clk_list[i]; in qmp_pcie_msm8996_clk_init()
691 return devm_clk_bulk_get(dev, num, qmp->clks); in qmp_pcie_msm8996_clk_init()
717 static int phy_pipe_clk_register(struct qcom_qmp *qmp, struct device_node *np) in phy_pipe_clk_register() argument
725 dev_err(qmp->dev, "%pOFn: No clock-output-names\n", np); in phy_pipe_clk_register()
729 fixed = devm_kzalloc(qmp->dev, sizeof(*fixed), GFP_KERNEL); in phy_pipe_clk_register()
739 ret = devm_clk_hw_register(qmp->dev, &fixed->hw); in phy_pipe_clk_register()
751 return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np); in phy_pipe_clk_register()
768 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_pcie_msm8996_create() local
820 qphy->qmp = qmp; in qmp_pcie_msm8996_create()
821 qmp->phys[id] = qphy; in qmp_pcie_msm8996_create()
838 struct qcom_qmp *qmp; in qmp_pcie_msm8996_probe() local
847 qmp = devm_kzalloc(dev, sizeof(*qmp), GFP_KERNEL); in qmp_pcie_msm8996_probe()
848 if (!qmp) in qmp_pcie_msm8996_probe()
851 qmp->dev = dev; in qmp_pcie_msm8996_probe()
852 dev_set_drvdata(dev, qmp); in qmp_pcie_msm8996_probe()
866 mutex_init(&qmp->phy_mutex); in qmp_pcie_msm8996_probe()
886 qmp->phys = devm_kcalloc(dev, num, sizeof(*qmp->phys), GFP_KERNEL); in qmp_pcie_msm8996_probe()
887 if (!qmp->phys) in qmp_pcie_msm8996_probe()
904 ret = phy_pipe_clk_register(qmp, child); in qmp_pcie_msm8996_probe()
906 dev_err(qmp->dev, in qmp_pcie_msm8996_probe()