11da177e4SLinus Torvalds #ifndef __SOUND_GUS_H 21da177e4SLinus Torvalds #define __SOUND_GUS_H 31da177e4SLinus Torvalds 41da177e4SLinus Torvalds /* 51da177e4SLinus Torvalds * Global structures used for GUS part of ALSA driver 6*c1017a4cSJaroslav Kysela * Copyright (c) by Jaroslav Kysela <perex@perex.cz> 71da177e4SLinus Torvalds * 81da177e4SLinus Torvalds * 91da177e4SLinus Torvalds * This program is free software; you can redistribute it and/or modify 101da177e4SLinus Torvalds * it under the terms of the GNU General Public License as published by 111da177e4SLinus Torvalds * the Free Software Foundation; either version 2 of the License, or 121da177e4SLinus Torvalds * (at your option) any later version. 131da177e4SLinus Torvalds * 141da177e4SLinus Torvalds * This program is distributed in the hope that it will be useful, 151da177e4SLinus Torvalds * but WITHOUT ANY WARRANTY; without even the implied warranty of 161da177e4SLinus Torvalds * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 171da177e4SLinus Torvalds * GNU General Public License for more details. 181da177e4SLinus Torvalds * 191da177e4SLinus Torvalds * You should have received a copy of the GNU General Public License 201da177e4SLinus Torvalds * along with this program; if not, write to the Free Software 211da177e4SLinus Torvalds * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 221da177e4SLinus Torvalds * 231da177e4SLinus Torvalds */ 241da177e4SLinus Torvalds 251da177e4SLinus Torvalds #include "pcm.h" 261da177e4SLinus Torvalds #include "rawmidi.h" 271da177e4SLinus Torvalds #include "timer.h" 281da177e4SLinus Torvalds #include "seq_midi_emul.h" 291da177e4SLinus Torvalds #include "seq_device.h" 301da177e4SLinus Torvalds #include "ainstr_iw.h" 311da177e4SLinus Torvalds #include "ainstr_gf1.h" 321da177e4SLinus Torvalds #include "ainstr_simple.h" 331da177e4SLinus Torvalds #include <asm/io.h> 341da177e4SLinus Torvalds 351da177e4SLinus Torvalds #define SNDRV_SEQ_DEV_ID_GUS "gus-synth" 361da177e4SLinus Torvalds 371da177e4SLinus Torvalds /* IO ports */ 381da177e4SLinus Torvalds 391da177e4SLinus Torvalds #define GUSP(gus, x) ((gus)->gf1.port + SNDRV_g_u_s_##x) 401da177e4SLinus Torvalds 411da177e4SLinus Torvalds #define SNDRV_g_u_s_MIDICTRL (0x320-0x220) 421da177e4SLinus Torvalds #define SNDRV_g_u_s_MIDISTAT (0x320-0x220) 431da177e4SLinus Torvalds #define SNDRV_g_u_s_MIDIDATA (0x321-0x220) 441da177e4SLinus Torvalds 451da177e4SLinus Torvalds #define SNDRV_g_u_s_GF1PAGE (0x322-0x220) 461da177e4SLinus Torvalds #define SNDRV_g_u_s_GF1REGSEL (0x323-0x220) 471da177e4SLinus Torvalds #define SNDRV_g_u_s_GF1DATALOW (0x324-0x220) 481da177e4SLinus Torvalds #define SNDRV_g_u_s_GF1DATAHIGH (0x325-0x220) 491da177e4SLinus Torvalds #define SNDRV_g_u_s_IRQSTAT (0x226-0x220) 501da177e4SLinus Torvalds #define SNDRV_g_u_s_TIMERCNTRL (0x228-0x220) 511da177e4SLinus Torvalds #define SNDRV_g_u_s_TIMERDATA (0x229-0x220) 521da177e4SLinus Torvalds #define SNDRV_g_u_s_DRAM (0x327-0x220) 531da177e4SLinus Torvalds #define SNDRV_g_u_s_MIXCNTRLREG (0x220-0x220) 541da177e4SLinus Torvalds #define SNDRV_g_u_s_IRQDMACNTRLREG (0x22b-0x220) 551da177e4SLinus Torvalds #define SNDRV_g_u_s_REGCNTRLS (0x22f-0x220) 561da177e4SLinus Torvalds #define SNDRV_g_u_s_BOARDVERSION (0x726-0x220) 571da177e4SLinus Torvalds #define SNDRV_g_u_s_MIXCNTRLPORT (0x726-0x220) 581da177e4SLinus Torvalds #define SNDRV_g_u_s_IVER (0x325-0x220) 591da177e4SLinus Torvalds #define SNDRV_g_u_s_MIXDATAPORT (0x326-0x220) 601da177e4SLinus Torvalds #define SNDRV_g_u_s_MAXCNTRLPORT (0x326-0x220) 611da177e4SLinus Torvalds 621da177e4SLinus Torvalds /* GF1 registers */ 631da177e4SLinus Torvalds 641da177e4SLinus Torvalds /* global registers */ 651da177e4SLinus Torvalds #define SNDRV_GF1_GB_ACTIVE_VOICES 0x0e 661da177e4SLinus Torvalds #define SNDRV_GF1_GB_VOICES_IRQ 0x0f 671da177e4SLinus Torvalds #define SNDRV_GF1_GB_GLOBAL_MODE 0x19 681da177e4SLinus Torvalds #define SNDRV_GF1_GW_LFO_BASE 0x1a 691da177e4SLinus Torvalds #define SNDRV_GF1_GB_VOICES_IRQ_READ 0x1f 701da177e4SLinus Torvalds #define SNDRV_GF1_GB_DRAM_DMA_CONTROL 0x41 711da177e4SLinus Torvalds #define SNDRV_GF1_GW_DRAM_DMA_LOW 0x42 721da177e4SLinus Torvalds #define SNDRV_GF1_GW_DRAM_IO_LOW 0x43 731da177e4SLinus Torvalds #define SNDRV_GF1_GB_DRAM_IO_HIGH 0x44 741da177e4SLinus Torvalds #define SNDRV_GF1_GB_SOUND_BLASTER_CONTROL 0x45 751da177e4SLinus Torvalds #define SNDRV_GF1_GB_ADLIB_TIMER_1 0x46 761da177e4SLinus Torvalds #define SNDRV_GF1_GB_ADLIB_TIMER_2 0x47 771da177e4SLinus Torvalds #define SNDRV_GF1_GB_RECORD_RATE 0x48 781da177e4SLinus Torvalds #define SNDRV_GF1_GB_REC_DMA_CONTROL 0x49 791da177e4SLinus Torvalds #define SNDRV_GF1_GB_JOYSTICK_DAC_LEVEL 0x4b 801da177e4SLinus Torvalds #define SNDRV_GF1_GB_RESET 0x4c 811da177e4SLinus Torvalds #define SNDRV_GF1_GB_DRAM_DMA_HIGH 0x50 821da177e4SLinus Torvalds #define SNDRV_GF1_GW_DRAM_IO16 0x51 831da177e4SLinus Torvalds #define SNDRV_GF1_GW_MEMORY_CONFIG 0x52 841da177e4SLinus Torvalds #define SNDRV_GF1_GB_MEMORY_CONTROL 0x53 851da177e4SLinus Torvalds #define SNDRV_GF1_GW_FIFO_RECORD_BASE_ADDR 0x54 861da177e4SLinus Torvalds #define SNDRV_GF1_GW_FIFO_PLAY_BASE_ADDR 0x55 871da177e4SLinus Torvalds #define SNDRV_GF1_GW_FIFO_SIZE 0x56 881da177e4SLinus Torvalds #define SNDRV_GF1_GW_INTERLEAVE 0x57 891da177e4SLinus Torvalds #define SNDRV_GF1_GB_COMPATIBILITY 0x59 901da177e4SLinus Torvalds #define SNDRV_GF1_GB_DECODE_CONTROL 0x5a 911da177e4SLinus Torvalds #define SNDRV_GF1_GB_VERSION_NUMBER 0x5b 921da177e4SLinus Torvalds #define SNDRV_GF1_GB_MPU401_CONTROL_A 0x5c 931da177e4SLinus Torvalds #define SNDRV_GF1_GB_MPU401_CONTROL_B 0x5d 941da177e4SLinus Torvalds #define SNDRV_GF1_GB_EMULATION_IRQ 0x60 951da177e4SLinus Torvalds /* voice specific registers */ 961da177e4SLinus Torvalds #define SNDRV_GF1_VB_ADDRESS_CONTROL 0x00 971da177e4SLinus Torvalds #define SNDRV_GF1_VW_FREQUENCY 0x01 981da177e4SLinus Torvalds #define SNDRV_GF1_VW_START_HIGH 0x02 991da177e4SLinus Torvalds #define SNDRV_GF1_VW_START_LOW 0x03 1001da177e4SLinus Torvalds #define SNDRV_GF1_VA_START SNDRV_GF1_VW_START_HIGH 1011da177e4SLinus Torvalds #define SNDRV_GF1_VW_END_HIGH 0x04 1021da177e4SLinus Torvalds #define SNDRV_GF1_VW_END_LOW 0x05 1031da177e4SLinus Torvalds #define SNDRV_GF1_VA_END SNDRV_GF1_VW_END_HIGH 1041da177e4SLinus Torvalds #define SNDRV_GF1_VB_VOLUME_RATE 0x06 1051da177e4SLinus Torvalds #define SNDRV_GF1_VB_VOLUME_START 0x07 1061da177e4SLinus Torvalds #define SNDRV_GF1_VB_VOLUME_END 0x08 1071da177e4SLinus Torvalds #define SNDRV_GF1_VW_VOLUME 0x09 1081da177e4SLinus Torvalds #define SNDRV_GF1_VW_CURRENT_HIGH 0x0a 1091da177e4SLinus Torvalds #define SNDRV_GF1_VW_CURRENT_LOW 0x0b 1101da177e4SLinus Torvalds #define SNDRV_GF1_VA_CURRENT SNDRV_GF1_VW_CURRENT_HIGH 1111da177e4SLinus Torvalds #define SNDRV_GF1_VB_PAN 0x0c 1121da177e4SLinus Torvalds #define SNDRV_GF1_VW_OFFSET_RIGHT 0x0c 1131da177e4SLinus Torvalds #define SNDRV_GF1_VB_VOLUME_CONTROL 0x0d 1141da177e4SLinus Torvalds #define SNDRV_GF1_VB_UPPER_ADDRESS 0x10 1151da177e4SLinus Torvalds #define SNDRV_GF1_VW_EFFECT_HIGH 0x11 1161da177e4SLinus Torvalds #define SNDRV_GF1_VW_EFFECT_LOW 0x12 1171da177e4SLinus Torvalds #define SNDRV_GF1_VA_EFFECT SNDRV_GF1_VW_EFFECT_HIGH 1181da177e4SLinus Torvalds #define SNDRV_GF1_VW_OFFSET_LEFT 0x13 1191da177e4SLinus Torvalds #define SNDRV_GF1_VB_ACCUMULATOR 0x14 1201da177e4SLinus Torvalds #define SNDRV_GF1_VB_MODE 0x15 1211da177e4SLinus Torvalds #define SNDRV_GF1_VW_EFFECT_VOLUME 0x16 1221da177e4SLinus Torvalds #define SNDRV_GF1_VB_FREQUENCY_LFO 0x17 1231da177e4SLinus Torvalds #define SNDRV_GF1_VB_VOLUME_LFO 0x18 1241da177e4SLinus Torvalds #define SNDRV_GF1_VW_OFFSET_RIGHT_FINAL 0x1b 1251da177e4SLinus Torvalds #define SNDRV_GF1_VW_OFFSET_LEFT_FINAL 0x1c 1261da177e4SLinus Torvalds #define SNDRV_GF1_VW_EFFECT_VOLUME_FINAL 0x1d 1271da177e4SLinus Torvalds 1281da177e4SLinus Torvalds /* ICS registers */ 1291da177e4SLinus Torvalds 1301da177e4SLinus Torvalds #define SNDRV_ICS_MIC_DEV 0 1311da177e4SLinus Torvalds #define SNDRV_ICS_LINE_DEV 1 1321da177e4SLinus Torvalds #define SNDRV_ICS_CD_DEV 2 1331da177e4SLinus Torvalds #define SNDRV_ICS_GF1_DEV 3 1341da177e4SLinus Torvalds #define SNDRV_ICS_NONE_DEV 4 1351da177e4SLinus Torvalds #define SNDRV_ICS_MASTER_DEV 5 1361da177e4SLinus Torvalds 1371da177e4SLinus Torvalds /* LFO */ 1381da177e4SLinus Torvalds 1391da177e4SLinus Torvalds #define SNDRV_LFO_TREMOLO 0 1401da177e4SLinus Torvalds #define SNDRV_LFO_VIBRATO 1 1411da177e4SLinus Torvalds 1421da177e4SLinus Torvalds /* misc */ 1431da177e4SLinus Torvalds 1441da177e4SLinus Torvalds #define SNDRV_GF1_DMA_UNSIGNED 0x80 1451da177e4SLinus Torvalds #define SNDRV_GF1_DMA_16BIT 0x40 1461da177e4SLinus Torvalds #define SNDRV_GF1_DMA_IRQ 0x20 1471da177e4SLinus Torvalds #define SNDRV_GF1_DMA_WIDTH16 0x04 1481da177e4SLinus Torvalds #define SNDRV_GF1_DMA_READ 0x02 /* read from GUS's DRAM */ 1491da177e4SLinus Torvalds #define SNDRV_GF1_DMA_ENABLE 0x01 1501da177e4SLinus Torvalds 1511da177e4SLinus Torvalds /* ramp ranges */ 1521da177e4SLinus Torvalds 1531da177e4SLinus Torvalds #define SNDRV_GF1_ATTEN(x) (snd_gf1_atten_table[x]) 1541da177e4SLinus Torvalds #define SNDRV_GF1_MIN_VOLUME 1800 1551da177e4SLinus Torvalds #define SNDRV_GF1_MAX_VOLUME 4095 1561da177e4SLinus Torvalds #define SNDRV_GF1_MIN_OFFSET (SNDRV_GF1_MIN_VOLUME>>4) 1571da177e4SLinus Torvalds #define SNDRV_GF1_MAX_OFFSET 255 1581da177e4SLinus Torvalds #define SNDRV_GF1_MAX_TDEPTH 90 1591da177e4SLinus Torvalds 1601da177e4SLinus Torvalds /* defines for memory manager */ 1611da177e4SLinus Torvalds 1621da177e4SLinus Torvalds #define SNDRV_GF1_MEM_BLOCK_16BIT 0x0001 1631da177e4SLinus Torvalds 1641da177e4SLinus Torvalds #define SNDRV_GF1_MEM_OWNER_DRIVER 0x0001 1651da177e4SLinus Torvalds #define SNDRV_GF1_MEM_OWNER_WAVE_SIMPLE 0x0002 1661da177e4SLinus Torvalds #define SNDRV_GF1_MEM_OWNER_WAVE_GF1 0x0003 1671da177e4SLinus Torvalds #define SNDRV_GF1_MEM_OWNER_WAVE_IWFFFF 0x0004 1681da177e4SLinus Torvalds 1691da177e4SLinus Torvalds /* constants for interrupt handlers */ 1701da177e4SLinus Torvalds 1711da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_MIDI_OUT 0x00010000 1721da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_MIDI_IN 0x00020000 1731da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_TIMER1 0x00040000 1741da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_TIMER2 0x00080000 1751da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_VOICE 0x00100000 1761da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_DMA_WRITE 0x00200000 1771da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_DMA_READ 0x00400000 1781da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_ALL (0xffff0000&~SNDRV_GF1_HANDLER_VOICE) 1791da177e4SLinus Torvalds 1801da177e4SLinus Torvalds /* constants for DMA flags */ 1811da177e4SLinus Torvalds 1821da177e4SLinus Torvalds #define SNDRV_GF1_DMA_TRIGGER 1 1831da177e4SLinus Torvalds 1841da177e4SLinus Torvalds /* --- */ 1851da177e4SLinus Torvalds 1865e2da206STakashi Iwai struct snd_gus_card; 1871da177e4SLinus Torvalds 1881da177e4SLinus Torvalds /* GF1 specific structure */ 1891da177e4SLinus Torvalds 1905e2da206STakashi Iwai struct snd_gf1_bank_info { 1911da177e4SLinus Torvalds unsigned int address; 1921da177e4SLinus Torvalds unsigned int size; 1935e2da206STakashi Iwai }; 1941da177e4SLinus Torvalds 1955e2da206STakashi Iwai struct snd_gf1_mem_block { 1961da177e4SLinus Torvalds unsigned short flags; /* flags - SNDRV_GF1_MEM_BLOCK_XXXX */ 1971da177e4SLinus Torvalds unsigned short owner; /* owner - SNDRV_GF1_MEM_OWNER_XXXX */ 1981da177e4SLinus Torvalds unsigned int share; /* share count */ 1991da177e4SLinus Torvalds unsigned int share_id[4]; /* share ID */ 2001da177e4SLinus Torvalds unsigned int ptr; 2011da177e4SLinus Torvalds unsigned int size; 2021da177e4SLinus Torvalds char *name; 2035e2da206STakashi Iwai struct snd_gf1_mem_block *next; 2045e2da206STakashi Iwai struct snd_gf1_mem_block *prev; 2055e2da206STakashi Iwai }; 2061da177e4SLinus Torvalds 2075e2da206STakashi Iwai struct snd_gf1_mem { 2085e2da206STakashi Iwai struct snd_gf1_bank_info banks_8[4]; 2095e2da206STakashi Iwai struct snd_gf1_bank_info banks_16[4]; 2105e2da206STakashi Iwai struct snd_gf1_mem_block *first; 2115e2da206STakashi Iwai struct snd_gf1_mem_block *last; 2128b7547f9SIngo Molnar struct mutex memory_mutex; 2135e2da206STakashi Iwai }; 2141da177e4SLinus Torvalds 2155e2da206STakashi Iwai struct snd_gf1_dma_block { 2161da177e4SLinus Torvalds void *buffer; /* buffer in computer's RAM */ 2171da177e4SLinus Torvalds unsigned long buf_addr; /* buffer address */ 2181da177e4SLinus Torvalds unsigned int addr; /* address in onboard memory */ 2191da177e4SLinus Torvalds unsigned int count; /* count in bytes */ 2201da177e4SLinus Torvalds unsigned int cmd; /* DMA command (format) */ 2215e2da206STakashi Iwai void (*ack)(struct snd_gus_card * gus, void *private_data); 2221da177e4SLinus Torvalds void *private_data; 2231da177e4SLinus Torvalds struct snd_gf1_dma_block *next; 2245e2da206STakashi Iwai }; 2251da177e4SLinus Torvalds 2265e2da206STakashi Iwai struct snd_gus_port { 2275e2da206STakashi Iwai struct snd_midi_channel_set * chset; 2285e2da206STakashi Iwai struct snd_gus_card * gus; 2291da177e4SLinus Torvalds int mode; /* operation mode */ 2301da177e4SLinus Torvalds int client; /* sequencer client number */ 2311da177e4SLinus Torvalds int port; /* sequencer port number */ 2321da177e4SLinus Torvalds unsigned int midi_has_voices: 1; 2335e2da206STakashi Iwai }; 2341da177e4SLinus Torvalds 2355e2da206STakashi Iwai struct snd_gus_voice; 2361da177e4SLinus Torvalds 2375e2da206STakashi Iwai struct snd_gus_sample_ops { 2385e2da206STakashi Iwai void (*sample_start)(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_position_t position); 2395e2da206STakashi Iwai void (*sample_stop)(struct snd_gus_card *gus, struct snd_gus_voice *voice, int mode); 2405e2da206STakashi Iwai void (*sample_freq)(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_frequency_t freq); 2415e2da206STakashi Iwai void (*sample_volume)(struct snd_gus_card *gus, struct snd_gus_voice *voice, struct snd_seq_ev_volume *volume); 2425e2da206STakashi Iwai void (*sample_loop)(struct snd_gus_card *card, struct snd_gus_voice *voice, struct snd_seq_ev_loop *loop); 2435e2da206STakashi Iwai void (*sample_pos)(struct snd_gus_card *card, struct snd_gus_voice *voice, snd_seq_position_t position); 2445e2da206STakashi Iwai void (*sample_private1)(struct snd_gus_card *card, struct snd_gus_voice *voice, unsigned char *data); 2455e2da206STakashi Iwai }; 2461da177e4SLinus Torvalds 2471da177e4SLinus Torvalds #define SNDRV_GF1_VOICE_TYPE_PCM 0 2481da177e4SLinus Torvalds #define SNDRV_GF1_VOICE_TYPE_SYNTH 1 2491da177e4SLinus Torvalds #define SNDRV_GF1_VOICE_TYPE_MIDI 2 2501da177e4SLinus Torvalds 2511da177e4SLinus Torvalds #define SNDRV_GF1_VFLG_RUNNING (1<<0) 2521da177e4SLinus Torvalds #define SNDRV_GF1_VFLG_EFFECT_TIMER1 (1<<1) 2531da177e4SLinus Torvalds #define SNDRV_GF1_VFLG_PAN (1<<2) 2541da177e4SLinus Torvalds 2555e2da206STakashi Iwai enum snd_gus_volume_state { 2561da177e4SLinus Torvalds VENV_BEFORE, 2571da177e4SLinus Torvalds VENV_ATTACK, 2581da177e4SLinus Torvalds VENV_SUSTAIN, 2591da177e4SLinus Torvalds VENV_RELEASE, 2601da177e4SLinus Torvalds VENV_DONE, 2611da177e4SLinus Torvalds VENV_VOLUME 2625e2da206STakashi Iwai }; 2631da177e4SLinus Torvalds 2645e2da206STakashi Iwai struct snd_gus_voice { 2651da177e4SLinus Torvalds int number; 2661da177e4SLinus Torvalds unsigned int use: 1, 2671da177e4SLinus Torvalds pcm: 1, 2681da177e4SLinus Torvalds synth:1, 2691da177e4SLinus Torvalds midi: 1; 2701da177e4SLinus Torvalds unsigned int flags; 2711da177e4SLinus Torvalds unsigned char client; 2721da177e4SLinus Torvalds unsigned char port; 2731da177e4SLinus Torvalds unsigned char index; 2741da177e4SLinus Torvalds unsigned char pad; 2751da177e4SLinus Torvalds 2761da177e4SLinus Torvalds #ifdef CONFIG_SND_DEBUG 2771da177e4SLinus Torvalds unsigned int interrupt_stat_wave; 2781da177e4SLinus Torvalds unsigned int interrupt_stat_volume; 2791da177e4SLinus Torvalds #endif 2805e2da206STakashi Iwai void (*handler_wave) (struct snd_gus_card * gus, struct snd_gus_voice * voice); 2815e2da206STakashi Iwai void (*handler_volume) (struct snd_gus_card * gus, struct snd_gus_voice * voice); 2825e2da206STakashi Iwai void (*handler_effect) (struct snd_gus_card * gus, struct snd_gus_voice * voice); 2835e2da206STakashi Iwai void (*volume_change) (struct snd_gus_card * gus); 2841da177e4SLinus Torvalds 2855e2da206STakashi Iwai struct snd_gus_sample_ops *sample_ops; 2861da177e4SLinus Torvalds 2875e2da206STakashi Iwai struct snd_seq_instr instr; 2881da177e4SLinus Torvalds 2891da177e4SLinus Torvalds /* running status / registers */ 2901da177e4SLinus Torvalds 2915e2da206STakashi Iwai struct snd_seq_ev_volume sample_volume; 2921da177e4SLinus Torvalds 2931da177e4SLinus Torvalds unsigned short fc_register; 2941da177e4SLinus Torvalds unsigned short fc_lfo; 2951da177e4SLinus Torvalds unsigned short gf1_volume; 2961da177e4SLinus Torvalds unsigned char control; 2971da177e4SLinus Torvalds unsigned char mode; 2981da177e4SLinus Torvalds unsigned char gf1_pan; 2991da177e4SLinus Torvalds unsigned char effect_accumulator; 3001da177e4SLinus Torvalds unsigned char volume_control; 3011da177e4SLinus Torvalds unsigned char venv_value_next; 3025e2da206STakashi Iwai enum snd_gus_volume_state venv_state; 3035e2da206STakashi Iwai enum snd_gus_volume_state venv_state_prev; 3041da177e4SLinus Torvalds unsigned short vlo; 3051da177e4SLinus Torvalds unsigned short vro; 3061da177e4SLinus Torvalds unsigned short gf1_effect_volume; 3071da177e4SLinus Torvalds 3081da177e4SLinus Torvalds /* --- */ 3091da177e4SLinus Torvalds 3101da177e4SLinus Torvalds void *private_data; 3115e2da206STakashi Iwai void (*private_free)(struct snd_gus_voice *voice); 3121da177e4SLinus Torvalds }; 3131da177e4SLinus Torvalds 3145e2da206STakashi Iwai struct snd_gf1 { 3151da177e4SLinus Torvalds 3161da177e4SLinus Torvalds unsigned int enh_mode:1, /* enhanced mode (GFA1) */ 3171da177e4SLinus Torvalds hw_lfo:1, /* use hardware LFO */ 3181da177e4SLinus Torvalds sw_lfo:1, /* use software LFO */ 3191da177e4SLinus Torvalds effect:1; /* use effect voices */ 3201da177e4SLinus Torvalds 3211da177e4SLinus Torvalds unsigned long port; /* port of GF1 chip */ 3221da177e4SLinus Torvalds struct resource *res_port1; 3231da177e4SLinus Torvalds struct resource *res_port2; 3241da177e4SLinus Torvalds int irq; /* IRQ number */ 3251da177e4SLinus Torvalds int dma1; /* DMA1 number */ 3261da177e4SLinus Torvalds int dma2; /* DMA2 number */ 3271da177e4SLinus Torvalds unsigned int memory; /* GUS's DRAM size in bytes */ 3281da177e4SLinus Torvalds unsigned int rom_memory; /* GUS's ROM size in bytes */ 3291da177e4SLinus Torvalds unsigned int rom_present; /* bitmask */ 3301da177e4SLinus Torvalds unsigned int rom_banks; /* GUS's ROM banks */ 3311da177e4SLinus Torvalds 3325e2da206STakashi Iwai struct snd_gf1_mem mem_alloc; 3331da177e4SLinus Torvalds 3341da177e4SLinus Torvalds /* registers */ 3351da177e4SLinus Torvalds unsigned short reg_page; 3361da177e4SLinus Torvalds unsigned short reg_regsel; 3371da177e4SLinus Torvalds unsigned short reg_data8; 3381da177e4SLinus Torvalds unsigned short reg_data16; 3391da177e4SLinus Torvalds unsigned short reg_irqstat; 3401da177e4SLinus Torvalds unsigned short reg_dram; 3411da177e4SLinus Torvalds unsigned short reg_timerctrl; 3421da177e4SLinus Torvalds unsigned short reg_timerdata; 3431da177e4SLinus Torvalds unsigned char ics_regs[6][2]; 3441da177e4SLinus Torvalds /* --------- */ 3451da177e4SLinus Torvalds 3461da177e4SLinus Torvalds unsigned char active_voices; /* active voices */ 3471da177e4SLinus Torvalds unsigned char active_voice; /* selected voice (GF1PAGE register) */ 3481da177e4SLinus Torvalds 3495e2da206STakashi Iwai struct snd_gus_voice voices[32]; /* GF1 voices */ 3501da177e4SLinus Torvalds 3511da177e4SLinus Torvalds unsigned int default_voice_address; 3521da177e4SLinus Torvalds 3531da177e4SLinus Torvalds unsigned short playback_freq; /* GF1 playback (mixing) frequency */ 3541da177e4SLinus Torvalds unsigned short mode; /* see to SNDRV_GF1_MODE_XXXX */ 3551da177e4SLinus Torvalds unsigned char volume_ramp; 3561da177e4SLinus Torvalds unsigned char smooth_pan; 3571da177e4SLinus Torvalds unsigned char full_range_pan; 3581da177e4SLinus Torvalds unsigned char pad0; 3591da177e4SLinus Torvalds 3601da177e4SLinus Torvalds unsigned char *lfos; 3611da177e4SLinus Torvalds 3621da177e4SLinus Torvalds /* interrupt handlers */ 3631da177e4SLinus Torvalds 3645e2da206STakashi Iwai void (*interrupt_handler_midi_out) (struct snd_gus_card * gus); 3655e2da206STakashi Iwai void (*interrupt_handler_midi_in) (struct snd_gus_card * gus); 3665e2da206STakashi Iwai void (*interrupt_handler_timer1) (struct snd_gus_card * gus); 3675e2da206STakashi Iwai void (*interrupt_handler_timer2) (struct snd_gus_card * gus); 3685e2da206STakashi Iwai void (*interrupt_handler_dma_write) (struct snd_gus_card * gus); 3695e2da206STakashi Iwai void (*interrupt_handler_dma_read) (struct snd_gus_card * gus); 3701da177e4SLinus Torvalds 3711da177e4SLinus Torvalds #ifdef CONFIG_SND_DEBUG 3721da177e4SLinus Torvalds unsigned int interrupt_stat_midi_out; 3731da177e4SLinus Torvalds unsigned int interrupt_stat_midi_in; 3741da177e4SLinus Torvalds unsigned int interrupt_stat_timer1; 3751da177e4SLinus Torvalds unsigned int interrupt_stat_timer2; 3761da177e4SLinus Torvalds unsigned int interrupt_stat_dma_write; 3771da177e4SLinus Torvalds unsigned int interrupt_stat_dma_read; 3781da177e4SLinus Torvalds unsigned int interrupt_stat_voice_lost; 3791da177e4SLinus Torvalds #endif 3801da177e4SLinus Torvalds 3811da177e4SLinus Torvalds /* synthesizer */ 3821da177e4SLinus Torvalds 3831da177e4SLinus Torvalds int seq_client; 3845e2da206STakashi Iwai struct snd_gus_port seq_ports[4]; 3855e2da206STakashi Iwai struct snd_seq_kinstr_list *ilist; 3865e2da206STakashi Iwai struct snd_iwffff_ops iwffff_ops; 3875e2da206STakashi Iwai struct snd_gf1_ops gf1_ops; 3885e2da206STakashi Iwai struct snd_simple_ops simple_ops; 3891da177e4SLinus Torvalds 3901da177e4SLinus Torvalds /* timer */ 3911da177e4SLinus Torvalds 3921da177e4SLinus Torvalds unsigned short timer_enabled; 3935e2da206STakashi Iwai struct snd_timer *timer1; 3945e2da206STakashi Iwai struct snd_timer *timer2; 3951da177e4SLinus Torvalds 3961da177e4SLinus Torvalds /* midi */ 3971da177e4SLinus Torvalds 3981da177e4SLinus Torvalds unsigned short uart_cmd; 3991da177e4SLinus Torvalds unsigned int uart_framing; 4001da177e4SLinus Torvalds unsigned int uart_overrun; 4011da177e4SLinus Torvalds 4021da177e4SLinus Torvalds /* dma operations */ 4031da177e4SLinus Torvalds 4041da177e4SLinus Torvalds unsigned int dma_flags; 4051da177e4SLinus Torvalds unsigned int dma_shared; 4065e2da206STakashi Iwai struct snd_gf1_dma_block *dma_data_pcm; 4075e2da206STakashi Iwai struct snd_gf1_dma_block *dma_data_pcm_last; 4085e2da206STakashi Iwai struct snd_gf1_dma_block *dma_data_synth; 4095e2da206STakashi Iwai struct snd_gf1_dma_block *dma_data_synth_last; 4105e2da206STakashi Iwai void (*dma_ack)(struct snd_gus_card * gus, void *private_data); 4111da177e4SLinus Torvalds void *dma_private_data; 4121da177e4SLinus Torvalds 4131da177e4SLinus Torvalds /* pcm */ 4141da177e4SLinus Torvalds int pcm_channels; 4151da177e4SLinus Torvalds int pcm_alloc_voices; 4161da177e4SLinus Torvalds unsigned short pcm_volume_level_left; 4171da177e4SLinus Torvalds unsigned short pcm_volume_level_right; 4181da177e4SLinus Torvalds unsigned short pcm_volume_level_left1; 4191da177e4SLinus Torvalds unsigned short pcm_volume_level_right1; 4201da177e4SLinus Torvalds 4211da177e4SLinus Torvalds unsigned char pcm_rcntrl_reg; 4221da177e4SLinus Torvalds unsigned char pad_end; 4231da177e4SLinus Torvalds }; 4241da177e4SLinus Torvalds 4251da177e4SLinus Torvalds /* main structure for GUS card */ 4261da177e4SLinus Torvalds 4275e2da206STakashi Iwai struct snd_gus_card { 4285e2da206STakashi Iwai struct snd_card *card; 4291da177e4SLinus Torvalds 4301da177e4SLinus Torvalds unsigned int 4311da177e4SLinus Torvalds initialized: 1, /* resources were initialized */ 4321da177e4SLinus Torvalds equal_irq:1, /* GF1 and CODEC shares IRQ (GUS MAX only) */ 4331da177e4SLinus Torvalds equal_dma:1, /* if dma channels are equal (not valid for daughter board) */ 4341da177e4SLinus Torvalds ics_flag:1, /* have we ICS mixer chip */ 4351da177e4SLinus Torvalds ics_flipped:1, /* ICS mixer have flipped some channels? */ 4361da177e4SLinus Torvalds codec_flag:1, /* have we CODEC chip? */ 4371da177e4SLinus Torvalds max_flag:1, /* have we GUS MAX card? */ 4381da177e4SLinus Torvalds max_ctrl_flag:1, /* have we original GUS MAX card? */ 4391da177e4SLinus Torvalds daughter_flag:1, /* have we daughter board? */ 4401da177e4SLinus Torvalds interwave:1, /* hey - we have InterWave card */ 4411da177e4SLinus Torvalds ess_flag:1, /* ESS chip found... GUS Extreme */ 4421da177e4SLinus Torvalds ace_flag:1, /* GUS ACE detected */ 4431da177e4SLinus Torvalds uart_enable:1; /* enable MIDI UART */ 4441da177e4SLinus Torvalds unsigned short revision; /* revision of chip */ 4451da177e4SLinus Torvalds unsigned short max_cntrl_val; /* GUS MAX control value */ 4461da177e4SLinus Torvalds unsigned short mix_cntrl_reg; /* mixer control register */ 4471da177e4SLinus Torvalds unsigned short joystick_dac; /* joystick DAC level */ 4481da177e4SLinus Torvalds int timer_dev; /* timer device */ 4491da177e4SLinus Torvalds 4505e2da206STakashi Iwai struct snd_gf1 gf1; /* gf1 specific variables */ 4515e2da206STakashi Iwai struct snd_pcm *pcm; 4525e2da206STakashi Iwai struct snd_pcm_substream *pcm_cap_substream; 4531da177e4SLinus Torvalds unsigned int c_dma_size; 4541da177e4SLinus Torvalds unsigned int c_period_size; 4551da177e4SLinus Torvalds unsigned int c_pos; 4561da177e4SLinus Torvalds 4575e2da206STakashi Iwai struct snd_rawmidi *midi_uart; 4585e2da206STakashi Iwai struct snd_rawmidi_substream *midi_substream_output; 4595e2da206STakashi Iwai struct snd_rawmidi_substream *midi_substream_input; 4601da177e4SLinus Torvalds 4615e2da206STakashi Iwai struct snd_seq_device *seq_dev; 4621da177e4SLinus Torvalds 4631da177e4SLinus Torvalds spinlock_t reg_lock; 4641da177e4SLinus Torvalds spinlock_t voice_alloc; 4651da177e4SLinus Torvalds spinlock_t active_voice_lock; 4661da177e4SLinus Torvalds spinlock_t event_lock; 4671da177e4SLinus Torvalds spinlock_t dma_lock; 4681da177e4SLinus Torvalds spinlock_t pcm_volume_level_lock; 4691da177e4SLinus Torvalds spinlock_t uart_cmd_lock; 4708b7547f9SIngo Molnar struct mutex dma_mutex; 4718b7547f9SIngo Molnar struct mutex register_mutex; 4721da177e4SLinus Torvalds }; 4731da177e4SLinus Torvalds 4741da177e4SLinus Torvalds /* I/O functions for GF1/InterWave chip - gus_io.c */ 4751da177e4SLinus Torvalds 4765e2da206STakashi Iwai static inline void snd_gf1_select_voice(struct snd_gus_card * gus, int voice) 4771da177e4SLinus Torvalds { 4781da177e4SLinus Torvalds unsigned long flags; 4791da177e4SLinus Torvalds 4801da177e4SLinus Torvalds spin_lock_irqsave(&gus->active_voice_lock, flags); 4811da177e4SLinus Torvalds if (voice != gus->gf1.active_voice) { 4821da177e4SLinus Torvalds gus->gf1.active_voice = voice; 4831da177e4SLinus Torvalds outb(voice, GUSP(gus, GF1PAGE)); 4841da177e4SLinus Torvalds } 4851da177e4SLinus Torvalds spin_unlock_irqrestore(&gus->active_voice_lock, flags); 4861da177e4SLinus Torvalds } 4871da177e4SLinus Torvalds 4885e2da206STakashi Iwai static inline void snd_gf1_uart_cmd(struct snd_gus_card * gus, unsigned char b) 4891da177e4SLinus Torvalds { 4901da177e4SLinus Torvalds outb(gus->gf1.uart_cmd = b, GUSP(gus, MIDICTRL)); 4911da177e4SLinus Torvalds } 4921da177e4SLinus Torvalds 4935e2da206STakashi Iwai static inline unsigned char snd_gf1_uart_stat(struct snd_gus_card * gus) 4941da177e4SLinus Torvalds { 4951da177e4SLinus Torvalds return inb(GUSP(gus, MIDISTAT)); 4961da177e4SLinus Torvalds } 4971da177e4SLinus Torvalds 4985e2da206STakashi Iwai static inline void snd_gf1_uart_put(struct snd_gus_card * gus, unsigned char b) 4991da177e4SLinus Torvalds { 5001da177e4SLinus Torvalds outb(b, GUSP(gus, MIDIDATA)); 5011da177e4SLinus Torvalds } 5021da177e4SLinus Torvalds 5035e2da206STakashi Iwai static inline unsigned char snd_gf1_uart_get(struct snd_gus_card * gus) 5041da177e4SLinus Torvalds { 5051da177e4SLinus Torvalds return inb(GUSP(gus, MIDIDATA)); 5061da177e4SLinus Torvalds } 5071da177e4SLinus Torvalds 5085e2da206STakashi Iwai extern void snd_gf1_delay(struct snd_gus_card * gus); 5091da177e4SLinus Torvalds 5105e2da206STakashi Iwai extern void snd_gf1_ctrl_stop(struct snd_gus_card * gus, unsigned char reg); 5111da177e4SLinus Torvalds 5125e2da206STakashi Iwai extern void snd_gf1_write8(struct snd_gus_card * gus, unsigned char reg, unsigned char data); 5135e2da206STakashi Iwai extern unsigned char snd_gf1_look8(struct snd_gus_card * gus, unsigned char reg); 5145e2da206STakashi Iwai static inline unsigned char snd_gf1_read8(struct snd_gus_card * gus, unsigned char reg) 5151da177e4SLinus Torvalds { 5161da177e4SLinus Torvalds return snd_gf1_look8(gus, reg | 0x80); 5171da177e4SLinus Torvalds } 5185e2da206STakashi Iwai extern void snd_gf1_write16(struct snd_gus_card * gus, unsigned char reg, unsigned int data); 5195e2da206STakashi Iwai extern unsigned short snd_gf1_look16(struct snd_gus_card * gus, unsigned char reg); 5205e2da206STakashi Iwai static inline unsigned short snd_gf1_read16(struct snd_gus_card * gus, unsigned char reg) 5211da177e4SLinus Torvalds { 5221da177e4SLinus Torvalds return snd_gf1_look16(gus, reg | 0x80); 5231da177e4SLinus Torvalds } 5245e2da206STakashi Iwai extern void snd_gf1_adlib_write(struct snd_gus_card * gus, unsigned char reg, unsigned char data); 5255e2da206STakashi Iwai extern void snd_gf1_dram_addr(struct snd_gus_card * gus, unsigned int addr); 5265e2da206STakashi Iwai extern void snd_gf1_poke(struct snd_gus_card * gus, unsigned int addr, unsigned char data); 5275e2da206STakashi Iwai extern unsigned char snd_gf1_peek(struct snd_gus_card * gus, unsigned int addr); 5285e2da206STakashi Iwai extern void snd_gf1_write_addr(struct snd_gus_card * gus, unsigned char reg, unsigned int addr, short w_16bit); 5295e2da206STakashi Iwai extern unsigned int snd_gf1_read_addr(struct snd_gus_card * gus, unsigned char reg, short w_16bit); 5305e2da206STakashi Iwai extern void snd_gf1_i_ctrl_stop(struct snd_gus_card * gus, unsigned char reg); 5315e2da206STakashi Iwai extern void snd_gf1_i_write8(struct snd_gus_card * gus, unsigned char reg, unsigned char data); 5325e2da206STakashi Iwai extern unsigned char snd_gf1_i_look8(struct snd_gus_card * gus, unsigned char reg); 5335e2da206STakashi Iwai extern void snd_gf1_i_write16(struct snd_gus_card * gus, unsigned char reg, unsigned int data); 5345e2da206STakashi Iwai static inline unsigned char snd_gf1_i_read8(struct snd_gus_card * gus, unsigned char reg) 5351da177e4SLinus Torvalds { 5361da177e4SLinus Torvalds return snd_gf1_i_look8(gus, reg | 0x80); 5371da177e4SLinus Torvalds } 5385e2da206STakashi Iwai extern unsigned short snd_gf1_i_look16(struct snd_gus_card * gus, unsigned char reg); 5395e2da206STakashi Iwai static inline unsigned short snd_gf1_i_read16(struct snd_gus_card * gus, unsigned char reg) 5401da177e4SLinus Torvalds { 5411da177e4SLinus Torvalds return snd_gf1_i_look16(gus, reg | 0x80); 5421da177e4SLinus Torvalds } 5431da177e4SLinus Torvalds 5445e2da206STakashi Iwai extern void snd_gf1_select_active_voices(struct snd_gus_card * gus); 5451da177e4SLinus Torvalds 5461da177e4SLinus Torvalds /* gus_lfo.c */ 5471da177e4SLinus Torvalds 5481da177e4SLinus Torvalds struct _SND_IW_LFO_PROGRAM { 5491da177e4SLinus Torvalds unsigned short freq_and_control; 5501da177e4SLinus Torvalds unsigned char depth_final; 5511da177e4SLinus Torvalds unsigned char depth_inc; 5521da177e4SLinus Torvalds unsigned short twave; 5531da177e4SLinus Torvalds unsigned short depth; 5541da177e4SLinus Torvalds }; 5551da177e4SLinus Torvalds 5561da177e4SLinus Torvalds #if 0 5575e2da206STakashi Iwai extern irqreturn_t snd_gf1_lfo_effect_interrupt(struct snd_gus_card * gus, snd_gf1_voice_t * voice); 5581da177e4SLinus Torvalds #endif 5595e2da206STakashi Iwai extern void snd_gf1_lfo_init(struct snd_gus_card * gus); 5605e2da206STakashi Iwai extern void snd_gf1_lfo_done(struct snd_gus_card * gus); 5615e2da206STakashi Iwai extern void snd_gf1_lfo_program(struct snd_gus_card * gus, int voice, int lfo_type, struct _SND_IW_LFO_PROGRAM *program); 5625e2da206STakashi Iwai extern void snd_gf1_lfo_enable(struct snd_gus_card * gus, int voice, int lfo_type); 5635e2da206STakashi Iwai extern void snd_gf1_lfo_disable(struct snd_gus_card * gus, int voice, int lfo_type); 5645e2da206STakashi Iwai extern void snd_gf1_lfo_change_freq(struct snd_gus_card * gus, int voice, int lfo_type, int freq); 5655e2da206STakashi Iwai extern void snd_gf1_lfo_change_depth(struct snd_gus_card * gus, int voice, int lfo_type, int depth); 5665e2da206STakashi Iwai extern void snd_gf1_lfo_setup(struct snd_gus_card * gus, int voice, int lfo_type, int freq, int current_depth, int depth, int sweep, int shape); 5675e2da206STakashi Iwai extern void snd_gf1_lfo_shutdown(struct snd_gus_card * gus, int voice, int lfo_type); 5681da177e4SLinus Torvalds #if 0 5695e2da206STakashi Iwai extern void snd_gf1_lfo_command(struct snd_gus_card * gus, int voice, unsigned char *command); 5701da177e4SLinus Torvalds #endif 5711da177e4SLinus Torvalds 5721da177e4SLinus Torvalds /* gus_mem.c */ 5731da177e4SLinus Torvalds 5745e2da206STakashi Iwai void snd_gf1_mem_lock(struct snd_gf1_mem * alloc, int xup); 5755e2da206STakashi Iwai int snd_gf1_mem_xfree(struct snd_gf1_mem * alloc, struct snd_gf1_mem_block * block); 5765e2da206STakashi Iwai struct snd_gf1_mem_block *snd_gf1_mem_alloc(struct snd_gf1_mem * alloc, int owner, 5771da177e4SLinus Torvalds char *name, int size, int w_16, 5781da177e4SLinus Torvalds int align, unsigned int *share_id); 5795e2da206STakashi Iwai int snd_gf1_mem_free(struct snd_gf1_mem * alloc, unsigned int address); 5805e2da206STakashi Iwai int snd_gf1_mem_free_owner(struct snd_gf1_mem * alloc, int owner); 5815e2da206STakashi Iwai int snd_gf1_mem_init(struct snd_gus_card * gus); 5825e2da206STakashi Iwai int snd_gf1_mem_done(struct snd_gus_card * gus); 5831da177e4SLinus Torvalds 5841da177e4SLinus Torvalds /* gus_mem_proc.c */ 5851da177e4SLinus Torvalds 5865e2da206STakashi Iwai int snd_gf1_mem_proc_init(struct snd_gus_card * gus); 5871da177e4SLinus Torvalds 5881da177e4SLinus Torvalds /* gus_dma.c */ 5891da177e4SLinus Torvalds 5905e2da206STakashi Iwai int snd_gf1_dma_init(struct snd_gus_card * gus); 5915e2da206STakashi Iwai int snd_gf1_dma_done(struct snd_gus_card * gus); 5925e2da206STakashi Iwai int snd_gf1_dma_transfer_block(struct snd_gus_card * gus, 5935e2da206STakashi Iwai struct snd_gf1_dma_block * block, 5941da177e4SLinus Torvalds int atomic, 5951da177e4SLinus Torvalds int synth); 5961da177e4SLinus Torvalds 5971da177e4SLinus Torvalds /* gus_volume.c */ 5981da177e4SLinus Torvalds 5991da177e4SLinus Torvalds unsigned short snd_gf1_lvol_to_gvol_raw(unsigned int vol); 6005e2da206STakashi Iwai unsigned short snd_gf1_translate_freq(struct snd_gus_card * gus, unsigned int freq2); 6011da177e4SLinus Torvalds 6021da177e4SLinus Torvalds /* gus_reset.c */ 6031da177e4SLinus Torvalds 6045e2da206STakashi Iwai void snd_gf1_set_default_handlers(struct snd_gus_card * gus, unsigned int what); 6055e2da206STakashi Iwai void snd_gf1_smart_stop_voice(struct snd_gus_card * gus, unsigned short voice); 6065e2da206STakashi Iwai void snd_gf1_stop_voice(struct snd_gus_card * gus, unsigned short voice); 6075e2da206STakashi Iwai void snd_gf1_stop_voices(struct snd_gus_card * gus, unsigned short v_min, unsigned short v_max); 6085e2da206STakashi Iwai struct snd_gus_voice *snd_gf1_alloc_voice(struct snd_gus_card * gus, int type, int client, int port); 6095e2da206STakashi Iwai void snd_gf1_free_voice(struct snd_gus_card * gus, struct snd_gus_voice *voice); 6105e2da206STakashi Iwai int snd_gf1_start(struct snd_gus_card * gus); 6115e2da206STakashi Iwai int snd_gf1_stop(struct snd_gus_card * gus); 6121da177e4SLinus Torvalds 6131da177e4SLinus Torvalds /* gus_mixer.c */ 6141da177e4SLinus Torvalds 6155e2da206STakashi Iwai int snd_gf1_new_mixer(struct snd_gus_card * gus); 6161da177e4SLinus Torvalds 6171da177e4SLinus Torvalds /* gus_pcm.c */ 6181da177e4SLinus Torvalds 6195e2da206STakashi Iwai int snd_gf1_pcm_new(struct snd_gus_card * gus, int pcm_dev, int control_index, struct snd_pcm ** rpcm); 6201da177e4SLinus Torvalds 6211da177e4SLinus Torvalds #ifdef CONFIG_SND_DEBUG 6225e2da206STakashi Iwai extern void snd_gf1_print_voice_registers(struct snd_gus_card * gus); 6231da177e4SLinus Torvalds #endif 6241da177e4SLinus Torvalds 6251da177e4SLinus Torvalds /* gus.c */ 6261da177e4SLinus Torvalds 6275e2da206STakashi Iwai int snd_gus_use_inc(struct snd_gus_card * gus); 6285e2da206STakashi Iwai void snd_gus_use_dec(struct snd_gus_card * gus); 6295e2da206STakashi Iwai int snd_gus_create(struct snd_card *card, 6301da177e4SLinus Torvalds unsigned long port, 6311da177e4SLinus Torvalds int irq, int dma1, int dma2, 6321da177e4SLinus Torvalds int timer_dev, 6331da177e4SLinus Torvalds int voices, 6341da177e4SLinus Torvalds int pcm_channels, 6351da177e4SLinus Torvalds int effect, 6365e2da206STakashi Iwai struct snd_gus_card ** rgus); 6375e2da206STakashi Iwai int snd_gus_initialize(struct snd_gus_card * gus); 6381da177e4SLinus Torvalds 6391da177e4SLinus Torvalds /* gus_irq.c */ 6401da177e4SLinus Torvalds 6417d12e780SDavid Howells irqreturn_t snd_gus_interrupt(int irq, void *dev_id); 6421da177e4SLinus Torvalds #ifdef CONFIG_SND_DEBUG 6435e2da206STakashi Iwai void snd_gus_irq_profile_init(struct snd_gus_card *gus); 6441da177e4SLinus Torvalds #endif 6451da177e4SLinus Torvalds 6461da177e4SLinus Torvalds /* gus_uart.c */ 6471da177e4SLinus Torvalds 6485e2da206STakashi Iwai int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmidi **rrawmidi); 6491da177e4SLinus Torvalds 6501da177e4SLinus Torvalds #if 0 6511da177e4SLinus Torvalds extern void snd_engine_instrument_register(unsigned short mode, 6521da177e4SLinus Torvalds struct _SND_INSTRUMENT_VOICE_COMMANDS *voice_cmds, 6531da177e4SLinus Torvalds struct _SND_INSTRUMENT_NOTE_COMMANDS *note_cmds, 6541da177e4SLinus Torvalds struct _SND_INSTRUMENT_CHANNEL_COMMANDS *channel_cmds); 6551da177e4SLinus Torvalds extern int snd_engine_instrument_register_ask(unsigned short mode); 6561da177e4SLinus Torvalds #endif 6571da177e4SLinus Torvalds 6581da177e4SLinus Torvalds /* gus_dram.c */ 6595e2da206STakashi Iwai int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr, 6601da177e4SLinus Torvalds unsigned int addr, unsigned int size); 6615e2da206STakashi Iwai int snd_gus_dram_read(struct snd_gus_card *gus, char __user *ptr, 6621da177e4SLinus Torvalds unsigned int addr, unsigned int size, int rom); 6631da177e4SLinus Torvalds 6641da177e4SLinus Torvalds #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) 6651da177e4SLinus Torvalds 6661da177e4SLinus Torvalds /* gus_sample.c */ 6675e2da206STakashi Iwai void snd_gus_sample_event(struct snd_seq_event *ev, struct snd_gus_port *p); 6681da177e4SLinus Torvalds 6691da177e4SLinus Torvalds /* gus_simple.c */ 6705e2da206STakashi Iwai void snd_gf1_simple_init(struct snd_gus_voice *voice); 6711da177e4SLinus Torvalds 6721da177e4SLinus Torvalds /* gus_instr.c */ 6735e2da206STakashi Iwai int snd_gus_iwffff_put_sample(void *private_data, struct iwffff_wave *wave, 6741da177e4SLinus Torvalds char __user *data, long len, int atomic); 6755e2da206STakashi Iwai int snd_gus_iwffff_get_sample(void *private_data, struct iwffff_wave *wave, 6761da177e4SLinus Torvalds char __user *data, long len, int atomic); 6775e2da206STakashi Iwai int snd_gus_iwffff_remove_sample(void *private_data, struct iwffff_wave *wave, 6781da177e4SLinus Torvalds int atomic); 6795e2da206STakashi Iwai int snd_gus_gf1_put_sample(void *private_data, struct gf1_wave *wave, 6801da177e4SLinus Torvalds char __user *data, long len, int atomic); 6815e2da206STakashi Iwai int snd_gus_gf1_get_sample(void *private_data, struct gf1_wave *wave, 6821da177e4SLinus Torvalds char __user *data, long len, int atomic); 6835e2da206STakashi Iwai int snd_gus_gf1_remove_sample(void *private_data, struct gf1_wave *wave, 6841da177e4SLinus Torvalds int atomic); 6855e2da206STakashi Iwai int snd_gus_simple_put_sample(void *private_data, struct simple_instrument *instr, 6861da177e4SLinus Torvalds char __user *data, long len, int atomic); 6875e2da206STakashi Iwai int snd_gus_simple_get_sample(void *private_data, struct simple_instrument *instr, 6881da177e4SLinus Torvalds char __user *data, long len, int atomic); 6895e2da206STakashi Iwai int snd_gus_simple_remove_sample(void *private_data, struct simple_instrument *instr, 6901da177e4SLinus Torvalds int atomic); 6911da177e4SLinus Torvalds 6921da177e4SLinus Torvalds #endif /* CONFIG_SND_SEQUENCER */ 6931da177e4SLinus Torvalds 6941da177e4SLinus Torvalds #endif /* __SOUND_GUS_H */ 695