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