diff options
author | Ajay Kumar Gupta <ajay.gupta@ti.com> | 2009-12-28 06:40:42 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:53:48 -0500 |
commit | 5fc4e77911f457b6aa910c704eebe3a58d334116 (patch) | |
tree | d5ca15301784865d7bb77d5cba1bd1d099994f37 /drivers/usb | |
parent | 51bf0d0e6cc1f9679a973f61d07cb48e71f9c992 (diff) |
usb: musb: Add 'extvbus' in musb_hdrc_platform_data
Some of the board might use external Vbus power supply on musb
interface which would require to program ULPI_BUSCONTROL register.
Adding 'extvbus' flag which can be set from such boards which will
be checked at musb driver files before programming ULPI_BUSCONTROL.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/musb/musb_core.c | 8 | ||||
-rw-r--r-- | drivers/usb/musb/musb_regs.h | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 4c8962f976b2..074d380bf883 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -2031,6 +2031,7 @@ bad_config: | |||
2031 | /* host side needs more setup */ | 2031 | /* host side needs more setup */ |
2032 | if (is_host_enabled(musb)) { | 2032 | if (is_host_enabled(musb)) { |
2033 | struct usb_hcd *hcd = musb_to_hcd(musb); | 2033 | struct usb_hcd *hcd = musb_to_hcd(musb); |
2034 | u8 busctl; | ||
2034 | 2035 | ||
2035 | otg_set_host(musb->xceiv, &hcd->self); | 2036 | otg_set_host(musb->xceiv, &hcd->self); |
2036 | 2037 | ||
@@ -2038,6 +2039,13 @@ bad_config: | |||
2038 | hcd->self.otg_port = 1; | 2039 | hcd->self.otg_port = 1; |
2039 | musb->xceiv->host = &hcd->self; | 2040 | musb->xceiv->host = &hcd->self; |
2040 | hcd->power_budget = 2 * (plat->power ? : 250); | 2041 | hcd->power_budget = 2 * (plat->power ? : 250); |
2042 | |||
2043 | /* program PHY to use external vBus if required */ | ||
2044 | if (plat->extvbus) { | ||
2045 | busctl = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL); | ||
2046 | busctl |= MUSB_ULPI_USE_EXTVBUS; | ||
2047 | musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, busctl); | ||
2048 | } | ||
2041 | } | 2049 | } |
2042 | 2050 | ||
2043 | /* For the host-only role, we can activate right away. | 2051 | /* For the host-only role, we can activate right away. |
diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h index 473a94ef905f..9a8621ac5ac2 100644 --- a/drivers/usb/musb/musb_regs.h +++ b/drivers/usb/musb/musb_regs.h | |||
@@ -72,6 +72,10 @@ | |||
72 | #define MUSB_DEVCTL_HR 0x02 | 72 | #define MUSB_DEVCTL_HR 0x02 |
73 | #define MUSB_DEVCTL_SESSION 0x01 | 73 | #define MUSB_DEVCTL_SESSION 0x01 |
74 | 74 | ||
75 | /* MUSB ULPI VBUSCONTROL */ | ||
76 | #define MUSB_ULPI_USE_EXTVBUS 0x01 | ||
77 | #define MUSB_ULPI_USE_EXTVBUSIND 0x02 | ||
78 | |||
75 | /* TESTMODE */ | 79 | /* TESTMODE */ |
76 | #define MUSB_TEST_FORCE_HOST 0x80 | 80 | #define MUSB_TEST_FORCE_HOST 0x80 |
77 | #define MUSB_TEST_FIFO_ACCESS 0x40 | 81 | #define MUSB_TEST_FIFO_ACCESS 0x40 |
@@ -246,6 +250,7 @@ | |||
246 | 250 | ||
247 | /* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at 0x68 */ | 251 | /* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at 0x68 */ |
248 | #define MUSB_HWVERS 0x6C /* 8 bit */ | 252 | #define MUSB_HWVERS 0x6C /* 8 bit */ |
253 | #define MUSB_ULPI_BUSCONTROL 0x70 /* 8 bit */ | ||
249 | 254 | ||
250 | #define MUSB_EPINFO 0x78 /* 8 bit */ | 255 | #define MUSB_EPINFO 0x78 /* 8 bit */ |
251 | #define MUSB_RAMINFO 0x79 /* 8 bit */ | 256 | #define MUSB_RAMINFO 0x79 /* 8 bit */ |