lkml.org 
[lkml]   [2013]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] usb: phy-ulpi: Add EXTVBUSIND,CHRGVBUS flag support
Date
usb: phy-ulpi: Add EXTVBUSIND,CHRGVBUS flag support

ULPI like ISP1504 support external vbus power indication
used in combination with vbus switches mic2075.

Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
---
drivers/usb/phy/phy-ulpi.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/phy/phy-ulpi.c b/drivers/usb/phy/phy-ulpi.c
index 217339d..e2f15c4 100644
--- a/drivers/usb/phy/phy-ulpi.c
+++ b/drivers/usb/phy/phy-ulpi.c
@@ -180,6 +180,8 @@ static int ulpi_init(struct usb_phy *phy)
int i, vid, pid, ret;
u32 ulpi_id = 0;

+ pr_info("ULPI Viewport 0x%p\n",phy->io_priv);
+
for (i = 0; i < 4; i++) {
ret = usb_phy_io_read(phy, ULPI_PRODUCT_ID_HIGH - i);
if (ret < 0)
@@ -237,7 +239,8 @@ static int ulpi_set_vbus(struct usb_otg *otg, bool on)
struct usb_phy *phy = otg->phy;
unsigned int flags = usb_phy_io_read(phy, ULPI_OTG_CTRL);

- flags &= ~(ULPI_OTG_CTRL_DRVVBUS | ULPI_OTG_CTRL_DRVVBUS_EXT);
+ flags &= ~(ULPI_OTG_CTRL_DRVVBUS | ULPI_OTG_CTRL_DRVVBUS_EXT |
+ ULPI_OTG_CTRL_EXTVBUSIND | ULPI_OTG_CTRL_CHRGVBUS);

if (on) {
if (phy->flags & ULPI_OTG_DRVVBUS)
@@ -245,6 +248,12 @@ static int ulpi_set_vbus(struct usb_otg *otg, bool on)

if (phy->flags & ULPI_OTG_DRVVBUS_EXT)
flags |= ULPI_OTG_CTRL_DRVVBUS_EXT;
+
+ if (phy->flags & ULPI_OTG_EXTVBUSIND)
+ flags |= ULPI_OTG_CTRL_EXTVBUSIND;
+
+ if (phy->flags & ULPI_OTG_CHRGVBUS)
+ flags |= ULPI_OTG_CTRL_CHRGVBUS;
}

return usb_phy_io_write(phy, flags, ULPI_OTG_CTRL);
--
1.7.10.4


\
 
 \ /
  Last update: 2013-12-02 08:41    [W:0.100 / U:1.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site