Lines Matching refs:dphy

494 	int (*probe)(struct cdns_dphy *dphy);
495 void (*remove)(struct cdns_dphy *dphy);
496 void (*set_psm_div)(struct cdns_dphy *dphy, u8 div);
497 void (*set_clk_lane_cfg)(struct cdns_dphy *dphy,
499 void (*set_pll_cfg)(struct cdns_dphy *dphy,
501 unsigned long (*get_wakeup_time_ns)(struct cdns_dphy *dphy);
529 struct cdns_dphy *dphy; member
548 static int cdns_dsi_get_dphy_pll_cfg(struct cdns_dphy *dphy, in cdns_dsi_get_dphy_pll_cfg() argument
558 unsigned long pll_ref_hz = clk_get_rate(dphy->pll_ref_clk); in cdns_dsi_get_dphy_pll_cfg()
683 static int cdns_dphy_setup_psm(struct cdns_dphy *dphy) in cdns_dphy_setup_psm() argument
685 unsigned long psm_clk_hz = clk_get_rate(dphy->psm_clk); in cdns_dphy_setup_psm()
692 if (dphy->ops->set_psm_div) in cdns_dphy_setup_psm()
693 dphy->ops->set_psm_div(dphy, psm_div); in cdns_dphy_setup_psm()
698 static void cdns_dphy_set_clk_lane_cfg(struct cdns_dphy *dphy, in cdns_dphy_set_clk_lane_cfg() argument
701 if (dphy->ops->set_clk_lane_cfg) in cdns_dphy_set_clk_lane_cfg()
702 dphy->ops->set_clk_lane_cfg(dphy, cfg); in cdns_dphy_set_clk_lane_cfg()
705 static void cdns_dphy_set_pll_cfg(struct cdns_dphy *dphy, in cdns_dphy_set_pll_cfg() argument
708 if (dphy->ops->set_pll_cfg) in cdns_dphy_set_pll_cfg()
709 dphy->ops->set_pll_cfg(dphy, cfg); in cdns_dphy_set_pll_cfg()
712 static unsigned long cdns_dphy_get_wakeup_time_ns(struct cdns_dphy *dphy) in cdns_dphy_get_wakeup_time_ns() argument
714 return dphy->ops->get_wakeup_time_ns(dphy); in cdns_dphy_get_wakeup_time_ns()
789 ret = cdns_dsi_get_dphy_pll_cfg(dsi->dphy, dphy_cfg, in cdns_dsi_mode2cfg()
795 ret = cdns_dsi_get_dphy_pll_cfg(dsi->dphy, dphy_cfg, in cdns_dsi_mode2cfg()
905 WARN_ON_ONCE(cdns_dphy_setup_psm(dsi->dphy)); in cdns_dsi_hs_init()
914 cdns_dphy_set_clk_lane_cfg(dsi->dphy, DPHY_CLK_CFG_LEFT_DRIVES_LEFT); in cdns_dsi_hs_init()
920 cdns_dphy_set_pll_cfg(dsi->dphy, dphy_cfg); in cdns_dsi_hs_init()
924 dsi->dphy->regs + DPHY_CMN_SSM); in cdns_dsi_hs_init()
1032 reg_wakeup = cdns_dphy_get_wakeup_time_ns(dsi->dphy) / in cdns_dsi_bridge_enable()
1347 clk_prepare_enable(dsi->dphy->psm_clk); in cdns_dsi_resume()
1348 clk_prepare_enable(dsi->dphy->pll_ref_clk); in cdns_dsi_resume()
1357 clk_disable_unprepare(dsi->dphy->pll_ref_clk); in cdns_dsi_suspend()
1358 clk_disable_unprepare(dsi->dphy->psm_clk); in cdns_dsi_suspend()
1369 static unsigned long cdns_dphy_ref_get_wakeup_time_ns(struct cdns_dphy *dphy) in cdns_dphy_ref_get_wakeup_time_ns() argument
1375 static void cdns_dphy_ref_set_pll_cfg(struct cdns_dphy *dphy, in cdns_dphy_ref_set_pll_cfg() argument
1386 dphy->regs + DPHY_CMN_OPIPDIV); in cdns_dphy_ref_set_pll_cfg()
1389 dphy->regs + DPHY_CMN_FBDIV); in cdns_dphy_ref_set_pll_cfg()
1392 dphy->regs + DPHY_CMN_PWM); in cdns_dphy_ref_set_pll_cfg()
1395 static void cdns_dphy_ref_set_psm_div(struct cdns_dphy *dphy, u8 div) in cdns_dphy_ref_set_psm_div() argument
1398 dphy->regs + DPHY_PSM_CFG); in cdns_dphy_ref_set_psm_div()
1420 struct cdns_dphy *dphy; in cdns_dphy_probe() local
1434 dphy = devm_kzalloc(&pdev->dev, sizeof(*dphy), GFP_KERNEL); in cdns_dphy_probe()
1435 if (!dphy) in cdns_dphy_probe()
1438 dphy->ops = match->data; in cdns_dphy_probe()
1444 dphy->regs = devm_ioremap_resource(&pdev->dev, &res); in cdns_dphy_probe()
1445 if (IS_ERR(dphy->regs)) in cdns_dphy_probe()
1446 return ERR_CAST(dphy->regs); in cdns_dphy_probe()
1448 dphy->psm_clk = of_clk_get_by_name(args.np, "psm"); in cdns_dphy_probe()
1449 if (IS_ERR(dphy->psm_clk)) in cdns_dphy_probe()
1450 return ERR_CAST(dphy->psm_clk); in cdns_dphy_probe()
1452 dphy->pll_ref_clk = of_clk_get_by_name(args.np, "pll_ref"); in cdns_dphy_probe()
1453 if (IS_ERR(dphy->pll_ref_clk)) { in cdns_dphy_probe()
1454 ret = PTR_ERR(dphy->pll_ref_clk); in cdns_dphy_probe()
1458 if (dphy->ops->probe) { in cdns_dphy_probe()
1459 ret = dphy->ops->probe(dphy); in cdns_dphy_probe()
1464 return dphy; in cdns_dphy_probe()
1467 clk_put(dphy->pll_ref_clk); in cdns_dphy_probe()
1470 clk_put(dphy->psm_clk); in cdns_dphy_probe()
1475 static void cdns_dphy_remove(struct cdns_dphy *dphy) in cdns_dphy_remove() argument
1477 if (dphy->ops->remove) in cdns_dphy_remove()
1478 dphy->ops->remove(dphy); in cdns_dphy_remove()
1480 clk_put(dphy->pll_ref_clk); in cdns_dphy_remove()
1481 clk_put(dphy->psm_clk); in cdns_dphy_remove()
1522 dsi->dphy = cdns_dphy_probe(pdev); in cdns_dsi_drm_probe()
1523 if (IS_ERR(dsi->dphy)) in cdns_dsi_drm_probe()
1524 return PTR_ERR(dsi->dphy); in cdns_dsi_drm_probe()
1587 cdns_dphy_remove(dsi->dphy); in cdns_dsi_drm_probe()
1598 cdns_dphy_remove(dsi->dphy); in cdns_dsi_drm_remove()