Lines Matching full:qmp

22 #include "phy-qcom-qmp-common.h"
24 #include "phy-qcom-qmp.h"
179 * @qmp: QMP phy to which this lane belongs
191 struct qcom_qmp *qmp; member
196 * struct qcom_qmp - structure holding QMP phy block attributes
282 struct qcom_qmp *qmp = qphy->qmp; in qmp_pcie_msm8996_serdes_init() local
291 qmp_configure(qmp->dev, serdes, serdes_tbl, serdes_tbl_num); in qmp_pcie_msm8996_serdes_init()
301 dev_err(qmp->dev, in qmp_pcie_msm8996_serdes_init()
311 struct qcom_qmp *qmp = qphy->qmp; in qmp_pcie_msm8996_com_init() local
316 mutex_lock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_init()
317 if (qmp->init_count++) { in qmp_pcie_msm8996_com_init()
318 mutex_unlock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_init()
322 ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs); in qmp_pcie_msm8996_com_init()
324 dev_err(qmp->dev, "failed to enable regulators, err=%d\n", ret); in qmp_pcie_msm8996_com_init()
328 ret = reset_control_bulk_assert(cfg->num_resets, qmp->resets); in qmp_pcie_msm8996_com_init()
330 dev_err(qmp->dev, "reset assert failed\n"); in qmp_pcie_msm8996_com_init()
334 ret = reset_control_bulk_deassert(cfg->num_resets, qmp->resets); in qmp_pcie_msm8996_com_init()
336 dev_err(qmp->dev, "reset deassert failed\n"); in qmp_pcie_msm8996_com_init()
340 ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); in qmp_pcie_msm8996_com_init()
347 mutex_unlock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_init()
352 reset_control_bulk_assert(cfg->num_resets, qmp->resets); in qmp_pcie_msm8996_com_init()
354 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); in qmp_pcie_msm8996_com_init()
356 qmp->init_count--; in qmp_pcie_msm8996_com_init()
357 mutex_unlock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_init()
364 struct qcom_qmp *qmp = qphy->qmp; in qmp_pcie_msm8996_com_exit() local
368 mutex_lock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_exit()
369 if (--qmp->init_count) { in qmp_pcie_msm8996_com_exit()
370 mutex_unlock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_exit()
381 reset_control_bulk_assert(cfg->num_resets, qmp->resets); in qmp_pcie_msm8996_com_exit()
383 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qmp_pcie_msm8996_com_exit()
385 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); in qmp_pcie_msm8996_com_exit()
387 mutex_unlock(&qmp->phy_mutex); in qmp_pcie_msm8996_com_exit()
395 struct qcom_qmp *qmp = qphy->qmp; in qmp_pcie_msm8996_init() local
397 dev_vdbg(qmp->dev, "Initializing QMP phy\n"); in qmp_pcie_msm8996_init()
409 struct qcom_qmp *qmp = qphy->qmp; in qmp_pcie_msm8996_power_on() local
422 dev_err(qmp->dev, "lane%d reset deassert failed\n", in qmp_pcie_msm8996_power_on()
429 dev_err(qmp->dev, "pipe_clk enable failed err=%d\n", ret); in qmp_pcie_msm8996_power_on()
434 qmp_configure_lane(qmp->dev, tx, cfg->tx_tbl, cfg->tx_tbl_num, 1); in qmp_pcie_msm8996_power_on()
435 qmp_configure_lane(qmp->dev, rx, cfg->rx_tbl, cfg->rx_tbl_num, 1); in qmp_pcie_msm8996_power_on()
436 qmp_configure(qmp->dev, pcs, cfg->pcs_tbl, cfg->pcs_tbl_num); in qmp_pcie_msm8996_power_on()
458 dev_err(qmp->dev, "phy initialization timed-out\n"); in qmp_pcie_msm8996_power_on()
531 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_pcie_msm8996_vreg_init() local
535 qmp->vregs = devm_kcalloc(dev, num, sizeof(*qmp->vregs), GFP_KERNEL); in qmp_pcie_msm8996_vreg_init()
536 if (!qmp->vregs) in qmp_pcie_msm8996_vreg_init()
540 qmp->vregs[i].supply = cfg->vreg_list[i]; in qmp_pcie_msm8996_vreg_init()
542 return devm_regulator_bulk_get(dev, num, qmp->vregs); in qmp_pcie_msm8996_vreg_init()
547 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_pcie_msm8996_reset_init() local
551 qmp->resets = devm_kcalloc(dev, cfg->num_resets, in qmp_pcie_msm8996_reset_init()
552 sizeof(*qmp->resets), GFP_KERNEL); in qmp_pcie_msm8996_reset_init()
553 if (!qmp->resets) in qmp_pcie_msm8996_reset_init()
557 qmp->resets[i].id = cfg->reset_list[i]; in qmp_pcie_msm8996_reset_init()
559 ret = devm_reset_control_bulk_get_exclusive(dev, cfg->num_resets, qmp->resets); in qmp_pcie_msm8996_reset_init()
568 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_pcie_msm8996_clk_init() local
572 qmp->clks = devm_kcalloc(dev, num, sizeof(*qmp->clks), GFP_KERNEL); in qmp_pcie_msm8996_clk_init()
573 if (!qmp->clks) in qmp_pcie_msm8996_clk_init()
577 qmp->clks[i].id = cfg->clk_list[i]; in qmp_pcie_msm8996_clk_init()
579 return devm_clk_bulk_get(dev, num, qmp->clks); in qmp_pcie_msm8996_clk_init()
605 static int phy_pipe_clk_register(struct qcom_qmp *qmp, struct device_node *np) in phy_pipe_clk_register() argument
613 dev_err(qmp->dev, "%pOFn: No clock-output-names\n", np); in phy_pipe_clk_register()
617 fixed = devm_kzalloc(qmp->dev, sizeof(*fixed), GFP_KERNEL); in phy_pipe_clk_register()
623 /* controllers using QMP phys use 125MHz pipe clock interface */ in phy_pipe_clk_register()
627 ret = devm_clk_hw_register(qmp->dev, &fixed->hw); in phy_pipe_clk_register()
639 return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np); in phy_pipe_clk_register()
656 struct qcom_qmp *qmp = dev_get_drvdata(dev); in qmp_pcie_msm8996_create() local
708 qphy->qmp = qmp; in qmp_pcie_msm8996_create()
709 qmp->phys[id] = qphy; in qmp_pcie_msm8996_create()
717 .compatible = "qcom,msm8996-qmp-pcie-phy",
726 struct qcom_qmp *qmp; in qmp_pcie_msm8996_probe() local
734 qmp = devm_kzalloc(dev, sizeof(*qmp), GFP_KERNEL); in qmp_pcie_msm8996_probe()
735 if (!qmp) in qmp_pcie_msm8996_probe()
738 qmp->dev = dev; in qmp_pcie_msm8996_probe()
739 dev_set_drvdata(dev, qmp); in qmp_pcie_msm8996_probe()
751 mutex_init(&qmp->phy_mutex); in qmp_pcie_msm8996_probe()
770 qmp->phys = devm_kcalloc(dev, num, sizeof(*qmp->phys), GFP_KERNEL); in qmp_pcie_msm8996_probe()
771 if (!qmp->phys) in qmp_pcie_msm8996_probe()
788 ret = phy_pipe_clk_register(qmp, child); in qmp_pcie_msm8996_probe()
790 dev_err(qmp->dev, in qmp_pcie_msm8996_probe()
806 .name = "qcom-qmp-msm8996-pcie-phy",
814 MODULE_DESCRIPTION("Qualcomm QMP MSM8996 PCIe PHY driver");