grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / devs / AHI / Drivers / ac97 / DriverData.h
blob49292d51cd5d0a6902fa51fbf484d33e5f284f9c
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 struct ac97Base
16 struct DriverBase driverbase;
17 struct Library* dosbase;
18 struct OOPBase* oopbase;
19 struct ExecBase* sysbase;
20 BOOL cardfound;
21 ULONG mixerbase;
22 ULONG dmabase;
23 ULONG irq_num;
25 /* card specific data */
26 ULONG off_po_sr;
27 ULONG off_po_picb;
28 ULONG size_shift;
29 /* card specific data ends */
31 struct {
32 APTR sample_address;
33 ULONG sample_size;
34 } *PCM_out;
36 void (*mixer_set_reg)(struct ac97Base *, ULONG reg, UWORD value);
37 UWORD (*mixer_get_reg)(struct ac97Base *, ULONG reg);
40 #define DRIVERBASE_SIZEOF (sizeof (struct ac97Base))
42 #define DOSBase ((struct DosLibrary*)ac97Base->dosbase)
43 #define OOPBase ((struct OOPBase *)ac97Base->oopbase)
45 struct AC97Data
47 struct DriverData driverdata;
48 UBYTE flags;
49 UBYTE pad1;
50 BYTE mastersignal;
51 BYTE slavesignal;
52 struct Process* mastertask;
53 struct Process* slavetask;
54 struct ac97Base* ahisubbase;
55 APTR mixbuffer;
56 UWORD old_SR;
58 struct Interrupt irq;
60 ULONG out_volume;
63 /* AC97 mixer registers */
64 #define AC97_RESET 0x00
65 #define AC97_MASTER_VOL 0x02
66 #define AC97_HEADPHONE_VOL 0x04
67 #define AC97_MASTER_MONO_VOL 0x06
68 #define AC97_TONE 0x08
69 #define AC97_PCBEEP_VOL 0x0a
70 #define AC97_PHONE_VOL 0x0c
71 #define AC97_MIC_VOL 0x0e
72 #define AC97_LINEIN_VOL 0x10
73 #define AC97_CD_VOL 0x12
74 #define AC97_VIDEO_VOL 0x14
75 #define AC97_AUX_VOL 0x16
76 #define AC97_PCM_VOL 0x18
77 #define AC97_RECORD_SEL 0x1a
78 #define AC97_RECORD_GAIN 0x1c
79 #define AC97_RECORD_GAIN_MIX 0x1e
80 #define AC97_POWERDOWN 0x26
82 #define PO_BDBAR 0x10
83 #define PO_CIV 0x14
84 #define PO_LVI 0x15
85 #define DEFAULT_PO_SR 0x16
86 #define DEFAULT_PO_PICB 0x18
87 #define PO_PIV 0x1a
88 #define PO_CR 0x1b
90 #define GLOB_CNT 0x2c
91 #define GLOB_STA 0x30
92 #define ACC_SEMA 0x34
94 #endif /* AHI_Drivers_AC97_DriverData_h */