diff options
author | Bill Richardson <wfrichar@chromium.org> | 2013-06-12 11:32:48 -0700 |
---|---|---|
committer | Bill Richardson <wfrichar@chromium.org> | 2013-06-13 09:02:04 -0700 |
commit | cab5abeb40a9fe171ebef931df2fc1655d18314a (patch) | |
tree | bf653574d77b6445cff0849d179d97596ef58d55 | |
parent | ffce85ac520e3d8b928f1ab7fe53353affbb4f5b (diff) | |
download | chrome-ec-cab5abeb40a9fe171ebef931df2fc1655d18314a.tar.gz |
Falco: Measure adapter ID voltage
This measures the analog voltage from the AC adapater's ID pin. The values
don't seem to match what we expected, so there's more work to come. Still,
here it is.
BUG=chrome-os-partner:19594
BRANCH=none
TEST=manual
From the EC console, run "adc". You should see a line like this:
ADC channel "AdapterIDVoltage" = 553
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Idf84ceb6cd85d66d879f07bf4f26881ec078f638
Reviewed-on: https://gerrit.chromium.org/gerrit/58465
-rw-r--r-- | board/falco/board.c | 6 | ||||
-rw-r--r-- | board/falco/board.h | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/board/falco/board.c b/board/falco/board.c index 978630dd45..3aa5719915 100644 --- a/board/falco/board.c +++ b/board/falco/board.c @@ -112,7 +112,7 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"PCH_RTCRST_L", LM4_GPIO_F, (1<<6), GPIO_HI_Z, NULL}, {"PCH_SRTCRST_L", LM4_GPIO_F, (1<<7), GPIO_HI_Z, NULL}, - {"PWR_LED_L", LM4_GPIO_N, (1<<6), GPIO_HI_Z, NULL}, + {"PWR_LED_L", LM4_GPIO_N, (1<<6), GPIO_OUT_HIGH, NULL}, {"KB_LED_EN", LM4_GPIO_D, (1<<4), GPIO_OUT_LOW, NULL}, {"BAT_LED0", LM4_GPIO_D, (1<<0), GPIO_OUT_LOW, NULL}, {"BAT_LED1", LM4_GPIO_D, (1<<1), GPIO_OUT_LOW, NULL}, @@ -134,7 +134,9 @@ const struct adc_t adc_channels[ADC_CH_COUNT] = { {"ChargerCurrent", LM4_ADC_SEQ1, 33 * 4000, ADC_READ_MAX * 16, 0, LM4_AIN(0), 0x06 /* IE0 | END0 */, LM4_GPIO_E, (1<<3)}, - /* HEY: Falco will have AD_TYPE on PB5/AIN11 */ + /* AC Adapter ID voltage (mv) */ + {"AdapterIDVoltage", LM4_ADC_SEQ2, 3300, ADC_READ_MAX, 0, + LM4_AIN(11), 0x06 /* IE0 | END0 */, LM4_GPIO_B, (1<<5)}, }; /* I2C ports */ diff --git a/board/falco/board.h b/board/falco/board.h index 47340da957..8ab0fae962 100644 --- a/board/falco/board.h +++ b/board/falco/board.h @@ -145,15 +145,16 @@ enum adc_channel { /* EC internal die temperature in degrees K. */ ADC_CH_EC_TEMP = 0, + /* Charger current in mA. */ + ADC_CH_CHARGER_CURRENT, + + /* AC Adapter ID voltage in mV */ + ADC_AC_ADAPTER_ID_VOLTAGE, + /* HEY: Falco MB has only one discrete thermal sensor, but it has two * values (one internal and one external). Both should be here. - * HEY: There may be a BAT_TEMP sensor on the battery pack too. */ - /* HEY: Be prepared to read this (ICMNT). */ - /* Charger current in mA. */ - ADC_CH_CHARGER_CURRENT, - ADC_CH_COUNT }; |