Lines Matching refs:salvo_phy

145 static bool cdns_is_nxp_phy(struct cdns_salvo_phy *salvo_phy)  in cdns_is_nxp_phy()  argument
147 return salvo_phy->data == &cdns_nxp_salvo_data; in cdns_is_nxp_phy()
150 static u16 cdns_salvo_read(struct cdns_salvo_phy *salvo_phy, u32 offset, u32 reg) in cdns_salvo_read() argument
152 return (u16)readl(salvo_phy->base + offset + in cdns_salvo_read()
153 reg * (1 << salvo_phy->data->reg_offset_shift)); in cdns_salvo_read()
156 static void cdns_salvo_write(struct cdns_salvo_phy *salvo_phy, u32 offset, in cdns_salvo_write() argument
159 writel(val, salvo_phy->base + offset + in cdns_salvo_write()
160 reg * (1 << salvo_phy->data->reg_offset_shift)); in cdns_salvo_write()
248 struct cdns_salvo_phy *salvo_phy = phy_get_drvdata(phy); in cdns_salvo_phy_init() local
249 struct cdns_salvo_data *data = salvo_phy->data; in cdns_salvo_phy_init()
253 ret = clk_prepare_enable(salvo_phy->clk); in cdns_salvo_phy_init()
260 cdns_salvo_write(salvo_phy, USB3_PHY_OFFSET, reg_pair->off, reg_pair->val); in cdns_salvo_phy_init()
264 value = cdns_salvo_read(salvo_phy, USB3_PHY_OFFSET, TB_ADDR_TX_RCVDETSC_CTRL); in cdns_salvo_phy_init()
266 cdns_salvo_write(salvo_phy, USB3_PHY_OFFSET, TB_ADDR_TX_RCVDETSC_CTRL, in cdns_salvo_phy_init()
269 value = cdns_salvo_read(salvo_phy, USB2_PHY_OFFSET, UTMI_REG15); in cdns_salvo_phy_init()
271 cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_REG15, in cdns_salvo_phy_init()
274 cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_RX_REG5, 0x5); in cdns_salvo_phy_init()
276 value = cdns_salvo_read(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_RX_REG0); in cdns_salvo_phy_init()
278 value = FIELD_PREP(RX_USB2_DISCONN_MASK, salvo_phy->usb2_disconn); in cdns_salvo_phy_init()
279 cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_RX_REG0, value); in cdns_salvo_phy_init()
283 clk_disable_unprepare(salvo_phy->clk); in cdns_salvo_phy_init()
290 struct cdns_salvo_phy *salvo_phy = phy_get_drvdata(phy); in cdns_salvo_phy_power_on() local
292 return clk_prepare_enable(salvo_phy->clk); in cdns_salvo_phy_power_on()
297 struct cdns_salvo_phy *salvo_phy = phy_get_drvdata(phy); in cdns_salvo_phy_power_off() local
299 clk_disable_unprepare(salvo_phy->clk); in cdns_salvo_phy_power_off()
306 struct cdns_salvo_phy *salvo_phy = phy_get_drvdata(phy); in cdns_salvo_set_mode() local
308 if (!cdns_is_nxp_phy(salvo_phy)) in cdns_salvo_set_mode()
312 cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_BC_REG4, in cdns_salvo_set_mode()
315 cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_BC_REG4, in cdns_salvo_set_mode()
333 struct cdns_salvo_phy *salvo_phy; in cdns_salvo_phy_probe() local
338 salvo_phy = devm_kzalloc(dev, sizeof(*salvo_phy), GFP_KERNEL); in cdns_salvo_phy_probe()
339 if (!salvo_phy) in cdns_salvo_phy_probe()
342 salvo_phy->data = data; in cdns_salvo_phy_probe()
343 salvo_phy->clk = devm_clk_get_optional(dev, "salvo_phy_clk"); in cdns_salvo_phy_probe()
344 if (IS_ERR(salvo_phy->clk)) in cdns_salvo_phy_probe()
345 return PTR_ERR(salvo_phy->clk); in cdns_salvo_phy_probe()
351 salvo_phy->usb2_disconn = USB2_DISCONN_THRESHOLD_575; in cdns_salvo_phy_probe()
353 salvo_phy->usb2_disconn = USB2_DISCONN_THRESHOLD_610; in cdns_salvo_phy_probe()
355 salvo_phy->usb2_disconn = USB2_DISCONN_THRESHOLD_645; in cdns_salvo_phy_probe()
357 salvo_phy->base = devm_platform_ioremap_resource(pdev, 0); in cdns_salvo_phy_probe()
358 if (IS_ERR(salvo_phy->base)) in cdns_salvo_phy_probe()
359 return PTR_ERR(salvo_phy->base); in cdns_salvo_phy_probe()
361 salvo_phy->phy = devm_phy_create(dev, NULL, &cdns_salvo_phy_ops); in cdns_salvo_phy_probe()
362 if (IS_ERR(salvo_phy->phy)) in cdns_salvo_phy_probe()
363 return PTR_ERR(salvo_phy->phy); in cdns_salvo_phy_probe()
365 phy_set_drvdata(salvo_phy->phy, salvo_phy); in cdns_salvo_phy_probe()