diff options
author | Avinash Kumar <avinash.kumar@stericsson.com> | 2011-09-19 16:22:01 +0530 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-09-19 16:22:30 +0200 |
commit | ee35aaef0e49fc7a7878f1c869b7eb9e61cbe4b0 (patch) | |
tree | c70b8738712caf26bb7f98bab647c484bdc452a9 | |
parent | 4b9ab4aad7eb969c04bff4d194b500e2af820304 (diff) |
u5500: usb: Migrate the patches to kernel 3.0
usb driver wakelock related changes.
ee909c0 [ANDROID] ux500: usb: USB suspend, resume and pm
ST-Ericsson ID: 352334
ST-Ericsson Linux next: NA
ST-Ericsson FOSS-OUT ID: NA
Signed-off-by: Avinash Kumar <avinash.kumar@stericsson.com>
Change-Id: Ia07fa6ef73dcc3d4c5bc025b8913c51186a4ab31
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/31339
Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com>
-rw-r--r-- | drivers/usb/otg/ab5500-usb.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/otg/ab5500-usb.c b/drivers/usb/otg/ab5500-usb.c index a4f4f58f847..fecf15766b5 100644 --- a/drivers/usb/otg/ab5500-usb.c +++ b/drivers/usb/otg/ab5500-usb.c @@ -21,6 +21,9 @@ #include <linux/kernel_stat.h> #include <mach/gpio.h> +#include <linux/wakelock.h> +static struct wake_lock ab5500_musb_wakelock; + /* AB5500 USB macros */ #define AB5500_USB_HOST_ENABLE 0x1 @@ -146,6 +149,7 @@ static void ab5500_usb_phy_enable(struct ab5500_usb *ab, bool sel_host) bit = sel_host ? AB5500_USB_HOST_ENABLE : AB5500_USB_DEVICE_ENABLE; + wake_lock(&ab5500_musb_wakelock); ab->usb_gpio->enable(); clk_enable(ab->sysclk); regulator_enable(ab->v_ape); @@ -186,6 +190,7 @@ static void ab5500_usb_phy_disable(struct ab5500_usb *ab, bool sel_host) "usb", 25); } + wake_unlock(&ab5500_musb_wakelock); } #define ab5500_usb_peri_phy_en(ab) ab5500_usb_phy_enable(ab, false) @@ -693,6 +698,12 @@ static int __devinit ab5500_usb_probe(struct platform_device *pdev) if (err < 0) goto fail1; + /* + * wake lock is acquired when usb cable is connected and released when + * cable is removed + */ + wake_lock_init(&ab5500_musb_wakelock, WAKE_LOCK_SUSPEND, "ab5500-usb"); + err = ab5500_usb_boot_detect(ab); if (err < 0) goto fail1; |