aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike J. Chen <mjchen@google.com>2012-03-03 13:35:21 -0800
committerMike J. Chen <mjchen@google.com>2012-03-03 17:29:40 -0800
commitc097ba3e8df2382e051a409fdc85f55d792decec (patch)
tree5a750830082d27e4d92d0f4e2e884e073e5874e4
parent9714abbb6aa85a365da91ea4cf53efbcf9969d44 (diff)
downloaduboot-c097ba3e8df2382e051a409fdc85f55d792decec.tar.gz
ARMV7: OMAP4: USB: Configure twl6030x USB like ROM bootloader
This is a followup to commit 00261ba7a7e29c28708972c908a94993ea322dba. That change worked in that USB worked in fastboot if the cable is attached after boot, but had a bad side-effect that if we then booted to OS (using fastboot continue or fastboot reboot), then unplugged and replugged USB, USB wouldn't work. I believe the VUSB_IN_VBAT was not the right setting, but to be extra safe, I dumped the registers in question after the ROM set them up in the cold boot with USB cable attached case, and just made them the same. CFG_LDO_PD2 and USB_VBUS_CTRL_SET registers appeared to be already set to working values by the ROM bootloader in all cases, and VBUS_IN_PMID is set instead of VUSB_IN_VBAT. This fixes the plug/unplug problem in adb. Change-Id: I200e7701ca9905a6eba6f47ebd71787ea3dcb993 Signed-off-by: Mike J. Chen <mjchen@google.com>
-rw-r--r--drivers/power/twl6030.c12
-rw-r--r--include/twl6030.h1
2 files changed, 4 insertions, 9 deletions
diff --git a/drivers/power/twl6030.c b/drivers/power/twl6030.c
index 164a4455e..6940f556a 100644
--- a/drivers/power/twl6030.c
+++ b/drivers/power/twl6030.c
@@ -194,14 +194,8 @@ void twl6030_usb_device_settings()
/* Set to OTG_REV 1.3 and turn on the ID_WAKEUP_COMP */
twl6030_i2c_write_u8(TWL6030_CHIP_PM, BACKUP_REG_WKUP_COMP, BACKUP_REG);
- /* Program CFG_LDO_PD2 register and set VUSB bit */
- twl6030_i2c_write_u8(TWL6030_CHIP_PM, CFG_LDO_VUSB, CFG_LDO_PD2);
-
- /* Program MISC2 register and set bit VUSB_IN_VBAT */
- twl6030_i2c_write_u8(TWL6030_CHIP_PM, MISC2_VUSB_IN_VBAT, MISC2);
-
- /* Program the USB_VBUS_CTRL_SET and set VBUS_ACT_COMP bit */
- twl6030_i2c_write_u8(TWL6030_CHIP_USB, USB_VBUS_CTRL_IADP_SINK,
- USB_VBUS_CTRL_SET);
+ /* Program MISC2 register and set bit VUSB_IN_PMID */
+ twl6030_i2c_write_u8(TWL6030_CHIP_PM, MISC2_VUSB_IN_PMID, MISC2);
}
+
#endif
diff --git a/include/twl6030.h b/include/twl6030.h
index 4a5d17b41..6e94f6fb0 100644
--- a/include/twl6030.h
+++ b/include/twl6030.h
@@ -44,6 +44,7 @@
#define MISC2 0xE5
#define MISC2_VUSB_IN_VBAT (1 << 4)
+#define MISC2_VUSB_IN_PMID (1 << 3)
#define CFG_LDO_PD2 0xF5
#define CFG_LDO_VUSB (1 << 0)