summaryrefslogtreecommitdiff
path: root/driver/tcpm/anx74xx.h
diff options
context:
space:
mode:
authorCaveh Jalali <caveh@google.com>2017-08-24 02:15:36 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-08-29 22:08:20 -0700
commitc1e5671e561c82c9532cb29b17fc7cf4061ab20a (patch)
tree22348963ba0441bf7c4f93e1c88d481438c78b3e /driver/tcpm/anx74xx.h
parentc191bf9f4d5b4c2e45583820307d95592d2221ba (diff)
downloadchrome-ec-c1e5671e561c82c9532cb29b17fc7cf4061ab20a.tar.gz
anx3429: force chip reset on PD_RESUME
we need to properly restart the anx3429 after a firmware update. simply initializing the chip doesn't seem to get it to reload its firmware - at least not the portion of the chip that implements the firmware version register. so, we explicitly power down and reset the chip before reinitializing it to force it to run the new firmware. the chip also needs a 10ms "off" time so the reset is properly seen by the chip, so i did a light refactoring of the code paths that reset the anx3429. TEST=used 2 different firmware blobs and verified it switches between them during software sync. BRANCH=none BUG=b:35586895 Change-Id: I967898dd906f21bdc5bc4ce9c1dff9f873d198c1 Signed-off-by: Caveh Jalali <caveh@google.com> Reviewed-on: https://chromium-review.googlesource.com/631976
Diffstat (limited to 'driver/tcpm/anx74xx.h')
-rw-r--r--driver/tcpm/anx74xx.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/driver/tcpm/anx74xx.h b/driver/tcpm/anx74xx.h
index 06720650bd..11ae964af7 100644
--- a/driver/tcpm/anx74xx.h
+++ b/driver/tcpm/anx74xx.h
@@ -186,13 +186,25 @@
#define ANX74XX_CC_RD_MASK (BIT_VALUE_OF_SRC_CC_RD | \
(BIT_VALUE_OF_SRC_CC_RD << 4))
+/*
+ * RESETN low to PWR_EN low delay
+ */
+#define ANX74XX_RST_L_PWR_L_DELAY_MS 1
+/*
+ * minimum power off-to-on delay to reset chip
+ */
+#define ANX74XX_PWR_L_PWR_H_DELAY_MS 10
+/*
+ * parameter T4: PWR_EN high to RESETN high delay
+ */
+#define ANX74XX_PWR_H_RST_H_DELAY_MS 10
+
extern const struct tcpm_drv anx74xx_tcpm_drv;
extern const struct usb_mux_driver anx74xx_tcpm_usb_mux_driver;
void anx74xx_tcpc_set_vbus(int port, int enable);
void anx74xx_tcpc_update_hpd_status(int port, int hpd_lvl, int hpd_irq);
void anx74xx_tcpc_clear_hpd_status(int port);
int anx74xx_tcpc_get_fw_version(int port, int *version);
-void anx74xx_handle_power_mode(int port, int mode);
#ifdef CONFIG_CMD_I2C_STRESS_TEST_TCPC
extern struct i2c_stress_test_dev anx74xx_i2c_stress_test_dev;