xref: /minix3/minix/drivers/audio/es1370/AC97.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #ifndef AC97_MIXER_H
2*433d6423SLionel Sambuc #define AC97_MIXER_H
3*433d6423SLionel Sambuc 
4*433d6423SLionel Sambuc /* This is a main memory cache copy of the codec's ac97 configuration
5*433d6423SLionel Sambuc    registers. See Intel's Audio Codec 97 standard (rev2.3) for info. */
6*433d6423SLionel Sambuc 
7*433d6423SLionel Sambuc typedef struct ac97_struct {
8*433d6423SLionel Sambuc   u16_t Reset;                    /* 0x00 */
9*433d6423SLionel Sambuc   u16_t MasterVolume;             /* 0x02 */
10*433d6423SLionel Sambuc   u16_t AUXOutVolume;             /* 0x04 */
11*433d6423SLionel Sambuc   u16_t MonoVolume;               /* 0x06 */
12*433d6423SLionel Sambuc   u16_t MasterTone;               /* 0x08 */
13*433d6423SLionel Sambuc   u16_t PCBeepVolume;             /* 0x0A */
14*433d6423SLionel Sambuc   u16_t PhoneVolume;              /* 0x0C */
15*433d6423SLionel Sambuc   u16_t MicVolume;                /* 0x0E */
16*433d6423SLionel Sambuc   u16_t LineInVolume;             /* 0x10 */
17*433d6423SLionel Sambuc   u16_t CDVolume;                 /* 0x12 */
18*433d6423SLionel Sambuc   u16_t VideoVolume;              /* 0x14 */
19*433d6423SLionel Sambuc   u16_t AUXInVolume;              /* 0x16 */
20*433d6423SLionel Sambuc   u16_t PCMOutVolume;             /* 0x18 */
21*433d6423SLionel Sambuc   u16_t RecordSelect;             /* 0x1A */
22*433d6423SLionel Sambuc   u16_t RecordGain;               /* 0x1C */
23*433d6423SLionel Sambuc   u16_t RecordGainMic;            /* 0x1E */
24*433d6423SLionel Sambuc   u16_t GeneralPurpose;           /* 0x20 */
25*433d6423SLionel Sambuc   u16_t Control3D;                /* 0x22 */
26*433d6423SLionel Sambuc   u16_t AudioIntAndPaging;        /* 0x24 */
27*433d6423SLionel Sambuc   u16_t PowerdownControlAndStat;  /* 0x26 */
28*433d6423SLionel Sambuc   u16_t ExtendedAudio1;           /* 0x28 */
29*433d6423SLionel Sambuc   u16_t ExtendedAudio2;           /* 0x2A */
30*433d6423SLionel Sambuc                                   /* ...  */
31*433d6423SLionel Sambuc   u16_t VendorID1;                /* 0x7C */
32*433d6423SLionel Sambuc   u16_t VendorID2;                /* 0x7E */
33*433d6423SLionel Sambuc } ac97_t;
34*433d6423SLionel Sambuc 
35*433d6423SLionel Sambuc 
36*433d6423SLionel Sambuc 
37*433d6423SLionel Sambuc /* Source and output volume control register defines */
38*433d6423SLionel Sambuc #define AC97_MASTER_VOLUME        0x02U   /* Master out */
39*433d6423SLionel Sambuc #define AC97_AUX_OUT_VOLUME       0x04U   /* Auxiliary out volume */
40*433d6423SLionel Sambuc #define AC97_MONO_VOLUME          0x06U   /* Mono out volume */
41*433d6423SLionel Sambuc #define AC97_MASTER_TONE          0x08U   /* high byte= bass, low byte= treble*/
42*433d6423SLionel Sambuc #define AC97_PC_BEEP_VOLUME       0x0aU   /* PC speaker volume */
43*433d6423SLionel Sambuc #define AC97_PHONE_VOLUME         0x0cU   /* Phone volume */
44*433d6423SLionel Sambuc #define AC97_MIC_VOLUME           0x0eU   /* Mic, mono */
45*433d6423SLionel Sambuc #define AC97_LINE_IN_VOLUME       0x10U   /* Line volume */
46*433d6423SLionel Sambuc #define AC97_CD_VOLUME            0x12U   /* CD audio volume */
47*433d6423SLionel Sambuc #define AC97_VIDEO_VOLUME         0x14U   /* Video (TV) volume */
48*433d6423SLionel Sambuc #define AC97_AUX_IN_VOLUME        0x16U   /* Aux line source, left */
49*433d6423SLionel Sambuc #define AC97_PCM_OUT_VOLUME       0x18U   /* The DACs - wav+synth */
50*433d6423SLionel Sambuc #define AC97_RECORD_GAIN_VOLUME   0x1cU   /* Record input level */
51*433d6423SLionel Sambuc 
52*433d6423SLionel Sambuc /* Other CODEC control register defines */
53*433d6423SLionel Sambuc #define AC97_RESET                     0x00U   /* any write here to reset CODEC */
54*433d6423SLionel Sambuc #define AC97_GENERAL_PURPOSE           0x20U   /*  */
55*433d6423SLionel Sambuc #define AC97_POWERDOWN_CONTROL_STAT    0x26U   /*  */
56*433d6423SLionel Sambuc #define AC97_RECORD_SELECT             0x1aU   /* record mux select */
57*433d6423SLionel Sambuc #define AC97_VENDOR_ID1                0x7cU   /* 1st two Vendor ID bytes */
58*433d6423SLionel Sambuc #define AC97_VENDOR_ID2                0x7eU   /* last Vendor ID byte plus rev. number */
59*433d6423SLionel Sambuc 
60*433d6423SLionel Sambuc /* Record Select defines */
61*433d6423SLionel Sambuc #define AC97_RECORD_MIC         0
62*433d6423SLionel Sambuc #define AC97_RECORD_CD          1
63*433d6423SLionel Sambuc #define AC97_RECORD_VIDEO       2
64*433d6423SLionel Sambuc #define AC97_RECORD_AUX         3
65*433d6423SLionel Sambuc #define AC97_RECORD_LINE        4
66*433d6423SLionel Sambuc #define AC97_RECORD_STEREO_MIX  5
67*433d6423SLionel Sambuc #define AC97_RECORD_MONO_MIX    6
68*433d6423SLionel Sambuc #define AC97_RECORD_PHONE       7
69*433d6423SLionel Sambuc 
70*433d6423SLionel Sambuc #define MASTER_VOL_MASK     0x1F
71*433d6423SLionel Sambuc #define DAC_VOL_MASK        0x1F
72*433d6423SLionel Sambuc #define AUX_IN_VOL_MASK     0x1F
73*433d6423SLionel Sambuc #define MUTE_MASK           0x8000
74*433d6423SLionel Sambuc #endif  /* AC97_MIXER_H */
75