Lines Matching refs:ohci_at91

73 static void at91_start_clock(struct ohci_at91_priv *ohci_at91)  in at91_start_clock()  argument
75 if (ohci_at91->clocked) in at91_start_clock()
78 clk_set_rate(ohci_at91->fclk, 48000000); in at91_start_clock()
79 clk_prepare_enable(ohci_at91->hclk); in at91_start_clock()
80 clk_prepare_enable(ohci_at91->iclk); in at91_start_clock()
81 clk_prepare_enable(ohci_at91->fclk); in at91_start_clock()
82 ohci_at91->clocked = true; in at91_start_clock()
85 static void at91_stop_clock(struct ohci_at91_priv *ohci_at91) in at91_stop_clock() argument
87 if (!ohci_at91->clocked) in at91_stop_clock()
90 clk_disable_unprepare(ohci_at91->fclk); in at91_stop_clock()
91 clk_disable_unprepare(ohci_at91->iclk); in at91_stop_clock()
92 clk_disable_unprepare(ohci_at91->hclk); in at91_stop_clock()
93 ohci_at91->clocked = false; in at91_stop_clock()
100 struct ohci_at91_priv *ohci_at91 = hcd_to_ohci_at91_priv(hcd); in at91_start_hc() local
107 at91_start_clock(ohci_at91); in at91_start_hc()
118 struct ohci_at91_priv *ohci_at91 = hcd_to_ohci_at91_priv(hcd); in at91_stop_hc() local
130 at91_stop_clock(ohci_at91); in at91_stop_hc()
187 struct ohci_at91_priv *ohci_at91; in usb_hcd_at91_probe() local
199 ohci_at91 = hcd_to_ohci_at91_priv(hcd); in usb_hcd_at91_probe()
209 ohci_at91->iclk = devm_clk_get(dev, "ohci_clk"); in usb_hcd_at91_probe()
210 if (IS_ERR(ohci_at91->iclk)) { in usb_hcd_at91_probe()
212 retval = PTR_ERR(ohci_at91->iclk); in usb_hcd_at91_probe()
215 ohci_at91->fclk = devm_clk_get(dev, "uhpck"); in usb_hcd_at91_probe()
216 if (IS_ERR(ohci_at91->fclk)) { in usb_hcd_at91_probe()
218 retval = PTR_ERR(ohci_at91->fclk); in usb_hcd_at91_probe()
221 ohci_at91->hclk = devm_clk_get(dev, "hclk"); in usb_hcd_at91_probe()
222 if (IS_ERR(ohci_at91->hclk)) { in usb_hcd_at91_probe()
224 retval = PTR_ERR(ohci_at91->hclk); in usb_hcd_at91_probe()
228 ohci_at91->suspend_smc_id = at91_dt_suspend_smc(dev); in usb_hcd_at91_probe()
229 if (!ohci_at91->suspend_smc_id) { in usb_hcd_at91_probe()
231 ohci_at91->sfr_regmap = at91_dt_syscon_sfr(); in usb_hcd_at91_probe()
232 if (!ohci_at91->sfr_regmap) in usb_hcd_at91_probe()
320 static int ohci_at91_port_suspend(struct ohci_at91_priv *ohci_at91, u8 set) in ohci_at91_port_suspend() argument
322 struct regmap *regmap = ohci_at91->sfr_regmap; in ohci_at91_port_suspend()
326 if (ohci_at91->suspend_smc_id) { in ohci_at91_port_suspend()
329 arm_smccc_smc(ohci_at91->suspend_smc_id, set, 0, 0, 0, 0, 0, 0, &res); in ohci_at91_port_suspend()
355 struct ohci_at91_priv *ohci_at91 = hcd_to_ohci_at91_priv(hcd); in ohci_at91_hub_control() local
381 ohci_at91_port_suspend(ohci_at91, 1); in ohci_at91_hub_control()
423 ohci_at91_port_suspend(ohci_at91, 0); in ohci_at91_hub_control()
618 struct ohci_at91_priv *ohci_at91 = hcd_to_ohci_at91_priv(hcd); in ohci_hcd_at91_drv_suspend() local
625 ohci_at91->wakeup = device_may_wakeup(dev) in ohci_hcd_at91_drv_suspend()
628 if (ohci_at91->wakeup) in ohci_hcd_at91_drv_suspend()
631 ret = ohci_suspend(hcd, ohci_at91->wakeup); in ohci_hcd_at91_drv_suspend()
633 if (ohci_at91->wakeup) in ohci_hcd_at91_drv_suspend()
644 if (!ohci_at91->wakeup) { in ohci_hcd_at91_drv_suspend()
650 ohci_at91_port_suspend(ohci_at91, 1); in ohci_hcd_at91_drv_suspend()
651 at91_stop_clock(ohci_at91); in ohci_hcd_at91_drv_suspend()
653 ohci_at91_port_suspend(ohci_at91, 1); in ohci_hcd_at91_drv_suspend()
663 struct ohci_at91_priv *ohci_at91 = hcd_to_ohci_at91_priv(hcd); in ohci_hcd_at91_drv_resume() local
665 ohci_at91_port_suspend(ohci_at91, 0); in ohci_hcd_at91_drv_resume()
667 if (ohci_at91->wakeup) in ohci_hcd_at91_drv_resume()
670 at91_start_clock(ohci_at91); in ohci_hcd_at91_drv_resume()
678 ohci_resume(hcd, !ohci_at91->wakeup); in ohci_hcd_at91_drv_resume()