Lines Matching refs:qphy
1298 static int qcom_qmp_phy_com_init(struct qmp_phy *qphy) in qcom_qmp_phy_com_init() argument
1300 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_com_init()
1303 void __iomem *pcs = qphy->pcs; in qcom_qmp_phy_com_init()
1444 struct qmp_phy *qphy = phy_get_drvdata(phy); in qcom_qmp_phy_enable() local
1445 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_enable()
1447 void __iomem *tx = qphy->tx; in qcom_qmp_phy_enable()
1448 void __iomem *rx = qphy->rx; in qcom_qmp_phy_enable()
1449 void __iomem *pcs = qphy->pcs; in qcom_qmp_phy_enable()
1484 ret = qcom_qmp_phy_com_init(qphy); in qcom_qmp_phy_enable()
1489 ret = reset_control_deassert(qphy->lane_rst); in qcom_qmp_phy_enable()
1492 qphy->index); in qcom_qmp_phy_enable()
1497 ret = clk_prepare_enable(qphy->pipe_clk); in qcom_qmp_phy_enable()
1507 qcom_qmp_phy_configure(qphy->tx2, cfg->regs, in qcom_qmp_phy_enable()
1512 qcom_qmp_phy_configure(qphy->rx2, cfg->regs, in qcom_qmp_phy_enable()
1561 clk_disable_unprepare(qphy->pipe_clk); in qcom_qmp_phy_enable()
1564 reset_control_assert(qphy->lane_rst); in qcom_qmp_phy_enable()
1573 struct qmp_phy *qphy = phy_get_drvdata(phy); in qcom_qmp_phy_disable() local
1574 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_disable()
1577 clk_disable_unprepare(qphy->pipe_clk); in qcom_qmp_phy_disable()
1581 qphy_setbits(qphy->pcs, cfg->regs[QPHY_SW_RESET], SW_RESET); in qcom_qmp_phy_disable()
1584 qphy_clrbits(qphy->pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl); in qcom_qmp_phy_disable()
1587 qphy_clrbits(qphy->pcs, QPHY_POWER_DOWN_CONTROL, cfg->pwrdn_ctrl); in qcom_qmp_phy_disable()
1590 reset_control_assert(qphy->lane_rst); in qcom_qmp_phy_disable()
1602 struct qmp_phy *qphy = phy_get_drvdata(phy); in qcom_qmp_phy_set_mode() local
1603 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_set_mode()
1610 static void qcom_qmp_phy_enable_autonomous_mode(struct qmp_phy *qphy) in qcom_qmp_phy_enable_autonomous_mode() argument
1612 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_enable_autonomous_mode()
1614 void __iomem *pcs = qphy->pcs; in qcom_qmp_phy_enable_autonomous_mode()
1615 void __iomem *pcs_misc = qphy->pcs_misc; in qcom_qmp_phy_enable_autonomous_mode()
1640 static void qcom_qmp_phy_disable_autonomous_mode(struct qmp_phy *qphy) in qcom_qmp_phy_disable_autonomous_mode() argument
1642 struct qcom_qmp *qmp = qphy->qmp; in qcom_qmp_phy_disable_autonomous_mode()
1644 void __iomem *pcs = qphy->pcs; in qcom_qmp_phy_disable_autonomous_mode()
1645 void __iomem *pcs_misc = qphy->pcs_misc; in qcom_qmp_phy_disable_autonomous_mode()
1662 struct qmp_phy *qphy = qmp->phys[0]; in qcom_qmp_phy_runtime_suspend() local
1676 qcom_qmp_phy_enable_autonomous_mode(qphy); in qcom_qmp_phy_runtime_suspend()
1678 clk_disable_unprepare(qphy->pipe_clk); in qcom_qmp_phy_runtime_suspend()
1687 struct qmp_phy *qphy = qmp->phys[0]; in qcom_qmp_phy_runtime_resume() local
1708 ret = clk_prepare_enable(qphy->pipe_clk); in qcom_qmp_phy_runtime_resume()
1715 qcom_qmp_phy_disable_autonomous_mode(qphy); in qcom_qmp_phy_runtime_resume()
1866 struct qmp_phy *qphy; in qcom_qmp_phy_create() local
1871 qphy = devm_kzalloc(dev, sizeof(*qphy), GFP_KERNEL); in qcom_qmp_phy_create()
1872 if (!qphy) in qcom_qmp_phy_create()
1881 qphy->tx = of_iomap(np, 0); in qcom_qmp_phy_create()
1882 if (!qphy->tx) in qcom_qmp_phy_create()
1885 qphy->rx = of_iomap(np, 1); in qcom_qmp_phy_create()
1886 if (!qphy->rx) in qcom_qmp_phy_create()
1889 qphy->pcs = of_iomap(np, 2); in qcom_qmp_phy_create()
1890 if (!qphy->pcs) in qcom_qmp_phy_create()
1900 qphy->tx2 = of_iomap(np, 3); in qcom_qmp_phy_create()
1901 qphy->rx2 = of_iomap(np, 4); in qcom_qmp_phy_create()
1902 if (!qphy->tx2 || !qphy->rx2) { in qcom_qmp_phy_create()
1907 qphy->pcs_misc = qphy->tx2; in qcom_qmp_phy_create()
1908 qphy->tx2 = qphy->tx + QMP_PHY_LEGACY_LANE_STRIDE; in qcom_qmp_phy_create()
1909 qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE; in qcom_qmp_phy_create()
1912 qphy->pcs_misc = of_iomap(np, 5); in qcom_qmp_phy_create()
1916 qphy->pcs_misc = of_iomap(np, 3); in qcom_qmp_phy_create()
1919 if (!qphy->pcs_misc) in qcom_qmp_phy_create()
1930 qphy->pipe_clk = of_clk_get_by_name(np, prop_name); in qcom_qmp_phy_create()
1931 if (IS_ERR(qphy->pipe_clk)) { in qcom_qmp_phy_create()
1934 ret = PTR_ERR(qphy->pipe_clk); in qcom_qmp_phy_create()
1941 qphy->pipe_clk = NULL; in qcom_qmp_phy_create()
1947 qphy->lane_rst = of_reset_control_get(np, prop_name); in qcom_qmp_phy_create()
1948 if (IS_ERR(qphy->lane_rst)) { in qcom_qmp_phy_create()
1950 return PTR_ERR(qphy->lane_rst); in qcom_qmp_phy_create()
1964 qphy->phy = generic_phy; in qcom_qmp_phy_create()
1965 qphy->index = id; in qcom_qmp_phy_create()
1966 qphy->qmp = qmp; in qcom_qmp_phy_create()
1967 qmp->phys[id] = qphy; in qcom_qmp_phy_create()
1968 phy_set_drvdata(generic_phy, qphy); in qcom_qmp_phy_create()