Skip to content

Commit 29ddce1

Browse files
wangweidongabroonie
authored andcommitted
ASoC: codecs: Add calibration function to aw88399 chip
Add calibration functionality to the aw88399 chip. When the chip is in calibration condition, calibration can be achieved by configuring the chip's internal DSP and save the calibration values in cali_re. Signed-off-by: Weidong Wang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 086d096 commit 29ddce1

File tree

3 files changed

+493
-2
lines changed

3 files changed

+493
-2
lines changed

sound/soc/codecs/aw88395/aw88395_device.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ struct aw_profctrl_desc {
102102
unsigned int cur_mode;
103103
};
104104

105+
enum {
106+
CALI_RESULT_NORMAL,
107+
CALI_RESULT_ERROR,
108+
};
109+
105110
struct aw_volume_desc {
106111
unsigned int init_volume;
107112
unsigned int mute_volume;
@@ -124,9 +129,25 @@ struct aw_cali_delay_desc {
124129
unsigned int delay;
125130
};
126131

132+
#define AW_CALI_CFG_NUM (4)
133+
struct cali_cfg {
134+
uint32_t data[AW_CALI_CFG_NUM];
135+
};
136+
137+
struct aw_cali_backup_desc {
138+
unsigned int dsp_ng_cfg;
139+
unsigned int dsp_lp_cfg;
140+
};
141+
127142
struct aw_cali_desc {
128143
u32 cali_re;
129144
u32 ra;
145+
bool cali_switch;
146+
bool cali_running;
147+
uint16_t cali_result;
148+
uint16_t store_vol;
149+
struct cali_cfg cali_cfg;
150+
struct aw_cali_backup_desc backup_info;
130151
};
131152

132153
struct aw_container {

0 commit comments

Comments
 (0)