diff options
author | Vic (Chun-Ju) Yang <victoryang@chromium.org> | 2013-12-19 14:51:06 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-12-20 05:08:02 +0000 |
commit | 1b1d2e999c7349e896121abec9515270a76072f9 (patch) | |
tree | a39a10a56111ba2618da232771220bc685d4ef75 /chip/mec1322/registers.h | |
parent | c455d255076f50b217f35115f2591bc5ce5f0c69 (diff) | |
download | chrome-ec-1b1d2e999c7349e896121abec9515270a76072f9.tar.gz |
mec1322: ADC driver
ADC driver for MEC1322 with ADC interrupt support.
BUG=chrome-os-partner:24107
TEST=Read single channel
TEST=Read all channels
BRANCH=None
Change-Id: I89d196c7fd78e736575e2c368b65cfb1ec651004
Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/180832
Diffstat (limited to 'chip/mec1322/registers.h')
-rw-r--r-- | chip/mec1322/registers.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chip/mec1322/registers.h b/chip/mec1322/registers.h index 14c1aebfff..5a5aa98f2b 100644 --- a/chip/mec1322/registers.h +++ b/chip/mec1322/registers.h @@ -262,6 +262,16 @@ static inline uintptr_t gpio_port_base(int port_id) #define MEC1322_KS_EXT_CTRL REG32(MEC1322_KS_BASE + 0x14) +/* ADC */ +#define MEC1322_ADC_BASE 0x40007c00 +#define MEC1322_ADC_CTRL REG32(MEC1322_ADC_BASE + 0x0) +#define MEC1322_ADC_DELAY REG32(MEC1322_ADC_BASE + 0x4) +#define MEC1322_ADC_STS REG32(MEC1322_ADC_BASE + 0x8) +#define MEC1322_ADC_SINGLE REG32(MEC1322_ADC_BASE + 0xc) +#define MEC1322_ADC_REPEAT REG32(MEC1322_ADC_BASE + 0x10) +#define MEC1322_ADC_READ(x) REG32(MEC1322_ADC_BASE + 0x14 + (x) * 0x4) + + /* IRQ Numbers */ #define MEC1322_IRQ_I2C_0 0 #define MEC1322_IRQ_I2C_1 1 |