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()
438 int ufs_qcom_phy_disable_vreg(struct phy *phy, in ufs_qcom_phy_disable_vreg() argument
441 struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(phy); in ufs_qcom_phy_disable_vreg()
452 ufs_qcom_phy_cfg_vreg(phy, vreg, false); in ufs_qcom_phy_disable_vreg()
462 void ufs_qcom_phy_disable_ref_clk(struct phy *generic_phy) in ufs_qcom_phy_disable_ref_clk()
464 struct ufs_qcom_phy *phy = get_ufs_qcom_phy(generic_phy); in ufs_qcom_phy_disable_ref_clk() local
466 if (phy->is_ref_clk_enabled) { in ufs_qcom_phy_disable_ref_clk()
467 clk_disable_unprepare(phy->ref_clk); in ufs_qcom_phy_disable_ref_clk()
472 if (phy->ref_clk_parent) in ufs_qcom_phy_disable_ref_clk()
473 clk_disable_unprepare(phy->ref_clk_parent); in ufs_qcom_phy_disable_ref_clk()
474 clk_disable_unprepare(phy->ref_clk_src); in ufs_qcom_phy_disable_ref_clk()
475 phy->is_ref_clk_enabled = false; in ufs_qcom_phy_disable_ref_clk()
482 static void ufs_qcom_phy_dev_ref_clk_ctrl(struct phy *generic_phy, bool enable) in ufs_qcom_phy_dev_ref_clk_ctrl()
484 struct ufs_qcom_phy *phy = get_ufs_qcom_phy(generic_phy); in ufs_qcom_phy_dev_ref_clk_ctrl() local
486 if (phy->dev_ref_clk_ctrl_mmio && in ufs_qcom_phy_dev_ref_clk_ctrl()
487 (enable ^ phy->is_dev_ref_clk_enabled)) { in ufs_qcom_phy_dev_ref_clk_ctrl()
488 u32 temp = readl_relaxed(phy->dev_ref_clk_ctrl_mmio); in ufs_qcom_phy_dev_ref_clk_ctrl()
503 writel_relaxed(temp, phy->dev_ref_clk_ctrl_mmio); in ufs_qcom_phy_dev_ref_clk_ctrl()
514 phy->is_dev_ref_clk_enabled = enable; in ufs_qcom_phy_dev_ref_clk_ctrl()
518 void ufs_qcom_phy_enable_dev_ref_clk(struct phy *generic_phy) in ufs_qcom_phy_enable_dev_ref_clk()
524 void ufs_qcom_phy_disable_dev_ref_clk(struct phy *generic_phy) in ufs_qcom_phy_disable_dev_ref_clk()
531 int ufs_qcom_phy_enable_iface_clk(struct phy *generic_phy) in ufs_qcom_phy_enable_iface_clk()
533 struct ufs_qcom_phy *phy = get_ufs_qcom_phy(generic_phy); in ufs_qcom_phy_enable_iface_clk() local
536 if (phy->is_iface_clk_enabled) in ufs_qcom_phy_enable_iface_clk()
539 ret = clk_prepare_enable(phy->tx_iface_clk); in ufs_qcom_phy_enable_iface_clk()
541 dev_err(phy->dev, "%s: tx_iface_clk enable failed %d\n", in ufs_qcom_phy_enable_iface_clk()
545 ret = clk_prepare_enable(phy->rx_iface_clk); in ufs_qcom_phy_enable_iface_clk()
547 clk_disable_unprepare(phy->tx_iface_clk); in ufs_qcom_phy_enable_iface_clk()
548 dev_err(phy->dev, "%s: rx_iface_clk enable failed %d. disabling also tx_iface_clk\n", in ufs_qcom_phy_enable_iface_clk()
552 phy->is_iface_clk_enabled = true; in ufs_qcom_phy_enable_iface_clk()
560 void ufs_qcom_phy_disable_iface_clk(struct phy *generic_phy) in ufs_qcom_phy_disable_iface_clk()
562 struct ufs_qcom_phy *phy = get_ufs_qcom_phy(generic_phy); in ufs_qcom_phy_disable_iface_clk() local
564 if (phy->is_iface_clk_enabled) { in ufs_qcom_phy_disable_iface_clk()
565 clk_disable_unprepare(phy->tx_iface_clk); in ufs_qcom_phy_disable_iface_clk()
566 clk_disable_unprepare(phy->rx_iface_clk); in ufs_qcom_phy_disable_iface_clk()
567 phy->is_iface_clk_enabled = false; in ufs_qcom_phy_disable_iface_clk()
572 int ufs_qcom_phy_start_serdes(struct phy *generic_phy) in ufs_qcom_phy_start_serdes()
589 int ufs_qcom_phy_set_tx_lane_enable(struct phy *generic_phy, u32 tx_lanes) in ufs_qcom_phy_set_tx_lane_enable()
607 void ufs_qcom_phy_save_controller_version(struct phy *generic_phy, in ufs_qcom_phy_save_controller_version()
618 int ufs_qcom_phy_calibrate_phy(struct phy *generic_phy, bool is_rate_B) in ufs_qcom_phy_calibrate_phy()
639 int ufs_qcom_phy_remove(struct phy *generic_phy, in ufs_qcom_phy_remove()
651 int ufs_qcom_phy_exit(struct phy *generic_phy) in ufs_qcom_phy_exit()
662 int ufs_qcom_phy_is_pcs_ready(struct phy *generic_phy) in ufs_qcom_phy_is_pcs_ready()
677 int ufs_qcom_phy_power_on(struct phy *generic_phy) in ufs_qcom_phy_power_on()
732 int ufs_qcom_phy_power_off(struct phy *generic_phy) in ufs_qcom_phy_power_off()