34 #define GUSP(gus, x) ((gus)->gf1.port + SNDRV_g_u_s_##x)
36 #define SNDRV_g_u_s_MIDICTRL (0x320-0x220)
37 #define SNDRV_g_u_s_MIDISTAT (0x320-0x220)
38 #define SNDRV_g_u_s_MIDIDATA (0x321-0x220)
40 #define SNDRV_g_u_s_GF1PAGE (0x322-0x220)
41 #define SNDRV_g_u_s_GF1REGSEL (0x323-0x220)
42 #define SNDRV_g_u_s_GF1DATALOW (0x324-0x220)
43 #define SNDRV_g_u_s_GF1DATAHIGH (0x325-0x220)
44 #define SNDRV_g_u_s_IRQSTAT (0x226-0x220)
45 #define SNDRV_g_u_s_TIMERCNTRL (0x228-0x220)
46 #define SNDRV_g_u_s_TIMERDATA (0x229-0x220)
47 #define SNDRV_g_u_s_DRAM (0x327-0x220)
48 #define SNDRV_g_u_s_MIXCNTRLREG (0x220-0x220)
49 #define SNDRV_g_u_s_IRQDMACNTRLREG (0x22b-0x220)
50 #define SNDRV_g_u_s_REGCNTRLS (0x22f-0x220)
51 #define SNDRV_g_u_s_BOARDVERSION (0x726-0x220)
52 #define SNDRV_g_u_s_MIXCNTRLPORT (0x726-0x220)
53 #define SNDRV_g_u_s_IVER (0x325-0x220)
54 #define SNDRV_g_u_s_MIXDATAPORT (0x326-0x220)
55 #define SNDRV_g_u_s_MAXCNTRLPORT (0x326-0x220)
60 #define SNDRV_GF1_GB_ACTIVE_VOICES 0x0e
61 #define SNDRV_GF1_GB_VOICES_IRQ 0x0f
62 #define SNDRV_GF1_GB_GLOBAL_MODE 0x19
63 #define SNDRV_GF1_GW_LFO_BASE 0x1a
64 #define SNDRV_GF1_GB_VOICES_IRQ_READ 0x1f
65 #define SNDRV_GF1_GB_DRAM_DMA_CONTROL 0x41
66 #define SNDRV_GF1_GW_DRAM_DMA_LOW 0x42
67 #define SNDRV_GF1_GW_DRAM_IO_LOW 0x43
68 #define SNDRV_GF1_GB_DRAM_IO_HIGH 0x44
69 #define SNDRV_GF1_GB_SOUND_BLASTER_CONTROL 0x45
70 #define SNDRV_GF1_GB_ADLIB_TIMER_1 0x46
71 #define SNDRV_GF1_GB_ADLIB_TIMER_2 0x47
72 #define SNDRV_GF1_GB_RECORD_RATE 0x48
73 #define SNDRV_GF1_GB_REC_DMA_CONTROL 0x49
74 #define SNDRV_GF1_GB_JOYSTICK_DAC_LEVEL 0x4b
75 #define SNDRV_GF1_GB_RESET 0x4c
76 #define SNDRV_GF1_GB_DRAM_DMA_HIGH 0x50
77 #define SNDRV_GF1_GW_DRAM_IO16 0x51
78 #define SNDRV_GF1_GW_MEMORY_CONFIG 0x52
79 #define SNDRV_GF1_GB_MEMORY_CONTROL 0x53
80 #define SNDRV_GF1_GW_FIFO_RECORD_BASE_ADDR 0x54
81 #define SNDRV_GF1_GW_FIFO_PLAY_BASE_ADDR 0x55
82 #define SNDRV_GF1_GW_FIFO_SIZE 0x56
83 #define SNDRV_GF1_GW_INTERLEAVE 0x57
84 #define SNDRV_GF1_GB_COMPATIBILITY 0x59
85 #define SNDRV_GF1_GB_DECODE_CONTROL 0x5a
86 #define SNDRV_GF1_GB_VERSION_NUMBER 0x5b
87 #define SNDRV_GF1_GB_MPU401_CONTROL_A 0x5c
88 #define SNDRV_GF1_GB_MPU401_CONTROL_B 0x5d
89 #define SNDRV_GF1_GB_EMULATION_IRQ 0x60
91 #define SNDRV_GF1_VB_ADDRESS_CONTROL 0x00
92 #define SNDRV_GF1_VW_FREQUENCY 0x01
93 #define SNDRV_GF1_VW_START_HIGH 0x02
94 #define SNDRV_GF1_VW_START_LOW 0x03
95 #define SNDRV_GF1_VA_START SNDRV_GF1_VW_START_HIGH
96 #define SNDRV_GF1_VW_END_HIGH 0x04
97 #define SNDRV_GF1_VW_END_LOW 0x05
98 #define SNDRV_GF1_VA_END SNDRV_GF1_VW_END_HIGH
99 #define SNDRV_GF1_VB_VOLUME_RATE 0x06
100 #define SNDRV_GF1_VB_VOLUME_START 0x07
101 #define SNDRV_GF1_VB_VOLUME_END 0x08
102 #define SNDRV_GF1_VW_VOLUME 0x09
103 #define SNDRV_GF1_VW_CURRENT_HIGH 0x0a
104 #define SNDRV_GF1_VW_CURRENT_LOW 0x0b
105 #define SNDRV_GF1_VA_CURRENT SNDRV_GF1_VW_CURRENT_HIGH
106 #define SNDRV_GF1_VB_PAN 0x0c
107 #define SNDRV_GF1_VW_OFFSET_RIGHT 0x0c
108 #define SNDRV_GF1_VB_VOLUME_CONTROL 0x0d
109 #define SNDRV_GF1_VB_UPPER_ADDRESS 0x10
110 #define SNDRV_GF1_VW_EFFECT_HIGH 0x11
111 #define SNDRV_GF1_VW_EFFECT_LOW 0x12
112 #define SNDRV_GF1_VA_EFFECT SNDRV_GF1_VW_EFFECT_HIGH
113 #define SNDRV_GF1_VW_OFFSET_LEFT 0x13
114 #define SNDRV_GF1_VB_ACCUMULATOR 0x14
115 #define SNDRV_GF1_VB_MODE 0x15
116 #define SNDRV_GF1_VW_EFFECT_VOLUME 0x16
117 #define SNDRV_GF1_VB_FREQUENCY_LFO 0x17
118 #define SNDRV_GF1_VB_VOLUME_LFO 0x18
119 #define SNDRV_GF1_VW_OFFSET_RIGHT_FINAL 0x1b
120 #define SNDRV_GF1_VW_OFFSET_LEFT_FINAL 0x1c
121 #define SNDRV_GF1_VW_EFFECT_VOLUME_FINAL 0x1d
125 #define SNDRV_ICS_MIC_DEV 0
126 #define SNDRV_ICS_LINE_DEV 1
127 #define SNDRV_ICS_CD_DEV 2
128 #define SNDRV_ICS_GF1_DEV 3
129 #define SNDRV_ICS_NONE_DEV 4
130 #define SNDRV_ICS_MASTER_DEV 5
134 #define SNDRV_LFO_TREMOLO 0
135 #define SNDRV_LFO_VIBRATO 1
139 #define SNDRV_GF1_DMA_UNSIGNED 0x80
140 #define SNDRV_GF1_DMA_16BIT 0x40
141 #define SNDRV_GF1_DMA_IRQ 0x20
142 #define SNDRV_GF1_DMA_WIDTH16 0x04
143 #define SNDRV_GF1_DMA_READ 0x02
144 #define SNDRV_GF1_DMA_ENABLE 0x01
148 #define SNDRV_GF1_ATTEN(x) (snd_gf1_atten_table[x])
149 #define SNDRV_GF1_MIN_VOLUME 1800
150 #define SNDRV_GF1_MAX_VOLUME 4095
151 #define SNDRV_GF1_MIN_OFFSET (SNDRV_GF1_MIN_VOLUME>>4)
152 #define SNDRV_GF1_MAX_OFFSET 255
153 #define SNDRV_GF1_MAX_TDEPTH 90
157 #define SNDRV_GF1_MEM_BLOCK_16BIT 0x0001
159 #define SNDRV_GF1_MEM_OWNER_DRIVER 0x0001
160 #define SNDRV_GF1_MEM_OWNER_WAVE_SIMPLE 0x0002
161 #define SNDRV_GF1_MEM_OWNER_WAVE_GF1 0x0003
162 #define SNDRV_GF1_MEM_OWNER_WAVE_IWFFFF 0x0004
166 #define SNDRV_GF1_HANDLER_MIDI_OUT 0x00010000
167 #define SNDRV_GF1_HANDLER_MIDI_IN 0x00020000
168 #define SNDRV_GF1_HANDLER_TIMER1 0x00040000
169 #define SNDRV_GF1_HANDLER_TIMER2 0x00080000
170 #define SNDRV_GF1_HANDLER_VOICE 0x00100000
171 #define SNDRV_GF1_HANDLER_DMA_WRITE 0x00200000
172 #define SNDRV_GF1_HANDLER_DMA_READ 0x00400000
173 #define SNDRV_GF1_HANDLER_ALL (0xffff0000&~SNDRV_GF1_HANDLER_VOICE)
177 #define SNDRV_GF1_DMA_TRIGGER 1
232 #define SNDRV_GF1_VOICE_TYPE_PCM 0
233 #define SNDRV_GF1_VOICE_TYPE_SYNTH 1
234 #define SNDRV_GF1_VOICE_TYPE_MIDI 2
236 #define SNDRV_GF1_VFLG_RUNNING (1<<0)
237 #define SNDRV_GF1_VFLG_EFFECT_TIMER1 (1<<1)
238 #define SNDRV_GF1_VFLG_PAN (1<<2)
261 #ifdef CONFIG_SND_DEBUG
262 unsigned int interrupt_stat_wave;
263 unsigned int interrupt_stat_volume;
352 #ifdef CONFIG_SND_DEBUG
353 unsigned int interrupt_stat_midi_out;
354 unsigned int interrupt_stat_midi_in;
355 unsigned int interrupt_stat_timer1;
356 unsigned int interrupt_stat_timer2;
357 unsigned int interrupt_stat_dma_write;
358 unsigned int interrupt_stat_dma_read;
359 unsigned int interrupt_stat_voice_lost;
456 if (voice != gus->
gf1.active_voice) {
457 gus->
gf1.active_voice = voice;
463 static inline void snd_gf1_uart_cmd(
struct snd_gus_card * gus,
unsigned char b)
468 static inline unsigned char snd_gf1_uart_stat(
struct snd_gus_card * gus)
470 return inb(
GUSP(gus, MIDISTAT));
473 static inline void snd_gf1_uart_put(
struct snd_gus_card * gus,
unsigned char b)
478 static inline unsigned char snd_gf1_uart_get(
struct snd_gus_card * gus)
480 return inb(
GUSP(gus, MIDIDATA));
489 static inline unsigned char snd_gf1_read8(
struct snd_gus_card * gus,
unsigned char reg)
495 static inline unsigned short snd_gf1_read16(
struct snd_gus_card * gus,
unsigned char reg)
509 static inline unsigned char snd_gf1_i_read8(
struct snd_gus_card * gus,
unsigned char reg)
514 static inline unsigned short snd_gf1_i_read16(
struct snd_gus_card * gus,
unsigned char reg)
544 extern void snd_gf1_lfo_command(
struct snd_gus_card * gus,
int voice,
unsigned char *
command);
596 #ifdef CONFIG_SND_DEBUG
597 extern void snd_gf1_print_voice_registers(
struct snd_gus_card * gus);
606 int irq,
int dma1,
int dma2,
617 #ifdef CONFIG_SND_DEBUG
618 void snd_gus_irq_profile_init(
struct snd_gus_card *gus);
627 unsigned int addr,
unsigned int size);