1 /*
2  * Copyright (c) 2006-2021, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2018-05-25     RT-Thread    the first version
9  */
10 
11 #ifndef __DRV_AC97_H__
12 #define __DRV_AC97_H__
13 
14 /* Register offsets */
15 #define AC97_RESET              0x00
16 #define AC97_MASTER             0x02
17 #define AC97_HEADPHONE          0x04
18 #define AC97_MASTER_MONO        0x06
19 #define AC97_MASTER_TONE        0x08
20 #define AC97_PC_BEEP            0x0A    //mixer volume
21 #define AC97_PHONE              0x0C
22 #define AC97_MIC                0x0E    //qwert db
23 #define AC97_LINE               0x10
24 #define AC97_CD                 0x12
25 #define AC97_VIDEO              0x14
26 #define AC97_AUX                0x16
27 #define AC97_PCM                0x18
28 #define AC97_REC_SEL            0x1A    //0 represent mic
29 #define AC97_REC_GAIN           0x1C
30 #define AC97_REC_GAIN_MIC       0x1E
31 #define AC97_GENERAL_PURPOSE    0x20
32 #define AC97_3D_CONTROL         0x22
33 #define AC97_INT_PAGING         0x24    //qwert
34 #define AC97_POWERDOWN          0x26
35 #define AC97_PCM_FRONT_DAC_RATE 0x2c    /* PCM Front DAC Rate */
36 #define AC97_PCM_SURR_DAC_RATE  0x2e    /* PCM Surround DAC Rate */
37 #define AC97_PCM_LFE_DAC_RATE   0x30    /* PCM LFE DAC Rate */
38 #define AC97_PCM_LR_ADC_RATE    0x32    /* PCM LR ADC Rate */
39 #define AC97_PCM_MIC_ADC_RATE   0x34    /* PCM MIC ADC Rate */
40 #define AC97_DAC_SLOT_MAP       0x6C
41 #define AC97_ADC_SLOT_MAP       0x6E
42 
43 void ac97_reset(void);
44 rt_err_t ac97_set_vol(int vol);
45 int ac97_get_vol(void);
46 rt_err_t ac97_set_rate(int rate);
47 int ac97_get_rate(void);
48 
49 #endif
50