xref: /linux/sound/soc/codecs/aw88399.h (revision e5c91aac491def6ab3f90c4cc246e3fcb0f8f058)
1 // SPDX-License-Identifier: GPL-2.0-only
2 //
3 // aw88399.h --  ALSA SoC AW88399 codec support
4 //
5 // Copyright (c) 2023 AWINIC Technology CO., LTD
6 //
7 // Author: Weidong Wang <wangweidong.a@awinic.com>
8 //
9 
10 #ifndef __AW88399_H__
11 #define __AW88399_H__
12 
13 #include <sound/aw88399.h>
14 
15 #define AW88399_I2C_NAME			"aw88399"
16 
17 #define AW88399_RATES (SNDRV_PCM_RATE_8000_48000 | \
18 			SNDRV_PCM_RATE_96000)
19 #define AW88399_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
20 			SNDRV_PCM_FMTBIT_S24_LE | \
21 			SNDRV_PCM_FMTBIT_S32_LE)
22 
23 #define FADE_TIME_MAX		100000
24 #define FADE_TIME_MIN		0
25 
26 #define AW_CALI_READ_CNT_MAX			(8)
27 #define AW88399_DSP_REG_CALRE			(0x8141)
28 #define AW88399_DSP_REG_CALRE_SHIFT		(10)
29 #define AW_CALI_DATA_SUM_RM			(2)
30 
31 #define AW88399_DSP_REG_CFG_MBMEC_ACTAMPTH	(0x9B4C)
32 #define AW88399_DSP_REG_CFG_MBMEC_NOISEAMPTH	(0x9B4E)
33 #define AW88399_DSP_REG_CFG_ADPZ_USTEPN	(0x9B6E)
34 #define AW88399_DSP_REG_CFG_RE_ALPHA		(0x9BD4)
35 #define AW_GET_IV_CNT_MAX			(6)
36 
37 #define AW88399_DSP_VOL_MUTE			(0XFF00)
38 
39 #define AW88399_DSP_LOW_POWER_SWITCH_CFG_ADDR	(0x9BEC)
40 #define AW88399_DSP_LOW_POWER_SWITCH_DISABLE	(0x110b)
41 
42 #define AW88399_PROFILE_EXT(xname, profile_info, profile_get, profile_set) \
43 { \
44 	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
45 	.name = xname, \
46 	.info = profile_info, \
47 	.get = profile_get, \
48 	.put = profile_set, \
49 }
50 
51 #endif /* __AW88399_H__ */
52