2017-12-05 14:55:59 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2016-11-15 15:30:57 +00:00
|
|
|
/*
|
|
|
|
* This file is part of STM32 ADC driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2016, STMicroelectronics - All Rights Reserved
|
|
|
|
* Author: Fabrice Gasnier <fabrice.gasnier@st.com>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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
|
2017-01-26 14:28:33 +00:00
|
|
|
* @phys_base: control registers base physical addr
|
2017-05-29 09:28:20 +00:00
|
|
|
* @rate: clock rate used for analog circuitry
|
2016-11-15 15:30:57 +00:00
|
|
|
* @vref_mv: vref voltage (mv)
|
|
|
|
*/
|
|
|
|
struct stm32_adc_common {
|
|
|
|
void __iomem *base;
|
2017-01-26 14:28:33 +00:00
|
|
|
phys_addr_t phys_base;
|
2017-05-29 09:28:20 +00:00
|
|
|
unsigned long rate;
|
2016-11-15 15:30:57 +00:00
|
|
|
int vref_mv;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|