Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248755
b: refs/heads/master
c: 6e267da
h: refs/heads/master
i:
  248753: a963157
  248751: ea2b3e1
v: v3
  • Loading branch information
Kuninori Morimoto authored and Greg Kroah-Hartman committed Apr 30, 2011
1 parent f8486f5 commit 640f6a2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 206dcc2cfe15b6174f15293ae15a097ee03eb386
refs/heads/master: 6e267da8f10b1a6551b6c4dee3779f6f56e2644d
42 changes: 29 additions & 13 deletions trunk/drivers/usb/renesas_usbhs/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,31 @@ static u32 usbhsc_default_pipe_type[] = {
};

/*
* driver callback functions
* power control
*/
static void usbhsc_power_ctrl(struct usbhs_priv *priv, int enable)
{
struct device *dev = usbhs_priv_to_dev(priv);

if (enable) {
/* enable PM */
pm_runtime_get_sync(dev);

/* USB on */
usbhs_sys_clock_ctrl(priv, enable);
usbhsc_bus_ctrl(priv, enable);
} else {
/* USB off */
usbhsc_bus_ctrl(priv, enable);
usbhs_sys_clock_ctrl(priv, enable);

/* disable PM */
pm_runtime_put_sync(dev);
}
}

/*
* notify hotplug
*/
static void usbhsc_notify_hotplug(struct work_struct *work)
{
Expand Down Expand Up @@ -178,12 +202,8 @@ static void usbhsc_notify_hotplug(struct work_struct *work)

dev_dbg(&pdev->dev, "%s enable\n", __func__);

/* enable PM */
pm_runtime_get_sync(&pdev->dev);

/* USB on */
usbhs_sys_clock_ctrl(priv, enable);
usbhsc_bus_ctrl(priv, enable);
/* power on */
usbhsc_power_ctrl(priv, enable);

/* module start */
usbhs_mod_call(priv, start, priv);
Expand All @@ -194,12 +214,8 @@ static void usbhsc_notify_hotplug(struct work_struct *work)
/* module stop */
usbhs_mod_call(priv, stop, priv);

/* USB off */
usbhsc_bus_ctrl(priv, enable);
usbhs_sys_clock_ctrl(priv, enable);

/* disable PM */
pm_runtime_put_sync(&pdev->dev);
/* power off */
usbhsc_power_ctrl(priv, enable);

usbhs_mod_change(priv, -1);

Expand Down

0 comments on commit 640f6a2

Please sign in to comment.