diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2013-11-18 09:52:35 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-11-19 18:20:45 +0000 |
commit | 2c6be4ffd9445f08118b16f4952f54153cedb6ad (patch) | |
tree | f4b743ba35787a53f2a44ae6c95b82a3b039a24f | |
parent | fecd16603c8649b3d01b8900f97a573d876bd7d9 (diff) | |
download | chrome-ec-2c6be4ffd9445f08118b16f4952f54153cedb6ad.tar.gz |
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 <vpalatin@chromium.org>
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 <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/spring/usb_charging.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) |