• Home
  • Raw
  • Download

Lines Matching refs:sp

164 	struct cdns_sierra_phy *sp;  in cdns_sierra_phy_probe()  local
175 sp = devm_kzalloc(dev, sizeof(*sp), GFP_KERNEL); in cdns_sierra_phy_probe()
176 if (!sp) in cdns_sierra_phy_probe()
178 dev_set_drvdata(dev, sp); in cdns_sierra_phy_probe()
179 sp->dev = dev; in cdns_sierra_phy_probe()
182 sp->base = devm_ioremap_resource(dev, res); in cdns_sierra_phy_probe()
183 if (IS_ERR(sp->base)) { in cdns_sierra_phy_probe()
185 return PTR_ERR(sp->base); in cdns_sierra_phy_probe()
192 sp->init_data = (struct cdns_sierra_data *)match->data; in cdns_sierra_phy_probe()
194 platform_set_drvdata(pdev, sp); in cdns_sierra_phy_probe()
196 sp->clk = devm_clk_get(dev, "phy_clk"); in cdns_sierra_phy_probe()
197 if (IS_ERR(sp->clk)) { in cdns_sierra_phy_probe()
199 return PTR_ERR(sp->clk); in cdns_sierra_phy_probe()
202 sp->phy_rst = devm_reset_control_get(dev, "sierra_reset"); in cdns_sierra_phy_probe()
203 if (IS_ERR(sp->phy_rst)) { in cdns_sierra_phy_probe()
205 return PTR_ERR(sp->phy_rst); in cdns_sierra_phy_probe()
208 sp->apb_rst = devm_reset_control_get(dev, "sierra_apb"); in cdns_sierra_phy_probe()
209 if (IS_ERR(sp->apb_rst)) { in cdns_sierra_phy_probe()
211 return PTR_ERR(sp->apb_rst); in cdns_sierra_phy_probe()
214 ret = clk_prepare_enable(sp->clk); in cdns_sierra_phy_probe()
219 reset_control_deassert(sp->apb_rst); in cdns_sierra_phy_probe()
222 if (sp->init_data->id_value != readl(sp->base)) { in cdns_sierra_phy_probe()
227 sp->autoconf = of_property_read_bool(dn, "cdns,autoconf"); in cdns_sierra_phy_probe()
232 sp->phys[node].lnk_rst = in cdns_sierra_phy_probe()
235 if (IS_ERR(sp->phys[node].lnk_rst)) { in cdns_sierra_phy_probe()
238 ret = PTR_ERR(sp->phys[node].lnk_rst); in cdns_sierra_phy_probe()
242 if (!sp->autoconf) { in cdns_sierra_phy_probe()
243 ret = cdns_sierra_get_optional(&sp->phys[node], child); in cdns_sierra_phy_probe()
257 sp->phys[node].phy = gphy; in cdns_sierra_phy_probe()
258 phy_set_drvdata(gphy, &sp->phys[node]); in cdns_sierra_phy_probe()
261 if (!sp->autoconf) in cdns_sierra_phy_probe()
266 sp->nsubnodes = node; in cdns_sierra_phy_probe()
269 if (!sp->autoconf && sp->nsubnodes > 1) in cdns_sierra_phy_probe()
270 writel(2, sp->base + SIERRA_PHY_PLL_CFG); in cdns_sierra_phy_probe()
274 reset_control_deassert(sp->phy_rst); in cdns_sierra_phy_probe()
281 reset_control_put(sp->phys[i].lnk_rst); in cdns_sierra_phy_probe()
284 clk_disable_unprepare(sp->clk); in cdns_sierra_phy_probe()
285 reset_control_assert(sp->apb_rst); in cdns_sierra_phy_probe()