diff options
author | Divya Sasidharan <divya.s.sasidharan@intel.com> | 2016-08-09 14:06:52 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-08-11 16:52:00 -0700 |
commit | 6b6ed79a56a27a4a52730572e0f9338a138b9581 (patch) | |
tree | 5bdcd6eddc272da08b76552217462f9e05dc6644 /driver | |
parent | e6afb2ef97fbe09d65fe54e9ffcb0e6a9f26c95f (diff) | |
download | chrome-ec-6b6ed79a56a27a4a52730572e0f9338a138b9581.tar.gz |
Amenia/Reef: Present 1.5A Pullup
Enable config to choose the Rp pullup
strength to advertise the desired current
from USB-C while providing power.
BUG=chrome-os-partner:54452
BRANCH=none
TEST=Boot and check appropriate register
settings in Reef.
For Parade: i2cxfer r 1 0x16 0x1A -> 0x15
Change-Id: I5c1b7a45bf483333d7b411aad402fc95e4fa05de
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/353038
Commit-Ready: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Tested-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Kevin K Wong <kevin.k.wong@intel.com>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/tcpm/fusb302.c | 6 | ||||
-rw-r--r-- | driver/tcpm/it83xx.c | 6 | ||||
-rw-r--r-- | driver/tcpm/tcpci.c | 16 |
3 files changed, 25 insertions, 3 deletions
diff --git a/driver/tcpm/fusb302.c b/driver/tcpm/fusb302.c index 56ec303f04..424c203496 100644 --- a/driver/tcpm/fusb302.c +++ b/driver/tcpm/fusb302.c @@ -459,6 +459,12 @@ static int fusb302_tcpm_set_cc(int port, int pull) case TYPEC_CC_RP: /* Only use autodetect feature for revA silicon */ + /* + * 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 fusb302 hasn't figured anything out yet */ if ((state[port].device_id == FUSB302_DEVID_302A) && !state[port].togdone_pullup_cc1 && diff --git a/driver/tcpm/it83xx.c b/driver/tcpm/it83xx.c index ed871edd02..1be2367458 100644 --- a/driver/tcpm/it83xx.c +++ b/driver/tcpm/it83xx.c @@ -311,6 +311,12 @@ 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) diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c index 7eb2d9146b..14ab07769a 100644 --- a/driver/tcpm/tcpci.c +++ b/driver/tcpm/tcpci.c @@ -87,13 +87,23 @@ static int tcpci_tcpm_get_power_status(int port, int *status) int tcpci_tcpm_set_cc(int port, int pull) { + uint8_t rp = 0; /* * Set manual control of Rp/Rd, and set both CC lines to the same - * pull. + * pull. Set desired Rp strength: + * 00: Rp default + * 01: Rp 1.5A + * 10: Rp 3.0A + * 11: Reserved */ - /* TODO: set desired Rp strength */ +#ifdef CONFIG_USB_PD_PULLUP_1_5A + rp = 0x01; +#elif defined(CONFIG_USB_PD_PULLUP_3A) + rp = 0x02; +#endif + return tcpc_write(port, TCPC_REG_ROLE_CTRL, - TCPC_REG_ROLE_CTRL_SET(0, 0, pull, pull)); + TCPC_REG_ROLE_CTRL_SET(0, rp, pull, pull)); } int tcpci_tcpm_set_polarity(int port, int polarity) |