From 5b630340925e51c3eb1e03431a2748bf0a3c47ce Mon Sep 17 00:00:00 2001 From: Ajay Kumar Gupta Date: Mon, 28 Dec 2009 13:40:42 +0200 Subject: [PATCH] --- yaml --- r: 185290 b: refs/heads/master c: 5fc4e77911f457b6aa910c704eebe3a58d334116 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/musb/musb_core.c | 8 ++++++++ trunk/drivers/usb/musb/musb_regs.h | 5 +++++ trunk/include/linux/usb/musb.h | 3 +++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 5e7a2106cbbc..e6fbecae56ab 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 51bf0d0e6cc1f9679a973f61d07cb48e71f9c992 +refs/heads/master: 5fc4e77911f457b6aa910c704eebe3a58d334116 diff --git a/trunk/drivers/usb/musb/musb_core.c b/trunk/drivers/usb/musb/musb_core.c index 4c8962f976b2..074d380bf883 100644 --- a/trunk/drivers/usb/musb/musb_core.c +++ b/trunk/drivers/usb/musb/musb_core.c @@ -2031,6 +2031,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) /* 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); @@ -2038,6 +2039,13 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) 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. diff --git a/trunk/drivers/usb/musb/musb_regs.h b/trunk/drivers/usb/musb/musb_regs.h index 473a94ef905f..9a8621ac5ac2 100644 --- a/trunk/drivers/usb/musb/musb_regs.h +++ b/trunk/drivers/usb/musb/musb_regs.h @@ -72,6 +72,10 @@ #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 @@ -246,6 +250,7 @@ /* 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 */ diff --git a/trunk/include/linux/usb/musb.h b/trunk/include/linux/usb/musb.h index d43755669261..4b7f8fa252f0 100644 --- a/trunk/include/linux/usb/musb.h +++ b/trunk/include/linux/usb/musb.h @@ -76,6 +76,9 @@ struct musb_hdrc_platform_data { /* (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);