diff options
author | Kevin K Wong <kevin.k.wong@intel.com> | 2017-01-26 17:55:22 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-02-11 13:06:39 -0800 |
commit | 18327455c1a0d9db39d5d76964aaa1cb76c348c1 (patch) | |
tree | a7a8906f882bf683a8b063d49c9e627077c73f50 /driver/tcpm/anx74xx.h | |
parent | eb2e38ec56c5701a1d9bcc3618957b4d4dee50f6 (diff) | |
download | chrome-ec-18327455c1a0d9db39d5d76964aaa1cb76c348c1.tar.gz |
ANX74xx: add TCPC low power mode for different DRP state
Added code to put the ANX74xx in low power mode for different DRP state.
1. When nothing attached or system is in S3 or S5 disable the auto
toggling and put ANX74xx system in Analog control mode.
2. Using the CABLE_DET interrupt pin (attach event) enable normal power
mode.
BUG=chrome-os-partner:59841, chrome-os-partner:61640
BRANCH=None
TEST=Manually tested on Reef using below dut-control command
dut-control pp3300_pd_a_mw -r <n>
1. S0, S3, S5 - Nothing connected, ANX in low power mode.
2. In S0 SNK (display/USB dongle, eMark cable) connected & put
system to S3, ANX remains in normal mode.
3. In S0 SNK connected & put system to S5, ANX in low power** mode.
4. In S0 nothing connected, put system to S3 or S5, attach
SNK, ANX in low power** mode.
5. Attach SNK at S3/S5 & boot to S0, ANX in normal mode.
6. SRC (AC adapter) with/without eMark cable are detected in
S0, S3, S5, and continue to charge the system after S-state
transition.
low power**: ANX74xx hardware limitation that Ra/Open (Ex: E-Mark cable
only) detection will trigger CABLE_DET continuously, therefore ANX74xx
will go to normal power mode momentarily and then low power mode in a
loop.
Change-Id: I30f7fd7a85e31987fb77e2cab2fe140d59dd3629
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/415580
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'driver/tcpm/anx74xx.h')
-rw-r--r-- | driver/tcpm/anx74xx.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/driver/tcpm/anx74xx.h b/driver/tcpm/anx74xx.h index 5f0995725d..fcbd38fe41 100644 --- a/driver/tcpm/anx74xx.h +++ b/driver/tcpm/anx74xx.h @@ -68,6 +68,9 @@ #define ANX74XX_REG_AUTO_GOODCRC_EN 0x01 #define ANX74XX_REG_ENABLE_GOODCRC 0x38 +#define ANX74XX_REG_ANALOG_CTRL_0 0x41 +#define ANX74XX_REG_R_PIN_CABLE_DET (1 << 7) + #define ANX74XX_REG_ANALOG_CTRL_1 0x42 #define ANX74XX_REG_ANALOG_CTRL_5 0x46 #define ANX74XX_REG_ANALOG_CTRL_6 0x47 @@ -178,6 +181,7 @@ 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; |