diff options
author | Fabrice Gasnier <fabrice.gasnier@st.com> | 2016-11-15 16:30:57 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-11-19 12:17:45 +0000 |
commit | 1add6988024030b08e4cc14001c4e64a901fa35b (patch) | |
tree | 106f49cef85e8b894f162858662d07a6895f389f /drivers/iio/adc/stm32-adc-core.h | |
parent | 841fcea454fe8cd9e0744721bf491700a912d87e (diff) | |
download | kernel_replicant_linux-1add6988024030b08e4cc14001c4e64a901fa35b.tar.gz kernel_replicant_linux-1add6988024030b08e4cc14001c4e64a901fa35b.tar.bz2 kernel_replicant_linux-1add6988024030b08e4cc14001c4e64a901fa35b.zip |
iio: adc: Add support for STM32 ADC core
Add core driver for STMicroelectronics STM32 ADC (Analog to Digital
Converter). STM32 ADC can be composed of up to 3 ADCs with shared
resources like clock prescaler, common interrupt line and analog
reference voltage.
This core driver basically manages shared resources.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/adc/stm32-adc-core.h')
-rw-r--r-- | drivers/iio/adc/stm32-adc-core.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/drivers/iio/adc/stm32-adc-core.h b/drivers/iio/adc/stm32-adc-core.h new file mode 100644 index 000000000000..081fa5f55015 --- /dev/null +++ b/drivers/iio/adc/stm32-adc-core.h @@ -0,0 +1,52 @@ +/* + * This file is part of STM32 ADC driver + * + * Copyright (C) 2016, STMicroelectronics - All Rights Reserved + * Author: Fabrice Gasnier <fabrice.gasnier@st.com>. + * + * License type: GPLv2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __STM32_ADC_H +#define __STM32_ADC_H + +/* + * STM32 - ADC global register map + * ________________________________________________________ + * | Offset | Register | + * -------------------------------------------------------- + * | 0x000 | Master ADC1 | + * -------------------------------------------------------- + * | 0x100 | Slave ADC2 | + * -------------------------------------------------------- + * | 0x200 | Slave ADC3 | + * -------------------------------------------------------- + * | 0x300 | Master & Slave common regs | + * -------------------------------------------------------- + */ +#define STM32_ADC_MAX_ADCS 3 +#define STM32_ADCX_COMN_OFFSET 0x300 + +/** + * struct stm32_adc_common - stm32 ADC driver common data (for all instances) + * @base: control registers base cpu addr + * @vref_mv: vref voltage (mv) + */ +struct stm32_adc_common { + void __iomem *base; + int vref_mv; +}; + +#endif |