Lines Matching refs:qphy
1997 static int qmp_usb_serdes_init(struct qmp_phy *qphy) in qmp_usb_serdes_init() argument
1999 const struct qmp_phy_cfg *cfg = qphy->cfg; in qmp_usb_serdes_init()
2000 void __iomem *serdes = qphy->serdes; in qmp_usb_serdes_init()
2011 struct qmp_phy *qphy = phy_get_drvdata(phy); in qmp_usb_init() local
2012 struct qcom_qmp *qmp = qphy->qmp; in qmp_usb_init()
2013 const struct qmp_phy_cfg *cfg = qphy->cfg; in qmp_usb_init()
2014 void __iomem *pcs = qphy->pcs; in qmp_usb_init()
2078 struct qmp_phy *qphy = phy_get_drvdata(phy); in qmp_usb_exit() local
2079 struct qcom_qmp *qmp = qphy->qmp; in qmp_usb_exit()
2080 const struct qmp_phy_cfg *cfg = qphy->cfg; in qmp_usb_exit()
2093 struct qmp_phy *qphy = phy_get_drvdata(phy); in qmp_usb_power_on() local
2094 struct qcom_qmp *qmp = qphy->qmp; in qmp_usb_power_on()
2095 const struct qmp_phy_cfg *cfg = qphy->cfg; in qmp_usb_power_on()
2096 void __iomem *tx = qphy->tx; in qmp_usb_power_on()
2097 void __iomem *rx = qphy->rx; in qmp_usb_power_on()
2098 void __iomem *pcs = qphy->pcs; in qmp_usb_power_on()
2103 qmp_usb_serdes_init(qphy); in qmp_usb_power_on()
2105 ret = clk_prepare_enable(qphy->pipe_clk); in qmp_usb_power_on()
2115 qmp_usb_configure_lane(qphy->tx2, cfg->regs, in qmp_usb_power_on()
2122 qmp_usb_configure_lane(qphy->rx2, cfg->regs, in qmp_usb_power_on()
2149 clk_disable_unprepare(qphy->pipe_clk); in qmp_usb_power_on()
2156 struct qmp_phy *qphy = phy_get_drvdata(phy); in qmp_usb_power_off() local
2157 const struct qmp_phy_cfg *cfg = qphy->cfg; in qmp_usb_power_off()
2159 clk_disable_unprepare(qphy->pipe_clk); in qmp_usb_power_off()
2162 qphy_setbits(qphy->pcs, cfg->regs[QPHY_SW_RESET], SW_RESET); in qmp_usb_power_off()
2165 qphy_clrbits(qphy->pcs, cfg->regs[QPHY_START_CTRL], in qmp_usb_power_off()
2169 qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], in qmp_usb_power_off()
2202 struct qmp_phy *qphy = phy_get_drvdata(phy); in qmp_usb_set_mode() local
2204 qphy->mode = mode; in qmp_usb_set_mode()
2209 static void qmp_usb_enable_autonomous_mode(struct qmp_phy *qphy) in qmp_usb_enable_autonomous_mode() argument
2211 const struct qmp_phy_cfg *cfg = qphy->cfg; in qmp_usb_enable_autonomous_mode()
2212 void __iomem *pcs_usb = qphy->pcs_usb ?: qphy->pcs; in qmp_usb_enable_autonomous_mode()
2213 void __iomem *pcs_misc = qphy->pcs_misc; in qmp_usb_enable_autonomous_mode()
2216 if (qphy->mode == PHY_MODE_USB_HOST_SS || in qmp_usb_enable_autonomous_mode()
2217 qphy->mode == PHY_MODE_USB_DEVICE_SS) in qmp_usb_enable_autonomous_mode()
2238 static void qmp_usb_disable_autonomous_mode(struct qmp_phy *qphy) in qmp_usb_disable_autonomous_mode() argument
2240 const struct qmp_phy_cfg *cfg = qphy->cfg; in qmp_usb_disable_autonomous_mode()
2241 void __iomem *pcs_usb = qphy->pcs_usb ?: qphy->pcs; in qmp_usb_disable_autonomous_mode()
2242 void __iomem *pcs_misc = qphy->pcs_misc; in qmp_usb_disable_autonomous_mode()
2259 struct qmp_phy *qphy = qmp->phys[0]; in qmp_usb_runtime_suspend() local
2260 const struct qmp_phy_cfg *cfg = qphy->cfg; in qmp_usb_runtime_suspend()
2262 dev_vdbg(dev, "Suspending QMP phy, mode:%d\n", qphy->mode); in qmp_usb_runtime_suspend()
2264 if (!qphy->phy->init_count) { in qmp_usb_runtime_suspend()
2269 qmp_usb_enable_autonomous_mode(qphy); in qmp_usb_runtime_suspend()
2271 clk_disable_unprepare(qphy->pipe_clk); in qmp_usb_runtime_suspend()
2280 struct qmp_phy *qphy = qmp->phys[0]; in qmp_usb_runtime_resume() local
2281 const struct qmp_phy_cfg *cfg = qphy->cfg; in qmp_usb_runtime_resume()
2284 dev_vdbg(dev, "Resuming QMP phy, mode:%d\n", qphy->mode); in qmp_usb_runtime_resume()
2286 if (!qphy->phy->init_count) { in qmp_usb_runtime_resume()
2295 ret = clk_prepare_enable(qphy->pipe_clk); in qmp_usb_runtime_resume()
2302 qmp_usb_disable_autonomous_mode(qphy); in qmp_usb_runtime_resume()
2448 struct qmp_phy *qphy; in qmp_usb_create() local
2461 qphy = devm_kzalloc(dev, sizeof(*qphy), GFP_KERNEL); in qmp_usb_create()
2462 if (!qphy) in qmp_usb_create()
2465 qphy->cfg = cfg; in qmp_usb_create()
2466 qphy->serdes = serdes; in qmp_usb_create()
2473 qphy->tx = devm_of_iomap(dev, np, 0, NULL); in qmp_usb_create()
2474 if (IS_ERR(qphy->tx)) in qmp_usb_create()
2475 return PTR_ERR(qphy->tx); in qmp_usb_create()
2477 qphy->rx = devm_of_iomap(dev, np, 1, NULL); in qmp_usb_create()
2478 if (IS_ERR(qphy->rx)) in qmp_usb_create()
2479 return PTR_ERR(qphy->rx); in qmp_usb_create()
2481 qphy->pcs = qmp_usb_iomap(dev, np, 2, exclusive); in qmp_usb_create()
2482 if (IS_ERR(qphy->pcs)) in qmp_usb_create()
2483 return PTR_ERR(qphy->pcs); in qmp_usb_create()
2486 qphy->pcs_usb = qphy->pcs + cfg->pcs_usb_offset; in qmp_usb_create()
2489 qphy->tx2 = devm_of_iomap(dev, np, 3, NULL); in qmp_usb_create()
2490 if (IS_ERR(qphy->tx2)) in qmp_usb_create()
2491 return PTR_ERR(qphy->tx2); in qmp_usb_create()
2493 qphy->rx2 = devm_of_iomap(dev, np, 4, NULL); in qmp_usb_create()
2494 if (IS_ERR(qphy->rx2)) in qmp_usb_create()
2495 return PTR_ERR(qphy->rx2); in qmp_usb_create()
2497 qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL); in qmp_usb_create()
2499 qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL); in qmp_usb_create()
2502 if (IS_ERR(qphy->pcs_misc)) { in qmp_usb_create()
2504 qphy->pcs_misc = NULL; in qmp_usb_create()
2507 qphy->pipe_clk = devm_get_clk_from_child(dev, np, NULL); in qmp_usb_create()
2508 if (IS_ERR(qphy->pipe_clk)) { in qmp_usb_create()
2509 return dev_err_probe(dev, PTR_ERR(qphy->pipe_clk), in qmp_usb_create()
2520 qphy->phy = generic_phy; in qmp_usb_create()
2521 qphy->qmp = qmp; in qmp_usb_create()
2522 qmp->phys[id] = qphy; in qmp_usb_create()
2523 phy_set_drvdata(generic_phy, qphy); in qmp_usb_create()