diff options
author | tim <tim2.lin@ite.corp-partner.google.com> | 2020-04-28 10:45:35 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-29 11:06:51 +0000 |
commit | 7f310174323b5e67292b90375447f3ec06998ff3 (patch) | |
tree | 85f4b524c2d5394236718a448b90c15c1d698b54 /board/it8xxx2_evb | |
parent | dc5f575bdd51a022eb8e6daac74ab348620c73ba (diff) | |
download | chrome-ec-7f310174323b5e67292b90375447f3ec06998ff3.tar.gz |
it83xx/adc: enabled GPIO alternate mode by default for pin into gpio.inc marked as MODULE_ADC
In the ADC initialization function, we should use the function
of gpio_config_module to set alternate function and declare
corresponding alternate function pins in gpio.inc. So we are
able to enable extra flag if needed.
BUG=none
BRANCH=none
TEST=testing the alternate function pins are normal
on the board of it83xx_evb, it8xxx2_evb, it8xxx2_pdevb
and reef_it8320.
Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com>
Change-Id: I734b6ecc8f9343be65d9f29837e793b9574f8bdc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2160241
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board/it8xxx2_evb')
-rw-r--r-- | board/it8xxx2_evb/board.c | 8 | ||||
-rw-r--r-- | board/it8xxx2_evb/gpio.inc | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/board/it8xxx2_evb/board.c b/board/it8xxx2_evb/board.c index 082b8c0d9f..0daa3d48cd 100644 --- a/board/it8xxx2_evb/board.c +++ b/board/it8xxx2_evb/board.c @@ -52,28 +52,28 @@ const struct adc_t adc_channels[] = { .factor_mul = ADC_MAX_MVOLT, .factor_div = ADC_READ_MAX + 1, .shift = 0, - .channel = CHIP_ADC_CH13, /* GPL0, ADC13 */ + .channel = CHIP_ADC_CH13, /* GPL1, ADC13 */ }, [ADC_EVB_CH_14] = { .name = "ADC_EVB_CH_14", .factor_mul = ADC_MAX_MVOLT, .factor_div = ADC_READ_MAX + 1, .shift = 0, - .channel = CHIP_ADC_CH14, /* GPL1, ADC14 */ + .channel = CHIP_ADC_CH14, /* GPL2, ADC14 */ }, [ADC_EVB_CH_15] = { .name = "ADC_EVB_CH_15", .factor_mul = ADC_MAX_MVOLT, .factor_div = ADC_READ_MAX + 1, .shift = 0, - .channel = CHIP_ADC_CH15, /* GPL2, ADC15 */ + .channel = CHIP_ADC_CH15, /* GPL3, ADC15 */ }, [ADC_EVB_CH_16] = { .name = "ADC_EVB_CH_16", .factor_mul = ADC_MAX_MVOLT, .factor_div = ADC_READ_MAX + 1, .shift = 0, - .channel = CHIP_ADC_CH16, /* GPL3, ADC16 */ + .channel = CHIP_ADC_CH16, /* GPL0, ADC16 */ }, }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); diff --git a/board/it8xxx2_evb/gpio.inc b/board/it8xxx2_evb/gpio.inc index dd4b88e416..008034cfb3 100644 --- a/board/it8xxx2_evb/gpio.inc +++ b/board/it8xxx2_evb/gpio.inc @@ -71,3 +71,5 @@ ALTERNATE(PIN_MASK(C, 0x06), 1, MODULE_I2C, 0) /* I2C B SCL/SDA */ ALTERNATE(PIN_MASK(F, 0xC0), 1, MODULE_I2C, 0) /* I2C C SCL/SDA */ #endif ALTERNATE(PIN_MASK(E, 0x81), 1, MODULE_I2C, 0) /* I2C E SCL/SDA E0/E7 */ +ALTERNATE(PIN_MASK(I, 0x03), 1, MODULE_ADC, 0) /* ADC CH0, CH1 */ +ALTERNATE(PIN_MASK(L, 0x0F), 1, MODULE_ADC, 0) /* ADC CH13-CH16 */ |