Lines Matching refs:phy_common

76 			   struct ufs_qcom_phy *phy_common)  in ufs_qcom_phy_base_init()  argument
83 phy_common->mmio = devm_ioremap_resource(dev, res); in ufs_qcom_phy_base_init()
84 if (IS_ERR((void const *)phy_common->mmio)) { in ufs_qcom_phy_base_init()
85 err = PTR_ERR((void const *)phy_common->mmio); in ufs_qcom_phy_base_init()
86 phy_common->mmio = NULL; in ufs_qcom_phy_base_init()
95 phy_common->dev_ref_clk_ctrl_mmio = devm_ioremap_resource(dev, res); in ufs_qcom_phy_base_init()
96 if (IS_ERR((void const *)phy_common->dev_ref_clk_ctrl_mmio)) in ufs_qcom_phy_base_init()
97 phy_common->dev_ref_clk_ctrl_mmio = NULL; in ufs_qcom_phy_base_init()
141 static int ufs_qcom_phy_get_reset(struct ufs_qcom_phy *phy_common) in ufs_qcom_phy_get_reset() argument
145 if (phy_common->ufs_reset) in ufs_qcom_phy_get_reset()
148 reset = devm_reset_control_get_exclusive_by_index(phy_common->dev, 0); in ufs_qcom_phy_get_reset()
152 phy_common->ufs_reset = reset; in ufs_qcom_phy_get_reset()
180 int ufs_qcom_phy_init_clks(struct ufs_qcom_phy *phy_common) in ufs_qcom_phy_init_clks() argument
184 if (of_device_is_compatible(phy_common->dev->of_node, in ufs_qcom_phy_init_clks()
188 err = ufs_qcom_phy_clk_get(phy_common->dev, "tx_iface_clk", in ufs_qcom_phy_init_clks()
189 &phy_common->tx_iface_clk); in ufs_qcom_phy_init_clks()
193 err = ufs_qcom_phy_clk_get(phy_common->dev, "rx_iface_clk", in ufs_qcom_phy_init_clks()
194 &phy_common->rx_iface_clk); in ufs_qcom_phy_init_clks()
199 err = ufs_qcom_phy_clk_get(phy_common->dev, "ref_clk_src", in ufs_qcom_phy_init_clks()
200 &phy_common->ref_clk_src); in ufs_qcom_phy_init_clks()
208 __ufs_qcom_phy_clk_get(phy_common->dev, "ref_clk_parent", in ufs_qcom_phy_init_clks()
209 &phy_common->ref_clk_parent, false); in ufs_qcom_phy_init_clks()
211 err = ufs_qcom_phy_clk_get(phy_common->dev, "ref_clk", in ufs_qcom_phy_init_clks()
212 &phy_common->ref_clk); in ufs_qcom_phy_init_clks()
268 int ufs_qcom_phy_init_vregulators(struct ufs_qcom_phy *phy_common) in ufs_qcom_phy_init_vregulators() argument
272 err = ufs_qcom_phy_init_vreg(phy_common->dev, &phy_common->vdda_pll, in ufs_qcom_phy_init_vregulators()
277 err = ufs_qcom_phy_init_vreg(phy_common->dev, &phy_common->vdda_phy, in ufs_qcom_phy_init_vregulators()
283 err = ufs_qcom_phy_init_vreg(phy_common->dev, &phy_common->vddp_ref_clk, in ufs_qcom_phy_init_vregulators()
535 struct ufs_qcom_phy *phy_common = get_ufs_qcom_phy(generic_phy); in ufs_qcom_phy_power_on() local
536 struct device *dev = phy_common->dev; in ufs_qcom_phy_power_on()
540 err = ufs_qcom_phy_get_reset(phy_common); in ufs_qcom_phy_power_on()
544 err = reset_control_assert(phy_common->ufs_reset); in ufs_qcom_phy_power_on()
548 if (phy_common->mode == PHY_MODE_UFS_HS_B) in ufs_qcom_phy_power_on()
551 err = phy_common->phy_spec_ops->calibrate(phy_common, is_rate_B); in ufs_qcom_phy_power_on()
555 err = reset_control_deassert(phy_common->ufs_reset); in ufs_qcom_phy_power_on()
561 err = ufs_qcom_phy_start_serdes(phy_common); in ufs_qcom_phy_power_on()
565 err = ufs_qcom_phy_is_pcs_ready(phy_common); in ufs_qcom_phy_power_on()
569 err = ufs_qcom_phy_enable_vreg(dev, &phy_common->vdda_phy); in ufs_qcom_phy_power_on()
576 phy_common->phy_spec_ops->power_control(phy_common, true); in ufs_qcom_phy_power_on()
579 err = ufs_qcom_phy_enable_vreg(dev, &phy_common->vdda_pll); in ufs_qcom_phy_power_on()
586 err = ufs_qcom_phy_enable_iface_clk(phy_common); in ufs_qcom_phy_power_on()
593 err = ufs_qcom_phy_enable_ref_clk(phy_common); in ufs_qcom_phy_power_on()
601 if (phy_common->vddp_ref_clk.reg) { in ufs_qcom_phy_power_on()
603 &phy_common->vddp_ref_clk); in ufs_qcom_phy_power_on()
614 ufs_qcom_phy_disable_ref_clk(phy_common); in ufs_qcom_phy_power_on()
616 ufs_qcom_phy_disable_iface_clk(phy_common); in ufs_qcom_phy_power_on()
618 ufs_qcom_phy_disable_vreg(dev, &phy_common->vdda_pll); in ufs_qcom_phy_power_on()
620 ufs_qcom_phy_disable_vreg(dev, &phy_common->vdda_phy); in ufs_qcom_phy_power_on()
628 struct ufs_qcom_phy *phy_common = get_ufs_qcom_phy(generic_phy); in ufs_qcom_phy_power_off() local
630 phy_common->phy_spec_ops->power_control(phy_common, false); in ufs_qcom_phy_power_off()
632 if (phy_common->vddp_ref_clk.reg) in ufs_qcom_phy_power_off()
633 ufs_qcom_phy_disable_vreg(phy_common->dev, in ufs_qcom_phy_power_off()
634 &phy_common->vddp_ref_clk); in ufs_qcom_phy_power_off()
635 ufs_qcom_phy_disable_ref_clk(phy_common); in ufs_qcom_phy_power_off()
636 ufs_qcom_phy_disable_iface_clk(phy_common); in ufs_qcom_phy_power_off()
638 ufs_qcom_phy_disable_vreg(phy_common->dev, &phy_common->vdda_pll); in ufs_qcom_phy_power_off()
639 ufs_qcom_phy_disable_vreg(phy_common->dev, &phy_common->vdda_phy); in ufs_qcom_phy_power_off()
640 reset_control_assert(phy_common->ufs_reset); in ufs_qcom_phy_power_off()