-
Notifications
You must be signed in to change notification settings - Fork 1
/
DriverData.h
executable file
·147 lines (105 loc) · 3.75 KB
/
DriverData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#ifndef AHI_Drivers_Card_DriverData_h
#define AHI_Drivers_Card_DriverData_h
#include <IOKit/PCI/IOPCIDevice.h>
#include <IOKit/audio/IOAudioDevice.h>
#define UWORD unsigned short
#define ULONG UInt32
#define BOOL bool
#define APTR void *
#define UBYTE UInt8
#define DATA_PORT CCS_UART_DATA
#define COMMAND_PORT CCS_UART_COMMAND
#define STATUS_PORT CCS_UART_COMMAND
#define STATUSF_OUTPUT 0x40
#define STATUSF_INPUT 0x80
#define COMMAND_RESET 0xff
#define DATA_ACKNOWLEDGE 0xfe
#define COMMAND_UART_MODE 0x3f
#define MPU401_OUTPUT_READY() ((dev->InByte(card->iobase + STATUS_PORT) & STATUSF_OUTPUT) == 0)
#define MPU401_INPUT_READY() ((dev->InByte(card->iobase + STATUS_PORT) & STATUSF_INPUT) == 0)
#define MPU401_CMD(c) dev->OutByte(card->iobase + COMMAND_PORT, c)
#define MPU401_STATUS() dev->InByte(card->iobase + STATUS_PORT)
#define MPU401_READ() dev->InByte(card->iobase + DATA_PORT )
#define MPU401_WRITE(v) dev->OutByte(card->iobase + DATA_PORT,v )
enum Model {PHASE88, MAUDIO_2496, MAUDIO_1010LT, MAUDIO_DELTA44, MAUDIO_DELTA66, MAUDIO_1010, EWX2496, GENERIC, DELTA_410};
struct CardData;
#include "ak_codec.h"
#include "I2C.h"
#define NUM_SAMPLE_FRAMES 4096
struct CardSpecific
{
UInt32 NumChannels;
bool HasSPDIF;
UInt32 BufferSize;
UInt32 BufferSizeRec;
};
struct Parm
{
SInt32 InitialValue;
SInt32 MinValue;
SInt32 MaxValue;
IOFixed MindB;
IOFixed MaxdB;
UInt32 ChannelID; // enum
const char *Name;
UInt32 ControlID;
UInt32 Usage;
unsigned char reg; // register
bool reverse;
int codec;
struct Parm *Next;
};
struct CardData
{
/*** PCI/Card initialization progress *********************************/
IOPCIDevice *pci_dev;
IOMemoryMap* iobase;
IOMemoryMap* mtbase;
unsigned short model;
unsigned long SavedDir;
unsigned short SavedMask;
struct CardSpecific Specific;
/** TRUE if the Card chip has been initialized */
BOOL card_initialized;
enum Model SubType;
struct I2C *i2c;
unsigned char gpio_dir;
unsigned char gpio_data;
struct I2C_bit_ops *bit_ops;
struct I2C *i2c_cs8404;
struct I2C *i2c_in_addr;
struct I2C *i2c_out_addr;
enum akm_types akm_type;
struct akm_codec codec[4];
struct Parm *ParmList;
/*** Playback/recording interrupts ***************************************/
/** TRUE when playback is enabled */
BOOL is_playing;
/** TRUE when recording is enabled */
BOOL is_recording;
/** Analog mixer variables ***********************************************/
/** The currently selected input */
UWORD input;
/** The currently selected output */
UWORD output;
/** The hardware register value corresponding to monitor_volume */
UWORD monitor_volume_bits;
/** The hardware register value corresponding to input_gain */
UWORD input_gain_bits;
/** The hardware register value corresponding to output_volume */
UWORD output_volume_bits;
/** Saved state for AC97 mike */
UWORD ac97_mic;
/** Saved state for AC97 cd */
UWORD ac97_cd;
/** Saved state for AC97 vide */
UWORD ac97_video;
/** Saved state for AC97 aux */
UWORD ac97_aux;
/** Saved state for AC97 line in */
UWORD ac97_linein;
/** Saved state for AC97 phone */
unsigned short ac97_phone;
bool SPDIF_RateSupported;
};
#endif /* AHI_Drivers_Card_DriverData_h */