18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * This file is part of STM32 DAC driver 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2017, STMicroelectronics - All Rights Reserved 68c2ecf20Sopenharmony_ci * Author: Fabrice Gasnier <fabrice.gasnier@st.com>. 78c2ecf20Sopenharmony_ci */ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#ifndef __STM32_DAC_CORE_H 108c2ecf20Sopenharmony_ci#define __STM32_DAC_CORE_H 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include <linux/regmap.h> 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci/* STM32 DAC registers */ 158c2ecf20Sopenharmony_ci#define STM32_DAC_CR 0x00 168c2ecf20Sopenharmony_ci#define STM32_DAC_DHR12R1 0x08 178c2ecf20Sopenharmony_ci#define STM32_DAC_DHR12R2 0x14 188c2ecf20Sopenharmony_ci#define STM32_DAC_DOR1 0x2C 198c2ecf20Sopenharmony_ci#define STM32_DAC_DOR2 0x30 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci/* STM32_DAC_CR bit fields */ 228c2ecf20Sopenharmony_ci#define STM32_DAC_CR_EN1 BIT(0) 238c2ecf20Sopenharmony_ci#define STM32H7_DAC_CR_HFSEL BIT(15) 248c2ecf20Sopenharmony_ci#define STM32_DAC_CR_EN2 BIT(16) 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci/** 278c2ecf20Sopenharmony_ci * struct stm32_dac_common - stm32 DAC driver common data (for all instances) 288c2ecf20Sopenharmony_ci * @regmap: DAC registers shared via regmap 298c2ecf20Sopenharmony_ci * @vref_mv: reference voltage (mv) 308c2ecf20Sopenharmony_ci * @hfsel: high speed bus clock selected 318c2ecf20Sopenharmony_ci */ 328c2ecf20Sopenharmony_cistruct stm32_dac_common { 338c2ecf20Sopenharmony_ci struct regmap *regmap; 348c2ecf20Sopenharmony_ci int vref_mv; 358c2ecf20Sopenharmony_ci bool hfsel; 368c2ecf20Sopenharmony_ci}; 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci#endif 39