From cab5abeb40a9fe171ebef931df2fc1655d18314a Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Wed, 12 Jun 2013 11:32:48 -0700 Subject: [PATCH] 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 Change-Id: Idf84ceb6cd85d66d879f07bf4f26881ec078f638 Reviewed-on: https://gerrit.chromium.org/gerrit/58465 --- board/falco/board.c | 6 ++++-- board/falco/board.h | 13 +++++++------ 2 files changed, 11 insertions(+), 8 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, - /* 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, + /* 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. + */ + ADC_CH_COUNT };