diff mbox

[1/2] USB: twl4030-usb: do board specific phy_power up/down

Message ID 1300715420-25602-2-git-send-email-kalle.jokiniemi@nokia.com (mailing list archive)
State New, archived
Headers show

Commit Message

kalle.jokiniemi@nokia.com March 21, 2011, 1:50 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c
index 6ca505f..dea99b1 100644
--- a/drivers/usb/otg/twl4030-usb.c
+++ b/drivers/usb/otg/twl4030-usb.c
@@ -348,13 +348,20 @@  static void twl4030_i2c_access(struct twl4030_usb *twl, int on)
 
 static void __twl4030_phy_power(struct twl4030_usb *twl, int on)
 {
-	u8 pwr = twl4030_usb_read(twl, PHY_PWR_CTRL);
+	u8 pwr;
+	struct twl4030_usb_data *board = twl->dev->platform_data;
+
+	pwr = twl4030_usb_read(twl, PHY_PWR_CTRL);
 
 	if (on)
 		pwr &= ~PHY_PWR_PHYPWD;
 	else
 		pwr |= PHY_PWR_PHYPWD;
 
+	/* do board specific power up/down, if available */
+	if (board->phy_power)
+		board->phy_power(twl->dev, 0, on);
+
 	WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0);
 }