/* aica.h1* Header file for ALSA driver for2* Sega Dreamcast Yamaha AICA sound3* Copyright Adrian McMenamin4* <[email protected]>5* 20066*7* This program is free software; you can redistribute it and/or modify8* it under the terms of version 2 of the GNU General Public License as published by9* the Free Software Foundation.10*11* This program is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14* GNU General Public License for more details.15*16* You should have received a copy of the GNU General Public License17* along with this program; if not, write to the Free Software18* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19*20*/2122/* SPU memory and register constants etc */23#define G2_FIFO 0xa05f688c24#define SPU_MEMORY_BASE 0xA080000025#define ARM_RESET_REGISTER 0xA0702C0026#define SPU_REGISTER_BASE 0xA07000002728/* AICA channels stuff */29#define AICA_CONTROL_POINT 0xA081000030#define AICA_CONTROL_CHANNEL_SAMPLE_NUMBER 0xA081000831#define AICA_CHANNEL0_CONTROL_OFFSET 0x100043233/* Command values */34#define AICA_CMD_KICK 0x8000000035#define AICA_CMD_NONE 036#define AICA_CMD_START 137#define AICA_CMD_STOP 238#define AICA_CMD_VOL 33940/* Sound modes */41#define SM_8BIT 142#define SM_16BIT 043#define SM_ADPCM 24445/* Buffer and period size */46#define AICA_BUFFER_SIZE 0x800047#define AICA_PERIOD_SIZE 0x80048#define AICA_PERIOD_NUMBER 164950#define AICA_CHANNEL0_OFFSET 0x1100051#define AICA_CHANNEL1_OFFSET 0x2100052#define CHANNEL_OFFSET 0x100005354#define AICA_DMA_CHANNEL 555#define AICA_DMA_MODE 55657#define SND_AICA_DRIVER "AICA"5859struct aica_channel {60uint32_t cmd; /* Command ID */61uint32_t pos; /* Sample position */62uint32_t length; /* Sample length */63uint32_t freq; /* Frequency */64uint32_t vol; /* Volume 0-255 */65uint32_t pan; /* Pan 0-255 */66uint32_t sfmt; /* Sound format */67uint32_t flags; /* Bit flags */68};6970struct snd_card_aica {71struct work_struct spu_dma_work;72struct snd_card *card;73struct aica_channel *channel;74struct snd_pcm_substream *substream;75int clicks;76int current_period;77struct timer_list timer;78int master_volume;79int dma_check;80};818283