1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2010 Samsung Electronics
4 * Minkyu Kang <mk7.kang@samsung.com>
5 * MyungJoo Ham <myungjoo.ham@samsung.com>
8 #ifndef __ASM_ARM_ARCH_ADC_H_
9 #define __ASM_ARM_ARCH_ADC_H_
11 #define ADC_V2_CON1_SOFT_RESET (0x2 << 1)
12 #define ADC_V2_CON1_STC_EN 0x1
14 #define ADC_V2_CON2_OSEL(x) (((x) & 0x1) << 10)
16 #define OSEL_BINARY 0x1
17 #define ADC_V2_CON2_ESEL(x) (((x) & 0x1) << 9)
18 #define ESEL_ADC_EVAL_TIME_40CLK 0x0
19 #define ESEL_ADC_EVAL_TIME_20CLK 0x1
20 #define ADC_V2_CON2_HIGHF(x) (((x) & 0x1) << 8)
21 #define HIGHF_CONV_RATE_30KSPS 0x0
22 #define HIGHF_CONV_RATE_600KSPS 0x1
23 #define ADC_V2_CON2_C_TIME(x) (((x) & 0x7) << 4)
24 #define ADC_V2_CON2_CHAN_SEL_MASK 0xf
25 #define ADC_V2_CON2_CHAN_SEL(x) ((x) & ADC_V2_CON2_CHAN_SEL_MASK)
27 #define ADC_V2_GET_STATUS_FLAG(x) (((x) >> 2) & 0x1)
28 #define FLAG_CONV_END 0x1
30 #define ADC_V2_INT_DISABLE 0x0
31 #define ADC_V2_INT_ENABLE 0x1
32 #define INT_NOT_GENERATED 0x0
33 #define INT_GENERATED 0x1
35 #define ADC_V2_VERSION 0x80000008
37 #define ADC_V2_MAX_CHANNEL 9
39 /* For default 8 time convertion with sample rate 600 kSPS - 15us timeout */
40 #define ADC_V2_CONV_TIMEOUT_US 15
42 #define ADC_V2_DAT_MASK 0xfff
52 unsigned int adcclrint;
54 unsigned int adcclrintpndnup;
57 struct exynos_adc_v2 {
63 unsigned int int_status;
64 unsigned int reserved[2];
69 #endif /* __ASM_ARM_ARCH_ADC_H_ */