tsu6721: add function to control output pins

BRANCH=none
BUG=none
TEST=check mux actually switches

Change-Id: If157302329c2b570814d2a071078949bfe368356
Signed-off-by: Dominic Chen <ddchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/203492
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Dominic Chen
2014-06-11 15:12:20 -07:00
committed by chrome-internal-fetch
parent 054d4772d0
commit 5408b10490
2 changed files with 12 additions and 0 deletions

View File

@@ -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);

View File

@@ -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;