From 2c6be4ffd9445f08118b16f4952f54153cedb6ad Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Mon, 18 Nov 2013 09:52:35 -0800 Subject: spring: export the charger ID pin value in the charger type The current device type is 24-bit integer (concatenation of the TSU6721 3 8-bit device type registers), I'm adding the 5-bit ADC reading of ID pin resistance from the TSU6721 as the most significant byte. Signed-off-by: Vincent Palatin BRANCH=spring BUG=none TEST=On Spring, plug various charger and check UI and power_supply_info outputs. Change-Id: I5adabc9325714d78086e4fb4dc1ca7dfb0353d32 Reviewed-on: https://chromium-review.googlesource.com/177135 Reviewed-by: Todd Broch Commit-Queue: Vincent Palatin Tested-by: Vincent Palatin --- board/spring/usb_charging.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c index ec7ecb034f..7b736025d6 100644 --- a/board/spring/usb_charging.c +++ b/board/spring/usb_charging.c @@ -1042,7 +1042,10 @@ void board_usb_charge_update(int force_update) int board_get_usb_dev_type(void) { - return charger_idle ? 0 : current_dev_type; + uint8_t id = tsu6721_read(TSU6721_REG_ADC); + int dev_type = charger_idle ? 0 : current_dev_type; + + return ((int)id << 24) | dev_type; } int board_get_usb_current_limit(void) -- cgit v1.2.1