aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/dwc3-exynos.c
diff options
context:
space:
mode:
authorVikas Sajjan <vikas.sajjan@linaro.org>2012-10-16 05:45:38 -0400
committerFelipe Balbi <balbi@ti.com>2013-03-18 05:17:03 -0400
commit0646caf754aa3ce55ef978d7f4a3e3d0aab7a187 (patch)
tree8e6ffd401266aeba46624f219af93c8c98e79ed6 /drivers/usb/dwc3/dwc3-exynos.c
parentf3e117f4437af5a2d1b72ae0fa1890dbf9bca72f (diff)
usb: dwc3: exynos: add basic suspend/resume support
Adds suspend and resume callbacks to exynos dwc3 driver as part of power management support. This change does gating of dwc3 clock during suspend/resume cycles. Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com> Signed-off-by: Vikas C Sajjan <vikas.sajjan@linaro.org> CC: Doug Anderson <dianders@chromium.org> Tested-by: Vivek Gautam <gautam.vivek@samsung.com> [ balbi@ti.com : refreshed to current linus/master ] Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/dwc3-exynos.c')
-rw-r--r--drivers/usb/dwc3/dwc3-exynos.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index b082bec7343e..e12e45248862 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -187,12 +187,46 @@ static const struct of_device_id exynos_dwc3_match[] = {
187MODULE_DEVICE_TABLE(of, exynos_dwc3_match); 187MODULE_DEVICE_TABLE(of, exynos_dwc3_match);
188#endif 188#endif
189 189
190#ifdef CONFIG_PM
191static int dwc3_exynos_suspend(struct device *dev)
192{
193 struct dwc3_exynos *exynos = dev_get_drvdata(dev);
194
195 clk_disable(exynos->clk);
196
197 return 0;
198}
199
200static int dwc3_exynos_resume(struct device *dev)
201{
202 struct dwc3_exynos *exynos = dev_get_drvdata(dev);
203
204 clk_enable(exynos->clk);
205
206 /* runtime set active to reflect active state. */
207 pm_runtime_disable(dev);
208 pm_runtime_set_active(dev);
209 pm_runtime_enable(dev);
210
211 return 0;
212}
213
214static const struct dev_pm_ops dwc3_exynos_dev_pm_ops = {
215 SET_SYSTEM_SLEEP_PM_OPS(dwc3_exynos_suspend, dwc3_exynos_resume)
216};
217
218#define DEV_PM_OPS (&dwc3_exynos_dev_pm_ops)
219#else
220#define DEV_PM_OPS NULL
221#endif /* CONFIG_PM */
222
190static struct platform_driver dwc3_exynos_driver = { 223static struct platform_driver dwc3_exynos_driver = {
191 .probe = dwc3_exynos_probe, 224 .probe = dwc3_exynos_probe,
192 .remove = dwc3_exynos_remove, 225 .remove = dwc3_exynos_remove,
193 .driver = { 226 .driver = {
194 .name = "exynos-dwc3", 227 .name = "exynos-dwc3",
195 .of_match_table = of_match_ptr(exynos_dwc3_match), 228 .of_match_table = of_match_ptr(exynos_dwc3_match),
229 .pm = DEV_PM_OPS,
196 }, 230 },
197}; 231};
198 232