Lines Matching +full:sata +full:- +full:phy

1 // SPDX-License-Identifier: GPL-2.0-only
16 #include <linux/phy/phy.h>
18 /* PHY registers */
84 static int qcom_apq8064_sata_phy_init(struct phy *generic_phy) in qcom_apq8064_sata_phy_init()
86 struct qcom_apq8064_sata_phy *phy = phy_get_drvdata(generic_phy); in qcom_apq8064_sata_phy_init() local
87 void __iomem *base = phy->mmio; in qcom_apq8064_sata_phy_init()
90 /* SATA phy initialization */ in qcom_apq8064_sata_phy_init()
137 dev_err(phy->dev, "poll timeout UNIPHY_PLL_STATUS\n"); in qcom_apq8064_sata_phy_init()
144 dev_err(phy->dev, "poll timeout SATA_PHY_TX_IMCAL_STAT\n"); in qcom_apq8064_sata_phy_init()
151 dev_err(phy->dev, "poll timeout SATA_PHY_RX_IMCAL_STAT\n"); in qcom_apq8064_sata_phy_init()
155 /* SATA phy calibrated successfully, power up to functional mode */ in qcom_apq8064_sata_phy_init()
179 static int qcom_apq8064_sata_phy_exit(struct phy *generic_phy) in qcom_apq8064_sata_phy_exit()
181 struct qcom_apq8064_sata_phy *phy = phy_get_drvdata(generic_phy); in qcom_apq8064_sata_phy_exit() local
182 void __iomem *base = phy->mmio; in qcom_apq8064_sata_phy_exit()
184 /* Power down PHY */ in qcom_apq8064_sata_phy_exit()
202 struct qcom_apq8064_sata_phy *phy; in qcom_apq8064_sata_phy_probe() local
203 struct device *dev = &pdev->dev; in qcom_apq8064_sata_phy_probe()
205 struct phy *generic_phy; in qcom_apq8064_sata_phy_probe()
208 phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); in qcom_apq8064_sata_phy_probe()
209 if (!phy) in qcom_apq8064_sata_phy_probe()
210 return -ENOMEM; in qcom_apq8064_sata_phy_probe()
212 phy->mmio = devm_platform_ioremap_resource(pdev, 0); in qcom_apq8064_sata_phy_probe()
213 if (IS_ERR(phy->mmio)) in qcom_apq8064_sata_phy_probe()
214 return PTR_ERR(phy->mmio); in qcom_apq8064_sata_phy_probe()
218 dev_err(dev, "%s: failed to create phy\n", __func__); in qcom_apq8064_sata_phy_probe()
222 phy->dev = dev; in qcom_apq8064_sata_phy_probe()
223 phy_set_drvdata(generic_phy, phy); in qcom_apq8064_sata_phy_probe()
224 platform_set_drvdata(pdev, phy); in qcom_apq8064_sata_phy_probe()
226 phy->cfg_clk = devm_clk_get(dev, "cfg"); in qcom_apq8064_sata_phy_probe()
227 if (IS_ERR(phy->cfg_clk)) { in qcom_apq8064_sata_phy_probe()
228 dev_err(dev, "Failed to get sata cfg clock\n"); in qcom_apq8064_sata_phy_probe()
229 return PTR_ERR(phy->cfg_clk); in qcom_apq8064_sata_phy_probe()
232 ret = clk_prepare_enable(phy->cfg_clk); in qcom_apq8064_sata_phy_probe()
238 clk_disable_unprepare(phy->cfg_clk); in qcom_apq8064_sata_phy_probe()
239 dev_err(dev, "%s: failed to register phy\n", __func__); in qcom_apq8064_sata_phy_probe()
248 struct qcom_apq8064_sata_phy *phy = platform_get_drvdata(pdev); in qcom_apq8064_sata_phy_remove() local
250 clk_disable_unprepare(phy->cfg_clk); in qcom_apq8064_sata_phy_remove()
254 { .compatible = "qcom,apq8064-sata-phy" },
263 .name = "qcom-apq8064-sata-phy",
269 MODULE_DESCRIPTION("QCOM apq8064 SATA PHY driver");