summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorDino Li <Dino.Li@ite.com.tw>2016-08-16 18:17:30 +0800
committerchrome-bot <chrome-bot@chromium.org>2016-08-22 00:11:59 -0700
commit8d8f2401a20e1bc59aa9a05b41246d618d534399 (patch)
treefab5c11b6c83e7e62281003b00a9d19c4a5e9b66 /driver
parent81fd1393fa3ecb4709a7e6f83c402d7a6a1ccf00 (diff)
downloadchrome-ec-8d8f2401a20e1bc59aa9a05b41246d618d534399.tar.gz
TCPM: it83xx: support Rp 1.5/3.0A pullup configuration
Signed-off-by: Dino Li <dino.li@ite.com.tw> BRANCH=none BUG=chrome-os-partner:54452 TEST=1. To check appropriate register setting. 2. Measure the CC voltage by connecting USB-C to DP cable to EVB. Default : 433mV CONFIG_USB_PD_PULLUP_1_5A: 951mV CONFIG_USB_PD_PULLUP_3A : 1.72V Change-Id: Id5a36ded94121db4343c48ecea19a5a533244f43 Reviewed-on: https://chromium-review.googlesource.com/371020 Commit-Ready: Dino Li <Dino.Li@ite.com.tw> Tested-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/tcpm/it83xx.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/driver/tcpm/it83xx.c b/driver/tcpm/it83xx.c
index 1be2367458..f7bdf5b60b 100644
--- a/driver/tcpm/it83xx.c
+++ b/driver/tcpm/it83xx.c
@@ -273,8 +273,24 @@ static void it83xx_init(enum usbpd_port port, int role)
IT83XX_USBPD_PDMSR(port) = USBPD_REG_MASK_SOP_ENABLE;
/* W/C status */
IT83XX_USBPD_ISR(port) = 0xff;
- /* enable cc, select cc1 and Rd (80uA output when Rp selected) */
+ /* enable cc, select cc1 and Rd. */
+ /*
+ * bit[3-2]: CC output current (when Rp selected)
+ * 00: reserved
+ * 01: 330uA outpt (3.0A)
+ * 10: 180uA outpt (1.5A)
+ * 11: 80uA outpt (USB default)
+ */
+#ifdef CONFIG_USB_PD_PULLUP_1_5A
+ /* (Rp 1.5A when selected) */
+ IT83XX_USBPD_CCGCR(port) = 0x9;
+#elif defined(CONFIG_USB_PD_PULLUP_3A)
+ /* (Rp 3.0A when selected) */
+ IT83XX_USBPD_CCGCR(port) = 0x5;
+#else
+ /* (Rp default when selected) */
IT83XX_USBPD_CCGCR(port) = 0xd;
+#endif
/* change data role as the same power role */
it83xx_set_data_role(port, role);
/* set power role */
@@ -311,12 +327,6 @@ static void it83xx_select_polarity(enum usbpd_port port,
static void it83xx_set_cc(enum usbpd_port port, int pull)
{
- /*
- * TODO(crosbug.com/p/54452): Add configuration of Rp strength
- * values for presenting desired current to port partner.
- * This value will depend on config flags
- * CONFIG_USB_PD_PULLUP_* in the board file
- */
if (pull == TYPEC_CC_RD)
it83xx_set_power_role(port, PD_ROLE_SINK);
else if (pull == TYPEC_CC_RP)