summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2012-12-22 15:39:15 +0800
committerGerrit <chrome-bot@google.com>2012-12-22 01:54:35 -0800
commitd4fc07c1c2a50c3ef1fe8d06001c0523793c4be3 (patch)
treeb0d93bc03d9d82f7d6ee0190392983c4a11e66af
parent4d7820f4ad5ab746d5d07e72d10251a16cb2953a (diff)
downloadchrome-ec-d4fc07c1c2a50c3ef1fe8d06001c0523793c4be3.tar.gz
spring: Setting for USB voltage sense ADC
This changes ID pin sensing to VBUS sensing. BUG=chrome-os-partner:14319 TEST=Build success. BRANCH=none Change-Id: I179f7ab891f83d5c50ec7766372ba8826b3cd231 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/40154 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/spring/board.c8
-rw-r--r--board/spring/board.h2
2 files changed, 7 insertions, 3 deletions
diff --git a/board/spring/board.c b/board/spring/board.c
index b46bce1d44..49d591b87e 100644
--- a/board/spring/board.c
+++ b/board/spring/board.c
@@ -98,8 +98,12 @@ const struct gpio_info gpio_list[GPIO_COUNT] = {
/* ADC channels */
const struct adc_t adc_channels[ADC_CH_COUNT] = {
- /* Micro USB ID pin. Raw ADC value. */
- [ADC_CH_USB_ID] = {"USB_ID", 1, 1, 0, STM32_AIN(5)},
+ /*
+ * VBUS voltage sense pin.
+ * Sense pin 3.3V is converted to 4096. Accounting for the 2x
+ * voltage divider, the conversion factor is 6600mV/4096.
+ */
+ [ADC_CH_USB_VBUS_SNS] = {"USB_VBUS_SNS", 6600, 4096, 0, STM32_AIN(5)},
/* Micro USB D+ sense pin. Raw ADC value. */
[ADC_CH_USB_DP_SNS] = {"USB_DP_SNS", 1, 1, 0, STM32_AIN(2)},
/* Micro USB D- sense pin. Raw ADC value. */
diff --git a/board/spring/board.h b/board/spring/board.h
index a53976419b..4e78134842 100644
--- a/board/spring/board.h
+++ b/board/spring/board.h
@@ -65,7 +65,7 @@
/* ADC signal */
#define CONFIG_ADC
enum adc_channel {
- ADC_CH_USB_ID = 0,
+ ADC_CH_USB_VBUS_SNS = 0,
ADC_CH_USB_DP_SNS,
ADC_CH_USB_DN_SNS,