Lines Matching refs:phy
25 static int __ufs_qcom_phy_init_vreg(struct phy *, struct ufs_qcom_phy_vreg *,
27 static int ufs_qcom_phy_init_vreg(struct phy *, struct ufs_qcom_phy_vreg *,
78 struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev, in ufs_qcom_phy_generic_probe()
85 struct phy *generic_phy = NULL; in ufs_qcom_phy_generic_probe()
123 struct ufs_qcom_phy *get_ufs_qcom_phy(struct phy *generic_phy) in get_ufs_qcom_phy()
157 static int __ufs_qcom_phy_clk_get(struct phy *phy, in __ufs_qcom_phy_clk_get() argument
162 struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(phy); in __ufs_qcom_phy_clk_get()
178 int ufs_qcom_phy_clk_get(struct phy *phy, in ufs_qcom_phy_clk_get() argument
181 return __ufs_qcom_phy_clk_get(phy, name, clk_out, true); in ufs_qcom_phy_clk_get()
185 ufs_qcom_phy_init_clks(struct phy *generic_phy, in ufs_qcom_phy_init_clks()
221 ufs_qcom_phy_init_vregulators(struct phy *generic_phy, in ufs_qcom_phy_init_vregulators()
245 static int __ufs_qcom_phy_init_vreg(struct phy *phy, in __ufs_qcom_phy_init_vreg() argument
249 struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(phy); in __ufs_qcom_phy_init_vreg()
309 static int ufs_qcom_phy_init_vreg(struct phy *phy, in ufs_qcom_phy_init_vreg() argument
312 return __ufs_qcom_phy_init_vreg(phy, vreg, name, false); in ufs_qcom_phy_init_vreg()
316 int ufs_qcom_phy_cfg_vreg(struct phy *phy, in ufs_qcom_phy_cfg_vreg() argument
324 struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(phy); in ufs_qcom_phy_cfg_vreg()
356 int ufs_qcom_phy_enable_vreg(struct phy *phy, in ufs_qcom_phy_enable_vreg() argument
359 struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(phy); in ufs_qcom_phy_enable_vreg()
366 ret = ufs_qcom_phy_cfg_vreg(phy, vreg, true); in ufs_qcom_phy_enable_vreg()
385 int ufs_qcom_phy_enable_ref_clk(struct phy *generic_phy) in ufs_qcom_phy_enable_ref_clk()
388 struct ufs_qcom_phy *phy = get_ufs_qcom_phy(generic_phy); in ufs_qcom_phy_enable_ref_clk() local
390 if (phy->is_ref_clk_enabled) in ufs_qcom_phy_enable_ref_clk()
397 ret = clk_prepare_enable(phy->ref_clk_src); in ufs_qcom_phy_enable_ref_clk()
399 dev_err(phy->dev, "%s: ref_clk_src enable failed %d\n", in ufs_qcom_phy_enable_ref_clk()
408 if (phy->ref_clk_parent) { in ufs_qcom_phy_enable_ref_clk()
409 ret = clk_prepare_enable(phy->ref_clk_parent); in ufs_qcom_phy_enable_ref_clk()
411 dev_err(phy->dev, "%s: ref_clk_parent enable failed %d\n", in ufs_qcom_phy_enable_ref_clk()
417 ret = clk_prepare_enable(phy->ref_clk); in ufs_qcom_phy_enable_ref_clk()
419 dev_err(phy->dev, "%s: ref_clk enable failed %d\n", in ufs_qcom_phy_enable_ref_clk()
424 phy->is_ref_clk_enabled = true; in ufs_qcom_phy_enable_ref_clk()
428 if (phy->ref_clk_parent) in ufs_qcom_phy_enable_ref_clk()
429 clk_disable_unprepare(phy->ref_clk_parent); in ufs_qcom_phy_enable_ref_clk()
431 clk_disable_unprepare(phy->ref_clk_src); in ufs_qcom_phy_enable_ref_clk()
437 int ufs_qcom_phy_disable_vreg(struct phy *phy, in ufs_qcom_phy_disable_vreg() argument
440 struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(phy); in ufs_qcom_phy_disable_vreg()
451 ufs_qcom_phy_cfg_vreg(phy, vreg, false); in ufs_qcom_phy_disable_vreg()
461 void ufs_qcom_phy_disable_ref_clk(struct phy *generic_phy) in ufs_qcom_phy_disable_ref_clk()
463 struct ufs_qcom_phy *phy = get_ufs_qcom_phy(generic_phy); in ufs_qcom_phy_disable_ref_clk() local
465 if (phy->is_ref_clk_enabled) { in ufs_qcom_phy_disable_ref_clk()
466 clk_disable_unprepare(phy->ref_clk); in ufs_qcom_phy_disable_ref_clk()
471 if (phy->ref_clk_parent) in ufs_qcom_phy_disable_ref_clk()
472 clk_disable_unprepare(phy->ref_clk_parent); in ufs_qcom_phy_disable_ref_clk()
473 clk_disable_unprepare(phy->ref_clk_src); in ufs_qcom_phy_disable_ref_clk()
474 phy->is_ref_clk_enabled = false; in ufs_qcom_phy_disable_ref_clk()
480 static void ufs_qcom_phy_dev_ref_clk_ctrl(struct phy *generic_phy, bool enable) in ufs_qcom_phy_dev_ref_clk_ctrl()
482 struct ufs_qcom_phy *phy = get_ufs_qcom_phy(generic_phy); in ufs_qcom_phy_dev_ref_clk_ctrl() local
484 if (phy->dev_ref_clk_ctrl_mmio && in ufs_qcom_phy_dev_ref_clk_ctrl()
485 (enable ^ phy->is_dev_ref_clk_enabled)) { in ufs_qcom_phy_dev_ref_clk_ctrl()
486 u32 temp = readl_relaxed(phy->dev_ref_clk_ctrl_mmio); in ufs_qcom_phy_dev_ref_clk_ctrl()
501 writel_relaxed(temp, phy->dev_ref_clk_ctrl_mmio); in ufs_qcom_phy_dev_ref_clk_ctrl()
512 phy->is_dev_ref_clk_enabled = enable; in ufs_qcom_phy_dev_ref_clk_ctrl()
516 void ufs_qcom_phy_enable_dev_ref_clk(struct phy *generic_phy) in ufs_qcom_phy_enable_dev_ref_clk()
521 void ufs_qcom_phy_disable_dev_ref_clk(struct phy *generic_phy) in ufs_qcom_phy_disable_dev_ref_clk()
527 int ufs_qcom_phy_enable_iface_clk(struct phy *generic_phy) in ufs_qcom_phy_enable_iface_clk()
529 struct ufs_qcom_phy *phy = get_ufs_qcom_phy(generic_phy); in ufs_qcom_phy_enable_iface_clk() local
532 if (phy->is_iface_clk_enabled) in ufs_qcom_phy_enable_iface_clk()
535 ret = clk_prepare_enable(phy->tx_iface_clk); in ufs_qcom_phy_enable_iface_clk()
537 dev_err(phy->dev, "%s: tx_iface_clk enable failed %d\n", in ufs_qcom_phy_enable_iface_clk()
541 ret = clk_prepare_enable(phy->rx_iface_clk); in ufs_qcom_phy_enable_iface_clk()
543 clk_disable_unprepare(phy->tx_iface_clk); in ufs_qcom_phy_enable_iface_clk()
544 dev_err(phy->dev, "%s: rx_iface_clk enable failed %d. disabling also tx_iface_clk\n", in ufs_qcom_phy_enable_iface_clk()
548 phy->is_iface_clk_enabled = true; in ufs_qcom_phy_enable_iface_clk()
555 void ufs_qcom_phy_disable_iface_clk(struct phy *generic_phy) in ufs_qcom_phy_disable_iface_clk()
557 struct ufs_qcom_phy *phy = get_ufs_qcom_phy(generic_phy); in ufs_qcom_phy_disable_iface_clk() local
559 if (phy->is_iface_clk_enabled) { in ufs_qcom_phy_disable_iface_clk()
560 clk_disable_unprepare(phy->tx_iface_clk); in ufs_qcom_phy_disable_iface_clk()
561 clk_disable_unprepare(phy->rx_iface_clk); in ufs_qcom_phy_disable_iface_clk()
562 phy->is_iface_clk_enabled = false; in ufs_qcom_phy_disable_iface_clk()
566 int ufs_qcom_phy_start_serdes(struct phy *generic_phy) in ufs_qcom_phy_start_serdes()
582 int ufs_qcom_phy_set_tx_lane_enable(struct phy *generic_phy, u32 tx_lanes) in ufs_qcom_phy_set_tx_lane_enable()
599 void ufs_qcom_phy_save_controller_version(struct phy *generic_phy, in ufs_qcom_phy_save_controller_version()
609 int ufs_qcom_phy_calibrate_phy(struct phy *generic_phy, bool is_rate_B) in ufs_qcom_phy_calibrate_phy()
629 int ufs_qcom_phy_remove(struct phy *generic_phy, in ufs_qcom_phy_remove()
641 int ufs_qcom_phy_exit(struct phy *generic_phy) in ufs_qcom_phy_exit()
652 int ufs_qcom_phy_is_pcs_ready(struct phy *generic_phy) in ufs_qcom_phy_is_pcs_ready()
666 int ufs_qcom_phy_power_on(struct phy *generic_phy) in ufs_qcom_phy_power_on()
721 int ufs_qcom_phy_power_off(struct phy *generic_phy) in ufs_qcom_phy_power_off()