Lines Matching refs:d_phy

34 	struct da8xx_usb_phy *d_phy = phy_get_drvdata(phy);  in da8xx_usb11_phy_power_on()  local
37 ret = clk_prepare_enable(d_phy->usb11_clk); in da8xx_usb11_phy_power_on()
41 regmap_write_bits(d_phy->regmap, CFGCHIP(2), CFGCHIP2_USB1SUSPENDM, in da8xx_usb11_phy_power_on()
48 pm_runtime_get_sync(d_phy->dev); in da8xx_usb11_phy_power_on()
55 struct da8xx_usb_phy *d_phy = phy_get_drvdata(phy); in da8xx_usb11_phy_power_off() local
57 regmap_write_bits(d_phy->regmap, CFGCHIP(2), CFGCHIP2_USB1SUSPENDM, 0); in da8xx_usb11_phy_power_off()
59 clk_disable_unprepare(d_phy->usb11_clk); in da8xx_usb11_phy_power_off()
60 pm_runtime_put_sync(d_phy->dev); in da8xx_usb11_phy_power_off()
73 struct da8xx_usb_phy *d_phy = phy_get_drvdata(phy); in da8xx_usb20_phy_power_on() local
76 ret = clk_prepare_enable(d_phy->usb20_clk); in da8xx_usb20_phy_power_on()
80 regmap_write_bits(d_phy->regmap, CFGCHIP(2), CFGCHIP2_OTGPWRDN, 0); in da8xx_usb20_phy_power_on()
87 struct da8xx_usb_phy *d_phy = phy_get_drvdata(phy); in da8xx_usb20_phy_power_off() local
89 regmap_write_bits(d_phy->regmap, CFGCHIP(2), CFGCHIP2_OTGPWRDN, in da8xx_usb20_phy_power_off()
92 clk_disable_unprepare(d_phy->usb20_clk); in da8xx_usb20_phy_power_off()
100 struct da8xx_usb_phy *d_phy = phy_get_drvdata(phy); in da8xx_usb20_phy_set_mode() local
117 regmap_write_bits(d_phy->regmap, CFGCHIP(2), CFGCHIP2_OTGMODE_MASK, in da8xx_usb20_phy_set_mode()
132 struct da8xx_usb_phy *d_phy = dev_get_drvdata(dev); in da8xx_runtime_suspend() local
136 regmap_set_bits(d_phy->regmap, CFGCHIP(2), CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN); in da8xx_runtime_suspend()
144 struct da8xx_usb_phy *d_phy = dev_get_drvdata(dev); in da8xx_runtime_resume() local
147 regmap_update_bits(d_phy->regmap, CFGCHIP(2), mask, CFGCHIP2_PHY_PLLON); in da8xx_runtime_resume()
151 return regmap_read_poll_timeout(d_phy->regmap, CFGCHIP(2), pll_status, in da8xx_runtime_resume()
162 struct da8xx_usb_phy *d_phy = dev_get_drvdata(dev); in da8xx_usb_phy_of_xlate() local
164 if (!d_phy) in da8xx_usb_phy_of_xlate()
169 return d_phy->usb20_phy; in da8xx_usb_phy_of_xlate()
171 return d_phy->usb11_phy; in da8xx_usb_phy_of_xlate()
182 struct da8xx_usb_phy *d_phy; in da8xx_usb_phy_probe() local
184 d_phy = devm_kzalloc(dev, sizeof(*d_phy), GFP_KERNEL); in da8xx_usb_phy_probe()
185 if (!d_phy) in da8xx_usb_phy_probe()
188 d_phy->dev = dev; in da8xx_usb_phy_probe()
191 d_phy->regmap = pdata->cfgchip; in da8xx_usb_phy_probe()
193 d_phy->regmap = syscon_regmap_lookup_by_compatible( in da8xx_usb_phy_probe()
195 if (IS_ERR(d_phy->regmap)) { in da8xx_usb_phy_probe()
197 return PTR_ERR(d_phy->regmap); in da8xx_usb_phy_probe()
200 d_phy->usb11_clk = devm_clk_get(dev, "usb1_clk48"); in da8xx_usb_phy_probe()
201 if (IS_ERR(d_phy->usb11_clk)) { in da8xx_usb_phy_probe()
203 return PTR_ERR(d_phy->usb11_clk); in da8xx_usb_phy_probe()
206 d_phy->usb20_clk = devm_clk_get(dev, "usb0_clk48"); in da8xx_usb_phy_probe()
207 if (IS_ERR(d_phy->usb20_clk)) { in da8xx_usb_phy_probe()
209 return PTR_ERR(d_phy->usb20_clk); in da8xx_usb_phy_probe()
212 d_phy->usb11_phy = devm_phy_create(dev, node, &da8xx_usb11_phy_ops); in da8xx_usb_phy_probe()
213 if (IS_ERR(d_phy->usb11_phy)) { in da8xx_usb_phy_probe()
215 return PTR_ERR(d_phy->usb11_phy); in da8xx_usb_phy_probe()
218 d_phy->usb20_phy = devm_phy_create(dev, node, &da8xx_usb20_phy_ops); in da8xx_usb_phy_probe()
219 if (IS_ERR(d_phy->usb20_phy)) { in da8xx_usb_phy_probe()
221 return PTR_ERR(d_phy->usb20_phy); in da8xx_usb_phy_probe()
224 platform_set_drvdata(pdev, d_phy); in da8xx_usb_phy_probe()
225 phy_set_drvdata(d_phy->usb11_phy, d_phy); in da8xx_usb_phy_probe()
226 phy_set_drvdata(d_phy->usb20_phy, d_phy); in da8xx_usb_phy_probe()
229 d_phy->phy_provider = devm_of_phy_provider_register(dev, in da8xx_usb_phy_probe()
231 if (IS_ERR(d_phy->phy_provider)) { in da8xx_usb_phy_probe()
233 return PTR_ERR(d_phy->phy_provider); in da8xx_usb_phy_probe()
238 ret = phy_create_lookup(d_phy->usb11_phy, "usb-phy", in da8xx_usb_phy_probe()
242 ret = phy_create_lookup(d_phy->usb20_phy, "usb-phy", in da8xx_usb_phy_probe()
248 regmap_write_bits(d_phy->regmap, CFGCHIP(2), in da8xx_usb_phy_probe()
264 struct da8xx_usb_phy *d_phy = platform_get_drvdata(pdev); in da8xx_usb_phy_remove() local
267 phy_remove_lookup(d_phy->usb20_phy, "usb-phy", "musb-da8xx"); in da8xx_usb_phy_remove()
268 phy_remove_lookup(d_phy->usb11_phy, "usb-phy", "ohci-da8xx"); in da8xx_usb_phy_remove()