diff options
author | Caveh Jalali <caveh@google.com> | 2017-06-20 18:20:00 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-06-28 23:23:41 -0700 |
commit | c74c0785927ab7770143d5ff503b4c0ca9df9ff1 (patch) | |
tree | b2a5632f3fd95609aded847a26d1a29bcd4beb75 /driver/tcpm/it83xx.c | |
parent | 3a4298ef4835b1f75046ede8cace149e05089d1a (diff) | |
download | chrome-ec-c74c0785927ab7770143d5ff503b4c0ca9df9ff1.tar.gz |
tcpm: add .release driver operation.
similar to the USB_PD_TCPC case, add release/init operations when the
pd_task enters/leaves the PD_STATE_SUSPENDED state. one use case for
PD_SUSPEND is to get exlusive access to the TCPC for things like
firmware update, so the release/init operation is needed to get the
TCPC and driver into a good state.
updated all tcpm_drv style drivers. for backward compatibility, "old"
drivers that may not handle init/release properly simply return
EC_ERROR_UNIMPLEMENTED for tcpm_release(). pd_task() uses this as a
signal that it should not try to re-init() the driver.
TEST=tested in combination with follow-on CLs to do TCPC firmware
update on electro. also built for kevin, eve, sand which are
some of the other boards using these drivers.
"make buildall -j" passes.
BRANCH=none
BUG=b:35586896
Change-Id: I3d2964a79e710428f7a6e7004d68ab424af85be8
Signed-off-by: Caveh Jalali <caveh@google.com>
Reviewed-on: https://chromium-review.googlesource.com/544660
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver/tcpm/it83xx.c')
-rw-r--r-- | driver/tcpm/it83xx.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/driver/tcpm/it83xx.c b/driver/tcpm/it83xx.c index e30c73bac8..f5e78bbbb9 100644 --- a/driver/tcpm/it83xx.c +++ b/driver/tcpm/it83xx.c @@ -351,6 +351,11 @@ static int it83xx_tcpm_init(int port) return EC_SUCCESS; } +static int it83xx_tcpm_release(int port) +{ + return EC_ERROR_UNIMPLEMENTED; +} + static int it83xx_tcpm_get_cc(int port, int *cc1, int *cc2) { *cc2 = it83xx_get_cc(port, USBPD_CC_PIN_2); @@ -504,6 +509,7 @@ static int it83xx_tcpm_get_chip_info(int port, int renew, const struct tcpm_drv it83xx_tcpm_drv = { .init = &it83xx_tcpm_init, + .release = &it83xx_tcpm_release, .get_cc = &it83xx_tcpm_get_cc, #ifdef CONFIG_USB_PD_VBUS_DETECT_TCPC .get_vbus_level = NULL, |