From 5408b10490b753dc06ec47d37be5026cc762f2db Mon Sep 17 00:00:00 2001 From: Dominic Chen Date: Wed, 11 Jun 2014 15:12:20 -0700 Subject: tsu6721: add function to control output pins BRANCH=none BUG=none TEST=check mux actually switches Change-Id: If157302329c2b570814d2a071078949bfe368356 Signed-off-by: Dominic Chen Reviewed-on: https://chromium-review.googlesource.com/203492 Reviewed-by: Vincent Palatin --- driver/tsu6721.h | 7 +++++++ driver/usb_switch_tsu6721.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/driver/tsu6721.h b/driver/tsu6721.h index e614be7e09..da9cbecbec 100644 --- a/driver/tsu6721.h +++ b/driver/tsu6721.h @@ -38,6 +38,10 @@ enum tsu6721_mux { TSU6721_MUX_UART = 0x6C, }; +#define TSU6721_PIN_MANUAL2_JIG (1 << 2) +#define TSU6721_PIN_MANUAL2_BOOT (1 << 3) +#define TSU6721_PIN_MANUAL2_ISET (1 << 4) + #define TSU6721_INT_ATTACH 0x0001 #define TSU6721_INT_DETACH 0x0002 #define TSU6721_INT_KP 0x0004 @@ -105,6 +109,9 @@ int tsu6721_get_device_type(void); /* Control TSU6721 mux. */ int tsu6721_mux(enum tsu6721_mux sel); +/* Set bits to enable pins in SW2 register */ +void tsu6721_set_pins(int mask); + /* Reset TSU6721. */ void tsu6721_reset(void); diff --git a/driver/usb_switch_tsu6721.c b/driver/usb_switch_tsu6721.c index 6f21fc7cb3..8e966b42f7 100644 --- a/driver/usb_switch_tsu6721.c +++ b/driver/usb_switch_tsu6721.c @@ -141,6 +141,11 @@ int tsu6721_mux(enum tsu6721_mux sel) return EC_SUCCESS; } +void tsu6721_set_pins(int mask) +{ + tsu6721_write(TSU6721_REG_MANUAL2, mask); +} + int tsu6721_init(void) { uint8_t settings; -- cgit v1.2.1