xref: /linux/sound/soc/codecs/aw87390.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 // SPDX-License-Identifier: GPL-2.0-only
2 //
3 // aw87390.h  --  aw87390 ALSA SoC Audio driver
4 //
5 // Copyright (c) 2023 awinic Technology CO., LTD
6 //
7 // Author: Weidong Wang <wangweidong.a@awinic.com>
8 //
9 
10 #ifndef __AW87390_H__
11 #define __AW87390_H__
12 
13 #define AW87390_ID_REG			(0x00)
14 #define AW87390_SYSCTRL_REG		(0x01)
15 #define AW87390_MDCTRL_REG		(0x02)
16 #define AW87390_CPOVP_REG		(0x03)
17 #define AW87390_CPP_REG		(0x04)
18 #define AW87390_PAG_REG		(0x05)
19 #define AW87390_AGC3P_REG		(0x06)
20 #define AW87390_AGC3PA_REG		(0x07)
21 #define AW87390_AGC2P_REG		(0x08)
22 #define AW87390_AGC2PA_REG		(0x09)
23 #define AW87390_AGC1PA_REG		(0x0A)
24 #define AW87390_SYSST_REG		(0x59)
25 #define AW87390_SYSINT_REG		(0x60)
26 #define AW87390_DFT_SYSCTRL_REG	(0x61)
27 #define AW87390_DFT_MDCTRL_REG		(0x62)
28 #define AW87390_DFT_CPADP_REG		(0x63)
29 #define AW87390_DFT_AGCPA_REG		(0x64)
30 #define AW87390_DFT_POFR_REG		(0x65)
31 #define AW87390_DFT_OC_REG		(0x66)
32 #define AW87390_DFT_ADP1_REG		(0x67)
33 #define AW87390_DFT_REF_REG		(0x68)
34 #define AW87390_DFT_LDO_REG		(0x69)
35 #define AW87390_ADP1_REG		(0x70)
36 #define AW87390_ADP2_REG		(0x71)
37 #define AW87390_NG1_REG		(0x72)
38 #define AW87390_NG2_REG		(0x73)
39 #define AW87390_NG3_REG		(0x74)
40 #define AW87390_CP_REG			(0x75)
41 #define AW87390_AB_REG			(0x76)
42 #define AW87390_TEST_REG		(0x77)
43 #define AW87390_ENCR_REG		(0x78)
44 #define AW87390_DELAY_REG_ADDR		(0xFE)
45 
46 #define AW87390_SOFT_RESET_VALUE	(0xAA)
47 #define AW87390_POWER_DOWN_VALUE	(0x00)
48 #define AW87390_REG_MAX		(0xFF)
49 #define AW87390_DEV_DEFAULT_CH		(0)
50 #define AW87390_INIT_PROFILE		(0)
51 #define AW87390_REG_DELAY_TIME		(1000)
52 #define AW87390_I2C_NAME		"aw87390"
53 #define AW87390_ACF_FILE		"aw87390_acf.bin"
54 
55 #define AW87390_PROFILE_EXT(xname, profile_info, profile_get, profile_set) \
56 { \
57 	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
58 	.name = xname, \
59 	.info = profile_info, \
60 	.get = profile_get, \
61 	.put = profile_set, \
62 }
63 
64 enum aw87390_id {
65 	AW87390_CHIP_ID = 0x76,
66 };
67 
68 enum {
69 	AW87390_DEV_FW_FAILED = 0,
70 	AW87390_DEV_FW_OK,
71 };
72 
73 enum {
74 	AW87390_DEV_PW_OFF = 0,
75 	AW87390_DEV_PW_ON,
76 };
77 
78 struct aw87390 {
79 	struct aw_device *aw_pa;
80 	struct mutex lock;
81 	struct regmap *regmap;
82 	struct aw_container *aw_cfg;
83 };
84 
85 #endif
86