summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirupathi Chippakurthy <thirupathi.chippakurthy@stericsson.com>2011-09-05 17:26:43 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:03:07 +0200
commit29390773a3081c76e16f9958a6ddb38b58febb09 (patch)
tree06d5bbffb110e0b81c93b661fd26548b746d2831
parentc5b0321065e36cde8cdc18e125901b2914369c05 (diff)
ux500: USB: Set the charging cur to 300mA for ABV3
In case of AB-V3, the eye diagram related issues are resolved. So, set the device charging current to 300mA when connected to standard host. Also, add the USB PHY tuning values to improve the USB eye diagram ST-Ericsson ID: 330203 ST-Ericsson Linux next: ER 330203 ST-Ericsson FOSS-OUT ID: NA Change-Id: I7cd49289ce7e1a6d88263198e7b1258c923c1282 Signed-off-by: <thirupathi.chippakurthy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30031 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com>
-rw-r--r--drivers/usb/otg/ab8500-usb.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c
index a09fb341cb8..2b67433fa6c 100644
--- a/drivers/usb/otg/ab8500-usb.c
+++ b/drivers/usb/otg/ab8500-usb.c
@@ -55,6 +55,18 @@
#define AB8500_V20_31952_DISABLE_DELAY_US 100 /* usec */
#define AB8500_WD_V10_DISABLE_DELAY_MS 100 /* ms */
+/* Registers in bank 0x11 */
+#define AB8500_BANK12_ACCESS 0x00
+
+/* Registers in bank 0x12 */
+#define AB8500_USB_PHY_TUNE1 0x05
+#define AB8500_USB_PHY_TUNE2 0x06
+#define AB8500_USB_PHY_TUNE3 0x07
+
+
+
+
+
/* Usb line status register */
enum ab8500_usb_link_status {
USB_LINK_NOT_CONFIGURED = 0,
@@ -573,6 +585,7 @@ static int __devinit ab8500_usb_probe(struct platform_device *pdev)
dev_get_platdata(pdev->dev.parent);
int err;
int rev;
+ int ret = -1;
rev = abx500_get_chip_id(&pdev->dev);
if (rev < 0) {
@@ -639,6 +652,52 @@ static int __devinit ab8500_usb_probe(struct platform_device *pdev)
goto fail3;
}
+ /* Write Phy tuning values */
+ if (ab->rev == 0x30) {
+ /* Enable the PBT/Bank 0x12 access */
+ ret = abx500_set_register_interruptible(ab->dev,
+ AB8500_DEVELOPMENT,
+ AB8500_BANK12_ACCESS,
+ 0x01);
+ if (ret < 0)
+ printk(KERN_ERR "Failed to enable bank12"
+ " access ret=%d\n", ret);
+
+ ret = abx500_set_register_interruptible(ab->dev,
+ AB8500_DEBUG,
+ AB8500_USB_PHY_TUNE1,
+ 0xC8);
+ if (ret < 0)
+ printk(KERN_ERR "Failed to set PHY_TUNE1"
+ " register ret=%d\n", ret);
+
+ ret = abx500_set_register_interruptible(ab->dev,
+ AB8500_DEBUG,
+ AB8500_USB_PHY_TUNE2,
+ 0x00);
+ if (ret < 0)
+ printk(KERN_ERR "Failed to set PHY_TUNE2"
+ " register ret=%d\n", ret);
+
+ ret = abx500_set_register_interruptible(ab->dev,
+ AB8500_DEBUG,
+ AB8500_USB_PHY_TUNE3,
+ 0x78);
+
+ if (ret < 0)
+ printk(KERN_ERR "Failed to set PHY_TUNE3"
+ " regester ret=%d\n", ret);
+
+ /* Switch to normal mode/disable Bank 0x12 access */
+ ret = abx500_set_register_interruptible(ab->dev,
+ AB8500_DEVELOPMENT,
+ AB8500_BANK12_ACCESS,
+ 0x00);
+
+ if (ret < 0)
+ printk(KERN_ERR "Failed to switch bank12"
+ " access ret=%d\n", ret);
+ }
/* Needed to enable ID detection. */
ab8500_usb_wd_workaround(ab);