forked from krmnn/Envy24HT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDriverData.h
121 lines (101 loc) · 3.64 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
#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
#include "ak_codec.h"
#include "I2C.h"
#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 {AUREON_SKY, AUREON_SPACE, PHASE28, REVO51, REVO71, JULIA, MAYA44, PHASE22, AP192, PRODIGY_HD2, CANTATIS};
extern unsigned long Dirs[];
struct CardData;
#define NUM_SAMPLE_FRAMES 16384
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;
bool I2C;
int I2C_codec_addr;
struct akm_codec *codec;
bool HasMute;
unsigned char MuteReg;
unsigned char MuteOnVal;
unsigned char MuteOffVal;
struct Parm *Next;
};
struct CardSpecific
{
UInt32 NumChannels;
bool HasSPDIF;
UInt32 BufferSize;
UInt32 BufferSizeRec;
};
struct CardData
{
// PCI/Card initialization progress
IOPCIDevice *pci_dev;
IOMemoryMap* iobase;
IOMemoryMap* mtbase;
unsigned short model;
unsigned char chiprev;
unsigned int irq;
unsigned long SavedDir;
unsigned short SavedMask;
struct CardSpecific Specific;
BOOL card_initialized; // TRUE if the Card chip has been initialized
enum Model SubType;
struct I2C_bit_ops *bit_ops;
unsigned int gpio_dir;
unsigned int gpio_data;
struct I2C *i2c;
struct Parm *ParmList;
// Playback/recording interrupts
BOOL is_playing; // TRUE when playback is enabled
BOOL is_recording; // TRUE when recording is enabled
// Analog mixer variables
UWORD input; // The currently selected input
UWORD output; // The currently selected output
UWORD monitor_volume_bits; // The hardware register value corresponding to monitor_volume
UWORD input_gain_bits; // The hardware register value corresponding to input_gain
UWORD output_volume_bits; // The hardware register value corresponding to output_volume
UWORD ac97_mic; // Saved state for AC97 microphone
UWORD ac97_cd; // Saved state for AC97 cd
UWORD ac97_video; // Saved state for AC97 video
UWORD ac97_aux; // Saved state for AC97 aux
UWORD ac97_linein; // Saved state for AC97 line in
unsigned short ac97_phone; // Saved state for AC97 phone
// For revo71
struct akm_codec *RevoFrontCodec;
struct akm_codec *RevoSurroundCodec;
struct akm_codec *RevoRecCodec;
struct akm_codec *JuliaDAC;
struct akm_codec *JuliaRCV; // digital receiver
bool SPDIF_RateSupported;
};
#endif /* AHI_Drivers_Card_DriverData_h */