diff options
author | Adrian McMenamin <adrian@mcmen.demon.co.uk> | 2007-05-18 08:26:59 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-07-20 05:11:17 -0400 |
commit | 198de43d758ca2700e2b52b49c0b189b4931466c (patch) | |
tree | 4c783082bc682c6a3eaa9734563421bf42ba82eb /sound/sh/aica.h | |
parent | aef3b06ac69783d6a6d1e4357c62bab46dd16141 (diff) |
[ALSA] Add ALSA support for the SEGA Dreamcast PCM device
ALSA support for the SEGA Dreamcast Yamaha AICA sound device (pcm)
This patch adds ALSA sound support for pcm playback on two channels on
the SEGA Dreamcast built-in sound device (the Yamaha AICA)
Add driver for the AICA sound device built into the SEGA Dreamcast
Hook it all up with the build system.
Signed-off-by: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/sh/aica.h')
-rw-r--r-- | sound/sh/aica.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/sound/sh/aica.h b/sound/sh/aica.h new file mode 100644 index 000000000000..0603b5b0376b --- /dev/null +++ b/sound/sh/aica.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /* aica.h | ||
2 | * Header file for ALSA driver for | ||
3 | * Sega Dreamcast Yamaha AICA sound | ||
4 | * Copyright Adrian McMenamin | ||
5 | * <adrian@mcmen.demon.co.uk> | ||
6 | * 2006 | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of version 2 of the GNU General Public License as published by | ||
10 | * the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | */ | ||
22 | |||
23 | /* SPU memory and register constants etc */ | ||
24 | #define G2_FIFO 0xa05f688c | ||
25 | #define SPU_MEMORY_BASE 0xA0800000 | ||
26 | #define ARM_RESET_REGISTER 0xA0702C00 | ||
27 | #define SPU_REGISTER_BASE 0xA0700000 | ||
28 | |||
29 | /* AICA channels stuff */ | ||
30 | #define AICA_CONTROL_POINT 0xA0810000 | ||
31 | #define AICA_CONTROL_CHANNEL_SAMPLE_NUMBER 0xA0810008 | ||
32 | #define AICA_CHANNEL0_CONTROL_OFFSET 0x10004 | ||
33 | |||
34 | /* Command values */ | ||
35 | #define AICA_CMD_KICK 0x80000000 | ||
36 | #define AICA_CMD_NONE 0 | ||
37 | #define AICA_CMD_START 1 | ||
38 | #define AICA_CMD_STOP 2 | ||
39 | #define AICA_CMD_VOL 3 | ||
40 | |||
41 | /* Sound modes */ | ||
42 | #define SM_8BIT 1 | ||
43 | #define SM_16BIT 0 | ||
44 | #define SM_ADPCM 2 | ||
45 | |||
46 | /* Buffer and period size */ | ||
47 | #define AICA_BUFFER_SIZE 0x8000 | ||
48 | #define AICA_PERIOD_SIZE 0x800 | ||
49 | #define AICA_PERIOD_NUMBER 16 | ||
50 | |||
51 | #define AICA_CHANNEL0_OFFSET 0x11000 | ||
52 | #define AICA_CHANNEL1_OFFSET 0x21000 | ||
53 | #define CHANNEL_OFFSET 0x10000 | ||
54 | |||
55 | #define AICA_DMA_CHANNEL 0 | ||
56 | #define AICA_DMA_MODE 5 | ||
57 | |||
58 | #define SND_AICA_DRIVER "AICA" | ||
59 | |||
60 | struct aica_channel { | ||
61 | uint32_t cmd; /* Command ID */ | ||
62 | uint32_t pos; /* Sample position */ | ||
63 | uint32_t length; /* Sample length */ | ||
64 | uint32_t freq; /* Frequency */ | ||
65 | uint32_t vol; /* Volume 0-255 */ | ||
66 | uint32_t pan; /* Pan 0-255 */ | ||
67 | uint32_t sfmt; /* Sound format */ | ||
68 | uint32_t flags; /* Bit flags */ | ||
69 | }; | ||
70 | |||
71 | struct snd_card_aica { | ||
72 | struct snd_card *card; | ||
73 | struct aica_channel *channel; | ||
74 | struct snd_pcm_substream *substream; | ||
75 | int clicks; | ||
76 | int current_period; | ||
77 | struct timer_list timer; | ||
78 | int master_volume; | ||
79 | int dma_check; | ||
80 | }; | ||