summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 54e859d)
raw | patch | inline | side by side (parent: 54e859d)
author | Ajay Kumar Gupta <ajay.gupta@ti.com> | |
Tue, 26 Jan 2010 03:45:52 +0000 (19:45 -0800) | ||
committer | Tony Lindgren <tony@atomide.com> | |
Tue, 26 Jan 2010 03:45:52 +0000 (19:45 -0800) |
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>
Signed-off-by: Tony Lindgren <tony@atomide.com>
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>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/usb/musb/musb_core.c | patch | blob | history | |
drivers/usb/musb/musb_regs.h | patch | blob | history | |
include/linux/usb/musb.h | patch | blob | history |
index 4c8962f976b2d5ecd7297302038247b4d80456d1..074d380bf8833329043e75fdedf44992856e6f08 100644 (file)
/* host side needs more setup */
if (is_host_enabled(musb)) {
struct usb_hcd *hcd = musb_to_hcd(musb);
+ u8 busctl;
otg_set_host(musb->xceiv, &hcd->self);
hcd->self.otg_port = 1;
musb->xceiv->host = &hcd->self;
hcd->power_budget = 2 * (plat->power ? : 250);
+
+ /* program PHY to use external vBus if required */
+ if (plat->extvbus) {
+ busctl = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL);
+ busctl |= MUSB_ULPI_USE_EXTVBUS;
+ musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, busctl);
+ }
}
/* For the host-only role, we can activate right away.
index 473a94ef905f9f620b31480c29865b407d4d3cb9..9a8621ac5ac2ef8792f788117699ba49bcc90fd3 100644 (file)
#define MUSB_DEVCTL_HR 0x02
#define MUSB_DEVCTL_SESSION 0x01
+/* MUSB ULPI VBUSCONTROL */
+#define MUSB_ULPI_USE_EXTVBUS 0x01
+#define MUSB_ULPI_USE_EXTVBUSIND 0x02
+
/* TESTMODE */
#define MUSB_TEST_FORCE_HOST 0x80
#define MUSB_TEST_FIFO_ACCESS 0x40
/* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at 0x68 */
#define MUSB_HWVERS 0x6C /* 8 bit */
+#define MUSB_ULPI_BUSCONTROL 0x70 /* 8 bit */
#define MUSB_EPINFO 0x78 /* 8 bit */
#define MUSB_RAMINFO 0x79 /* 8 bit */
index d43755669261a6a1406af177d01b2c13ddf2ab77..4b7f8fa252f053e0af9bae9ab0b666e2763bed57 100644 (file)
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
/* (HOST or OTG) msec/2 after VBUS on till power good */
u8 potpgt;
+ /* (HOST or OTG) program PHY for external Vbus */
+ unsigned extvbus:1;
+
/* Power the device on or off */
int (*set_power)(int state);