WIP FPC-III support
[linux/fpc-iii.git] / drivers / iio / dac / stm32-dac-core.h
blobd3b415fb9575a1c2aa00add5f63124fa043f2b56
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * This file is part of STM32 DAC driver
5 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
6 * Author: Fabrice Gasnier <fabrice.gasnier@st.com>.
7 */
9 #ifndef __STM32_DAC_CORE_H
10 #define __STM32_DAC_CORE_H
12 #include <linux/regmap.h>
14 /* STM32 DAC registers */
15 #define STM32_DAC_CR 0x00
16 #define STM32_DAC_DHR12R1 0x08
17 #define STM32_DAC_DHR12R2 0x14
18 #define STM32_DAC_DOR1 0x2C
19 #define STM32_DAC_DOR2 0x30
21 /* STM32_DAC_CR bit fields */
22 #define STM32_DAC_CR_EN1 BIT(0)
23 #define STM32H7_DAC_CR_HFSEL BIT(15)
24 #define STM32_DAC_CR_EN2 BIT(16)
26 /**
27 * struct stm32_dac_common - stm32 DAC driver common data (for all instances)
28 * @regmap: DAC registers shared via regmap
29 * @vref_mv: reference voltage (mv)
30 * @hfsel: high speed bus clock selected
32 struct stm32_dac_common {
33 struct regmap *regmap;
34 int vref_mv;
35 bool hfsel;
38 #endif