- Set a default PCM volume so that something can be heard when driver is
[AROS.git] / workbench / devs / AHI / Drivers / ac97 / DriverData.h
blob2cc5da23b239b8f4618f87064c094e4be9d0866c
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>
11 #include <hidd/irq.h>
13 #include "DriverBase.h"
15 struct ac97Base
17 struct DriverBase driverbase;
18 struct Library* dosbase;
19 struct OOPBase* oopbase;
20 struct ExecBase* sysbase;
21 BOOL cardfound;
22 ULONG mixerbase;
23 ULONG dmabase;
24 ULONG irq_num;
26 /* card specific data */
27 ULONG off_po_sr;
28 ULONG off_po_picb;
29 ULONG size_shift;
30 /* card specific data ends */
32 struct {
33 APTR sample_address;
34 ULONG sample_size;
35 } *PCM_out;
37 void (*mixer_set_reg)(struct ac97Base *, ULONG reg, UWORD value);
38 UWORD (*mixer_get_reg)(struct ac97Base *, ULONG reg);
41 #define DRIVERBASE_SIZEOF (sizeof (struct ac97Base))
43 #define DOSBase ((struct DosLibrary*)ac97Base->dosbase)
44 #define OOPBase ((struct OOPBase *)ac97Base->oopbase)
46 struct AC97Data
48 struct DriverData driverdata;
49 UBYTE flags;
50 UBYTE pad1;
51 BYTE mastersignal;
52 BYTE slavesignal;
53 struct Process* mastertask;
54 struct Process* slavetask;
55 struct ac97Base* ahisubbase;
56 APTR mixbuffer;
57 UWORD old_SR;
59 HIDDT_IRQ_Handler *irq;
61 ULONG out_volume;
64 /* AC97 mixer registers */
65 #define AC97_RESET 0x00
66 #define AC97_MASTER_VOL 0x02
67 #define AC97_HEADPHONE_VOL 0x04
68 #define AC97_MASTER_MONO_VOL 0x06
69 #define AC97_TONE 0x08
70 #define AC97_PCBEEP_VOL 0x0a
71 #define AC97_PHONE_VOL 0x0c
72 #define AC97_MIC_VOL 0x0e
73 #define AC97_LINEIN_VOL 0x10
74 #define AC97_CD_VOL 0x12
75 #define AC97_VIDEO_VOL 0x14
76 #define AC97_AUX_VOL 0x16
77 #define AC97_PCM_VOL 0x18
78 #define AC97_RECORD_SEL 0x1a
79 #define AC97_RECORD_GAIN 0x1c
80 #define AC97_RECORD_GAIN_MIX 0x1e
81 #define AC97_POWERDOWN 0x26
83 #define PO_BDBAR 0x10
84 #define PO_CIV 0x14
85 #define PO_LVI 0x15
86 #define DEFAULT_PO_SR 0x16
87 #define DEFAULT_PO_PICB 0x18
88 #define PO_PIV 0x1a
89 #define PO_CR 0x1b
91 #define GLOB_CNT 0x2c
92 #define GLOB_STA 0x30
93 #define ACC_SEMA 0x34
95 #endif /* AHI_Drivers_AC97_DriverData_h */