Lines Matching refs:am62

138 static inline u32 dwc3_ti_readl(struct dwc3_am62 *am62, u32 offset)  in dwc3_ti_readl()  argument
140 return readl((am62->usbss) + offset); in dwc3_ti_readl()
143 static inline void dwc3_ti_writel(struct dwc3_am62 *am62, u32 offset, u32 value) in dwc3_ti_writel() argument
145 writel(value, (am62->usbss) + offset); in dwc3_ti_writel()
148 static int phy_syscon_pll_refclk(struct dwc3_am62 *am62) in phy_syscon_pll_refclk() argument
150 struct device *dev = am62->dev; in phy_syscon_pll_refclk()
162 am62->syscon = syscon; in phy_syscon_pll_refclk()
169 am62->offset = args.args[0]; in phy_syscon_pll_refclk()
172 ret = regmap_update_bits(am62->syscon, am62->offset, PHY_CORE_VOLTAGE_MASK, 0); in phy_syscon_pll_refclk()
178 ret = regmap_update_bits(am62->syscon, am62->offset, PHY_PLL_REFCLK_MASK, am62->rate_code); in phy_syscon_pll_refclk()
191 struct dwc3_am62 *am62; in dwc3_ti_probe() local
197 am62 = devm_kzalloc(dev, sizeof(*am62), GFP_KERNEL); in dwc3_ti_probe()
198 if (!am62) in dwc3_ti_probe()
201 am62->dev = dev; in dwc3_ti_probe()
202 platform_set_drvdata(pdev, am62); in dwc3_ti_probe()
204 am62->usbss = devm_platform_ioremap_resource(pdev, 0); in dwc3_ti_probe()
205 if (IS_ERR(am62->usbss)) { in dwc3_ti_probe()
207 return PTR_ERR(am62->usbss); in dwc3_ti_probe()
210 am62->usb2_refclk = devm_clk_get(dev, "ref"); in dwc3_ti_probe()
211 if (IS_ERR(am62->usb2_refclk)) { in dwc3_ti_probe()
213 return PTR_ERR(am62->usb2_refclk); in dwc3_ti_probe()
217 rate = clk_get_rate(am62->usb2_refclk); in dwc3_ti_probe()
229 am62->rate_code = i; in dwc3_ti_probe()
232 ret = phy_syscon_pll_refclk(am62); in dwc3_ti_probe()
248 am62->vbus_divider = device_property_read_bool(dev, "ti,vbus-divider"); in dwc3_ti_probe()
249 reg = dwc3_ti_readl(am62, USBSS_PHY_CONFIG); in dwc3_ti_probe()
250 if (am62->vbus_divider) in dwc3_ti_probe()
253 dwc3_ti_writel(am62, USBSS_PHY_CONFIG, reg); in dwc3_ti_probe()
261 clk_prepare_enable(am62->usb2_refclk); in dwc3_ti_probe()
271 reg = dwc3_ti_readl(am62, USBSS_MODE_CONTROL); in dwc3_ti_probe()
273 dwc3_ti_writel(am62, USBSS_MODE_CONTROL, reg); in dwc3_ti_probe()
289 clk_disable_unprepare(am62->usb2_refclk); in dwc3_ti_probe()
298 struct dwc3_am62 *am62 = platform_get_drvdata(pdev); in dwc3_ti_remove() local
306 reg = dwc3_ti_readl(am62, USBSS_MODE_CONTROL); in dwc3_ti_remove()
308 dwc3_ti_writel(am62, USBSS_MODE_CONTROL, reg); in dwc3_ti_remove()
319 struct dwc3_am62 *am62 = dev_get_drvdata(dev); in dwc3_ti_suspend_common() local
323 reg = dwc3_ti_readl(am62, USBSS_CORE_STAT); in dwc3_ti_suspend_common()
327 reg = dwc3_ti_readl(am62, USBSS_WAKEUP_CONFIG); in dwc3_ti_suspend_common()
337 dwc3_ti_writel(am62, USBSS_WAKEUP_CONFIG, reg); in dwc3_ti_suspend_common()
339 dwc3_ti_writel(am62, USBSS_WAKEUP_STAT, USBSS_WAKEUP_STAT_CLR); in dwc3_ti_suspend_common()
342 clk_disable_unprepare(am62->usb2_refclk); in dwc3_ti_suspend_common()
349 struct dwc3_am62 *am62 = dev_get_drvdata(dev); in dwc3_ti_resume_common() local
352 clk_prepare_enable(am62->usb2_refclk); in dwc3_ti_resume_common()
356 dwc3_ti_writel(am62, USBSS_WAKEUP_CONFIG, USBSS_WAKEUP_CFG_NONE); in dwc3_ti_resume_common()
359 reg = dwc3_ti_readl(am62, USBSS_WAKEUP_STAT); in dwc3_ti_resume_common()
360 am62->wakeup_stat = reg; in dwc3_ti_resume_common()