summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2016-07-15 19:38:20 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-07-21 00:48:05 -0700
commit4fe82acac2f4c9e458321611a424fb7fbc74e363 (patch)
treef224eaa7059d4fa22a96fafaf048630db8536fd6 /driver
parentf2fa9c94772f245bf7b91779a4765103d07df156 (diff)
downloadchrome-ec-4fe82acac2f4c9e458321611a424fb7fbc74e363.tar.gz
tcpm: anx74xx: Add alert polarity member to tcpc_config_t
This allows us to specify the polarity of the alert signal for each TCPC chip onboard, even if we have multiple instances of the same chip. BUG=none BRANCH=none TEST=built and booted on reef Change-Id: I06a58c4e26892843243e8e98f2c86c6d3a696eb1 Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/360948 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/tcpm/anx74xx.c4
-rw-r--r--driver/tcpm/anx74xx.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/driver/tcpm/anx74xx.c b/driver/tcpm/anx74xx.c
index ed38fccb23..bd5032376c 100644
--- a/driver/tcpm/anx74xx.c
+++ b/driver/tcpm/anx74xx.c
@@ -762,7 +762,9 @@ int anx74xx_tcpm_init(int port)
/* Initialize interrupt polarity */
rv |= tcpc_write(port, ANX74XX_REG_IRQ_STATUS,
- ANX74XX_INT_ACTIVE_POLARITY);
+ tcpc_config[port].pol == TCPC_ALERT_ACTIVE_LOW ?
+ ANX74XX_REG_IRQ_POL_LOW :
+ ANX74XX_REG_IRQ_POL_HIGH);
/* unmask interrupts */
rv |= tcpc_read(port, ANX74XX_REG_IRQ_EXT_MASK_1, &reg);
diff --git a/driver/tcpm/anx74xx.h b/driver/tcpm/anx74xx.h
index 972be9648a..e395083d33 100644
--- a/driver/tcpm/anx74xx.h
+++ b/driver/tcpm/anx74xx.h
@@ -12,7 +12,6 @@
#define ANX74XX_REG_IRQ_POL_LOW 0x00
#define ANX74XX_REG_IRQ_POL_HIGH 0x02
-#define ANX74XX_INT_ACTIVE_POLARITY ANX74XX_REG_IRQ_POL_HIGH
#define ANX74XX_REG_IRQ_STATUS 0x53