diff options
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0021-twl4030-usb-fix-minor-reporting-goofage.patch')
-rw-r--r-- | meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0021-twl4030-usb-fix-minor-reporting-goofage.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0021-twl4030-usb-fix-minor-reporting-goofage.patch b/meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0021-twl4030-usb-fix-minor-reporting-goofage.patch new file mode 100644 index 0000000000..d9733f92b0 --- /dev/null +++ b/meta/recipes-kernel/linux/linux-omap-2.6.29/musb/0021-twl4030-usb-fix-minor-reporting-goofage.patch | |||
@@ -0,0 +1,70 @@ | |||
1 | From c4804e5a447275553c55bbb0ab1748954cb8fbfc Mon Sep 17 00:00:00 2001 | ||
2 | From: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org> | ||
3 | Date: Tue, 31 Mar 2009 12:26:10 -0700 | ||
4 | Subject: [PATCH] twl4030-usb: fix minor reporting goofage | ||
5 | |||
6 | Fix a reporting glitch in the twl4030 USB transceiver code. | ||
7 | It wasn't properly distinguishing the two types of active | ||
8 | USB link: ID grounded, vs not. In the current code that | ||
9 | distinction doesn't much matter; in the future this bugfix | ||
10 | should help support better USB controller communications. | ||
11 | |||
12 | Provide a comment sorting out some of the cryptic bits of | ||
13 | the manual: different sections use different names for | ||
14 | key signals, and the register definitions don't help much | ||
15 | without the explanations and diagrams. | ||
16 | |||
17 | Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org> | ||
18 | --- | ||
19 | drivers/usb/otg/twl4030-usb.c | 26 +++++++++++++++++++------- | ||
20 | 1 files changed, 19 insertions(+), 7 deletions(-) | ||
21 | |||
22 | diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c | ||
23 | index d9478d0..f740390 100644 | ||
24 | --- a/drivers/usb/otg/twl4030-usb.c | ||
25 | +++ b/drivers/usb/otg/twl4030-usb.c | ||
26 | @@ -217,6 +217,7 @@ | ||
27 | |||
28 | /* In module TWL4030_MODULE_PM_MASTER */ | ||
29 | #define PROTECT_KEY 0x0E | ||
30 | +#define STS_HW_CONDITIONS 0x0F | ||
31 | |||
32 | /* In module TWL4030_MODULE_PM_RECEIVER */ | ||
33 | #define VUSB_DEDICATED1 0x7D | ||
34 | @@ -351,15 +352,26 @@ static enum linkstat twl4030_usb_linkstat(struct twl4030_usb *twl) | ||
35 | int status; | ||
36 | int linkstat = USB_LINK_UNKNOWN; | ||
37 | |||
38 | - /* STS_HW_CONDITIONS */ | ||
39 | - status = twl4030_readb(twl, TWL4030_MODULE_PM_MASTER, 0x0f); | ||
40 | + /* | ||
41 | + * For ID/VBUS sensing, see manual section 15.4.8 ... | ||
42 | + * except when using only battery backup power, two | ||
43 | + * comparators produce VBUS_PRES and ID_PRES signals, | ||
44 | + * which don't match docs elsewhere. But ... BIT(7) | ||
45 | + * and BIT(2) of STS_HW_CONDITIONS, respectively, do | ||
46 | + * seem to match up. If either is true the USB_PRES | ||
47 | + * signal is active, the OTG module is activated, and | ||
48 | + * its interrupt may be raised (may wake the system). | ||
49 | + */ | ||
50 | + status = twl4030_readb(twl, TWL4030_MODULE_PM_MASTER, | ||
51 | + STS_HW_CONDITIONS); | ||
52 | if (status < 0) | ||
53 | dev_err(twl->dev, "USB link status err %d\n", status); | ||
54 | - else if (status & BIT(7)) | ||
55 | - linkstat = USB_LINK_VBUS; | ||
56 | - else if (status & BIT(2)) | ||
57 | - linkstat = USB_LINK_ID; | ||
58 | - else | ||
59 | + else if (status & (BIT(7) | BIT(2))) { | ||
60 | + if (status & BIT(2)) | ||
61 | + linkstat = USB_LINK_ID; | ||
62 | + else | ||
63 | + linkstat = USB_LINK_VBUS; | ||
64 | + } else | ||
65 | linkstat = USB_LINK_NONE; | ||
66 | |||
67 | dev_dbg(twl->dev, "HW_CONDITIONS 0x%02x/%d; link %d\n", | ||
68 | -- | ||
69 | 1.6.0.4 | ||
70 | |||