revert between 56095 -> 55830 in arch
[AROS.git] / workbench / devs / AHI / Drivers / ac97 / DriverData.h
blob8ff86dec98ba871d4f33299810ddee3f4887779c
1 #ifndef AHI_Drivers_AC97_DriverData_h
2 #define AHI_Drivers_AC97_DriverData_h
4 #include <exec/libraries.h>
5 #include <dos/dos.h>
6 #include <oop/oop.h>
7 #include <proto/dos.h>
8 #include <proto/oop.h>
9 #include <proto/exec.h>
10 #include <hidd/pci.h>
12 #include "DriverBase.h"
14 #define ALIGN_AC97OUT 8
15 #define ALIGN_AC97(x) ((x + ALIGN_AC97OUT) & ~(ALIGN_AC97OUT-1))
17 struct ac97Base
19 struct DriverBase driverbase;
20 struct Library* dosbase;
21 struct OOPBase* oopbase;
22 struct ExecBase* sysbase;
23 #if defined(__AROS__) && (__WORDSIZE==64)
24 APTR buffer;
25 #endif
26 BOOL cardfound;
27 APTR mixerbase;
28 APTR dmabase;
29 ULONG irq_num;
31 /* card specific data */
32 ULONG off_po_sr;
33 ULONG off_po_picb;
34 ULONG size_shift;
35 /* card specific data ends */
37 struct {
38 ULONG sample_address;
39 ULONG sample_size;
40 } *PCM_out;
42 void (*mixer_set_reg)(struct ac97Base *, ULONG reg, UWORD value);
43 UWORD (*mixer_get_reg)(struct ac97Base *, ULONG reg);
46 #define DRIVERBASE_SIZEOF (sizeof (struct ac97Base))
48 #define DOSBase ((struct DosLibrary*)ac97Base->dosbase)
49 #define OOPBase ((struct OOPBase *)ac97Base->oopbase)
51 struct AC97Data
53 struct DriverData driverdata;
54 UBYTE flags;
55 UBYTE pad1;
56 BYTE mastersignal;
57 BYTE slavesignal;
58 struct Process* mastertask;
59 struct Process* slavetask;
60 struct ac97Base* ahisubbase;
61 APTR mixbuffer;
62 UWORD old_SR;
64 struct Interrupt irq;
66 ULONG out_volume;
69 /* AC97 mixer registers */
70 #define AC97_RESET 0x00
71 #define AC97_MASTER_VOL 0x02
72 #define AC97_HEADPHONE_VOL 0x04
73 #define AC97_MASTER_MONO_VOL 0x06
74 #define AC97_TONE 0x08
75 #define AC97_PCBEEP_VOL 0x0a
76 #define AC97_PHONE_VOL 0x0c
77 #define AC97_MIC_VOL 0x0e
78 #define AC97_LINEIN_VOL 0x10
79 #define AC97_CD_VOL 0x12
80 #define AC97_VIDEO_VOL 0x14
81 #define AC97_AUX_VOL 0x16
82 #define AC97_PCM_VOL 0x18
83 #define AC97_RECORD_SEL 0x1a
84 #define AC97_RECORD_GAIN 0x1c
85 #define AC97_RECORD_GAIN_MIX 0x1e
86 #define AC97_POWERDOWN 0x26
88 #define PO_BDBAR 0x10
89 #define PO_CIV 0x14
90 #define PO_LVI 0x15
91 #define DEFAULT_PO_SR 0x16
92 #define DEFAULT_PO_PICB 0x18
93 #define PO_PIV 0x1a
94 #define PO_CR 0x1b
96 #define GLOB_CNT 0x2c
97 #define GLOB_STA 0x30
98 #define ACC_SEMA 0x34
100 #endif /* AHI_Drivers_AC97_DriverData_h */