Lines Matching refs:sata_phy

74 	struct exynos_sata_phy *sata_phy = phy_get_drvdata(phy);  in exynos_sata_phy_power_on()  local
76 return regmap_update_bits(sata_phy->pmureg, SATAPHY_CONTROL_OFFSET, in exynos_sata_phy_power_on()
83 struct exynos_sata_phy *sata_phy = phy_get_drvdata(phy); in exynos_sata_phy_power_off() local
85 return regmap_update_bits(sata_phy->pmureg, SATAPHY_CONTROL_OFFSET, in exynos_sata_phy_power_off()
95 struct exynos_sata_phy *sata_phy = phy_get_drvdata(phy); in exynos_sata_phy_init() local
97 ret = regmap_update_bits(sata_phy->pmureg, SATAPHY_CONTROL_OFFSET, in exynos_sata_phy_init()
100 dev_err(&sata_phy->phy->dev, "phy init failed\n"); in exynos_sata_phy_init()
102 writel(val, sata_phy->regs + EXYNOS5_SATA_RESET); in exynos_sata_phy_init()
104 val = readl(sata_phy->regs + EXYNOS5_SATA_RESET); in exynos_sata_phy_init()
108 writel(val, sata_phy->regs + EXYNOS5_SATA_RESET); in exynos_sata_phy_init()
110 val = readl(sata_phy->regs + EXYNOS5_SATA_RESET); in exynos_sata_phy_init()
112 writel(val, sata_phy->regs + EXYNOS5_SATA_RESET); in exynos_sata_phy_init()
114 val = readl(sata_phy->regs + EXYNOS5_SATA_RESET); in exynos_sata_phy_init()
116 writel(val, sata_phy->regs + EXYNOS5_SATA_RESET); in exynos_sata_phy_init()
118 val = readl(sata_phy->regs + EXYNOS5_SATA_PHSATA_CTRLM); in exynos_sata_phy_init()
120 writel(val, sata_phy->regs + EXYNOS5_SATA_PHSATA_CTRLM); in exynos_sata_phy_init()
123 val = readl(sata_phy->regs + EXYNOS5_SATA_PHSATA_CTRLM); in exynos_sata_phy_init()
125 writel(val, sata_phy->regs + EXYNOS5_SATA_PHSATA_CTRLM); in exynos_sata_phy_init()
127 val = readl(sata_phy->regs + EXYNOS5_SATA_CTRL0); in exynos_sata_phy_init()
129 writel(val, sata_phy->regs + EXYNOS5_SATA_CTRL0); in exynos_sata_phy_init()
131 val = readl(sata_phy->regs + EXYNOS5_SATA_MODE0); in exynos_sata_phy_init()
133 writel(val, sata_phy->regs + EXYNOS5_SATA_MODE0); in exynos_sata_phy_init()
135 ret = i2c_master_send(sata_phy->client, buf, sizeof(buf)); in exynos_sata_phy_init()
140 val = readl(sata_phy->regs + EXYNOS5_SATA_RESET); in exynos_sata_phy_init()
142 writel(val, sata_phy->regs + EXYNOS5_SATA_RESET); in exynos_sata_phy_init()
144 val = readl(sata_phy->regs + EXYNOS5_SATA_RESET); in exynos_sata_phy_init()
146 writel(val, sata_phy->regs + EXYNOS5_SATA_RESET); in exynos_sata_phy_init()
148 ret = wait_for_reg_status(sata_phy->regs, in exynos_sata_phy_init()
152 dev_err(&sata_phy->phy->dev, in exynos_sata_phy_init()
166 struct exynos_sata_phy *sata_phy; in exynos_sata_phy_probe() local
173 sata_phy = devm_kzalloc(dev, sizeof(*sata_phy), GFP_KERNEL); in exynos_sata_phy_probe()
174 if (!sata_phy) in exynos_sata_phy_probe()
179 sata_phy->regs = devm_ioremap_resource(dev, res); in exynos_sata_phy_probe()
180 if (IS_ERR(sata_phy->regs)) in exynos_sata_phy_probe()
181 return PTR_ERR(sata_phy->regs); in exynos_sata_phy_probe()
183 sata_phy->pmureg = syscon_regmap_lookup_by_phandle(dev->of_node, in exynos_sata_phy_probe()
185 if (IS_ERR(sata_phy->pmureg)) { in exynos_sata_phy_probe()
187 return PTR_ERR(sata_phy->pmureg); in exynos_sata_phy_probe()
195 sata_phy->client = of_find_i2c_device_by_node(node); in exynos_sata_phy_probe()
196 if (!sata_phy->client) in exynos_sata_phy_probe()
199 dev_set_drvdata(dev, sata_phy); in exynos_sata_phy_probe()
201 sata_phy->phyclk = devm_clk_get(dev, "sata_phyctrl"); in exynos_sata_phy_probe()
202 if (IS_ERR(sata_phy->phyclk)) { in exynos_sata_phy_probe()
204 return PTR_ERR(sata_phy->phyclk); in exynos_sata_phy_probe()
207 ret = clk_prepare_enable(sata_phy->phyclk); in exynos_sata_phy_probe()
213 sata_phy->phy = devm_phy_create(dev, NULL, &exynos_sata_phy_ops); in exynos_sata_phy_probe()
214 if (IS_ERR(sata_phy->phy)) { in exynos_sata_phy_probe()
215 clk_disable_unprepare(sata_phy->phyclk); in exynos_sata_phy_probe()
217 return PTR_ERR(sata_phy->phy); in exynos_sata_phy_probe()
220 phy_set_drvdata(sata_phy->phy, sata_phy); in exynos_sata_phy_probe()
225 clk_disable_unprepare(sata_phy->phyclk); in exynos_sata_phy_probe()