aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-omap/eac.h1
-rw-r--r--include/asm-arm/arch-omap/omap-alsa.h1
-rw-r--r--include/asm-arm/arch-pxa/audio.h1
-rw-r--r--include/asm-generic/tlb.h1
-rw-r--r--include/asm-x86/pgalloc_32.h20
-rw-r--r--include/linux/swap.h1
-rw-r--r--include/sound/ad1848.h2
-rw-r--r--include/sound/ainstr_fm.h134
-rw-r--r--include/sound/ainstr_gf1.h229
-rw-r--r--include/sound/ainstr_iw.h384
-rw-r--r--include/sound/ainstr_simple.h159
-rw-r--r--include/sound/ak4xxx-adda.h2
-rw-r--r--include/sound/asequencer.h242
-rw-r--r--include/sound/asound.h34
-rw-r--r--include/sound/asound_fm.h19
-rw-r--r--include/sound/core.h10
-rw-r--r--include/sound/cs4231-regs.h2
-rw-r--r--include/sound/cs46xx.h3
-rw-r--r--include/sound/driver.h52
-rw-r--r--include/sound/emu10k1.h231
-rw-r--r--include/sound/gus.h63
-rw-r--r--include/sound/info.h2
-rw-r--r--include/sound/opl3.h78
-rw-r--r--include/sound/pcm.h18
-rw-r--r--include/sound/seq_instr.h110
-rw-r--r--include/sound/soc-dapm.h29
-rw-r--r--include/sound/soc.h67
-rw-r--r--include/sound/tea575x-tuner.h1
-rw-r--r--include/sound/trident.h22
-rw-r--r--include/sound/version.h4
30 files changed, 445 insertions, 1477 deletions
diff --git a/include/asm-arm/arch-omap/eac.h b/include/asm-arm/arch-omap/eac.h
index 6662cb02bafc..ccee3b0700b3 100644
--- a/include/asm-arm/arch-omap/eac.h
+++ b/include/asm-arm/arch-omap/eac.h
@@ -31,7 +31,6 @@
31#include <asm/arch/hardware.h> 31#include <asm/arch/hardware.h>
32#include <asm/irq.h> 32#include <asm/irq.h>
33 33
34#include <sound/driver.h>
35#include <sound/core.h> 34#include <sound/core.h>
36 35
37/* master codec clock source */ 36/* master codec clock source */
diff --git a/include/asm-arm/arch-omap/omap-alsa.h b/include/asm-arm/arch-omap/omap-alsa.h
index fcaf44c14714..faa0ed23d4ba 100644
--- a/include/asm-arm/arch-omap/omap-alsa.h
+++ b/include/asm-arm/arch-omap/omap-alsa.h
@@ -40,7 +40,6 @@
40#ifndef __OMAP_ALSA_H 40#ifndef __OMAP_ALSA_H
41#define __OMAP_ALSA_H 41#define __OMAP_ALSA_H
42 42
43#include <sound/driver.h>
44#include <asm/arch/dma.h> 43#include <asm/arch/dma.h>
45#include <sound/core.h> 44#include <sound/core.h>
46#include <sound/pcm.h> 45#include <sound/pcm.h>
diff --git a/include/asm-arm/arch-pxa/audio.h b/include/asm-arm/arch-pxa/audio.h
index 17eccd720136..52bbe3bc25e1 100644
--- a/include/asm-arm/arch-pxa/audio.h
+++ b/include/asm-arm/arch-pxa/audio.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_ARCH_AUDIO_H__ 1#ifndef __ASM_ARCH_AUDIO_H__
2#define __ASM_ARCH_AUDIO_H__ 2#define __ASM_ARCH_AUDIO_H__
3 3
4#include <sound/driver.h>
5#include <sound/core.h> 4#include <sound/core.h>
6#include <sound/pcm.h> 5#include <sound/pcm.h>
7 6
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index 6ce9f3ab928d..75f2bfab614f 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -15,6 +15,7 @@
15 15
16#include <linux/swap.h> 16#include <linux/swap.h>
17#include <linux/quicklist.h> 17#include <linux/quicklist.h>
18#include <asm/pgalloc.h>
18#include <asm/tlbflush.h> 19#include <asm/tlbflush.h>
19 20
20/* 21/*
diff --git a/include/asm-x86/pgalloc_32.h b/include/asm-x86/pgalloc_32.h
index 10c2b452e64c..7641e7b5d931 100644
--- a/include/asm-x86/pgalloc_32.h
+++ b/include/asm-x86/pgalloc_32.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/threads.h> 4#include <linux/threads.h>
5#include <linux/mm.h> /* for struct page */ 5#include <linux/mm.h> /* for struct page */
6#include <linux/pagemap.h>
6#include <asm/tlb.h> 7#include <asm/tlb.h>
7#include <asm-generic/tlb.h> 8#include <asm-generic/tlb.h>
8 9
@@ -51,11 +52,7 @@ static inline void pte_free(struct page *pte)
51} 52}
52 53
53 54
54static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte) 55extern void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte);
55{
56 paravirt_release_pt(page_to_pfn(pte));
57 tlb_remove_page(tlb, pte);
58}
59 56
60#ifdef CONFIG_X86_PAE 57#ifdef CONFIG_X86_PAE
61/* 58/*
@@ -72,18 +69,7 @@ static inline void pmd_free(pmd_t *pmd)
72 free_page((unsigned long)pmd); 69 free_page((unsigned long)pmd);
73} 70}
74 71
75static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) 72extern void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd);
76{
77 /* This is called just after the pmd has been detached from
78 the pgd, which requires a full tlb flush to be recognized
79 by the CPU. Rather than incurring multiple tlb flushes
80 while the address space is being pulled down, make the tlb
81 gathering machinery do a full flush when we're done. */
82 tlb->fullmm = 1;
83
84 paravirt_release_pd(__pa(pmd) >> PAGE_SHIFT);
85 tlb_remove_page(tlb, virt_to_page(pmd));
86}
87 73
88static inline void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd) 74static inline void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd)
89{ 75{
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 2c3ce4c69b25..4f3838adbb30 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -6,7 +6,6 @@
6#include <linux/mmzone.h> 6#include <linux/mmzone.h>
7#include <linux/list.h> 7#include <linux/list.h>
8#include <linux/sched.h> 8#include <linux/sched.h>
9#include <linux/pagemap.h>
10 9
11#include <asm/atomic.h> 10#include <asm/atomic.h>
12#include <asm/page.h> 11#include <asm/page.h>
diff --git a/include/sound/ad1848.h b/include/sound/ad1848.h
index d04f9e78c7c1..d9aebdf6db63 100644
--- a/include/sound/ad1848.h
+++ b/include/sound/ad1848.h
@@ -48,7 +48,7 @@
48#define AD1848_IFACE_CTRL 0x09 /* interface control - bits 7-2 MCE */ 48#define AD1848_IFACE_CTRL 0x09 /* interface control - bits 7-2 MCE */
49#define AD1848_PIN_CTRL 0x0a /* pin control */ 49#define AD1848_PIN_CTRL 0x0a /* pin control */
50#define AD1848_TEST_INIT 0x0b /* test and initialization */ 50#define AD1848_TEST_INIT 0x0b /* test and initialization */
51#define AD1848_MISC_INFO 0x0c /* miscellaneaous information */ 51#define AD1848_MISC_INFO 0x0c /* miscellaneous information */
52#define AD1848_LOOPBACK 0x0d /* loopback control */ 52#define AD1848_LOOPBACK 0x0d /* loopback control */
53#define AD1848_DATA_UPR_CNT 0x0e /* playback/capture upper base count */ 53#define AD1848_DATA_UPR_CNT 0x0e /* playback/capture upper base count */
54#define AD1848_DATA_LWR_CNT 0x0f /* playback/capture lower base count */ 54#define AD1848_DATA_LWR_CNT 0x0f /* playback/capture lower base count */
diff --git a/include/sound/ainstr_fm.h b/include/sound/ainstr_fm.h
deleted file mode 100644
index c4afb1f121fe..000000000000
--- a/include/sound/ainstr_fm.h
+++ /dev/null
@@ -1,134 +0,0 @@
1/*
2 * Advanced Linux Sound Architecture
3 *
4 * FM (OPL2/3) Instrument Format
5 * Copyright (c) 2000 Uros Bizjak <uros@kss-loka.si>
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __SOUND_AINSTR_FM_H
25#define __SOUND_AINSTR_FM_H
26
27#ifndef __KERNEL__
28#include <asm/types.h>
29#include <asm/byteorder.h>
30#endif
31
32/*
33 * share types (share ID 1)
34 */
35
36#define FM_SHARE_FILE 0
37
38/*
39 * FM operator
40 */
41
42struct fm_operator {
43 unsigned char am_vib;
44 unsigned char ksl_level;
45 unsigned char attack_decay;
46 unsigned char sustain_release;
47 unsigned char wave_select;
48};
49
50/*
51 * Instrument
52 */
53
54#define FM_PATCH_OPL2 0x01 /* OPL2 2 operators FM instrument */
55#define FM_PATCH_OPL3 0x02 /* OPL3 4 operators FM instrument */
56
57struct fm_instrument {
58 unsigned int share_id[4]; /* share id - zero = no sharing */
59 unsigned char type; /* instrument type */
60
61 struct fm_operator op[4];
62 unsigned char feedback_connection[2];
63
64 unsigned char echo_delay;
65 unsigned char echo_atten;
66 unsigned char chorus_spread;
67 unsigned char trnsps;
68 unsigned char fix_dur;
69 unsigned char modes;
70 unsigned char fix_key;
71};
72
73/*
74 *
75 * Kernel <-> user space
76 * Hardware (CPU) independent section
77 *
78 * * = zero or more
79 * + = one or more
80 *
81 * fm_xinstrument FM_STRU_INSTR
82 *
83 */
84
85#define FM_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
86
87/*
88 * FM operator
89 */
90
91struct fm_xoperator {
92 __u8 am_vib;
93 __u8 ksl_level;
94 __u8 attack_decay;
95 __u8 sustain_release;
96 __u8 wave_select;
97};
98
99/*
100 * Instrument
101 */
102
103struct fm_xinstrument {
104 __u32 stype; /* structure type */
105
106 __u32 share_id[4]; /* share id - zero = no sharing */
107 __u8 type; /* instrument type */
108
109 struct fm_xoperator op[4]; /* fm operators */
110 __u8 feedback_connection[2];
111
112 __u8 echo_delay;
113 __u8 echo_atten;
114 __u8 chorus_spread;
115 __u8 trnsps;
116 __u8 fix_dur;
117 __u8 modes;
118 __u8 fix_key;
119};
120
121#ifdef __KERNEL__
122
123#include "seq_instr.h"
124
125int snd_seq_fm_init(struct snd_seq_kinstr_ops * ops,
126 struct snd_seq_kinstr_ops * next);
127
128#endif
129
130/* typedefs for compatibility to user-space */
131typedef struct fm_xoperator fm_xoperator_t;
132typedef struct fm_xinstrument fm_xinstrument_t;
133
134#endif /* __SOUND_AINSTR_FM_H */
diff --git a/include/sound/ainstr_gf1.h b/include/sound/ainstr_gf1.h
deleted file mode 100644
index b62b665c69c6..000000000000
--- a/include/sound/ainstr_gf1.h
+++ /dev/null
@@ -1,229 +0,0 @@
1/*
2 * Advanced Linux Sound Architecture
3 *
4 * GF1 (GUS) Patch Instrument Format
5 * Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz>
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __SOUND_AINSTR_GF1_H
25#define __SOUND_AINSTR_GF1_H
26
27#ifndef __KERNEL__
28#include <asm/types.h>
29#include <asm/byteorder.h>
30#endif
31
32/*
33 * share types (share ID 1)
34 */
35
36#define GF1_SHARE_FILE 0
37
38/*
39 * wave formats
40 */
41
42#define GF1_WAVE_16BIT 0x0001 /* 16-bit wave */
43#define GF1_WAVE_UNSIGNED 0x0002 /* unsigned wave */
44#define GF1_WAVE_INVERT 0x0002 /* same as unsigned wave */
45#define GF1_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */
46#define GF1_WAVE_LOOP 0x0008 /* loop mode */
47#define GF1_WAVE_BIDIR 0x0010 /* bidirectional mode */
48#define GF1_WAVE_STEREO 0x0100 /* stereo mode */
49#define GF1_WAVE_ULAW 0x0200 /* uLaw compression mode */
50
51/*
52 * Wavetable definitions
53 */
54
55struct gf1_wave {
56 unsigned int share_id[4]; /* share id - zero = no sharing */
57 unsigned int format; /* wave format */
58
59 struct {
60 unsigned int number; /* some other ID for this instrument */
61 unsigned int memory; /* begin of waveform in onboard memory */
62 unsigned char *ptr; /* pointer to waveform in system memory */
63 } address;
64
65 unsigned int size; /* size of waveform in samples */
66 unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
67 unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
68 unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
69 unsigned short loop_repeat; /* loop repeat - 0 = forever */
70
71 unsigned char flags; /* GF1 patch flags */
72 unsigned char pad;
73 unsigned int sample_rate; /* sample rate in Hz */
74 unsigned int low_frequency; /* low frequency range */
75 unsigned int high_frequency; /* high frequency range */
76 unsigned int root_frequency; /* root frequency range */
77 signed short tune;
78 unsigned char balance;
79 unsigned char envelope_rate[6];
80 unsigned char envelope_offset[6];
81 unsigned char tremolo_sweep;
82 unsigned char tremolo_rate;
83 unsigned char tremolo_depth;
84 unsigned char vibrato_sweep;
85 unsigned char vibrato_rate;
86 unsigned char vibrato_depth;
87 unsigned short scale_frequency;
88 unsigned short scale_factor; /* 0-2048 or 0-2 */
89
90 struct gf1_wave *next;
91};
92
93/*
94 * Instrument
95 */
96
97#define IWFFFF_EXCLUDE_NONE 0x0000 /* exclusion mode - none */
98#define IWFFFF_EXCLUDE_SINGLE 0x0001 /* exclude single - single note from the instrument group */
99#define IWFFFF_EXCLUDE_MULTIPLE 0x0002 /* exclude multiple - stop only same note from this instrument */
100
101#define IWFFFF_EFFECT_NONE 0
102#define IWFFFF_EFFECT_REVERB 1
103#define IWFFFF_EFFECT_CHORUS 2
104#define IWFFFF_EFFECT_ECHO 3
105
106struct gf1_instrument {
107 unsigned short exclusion;
108 unsigned short exclusion_group; /* 0 - none, 1-65535 */
109
110 unsigned char effect1; /* effect 1 */
111 unsigned char effect1_depth; /* 0-127 */
112 unsigned char effect2; /* effect 2 */
113 unsigned char effect2_depth; /* 0-127 */
114
115 struct gf1_wave *wave; /* first waveform */
116};
117
118/*
119 *
120 * Kernel <-> user space
121 * Hardware (CPU) independent section
122 *
123 * * = zero or more
124 * + = one or more
125 *
126 * gf1_xinstrument IWFFFF_STRU_INSTR
127 * +gf1_xwave IWFFFF_STRU_WAVE
128 *
129 */
130
131#define GF1_STRU_WAVE __cpu_to_be32(('W'<<24)|('A'<<16)|('V'<<8)|'E')
132#define GF1_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
133
134/*
135 * Wavetable definitions
136 */
137
138struct gf1_xwave {
139 __u32 stype; /* structure type */
140
141 __u32 share_id[4]; /* share id - zero = no sharing */
142 __u32 format; /* wave format */
143
144 __u32 size; /* size of waveform in samples */
145 __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
146 __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
147 __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
148 __u16 loop_repeat; /* loop repeat - 0 = forever */
149
150 __u8 flags; /* GF1 patch flags */
151 __u8 pad;
152 __u32 sample_rate; /* sample rate in Hz */
153 __u32 low_frequency; /* low frequency range */
154 __u32 high_frequency; /* high frequency range */
155 __u32 root_frequency; /* root frequency range */
156 __s16 tune;
157 __u8 balance;
158 __u8 envelope_rate[6];
159 __u8 envelope_offset[6];
160 __u8 tremolo_sweep;
161 __u8 tremolo_rate;
162 __u8 tremolo_depth;
163 __u8 vibrato_sweep;
164 __u8 vibrato_rate;
165 __u8 vibrato_depth;
166 __u16 scale_frequency;
167 __u16 scale_factor; /* 0-2048 or 0-2 */
168};
169
170/*
171 * Instrument
172 */
173
174struct gf1_xinstrument {
175 __u32 stype;
176
177 __u16 exclusion;
178 __u16 exclusion_group; /* 0 - none, 1-65535 */
179
180 __u8 effect1; /* effect 1 */
181 __u8 effect1_depth; /* 0-127 */
182 __u8 effect2; /* effect 2 */
183 __u8 effect2_depth; /* 0-127 */
184};
185
186/*
187 * Instrument info
188 */
189
190#define GF1_INFO_ENVELOPE (1<<0)
191#define GF1_INFO_TREMOLO (1<<1)
192#define GF1_INFO_VIBRATO (1<<2)
193
194struct gf1_info {
195 unsigned char flags; /* supported wave flags */
196 unsigned char pad[3];
197 unsigned int features; /* supported features */
198 unsigned int max8_len; /* maximum 8-bit wave length */
199 unsigned int max16_len; /* maximum 16-bit wave length */
200};
201
202#ifdef __KERNEL__
203
204#include "seq_instr.h"
205
206struct snd_gf1_ops {
207 void *private_data;
208 int (*info)(void *private_data, struct gf1_info *info);
209 int (*put_sample)(void *private_data, struct gf1_wave *wave,
210 char __user *data, long len, int atomic);
211 int (*get_sample)(void *private_data, struct gf1_wave *wave,
212 char __user *data, long len, int atomic);
213 int (*remove_sample)(void *private_data, struct gf1_wave *wave,
214 int atomic);
215 void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what);
216 struct snd_seq_kinstr_ops kops;
217};
218
219int snd_seq_gf1_init(struct snd_gf1_ops *ops,
220 void *private_data,
221 struct snd_seq_kinstr_ops *next);
222
223#endif
224
225/* typedefs for compatibility to user-space */
226typedef struct gf1_xwave gf1_xwave_t;
227typedef struct gf1_xinstrument gf1_xinstrument_t;
228
229#endif /* __SOUND_AINSTR_GF1_H */
diff --git a/include/sound/ainstr_iw.h b/include/sound/ainstr_iw.h
deleted file mode 100644
index 11bd25082600..000000000000
--- a/include/sound/ainstr_iw.h
+++ /dev/null
@@ -1,384 +0,0 @@
1/*
2 * Advanced Linux Sound Architecture
3 *
4 * InterWave FFFF Instrument Format
5 * Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz>
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __SOUND_AINSTR_IW_H
25#define __SOUND_AINSTR_IW_H
26
27#ifndef __KERNEL__
28#include <asm/types.h>
29#include <asm/byteorder.h>
30#endif
31
32/*
33 * share types (share ID 1)
34 */
35
36#define IWFFFF_SHARE_FILE 0
37
38/*
39 * wave formats
40 */
41
42#define IWFFFF_WAVE_16BIT 0x0001 /* 16-bit wave */
43#define IWFFFF_WAVE_UNSIGNED 0x0002 /* unsigned wave */
44#define IWFFFF_WAVE_INVERT 0x0002 /* same as unsigned wave */
45#define IWFFFF_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */
46#define IWFFFF_WAVE_LOOP 0x0008 /* loop mode */
47#define IWFFFF_WAVE_BIDIR 0x0010 /* bidirectional mode */
48#define IWFFFF_WAVE_ULAW 0x0020 /* uLaw compressed wave */
49#define IWFFFF_WAVE_RAM 0x0040 /* wave is _preloaded_ in RAM (it is used for ROM simulation) */
50#define IWFFFF_WAVE_ROM 0x0080 /* wave is in ROM */
51#define IWFFFF_WAVE_STEREO 0x0100 /* wave is stereo */
52
53/*
54 * Wavetable definitions
55 */
56
57struct iwffff_wave {
58 unsigned int share_id[4]; /* share id - zero = no sharing */
59 unsigned int format; /* wave format */
60
61 struct {
62 unsigned int number; /* some other ID for this wave */
63 unsigned int memory; /* begin of waveform in onboard memory */
64 unsigned char *ptr; /* pointer to waveform in system memory */
65 } address;
66
67 unsigned int size; /* size of waveform in samples */
68 unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
69 unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
70 unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
71 unsigned short loop_repeat; /* loop repeat - 0 = forever */
72 unsigned int sample_ratio; /* sample ratio (44100 * 1024 / rate) */
73 unsigned char attenuation; /* 0 - 127 (no corresponding midi controller) */
74 unsigned char low_note; /* lower frequency range for this waveform */
75 unsigned char high_note; /* higher frequency range for this waveform */
76 unsigned char pad;
77
78 struct iwffff_wave *next;
79};
80
81/*
82 * Layer
83 */
84
85#define IWFFFF_LFO_SHAPE_TRIANGLE 0
86#define IWFFFF_LFO_SHAPE_POSTRIANGLE 1
87
88struct iwffff_lfo {
89 unsigned short freq; /* (0-2047) 0.01Hz - 21.5Hz */
90 signed short depth; /* volume +- (0-255) 0.48675dB/step */
91 signed short sweep; /* 0 - 950 deciseconds */
92 unsigned char shape; /* see to IWFFFF_LFO_SHAPE_XXXX */
93 unsigned char delay; /* 0 - 255 deciseconds */
94};
95
96#define IWFFFF_ENV_FLAG_RETRIGGER 0x0001 /* flag - retrigger */
97
98#define IWFFFF_ENV_MODE_ONE_SHOT 0x0001 /* mode - one shot */
99#define IWFFFF_ENV_MODE_SUSTAIN 0x0002 /* mode - sustain */
100#define IWFFFF_ENV_MODE_NO_SUSTAIN 0x0003 /* mode - no sustain */
101
102#define IWFFFF_ENV_INDEX_VELOCITY 0x0001 /* index - velocity */
103#define IWFFFF_ENV_INDEX_FREQUENCY 0x0002 /* index - frequency */
104
105struct iwffff_env_point {
106 unsigned short offset;
107 unsigned short rate;
108};
109
110struct iwffff_env_record {
111 unsigned short nattack;
112 unsigned short nrelease;
113 unsigned short sustain_offset;
114 unsigned short sustain_rate;
115 unsigned short release_rate;
116 unsigned char hirange;
117 unsigned char pad;
118 struct iwffff_env_record *next;
119 /* points are stored here */
120 /* count of points = nattack + nrelease */
121};
122
123struct iwffff_env {
124 unsigned char flags;
125 unsigned char mode;
126 unsigned char index;
127 unsigned char pad;
128 struct iwffff_env_record *record;
129};
130
131#define IWFFFF_LAYER_FLAG_RETRIGGER 0x0001 /* retrigger */
132
133#define IWFFFF_LAYER_VELOCITY_TIME 0x0000 /* velocity mode = time */
134#define IWFFFF_LAYER_VELOCITY_RATE 0x0001 /* velocity mode = rate */
135
136#define IWFFFF_LAYER_EVENT_KUP 0x0000 /* layer event - key up */
137#define IWFFFF_LAYER_EVENT_KDOWN 0x0001 /* layer event - key down */
138#define IWFFFF_LAYER_EVENT_RETRIG 0x0002 /* layer event - retrigger */
139#define IWFFFF_LAYER_EVENT_LEGATO 0x0003 /* layer event - legato */
140
141struct iwffff_layer {
142 unsigned char flags;
143 unsigned char velocity_mode;
144 unsigned char layer_event;
145 unsigned char low_range; /* range for layer based */
146 unsigned char high_range; /* on either velocity or frequency */
147 unsigned char pan; /* pan offset from CC1 (0 left - 127 right) */
148 unsigned char pan_freq_scale; /* position based on frequency (0-127) */
149 unsigned char attenuation; /* 0-127 (no corresponding midi controller) */
150 struct iwffff_lfo tremolo; /* tremolo effect */
151 struct iwffff_lfo vibrato; /* vibrato effect */
152 unsigned short freq_scale; /* 0-2048, 1024 is equal to semitone scaling */
153 unsigned char freq_center; /* center for keyboard frequency scaling */
154 unsigned char pad;
155 struct iwffff_env penv; /* pitch envelope */
156 struct iwffff_env venv; /* volume envelope */
157
158 struct iwffff_wave *wave;
159 struct iwffff_layer *next;
160};
161
162/*
163 * Instrument
164 */
165
166#define IWFFFF_EXCLUDE_NONE 0x0000 /* exclusion mode - none */
167#define IWFFFF_EXCLUDE_SINGLE 0x0001 /* exclude single - single note from the instrument group */
168#define IWFFFF_EXCLUDE_MULTIPLE 0x0002 /* exclude multiple - stop only same note from this instrument */
169
170#define IWFFFF_LAYER_NONE 0x0000 /* not layered */
171#define IWFFFF_LAYER_ON 0x0001 /* layered */
172#define IWFFFF_LAYER_VELOCITY 0x0002 /* layered by velocity */
173#define IWFFFF_LAYER_FREQUENCY 0x0003 /* layered by frequency */
174
175#define IWFFFF_EFFECT_NONE 0
176#define IWFFFF_EFFECT_REVERB 1
177#define IWFFFF_EFFECT_CHORUS 2
178#define IWFFFF_EFFECT_ECHO 3
179
180struct iwffff_instrument {
181 unsigned short exclusion;
182 unsigned short layer_type;
183 unsigned short exclusion_group; /* 0 - none, 1-65535 */
184
185 unsigned char effect1; /* effect 1 */
186 unsigned char effect1_depth; /* 0-127 */
187 unsigned char effect2; /* effect 2 */
188 unsigned char effect2_depth; /* 0-127 */
189
190 struct iwffff_layer *layer; /* first layer */
191};
192
193/*
194 *
195 * Kernel <-> user space
196 * Hardware (CPU) independent section
197 *
198 * * = zero or more
199 * + = one or more
200 *
201 * iwffff_xinstrument IWFFFF_STRU_INSTR
202 * +iwffff_xlayer IWFFFF_STRU_LAYER
203 * *iwffff_xenv_record IWFFFF_STRU_ENV_RECT (tremolo)
204 * *iwffff_xenv_record IWFFFF_STRU_EVN_RECT (vibrato)
205 * +iwffff_xwave IWFFFF_STRU_WAVE
206 *
207 */
208
209#define IWFFFF_STRU_WAVE __cpu_to_be32(('W'<<24)|('A'<<16)|('V'<<8)|'E')
210#define IWFFFF_STRU_ENV_RECP __cpu_to_be32(('E'<<24)|('N'<<16)|('R'<<8)|'P')
211#define IWFFFF_STRU_ENV_RECV __cpu_to_be32(('E'<<24)|('N'<<16)|('R'<<8)|'V')
212#define IWFFFF_STRU_LAYER __cpu_to_be32(('L'<<24)|('A'<<16)|('Y'<<8)|'R')
213#define IWFFFF_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
214
215/*
216 * Wavetable definitions
217 */
218
219struct iwffff_xwave {
220 __u32 stype; /* structure type */
221
222 __u32 share_id[4]; /* share id - zero = no sharing */
223
224 __u32 format; /* wave format */
225 __u32 offset; /* offset to ROM (address) */
226
227 __u32 size; /* size of waveform in samples */
228 __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
229 __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
230 __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
231 __u16 loop_repeat; /* loop repeat - 0 = forever */
232 __u32 sample_ratio; /* sample ratio (44100 * 1024 / rate) */
233 __u8 attenuation; /* 0 - 127 (no corresponding midi controller) */
234 __u8 low_note; /* lower frequency range for this waveform */
235 __u8 high_note; /* higher frequency range for this waveform */
236 __u8 pad;
237};
238
239/*
240 * Layer
241 */
242
243struct iwffff_xlfo {
244 __u16 freq; /* (0-2047) 0.01Hz - 21.5Hz */
245 __s16 depth; /* volume +- (0-255) 0.48675dB/step */
246 __s16 sweep; /* 0 - 950 deciseconds */
247 __u8 shape; /* see to ULTRA_IW_LFO_SHAPE_XXXX */
248 __u8 delay; /* 0 - 255 deciseconds */
249};
250
251struct iwffff_xenv_point {
252 __u16 offset;
253 __u16 rate;
254};
255
256struct iwffff_xenv_record {
257 __u32 stype;
258 __u16 nattack;
259 __u16 nrelease;
260 __u16 sustain_offset;
261 __u16 sustain_rate;
262 __u16 release_rate;
263 __u8 hirange;
264 __u8 pad;
265 /* points are stored here.. */
266 /* count of points = nattack + nrelease */
267};
268
269struct iwffff_xenv {
270 __u8 flags;
271 __u8 mode;
272 __u8 index;
273 __u8 pad;
274};
275
276struct iwffff_xlayer {
277 __u32 stype;
278 __u8 flags;
279 __u8 velocity_mode;
280 __u8 layer_event;
281 __u8 low_range; /* range for layer based */
282 __u8 high_range; /* on either velocity or frequency */
283 __u8 pan; /* pan offset from CC1 (0 left - 127 right) */
284 __u8 pan_freq_scale; /* position based on frequency (0-127) */
285 __u8 attenuation; /* 0-127 (no corresponding midi controller) */
286 struct iwffff_xlfo tremolo; /* tremolo effect */
287 struct iwffff_xlfo vibrato; /* vibrato effect */
288 __u16 freq_scale; /* 0-2048, 1024 is equal to semitone scaling */
289 __u8 freq_center; /* center for keyboard frequency scaling */
290 __u8 pad;
291 struct iwffff_xenv penv; /* pitch envelope */
292 struct iwffff_xenv venv; /* volume envelope */
293};
294
295/*
296 * Instrument
297 */
298
299struct iwffff_xinstrument {
300 __u32 stype;
301
302 __u16 exclusion;
303 __u16 layer_type;
304 __u16 exclusion_group; /* 0 - none, 1-65535 */
305
306 __u8 effect1; /* effect 1 */
307 __u8 effect1_depth; /* 0-127 */
308 __u8 effect2; /* effect 2 */
309 __u8 effect2_depth; /* 0-127 */
310};
311
312/*
313 * ROM support
314 * InterWave ROMs are Little-Endian (x86)
315 */
316
317#define IWFFFF_ROM_HDR_SIZE 512
318
319struct iwffff_rom_header {
320 __u8 iwave[8];
321 __u8 revision;
322 __u8 series_number;
323 __u8 series_name[16];
324 __u8 date[10];
325 __u16 vendor_revision_major;
326 __u16 vendor_revision_minor;
327 __u32 rom_size;
328 __u8 copyright[128];
329 __u8 vendor_name[64];
330 __u8 description[128];
331};
332
333/*
334 * Instrument info
335 */
336
337#define IWFFFF_INFO_LFO_VIBRATO (1<<0)
338#define IWFFFF_INFO_LFO_VIBRATO_SHAPE (1<<1)
339#define IWFFFF_INFO_LFO_TREMOLO (1<<2)
340#define IWFFFF_INFO_LFO_TREMOLO_SHAPE (1<<3)
341
342struct iwffff_info {
343 unsigned int format; /* supported format bits */
344 unsigned int effects; /* supported effects (1 << IWFFFF_EFFECT*) */
345 unsigned int lfos; /* LFO effects */
346 unsigned int max8_len; /* maximum 8-bit wave length */
347 unsigned int max16_len; /* maximum 16-bit wave length */
348};
349
350#ifdef __KERNEL__
351
352#include "seq_instr.h"
353
354struct snd_iwffff_ops {
355 void *private_data;
356 int (*info)(void *private_data, struct iwffff_info *info);
357 int (*put_sample)(void *private_data, struct iwffff_wave *wave,
358 char __user *data, long len, int atomic);
359 int (*get_sample)(void *private_data, struct iwffff_wave *wave,
360 char __user *data, long len, int atomic);
361 int (*remove_sample)(void *private_data, struct iwffff_wave *wave,
362 int atomic);
363 void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what);
364 struct snd_seq_kinstr_ops kops;
365};
366
367int snd_seq_iwffff_init(struct snd_iwffff_ops *ops,
368 void *private_data,
369 struct snd_seq_kinstr_ops *next);
370
371#endif
372
373/* typedefs for compatibility to user-space */
374typedef struct iwffff_xwave iwffff_xwave_t;
375typedef struct iwffff_xlfo iwffff_xlfo_t;
376typedef struct iwffff_xenv_point iwffff_xenv_point_t;
377typedef struct iwffff_xenv_record iwffff_xenv_record_t;
378typedef struct iwffff_xenv iwffff_xenv_t;
379typedef struct iwffff_xlayer iwffff_xlayer_t;
380typedef struct iwffff_xinstrument iwffff_xinstrument_t;
381typedef struct iwffff_rom_header iwffff_rom_header_t;
382typedef struct iwffff_info iwffff_info_t;
383
384#endif /* __SOUND_AINSTR_IW_H */
diff --git a/include/sound/ainstr_simple.h b/include/sound/ainstr_simple.h
deleted file mode 100644
index da08e7287557..000000000000
--- a/include/sound/ainstr_simple.h
+++ /dev/null
@@ -1,159 +0,0 @@
1/*
2 * Advanced Linux Sound Architecture
3 *
4 * Simple (MOD player) Instrument Format
5 * Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz>
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __SOUND_AINSTR_SIMPLE_H
25#define __SOUND_AINSTR_SIMPLE_H
26
27#ifndef __KERNEL__
28#include <asm/types.h>
29#include <asm/byteorder.h>
30#endif
31
32/*
33 * share types (share ID 1)
34 */
35
36#define SIMPLE_SHARE_FILE 0
37
38/*
39 * wave formats
40 */
41
42#define SIMPLE_WAVE_16BIT 0x0001 /* 16-bit wave */
43#define SIMPLE_WAVE_UNSIGNED 0x0002 /* unsigned wave */
44#define SIMPLE_WAVE_INVERT 0x0002 /* same as unsigned wave */
45#define SIMPLE_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */
46#define SIMPLE_WAVE_LOOP 0x0008 /* loop mode */
47#define SIMPLE_WAVE_BIDIR 0x0010 /* bidirectional mode */
48#define SIMPLE_WAVE_STEREO 0x0100 /* stereo wave */
49#define SIMPLE_WAVE_ULAW 0x0200 /* uLaw compression mode */
50
51/*
52 * instrument effects
53 */
54
55#define SIMPLE_EFFECT_NONE 0
56#define SIMPLE_EFFECT_REVERB 1
57#define SIMPLE_EFFECT_CHORUS 2
58#define SIMPLE_EFFECT_ECHO 3
59
60/*
61 * instrument info
62 */
63
64struct simple_instrument_info {
65 unsigned int format; /* supported format bits */
66 unsigned int effects; /* supported effects (1 << SIMPLE_EFFECT_*) */
67 unsigned int max8_len; /* maximum 8-bit wave length */
68 unsigned int max16_len; /* maximum 16-bit wave length */
69};
70
71/*
72 * Instrument
73 */
74
75struct simple_instrument {
76 unsigned int share_id[4]; /* share id - zero = no sharing */
77 unsigned int format; /* wave format */
78
79 struct {
80 unsigned int number; /* some other ID for this instrument */
81 unsigned int memory; /* begin of waveform in onboard memory */
82 unsigned char *ptr; /* pointer to waveform in system memory */
83 } address;
84
85 unsigned int size; /* size of waveform in samples */
86 unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
87 unsigned int loop_start; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
88 unsigned int loop_end; /* loop end offset in samples * 16 (lowest 4 bits - fraction) */
89 unsigned short loop_repeat; /* loop repeat - 0 = forever */
90
91 unsigned char effect1; /* effect 1 */
92 unsigned char effect1_depth; /* 0-127 */
93 unsigned char effect2; /* effect 2 */
94 unsigned char effect2_depth; /* 0-127 */
95};
96
97/*
98 *
99 * Kernel <-> user space
100 * Hardware (CPU) independent section
101 *
102 * * = zero or more
103 * + = one or more
104 *
105 * simple_xinstrument SIMPLE_STRU_INSTR
106 *
107 */
108
109#define SIMPLE_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
110
111/*
112 * Instrument
113 */
114
115struct simple_xinstrument {
116 __u32 stype;
117
118 __u32 share_id[4]; /* share id - zero = no sharing */
119 __u32 format; /* wave format */
120
121 __u32 size; /* size of waveform in samples */
122 __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */
123 __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */
124 __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */
125 __u16 loop_repeat; /* loop repeat - 0 = forever */
126
127 __u8 effect1; /* effect 1 */
128 __u8 effect1_depth; /* 0-127 */
129 __u8 effect2; /* effect 2 */
130 __u8 effect2_depth; /* 0-127 */
131};
132
133#ifdef __KERNEL__
134
135#include "seq_instr.h"
136
137struct snd_simple_ops {
138 void *private_data;
139 int (*info)(void *private_data, struct simple_instrument_info *info);
140 int (*put_sample)(void *private_data, struct simple_instrument *instr,
141 char __user *data, long len, int atomic);
142 int (*get_sample)(void *private_data, struct simple_instrument *instr,
143 char __user *data, long len, int atomic);
144 int (*remove_sample)(void *private_data, struct simple_instrument *instr,
145 int atomic);
146 void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what);
147 struct snd_seq_kinstr_ops kops;
148};
149
150int snd_seq_simple_init(struct snd_simple_ops *ops,
151 void *private_data,
152 struct snd_seq_kinstr_ops *next);
153
154#endif
155
156/* typedefs for compatibility to user-space */
157typedef struct simple_xinstrument simple_xinstrument_t;
158
159#endif /* __SOUND_AINSTR_SIMPLE_H */
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h
index 891cf1aea8b1..6153b91cdc3e 100644
--- a/include/sound/ak4xxx-adda.h
+++ b/include/sound/ak4xxx-adda.h
@@ -68,7 +68,7 @@ struct snd_akm4xxx {
68 enum { 68 enum {
69 SND_AK4524, SND_AK4528, SND_AK4529, 69 SND_AK4524, SND_AK4528, SND_AK4529,
70 SND_AK4355, SND_AK4358, SND_AK4381, 70 SND_AK4355, SND_AK4358, SND_AK4381,
71 SND_AK5365 71 SND_AK5365, NON_AKM
72 } type; 72 } type;
73 73
74 /* (array) information of combined codecs */ 74 /* (array) information of combined codecs */
diff --git a/include/sound/asequencer.h b/include/sound/asequencer.h
index 64daccbe8b29..1505e6d5ef82 100644
--- a/include/sound/asequencer.h
+++ b/include/sound/asequencer.h
@@ -110,18 +110,7 @@
110#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */ 110#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
111#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */ 111#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
112 112
113/** synthesizer events 113/* 70-89: synthesizer events - obsoleted */
114 * event data type = snd_seq_eve_sample_control
115 */
116#define SNDRV_SEQ_EVENT_SAMPLE 70 /* sample select */
117#define SNDRV_SEQ_EVENT_SAMPLE_CLUSTER 71 /* sample cluster select */
118#define SNDRV_SEQ_EVENT_SAMPLE_START 72 /* voice start */
119#define SNDRV_SEQ_EVENT_SAMPLE_STOP 73 /* voice stop */
120#define SNDRV_SEQ_EVENT_SAMPLE_FREQ 74 /* playback frequency */
121#define SNDRV_SEQ_EVENT_SAMPLE_VOLUME 75 /* volume and balance */
122#define SNDRV_SEQ_EVENT_SAMPLE_LOOP 76 /* sample loop */
123#define SNDRV_SEQ_EVENT_SAMPLE_POSITION 77 /* sample position */
124#define SNDRV_SEQ_EVENT_SAMPLE_PRIVATE1 78 /* private (hardware dependent) event */
125 114
126/** user-defined events with fixed length 115/** user-defined events with fixed length
127 * event data type = any 116 * event data type = any
@@ -137,28 +126,7 @@
137#define SNDRV_SEQ_EVENT_USR8 98 126#define SNDRV_SEQ_EVENT_USR8 98
138#define SNDRV_SEQ_EVENT_USR9 99 127#define SNDRV_SEQ_EVENT_USR9 99
139 128
140/** instrument layer 129/* 100-118: instrument layer - obsoleted */
141 * variable length data can be passed directly to the driver
142 */
143#define SNDRV_SEQ_EVENT_INSTR_BEGIN 100 /* begin of instrument management */
144#define SNDRV_SEQ_EVENT_INSTR_END 101 /* end of instrument management */
145#define SNDRV_SEQ_EVENT_INSTR_INFO 102 /* instrument interface info */
146#define SNDRV_SEQ_EVENT_INSTR_INFO_RESULT 103 /* result */
147#define SNDRV_SEQ_EVENT_INSTR_FINFO 104 /* get format info */
148#define SNDRV_SEQ_EVENT_INSTR_FINFO_RESULT 105 /* get format info */
149#define SNDRV_SEQ_EVENT_INSTR_RESET 106 /* reset instrument memory */
150#define SNDRV_SEQ_EVENT_INSTR_STATUS 107 /* instrument interface status */
151#define SNDRV_SEQ_EVENT_INSTR_STATUS_RESULT 108 /* result */
152#define SNDRV_SEQ_EVENT_INSTR_PUT 109 /* put instrument to port */
153#define SNDRV_SEQ_EVENT_INSTR_GET 110 /* get instrument from port */
154#define SNDRV_SEQ_EVENT_INSTR_GET_RESULT 111 /* result */
155#define SNDRV_SEQ_EVENT_INSTR_FREE 112 /* free instrument(s) */
156#define SNDRV_SEQ_EVENT_INSTR_LIST 113 /* instrument list */
157#define SNDRV_SEQ_EVENT_INSTR_LIST_RESULT 114 /* result */
158#define SNDRV_SEQ_EVENT_INSTR_CLUSTER 115 /* cluster parameters */
159#define SNDRV_SEQ_EVENT_INSTR_CLUSTER_GET 116 /* get cluster parameters */
160#define SNDRV_SEQ_EVENT_INSTR_CLUSTER_RESULT 117 /* result */
161#define SNDRV_SEQ_EVENT_INSTR_CHANGE 118 /* instrument change */
162/* 119-129: reserved */ 130/* 119-129: reserved */
163 131
164/* 130-139: variable length events 132/* 130-139: variable length events
@@ -258,78 +226,6 @@ struct snd_seq_ev_ext {
258 void *ptr; /* pointer to data (note: maybe 64-bit) */ 226 void *ptr; /* pointer to data (note: maybe 64-bit) */
259} __attribute__((packed)); 227} __attribute__((packed));
260 228
261/* Instrument cluster type */
262typedef unsigned int snd_seq_instr_cluster_t;
263
264/* Instrument type */
265struct snd_seq_instr {
266 snd_seq_instr_cluster_t cluster;
267 unsigned int std; /* the upper byte means a private instrument (owner - client #) */
268 unsigned short bank;
269 unsigned short prg;
270};
271
272 /* sample number */
273struct snd_seq_ev_sample {
274 unsigned int std;
275 unsigned short bank;
276 unsigned short prg;
277};
278
279 /* sample cluster */
280struct snd_seq_ev_cluster {
281 snd_seq_instr_cluster_t cluster;
282};
283
284 /* sample position */
285typedef unsigned int snd_seq_position_t; /* playback position (in samples) * 16 */
286
287 /* sample stop mode */
288enum {
289 SAMPLE_STOP_IMMEDIATELY = 0, /* terminate playing immediately */
290 SAMPLE_STOP_VENVELOPE = 1, /* finish volume envelope */
291 SAMPLE_STOP_LOOP = 2 /* terminate loop and finish wave */
292};
293
294 /* sample frequency */
295typedef int snd_seq_frequency_t; /* playback frequency in HZ * 16 */
296
297 /* sample volume control; if any value is set to -1 == do not change */
298struct snd_seq_ev_volume {
299 signed short volume; /* range: 0-16383 */
300 signed short lr; /* left-right balance; range: 0-16383 */
301 signed short fr; /* front-rear balance; range: 0-16383 */
302 signed short du; /* down-up balance; range: 0-16383 */
303};
304
305 /* simple loop redefinition */
306struct snd_seq_ev_loop {
307 unsigned int start; /* loop start (in samples) * 16 */
308 unsigned int end; /* loop end (in samples) * 16 */
309};
310
311struct snd_seq_ev_sample_control {
312 unsigned char channel;
313 unsigned char unused1, unused2, unused3; /* pad */
314 union {
315 struct snd_seq_ev_sample sample;
316 struct snd_seq_ev_cluster cluster;
317 snd_seq_position_t position;
318 int stop_mode;
319 snd_seq_frequency_t frequency;
320 struct snd_seq_ev_volume volume;
321 struct snd_seq_ev_loop loop;
322 unsigned char raw8[8];
323 } param;
324};
325
326
327
328/* INSTR_BEGIN event */
329struct snd_seq_ev_instr_begin {
330 int timeout; /* zero = forever, otherwise timeout in ms */
331};
332
333struct snd_seq_result { 229struct snd_seq_result {
334 int event; /* processed event type */ 230 int event; /* processed event type */
335 int result; 231 int result;
@@ -399,8 +295,6 @@ struct snd_seq_event {
399 struct snd_seq_addr addr; 295 struct snd_seq_addr addr;
400 struct snd_seq_connect connect; 296 struct snd_seq_connect connect;
401 struct snd_seq_result result; 297 struct snd_seq_result result;
402 struct snd_seq_ev_instr_begin instr_begin;
403 struct snd_seq_ev_sample_control sample;
404 struct snd_seq_ev_quote quote; 298 struct snd_seq_ev_quote quote;
405 } data; 299 } data;
406}; 300};
@@ -441,8 +335,6 @@ struct snd_seq_event_bounce {
441#define snd_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99) 335#define snd_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99)
442/* fixed length events: 0-99 */ 336/* fixed length events: 0-99 */
443#define snd_seq_ev_is_fixed_type(ev) ((ev)->type < 100) 337#define snd_seq_ev_is_fixed_type(ev) ((ev)->type < 100)
444/* instrument layer events: 100-129 */
445#define snd_seq_ev_is_instr_type(ev) ((ev)->type >= 100 && (ev)->type < 130)
446/* variable length events: 130-139 */ 338/* variable length events: 130-139 */
447#define snd_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140) 339#define snd_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140)
448/* reserved for kernel */ 340/* reserved for kernel */
@@ -738,136 +630,6 @@ struct snd_seq_query_subs {
738 630
739 631
740/* 632/*
741 * Instrument abstraction layer
742 * - based on events
743 */
744
745/* instrument types */
746#define SNDRV_SEQ_INSTR_ATYPE_DATA 0 /* instrument data */
747#define SNDRV_SEQ_INSTR_ATYPE_ALIAS 1 /* instrument alias */
748
749/* instrument ASCII identifiers */
750#define SNDRV_SEQ_INSTR_ID_DLS1 "DLS1"
751#define SNDRV_SEQ_INSTR_ID_DLS2 "DLS2"
752#define SNDRV_SEQ_INSTR_ID_SIMPLE "Simple Wave"
753#define SNDRV_SEQ_INSTR_ID_SOUNDFONT "SoundFont"
754#define SNDRV_SEQ_INSTR_ID_GUS_PATCH "GUS Patch"
755#define SNDRV_SEQ_INSTR_ID_INTERWAVE "InterWave FFFF"
756#define SNDRV_SEQ_INSTR_ID_OPL2_3 "OPL2/3 FM"
757#define SNDRV_SEQ_INSTR_ID_OPL4 "OPL4"
758
759/* instrument types */
760#define SNDRV_SEQ_INSTR_TYPE0_DLS1 (1<<0) /* MIDI DLS v1 */
761#define SNDRV_SEQ_INSTR_TYPE0_DLS2 (1<<1) /* MIDI DLS v2 */
762#define SNDRV_SEQ_INSTR_TYPE1_SIMPLE (1<<0) /* Simple Wave */
763#define SNDRV_SEQ_INSTR_TYPE1_SOUNDFONT (1<<1) /* EMU SoundFont */
764#define SNDRV_SEQ_INSTR_TYPE1_GUS_PATCH (1<<2) /* Gravis UltraSound Patch */
765#define SNDRV_SEQ_INSTR_TYPE1_INTERWAVE (1<<3) /* InterWave FFFF */
766#define SNDRV_SEQ_INSTR_TYPE2_OPL2_3 (1<<0) /* Yamaha OPL2/3 FM */
767#define SNDRV_SEQ_INSTR_TYPE2_OPL4 (1<<1) /* Yamaha OPL4 */
768
769/* put commands */
770#define SNDRV_SEQ_INSTR_PUT_CMD_CREATE 0
771#define SNDRV_SEQ_INSTR_PUT_CMD_REPLACE 1
772#define SNDRV_SEQ_INSTR_PUT_CMD_MODIFY 2
773#define SNDRV_SEQ_INSTR_PUT_CMD_ADD 3
774#define SNDRV_SEQ_INSTR_PUT_CMD_REMOVE 4
775
776/* get commands */
777#define SNDRV_SEQ_INSTR_GET_CMD_FULL 0
778#define SNDRV_SEQ_INSTR_GET_CMD_PARTIAL 1
779
780/* query flags */
781#define SNDRV_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0)
782
783/* free commands */
784#define SNDRV_SEQ_INSTR_FREE_CMD_ALL 0
785#define SNDRV_SEQ_INSTR_FREE_CMD_PRIVATE 1
786#define SNDRV_SEQ_INSTR_FREE_CMD_CLUSTER 2
787#define SNDRV_SEQ_INSTR_FREE_CMD_SINGLE 3
788
789/* size of ROM/RAM */
790typedef unsigned int snd_seq_instr_size_t;
791
792/* INSTR_INFO */
793
794struct snd_seq_instr_info {
795 int result; /* operation result */
796 unsigned int formats[8]; /* bitmap of supported formats */
797 int ram_count; /* count of RAM banks */
798 snd_seq_instr_size_t ram_sizes[16]; /* size of RAM banks */
799 int rom_count; /* count of ROM banks */
800 snd_seq_instr_size_t rom_sizes[8]; /* size of ROM banks */
801 char reserved[128];
802};
803
804/* INSTR_STATUS */
805
806struct snd_seq_instr_status {
807 int result; /* operation result */
808 snd_seq_instr_size_t free_ram[16]; /* free RAM in banks */
809 int instrument_count; /* count of downloaded instruments */
810 char reserved[128];
811};
812
813/* INSTR_FORMAT_INFO */
814
815struct snd_seq_instr_format_info {
816 char format[16]; /* format identifier - SNDRV_SEQ_INSTR_ID_* */
817 unsigned int len; /* max data length (without this structure) */
818};
819
820struct snd_seq_instr_format_info_result {
821 int result; /* operation result */
822 char format[16]; /* format identifier */
823 unsigned int len; /* filled data length (without this structure) */
824};
825
826/* instrument data */
827struct snd_seq_instr_data {
828 char name[32]; /* instrument name */
829 char reserved[16]; /* for the future use */
830 int type; /* instrument type */
831 union {
832 char format[16]; /* format identifier */
833 struct snd_seq_instr alias;
834 } data;
835};
836
837/* INSTR_PUT/GET, data are stored in one block (extended), header + data */
838
839struct snd_seq_instr_header {
840 union {
841 struct snd_seq_instr instr;
842 snd_seq_instr_cluster_t cluster;
843 } id; /* instrument identifier */
844 unsigned int cmd; /* get/put/free command */
845 unsigned int flags; /* query flags (only for get) */
846 unsigned int len; /* real instrument data length (without header) */
847 int result; /* operation result */
848 char reserved[16]; /* for the future */
849 struct snd_seq_instr_data data; /* instrument data (for put/get result) */
850};
851
852/* INSTR_CLUSTER_SET */
853
854struct snd_seq_instr_cluster_set {
855 snd_seq_instr_cluster_t cluster; /* cluster identifier */
856 char name[32]; /* cluster name */
857 int priority; /* cluster priority */
858 char reserved[64]; /* for the future use */
859};
860
861/* INSTR_CLUSTER_GET */
862
863struct snd_seq_instr_cluster_get {
864 snd_seq_instr_cluster_t cluster; /* cluster identifier */
865 char name[32]; /* cluster name */
866 int priority; /* cluster priority */
867 char reserved[64]; /* for the future use */
868};
869
870/*
871 * IOCTL commands 633 * IOCTL commands
872 */ 634 */
873 635
diff --git a/include/sound/asound.h b/include/sound/asound.h
index af9d11d315e9..3eaf155b850d 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -95,7 +95,7 @@ enum {
95 SNDRV_HWDEP_IFACE_HDA, /* HD-audio */ 95 SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
96 96
97 /* Don't forget to change the following: */ 97 /* Don't forget to change the following: */
98 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC 98 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_HDA
99}; 99};
100 100
101struct snd_hwdep_info { 101struct snd_hwdep_info {
@@ -138,7 +138,7 @@ enum {
138 * * 138 * *
139 *****************************************************************************/ 139 *****************************************************************************/
140 140
141#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8) 141#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9)
142 142
143typedef unsigned long snd_pcm_uframes_t; 143typedef unsigned long snd_pcm_uframes_t;
144typedef signed long snd_pcm_sframes_t; 144typedef signed long snd_pcm_sframes_t;
@@ -354,8 +354,8 @@ struct snd_pcm_hw_params {
354 354
355enum { 355enum {
356 SNDRV_PCM_TSTAMP_NONE = 0, 356 SNDRV_PCM_TSTAMP_NONE = 0,
357 SNDRV_PCM_TSTAMP_MMAP, 357 SNDRV_PCM_TSTAMP_ENABLE,
358 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP, 358 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
359}; 359};
360 360
361struct snd_pcm_sw_params { 361struct snd_pcm_sw_params {
@@ -363,7 +363,7 @@ struct snd_pcm_sw_params {
363 unsigned int period_step; 363 unsigned int period_step;
364 unsigned int sleep_min; /* min ticks to sleep */ 364 unsigned int sleep_min; /* min ticks to sleep */
365 snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */ 365 snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
366 snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */ 366 snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */
367 snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */ 367 snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */
368 snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */ 368 snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */
369 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ 369 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
@@ -435,9 +435,16 @@ struct snd_xfern {
435}; 435};
436 436
437enum { 437enum {
438 SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
439 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
440 SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
441};
442
443enum {
438 SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int), 444 SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int),
439 SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct snd_pcm_info), 445 SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct snd_pcm_info),
440 SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int), 446 SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int),
447 SNDRV_PCM_IOCTL_TTSTAMP = _IOW('A', 0x03, int),
441 SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct snd_pcm_hw_params), 448 SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct snd_pcm_hw_params),
442 SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct snd_pcm_hw_params), 449 SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct snd_pcm_hw_params),
443 SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12), 450 SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12),
@@ -689,7 +696,7 @@ struct snd_timer_tread {
689 * * 696 * *
690 ****************************************************************************/ 697 ****************************************************************************/
691 698
692#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4) 699#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5)
693 700
694struct snd_ctl_card_info { 701struct snd_ctl_card_info {
695 int card; /* card number */ 702 int card; /* card number */
@@ -738,8 +745,7 @@ typedef int __bitwise snd_ctl_elem_iface_t;
738#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */ 745#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */
739#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* kernel use a TLV callback */ 746#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* kernel use a TLV callback */
740#define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */ 747#define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */
741#define SNDRV_CTL_ELEM_ACCESS_DINDIRECT (1<<30) /* indirect access for matrix dimensions in the info structure */ 748/* bits 30 and 31 are obsoleted (for indirect access) */
742#define SNDRV_CTL_ELEM_ACCESS_INDIRECT (1<<31) /* indirect access for element value in the value structure */
743 749
744/* for further details see the ACPI and PCI power management specification */ 750/* for further details see the ACPI and PCI power management specification */
745#define SNDRV_CTL_POWER_D0 0x0000 /* full On */ 751#define SNDRV_CTL_POWER_D0 0x0000 /* full On */
@@ -793,30 +799,30 @@ struct snd_ctl_elem_info {
793 } value; 799 } value;
794 union { 800 union {
795 unsigned short d[4]; /* dimensions */ 801 unsigned short d[4]; /* dimensions */
796 unsigned short *d_ptr; /* indirect */ 802 unsigned short *d_ptr; /* indirect - obsoleted */
797 } dimen; 803 } dimen;
798 unsigned char reserved[64-4*sizeof(unsigned short)]; 804 unsigned char reserved[64-4*sizeof(unsigned short)];
799}; 805};
800 806
801struct snd_ctl_elem_value { 807struct snd_ctl_elem_value {
802 struct snd_ctl_elem_id id; /* W: element ID */ 808 struct snd_ctl_elem_id id; /* W: element ID */
803 unsigned int indirect: 1; /* W: use indirect pointer (xxx_ptr member) */ 809 unsigned int indirect: 1; /* W: indirect access - obsoleted */
804 union { 810 union {
805 union { 811 union {
806 long value[128]; 812 long value[128];
807 long *value_ptr; 813 long *value_ptr; /* obsoleted */
808 } integer; 814 } integer;
809 union { 815 union {
810 long long value[64]; 816 long long value[64];
811 long long *value_ptr; 817 long long *value_ptr; /* obsoleted */
812 } integer64; 818 } integer64;
813 union { 819 union {
814 unsigned int item[128]; 820 unsigned int item[128];
815 unsigned int *item_ptr; 821 unsigned int *item_ptr; /* obsoleted */
816 } enumerated; 822 } enumerated;
817 union { 823 union {
818 unsigned char data[512]; 824 unsigned char data[512];
819 unsigned char *data_ptr; 825 unsigned char *data_ptr; /* obsoleted */
820 } bytes; 826 } bytes;
821 struct snd_aes_iec958 iec958; 827 struct snd_aes_iec958 iec958;
822 } value; /* RO */ 828 } value; /* RO */
diff --git a/include/sound/asound_fm.h b/include/sound/asound_fm.h
index 8fbcab7cc73b..c2a4b967d5be 100644
--- a/include/sound/asound_fm.h
+++ b/include/sound/asound_fm.h
@@ -104,6 +104,8 @@ struct snd_dm_fm_params {
104#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int) 104#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int)
105/* for OPL3 only */ 105/* for OPL3 only */
106#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int) 106#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int)
107/* SBI patch management */
108#define SNDRV_DM_FM_IOCTL_CLEAR_PATCHES _IO ('H', 0x40)
107 109
108#define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20 110#define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20
109#define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21 111#define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21
@@ -112,4 +114,21 @@ struct snd_dm_fm_params {
112#define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24 114#define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24
113#define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25 115#define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25
114 116
117/*
118 * Patch Record - fixed size for write
119 */
120
121#define FM_KEY_SBI "SBI\032"
122#define FM_KEY_2OP "2OP\032"
123#define FM_KEY_4OP "4OP\032"
124
125struct sbi_patch {
126 unsigned char prog;
127 unsigned char bank;
128 char key[4];
129 char name[25];
130 char extension[7];
131 unsigned char data[32];
132};
133
115#endif /* __SOUND_ASOUND_FM_H */ 134#endif /* __SOUND_ASOUND_FM_H */
diff --git a/include/sound/core.h b/include/sound/core.h
index 6954836487ed..4fc0235ad784 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -22,12 +22,22 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/module.h>
25#include <linux/sched.h> /* wake_up() */ 26#include <linux/sched.h> /* wake_up() */
26#include <linux/mutex.h> /* struct mutex */ 27#include <linux/mutex.h> /* struct mutex */
27#include <linux/rwsem.h> /* struct rw_semaphore */ 28#include <linux/rwsem.h> /* struct rw_semaphore */
28#include <linux/pm.h> /* pm_message_t */ 29#include <linux/pm.h> /* pm_message_t */
29#include <linux/device.h> 30#include <linux/device.h>
30 31
32/* number of supported soundcards */
33#ifdef CONFIG_SND_DYNAMIC_MINORS
34#define SNDRV_CARDS 32
35#else
36#define SNDRV_CARDS 8 /* don't change - minor numbers */
37#endif
38
39#define CONFIG_SND_MAJOR 116 /* standard configuration */
40
31/* forward declarations */ 41/* forward declarations */
32#ifdef CONFIG_PCI 42#ifdef CONFIG_PCI
33struct pci_dev; 43struct pci_dev;
diff --git a/include/sound/cs4231-regs.h b/include/sound/cs4231-regs.h
index f1490265c9b8..e8d1f3e31f9e 100644
--- a/include/sound/cs4231-regs.h
+++ b/include/sound/cs4231-regs.h
@@ -45,7 +45,7 @@
45#define CS4231_IFACE_CTRL 0x09 /* interface control - bits 7-2 MCE */ 45#define CS4231_IFACE_CTRL 0x09 /* interface control - bits 7-2 MCE */
46#define CS4231_PIN_CTRL 0x0a /* pin control */ 46#define CS4231_PIN_CTRL 0x0a /* pin control */
47#define CS4231_TEST_INIT 0x0b /* test and initialization */ 47#define CS4231_TEST_INIT 0x0b /* test and initialization */
48#define CS4231_MISC_INFO 0x0c /* miscellaneaous information */ 48#define CS4231_MISC_INFO 0x0c /* miscellaneous information */
49#define CS4231_LOOPBACK 0x0d /* loopback control */ 49#define CS4231_LOOPBACK 0x0d /* loopback control */
50#define CS4231_PLY_UPR_CNT 0x0e /* playback upper base count */ 50#define CS4231_PLY_UPR_CNT 0x0e /* playback upper base count */
51#define CS4231_PLY_LWR_CNT 0x0f /* playback lower base count */ 51#define CS4231_PLY_LWR_CNT 0x0f /* playback lower base count */
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
index 6b40ee60f4c5..e3005a674a24 100644
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -1708,9 +1708,6 @@ struct snd_cs46xx {
1708 1708
1709 struct gameport *gameport; 1709 struct gameport *gameport;
1710 1710
1711#ifdef CONFIG_SND_CS46XX_DEBUG_GPIO
1712 int current_gpio;
1713#endif
1714#ifdef CONFIG_SND_CS46XX_NEW_DSP 1711#ifdef CONFIG_SND_CS46XX_NEW_DSP
1715 struct mutex spos_mutex; 1712 struct mutex spos_mutex;
1716 1713
diff --git a/include/sound/driver.h b/include/sound/driver.h
index 5ccb6c5feecb..f0359437d01a 100644
--- a/include/sound/driver.h
+++ b/include/sound/driver.h
@@ -1,51 +1 @@
1#ifndef __SOUND_DRIVER_H #warning "This file is deprecated"
2#define __SOUND_DRIVER_H
3
4/*
5 * Main header file for the ALSA driver
6 * Copyright (c) 1994-2000 by Jaroslav Kysela <perex@perex.cz>
7 *
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24
25#ifdef ALSA_BUILD
26#include "config.h"
27#endif
28
29
30/* number of supported soundcards */
31#ifdef CONFIG_SND_DYNAMIC_MINORS
32#define SNDRV_CARDS 32
33#else
34#define SNDRV_CARDS 8 /* don't change - minor numbers */
35#endif
36
37#ifndef CONFIG_SND_MAJOR /* standard configuration */
38#define CONFIG_SND_MAJOR 116
39#endif
40
41#ifndef CONFIG_SND_DEBUG
42#undef CONFIG_SND_DEBUG_MEMORY
43#endif
44
45#ifdef ALSA_BUILD
46#include "adriver.h"
47#endif
48
49#include <linux/module.h>
50
51#endif /* __SOUND_DRIVER_H */
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 441aa06dcd6f..7b7b9b13b4dd 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -1120,6 +1120,99 @@
1120/************************************************************************************************/ 1120/************************************************************************************************/
1121/* EMU1010m HANA Destinations */ 1121/* EMU1010m HANA Destinations */
1122/************************************************************************************************/ 1122/************************************************************************************************/
1123/* Hana, original 1010,1212,1820 using Alice2
1124 * Destiniations for SRATEX = 1X rates: 44.1 kHz or 48 kHz
1125 * 0x00, 0x00-0x0f: 16 EMU32 channels to Alice2
1126 * 0x01, 0x10-0x1f: 32 Elink channels to Audio Dock
1127 * 0x01, 0x00: Dock DAC 1 Left
1128 * 0x01, 0x04: Dock DAC 1 Right
1129 * 0x01, 0x08: Dock DAC 2 Left
1130 * 0x01, 0x0c: Dock DAC 2 Right
1131 * 0x01, 0x10: Dock DAC 3 Left
1132 * 0x01, 0x12: PHONES Left
1133 * 0x01, 0x14: Dock DAC 3 Right
1134 * 0x01, 0x16: PHONES Right
1135 * 0x01, 0x18: Dock DAC 4 Left
1136 * 0x01, 0x1a: S/PDIF Left
1137 * 0x01, 0x1c: Dock DAC 4 Right
1138 * 0x01, 0x1e: S/PDIF Right
1139 * 0x02, 0x00: Hana S/PDIF Left
1140 * 0x02, 0x01: Hana S/PDIF Right
1141 * 0x03, 0x00: Hanoa DAC Left
1142 * 0x03, 0x01: Hanoa DAC Right
1143 * 0x04, 0x00-0x07: Hana ADAT
1144 * 0x05, 0x00: I2S0 Left to Alice2
1145 * 0x05, 0x01: I2S0 Right to Alice2
1146 * 0x06, 0x00: I2S0 Left to Alice2
1147 * 0x06, 0x01: I2S0 Right to Alice2
1148 * 0x07, 0x00: I2S0 Left to Alice2
1149 * 0x07, 0x01: I2S0 Right to Alice2
1150 *
1151 * Hana2 never released, but used Tina
1152 * Not needed.
1153 *
1154 * Hana3, rev2 1010,1212,1616 using Tina
1155 * Destinations for SRATEX = 1X rates: 44.1 kHz or 48 kHz
1156 * 0x00, 0x00-0x0f: 16 EMU32A channels to Tina
1157 * 0x01, 0x10-0x1f: 32 EDI channels to Micro Dock
1158 * 0x01, 0x00: Dock DAC 1 Left
1159 * 0x01, 0x04: Dock DAC 1 Right
1160 * 0x01, 0x08: Dock DAC 2 Left
1161 * 0x01, 0x0c: Dock DAC 2 Right
1162 * 0x01, 0x10: Dock DAC 3 Left
1163 * 0x01, 0x12: Dock S/PDIF Left
1164 * 0x01, 0x14: Dock DAC 3 Right
1165 * 0x01, 0x16: Dock S/PDIF Right
1166 * 0x01, 0x18-0x1f: Dock ADAT 0-7
1167 * 0x02, 0x00: Hana3 S/PDIF Left
1168 * 0x02, 0x01: Hana3 S/PDIF Right
1169 * 0x03, 0x00: Hanoa DAC Left
1170 * 0x03, 0x01: Hanoa DAC Right
1171 * 0x04, 0x00-0x07: Hana3 ADAT 0-7
1172 * 0x05, 0x00-0x0f: 16 EMU32B channels to Tina
1173 * 0x06-0x07: Not used
1174 *
1175 * HanaLite, rev1 0404 using Alice2
1176 * Destiniations for SRATEX = 1X rates: 44.1 kHz or 48 kHz
1177 * 0x00, 0x00-0x0f: 16 EMU32 channels to Alice2
1178 * 0x01: Not used
1179 * 0x02, 0x00: S/PDIF Left
1180 * 0x02, 0x01: S/PDIF Right
1181 * 0x03, 0x00: DAC Left
1182 * 0x03, 0x01: DAC Right
1183 * 0x04-0x07: Not used
1184 *
1185 * HanaLiteLite, rev2 0404 using Alice2
1186 * Destiniations for SRATEX = 1X rates: 44.1 kHz or 48 kHz
1187 * 0x00, 0x00-0x0f: 16 EMU32 channels to Alice2
1188 * 0x01: Not used
1189 * 0x02, 0x00: S/PDIF Left
1190 * 0x02, 0x01: S/PDIF Right
1191 * 0x03, 0x00: DAC Left
1192 * 0x03, 0x01: DAC Right
1193 * 0x04-0x07: Not used
1194 *
1195 * Mana, Cardbus 1616 using Tina2
1196 * Destinations for SRATEX = 1X rates: 44.1 kHz or 48 kHz
1197 * 0x00, 0x00-0x0f: 16 EMU32A channels to Tina2
1198 * 0x01, 0x10-0x1f: 32 EDI channels to Micro Dock
1199 * 0x01, 0x00: Dock DAC 1 Left
1200 * 0x01, 0x04: Dock DAC 1 Right
1201 * 0x01, 0x08: Dock DAC 2 Left
1202 * 0x01, 0x0c: Dock DAC 2 Right
1203 * 0x01, 0x10: Dock DAC 3 Left
1204 * 0x01, 0x12: Dock S/PDIF Left
1205 * 0x01, 0x14: Dock DAC 3 Right
1206 * 0x01, 0x16: Dock S/PDIF Right
1207 * 0x01, 0x18-0x1f: Dock ADAT 0-7
1208 * 0x02: Not used
1209 * 0x03, 0x00: Mana DAC Left
1210 * 0x03, 0x01: Mana DAC Right
1211 * 0x04, 0x00-0x0f: 16 EMU32B channels to Tina2
1212 * 0x05-0x07: Not used
1213 *
1214 *
1215 */
1123/* 32-bit destinations of signal in the Hana FPGA. Destinations are either 1216/* 32-bit destinations of signal in the Hana FPGA. Destinations are either
1124 * physical outputs of Hana, or outputs going to Alice2 (audigy) for capture 1217 * physical outputs of Hana, or outputs going to Alice2 (audigy) for capture
1125 * - 16 x EMU_DST_ALICE2_EMU32_X. 1218 * - 16 x EMU_DST_ALICE2_EMU32_X.
@@ -1206,9 +1299,122 @@
1206#define EMU_DST_ALICE_I2S2_LEFT 0x0700 /* Alice2 I2S2 Left */ 1299#define EMU_DST_ALICE_I2S2_LEFT 0x0700 /* Alice2 I2S2 Left */
1207#define EMU_DST_ALICE_I2S2_RIGHT 0x0701 /* Alice2 I2S2 Right */ 1300#define EMU_DST_ALICE_I2S2_RIGHT 0x0701 /* Alice2 I2S2 Right */
1208 1301
1302/* Additional destinations for 1616(M)/Microdock */
1303/* Microdock S/PDIF OUT Left, 1st or 48kHz only */
1304#define EMU_DST_MDOCK_SPDIF_LEFT1 0x0112
1305/* Microdock S/PDIF OUT Left, 2nd or 96kHz */
1306#define EMU_DST_MDOCK_SPDIF_LEFT2 0x0113
1307/* Microdock S/PDIF OUT Right, 1st or 48kHz only */
1308#define EMU_DST_MDOCK_SPDIF_RIGHT1 0x0116
1309/* Microdock S/PDIF OUT Right, 2nd or 96kHz */
1310#define EMU_DST_MDOCK_SPDIF_RIGHT2 0x0117
1311/* Microdock S/PDIF ADAT 8 channel out +8 to +f */
1312#define EMU_DST_MDOCK_ADAT 0x0118
1313
1314/* Headphone jack on 1010 cardbus? 44.1/48kHz only? */
1315#define EMU_DST_MANA_DAC_LEFT 0x0300
1316/* Headphone jack on 1010 cardbus? 44.1/48kHz only? */
1317#define EMU_DST_MANA_DAC_RIGHT 0x0301
1318
1209/************************************************************************************************/ 1319/************************************************************************************************/
1210/* EMU1010m HANA Sources */ 1320/* EMU1010m HANA Sources */
1211/************************************************************************************************/ 1321/************************************************************************************************/
1322/* Hana, original 1010,1212,1820 using Alice2
1323 * Sources SRATEX = 1X rates: 44.1 kHz or 48 kHz
1324 * 0x00,0x00-0x1f: Silence
1325 * 0x01, 0x10-0x1f: 32 Elink channels from Audio Dock
1326 * 0x01, 0x00: Dock Mic A
1327 * 0x01, 0x04: Dock Mic B
1328 * 0x01, 0x08: Dock ADC 1 Left
1329 * 0x01, 0x0c: Dock ADC 1 Right
1330 * 0x01, 0x10: Dock ADC 2 Left
1331 * 0x01, 0x14: Dock ADC 2 Right
1332 * 0x01, 0x18: Dock ADC 3 Left
1333 * 0x01, 0x1c: Dock ADC 3 Right
1334 * 0x02, 0x00: Hana ADC Left
1335 * 0x02, 0x01: Hana ADC Right
1336 * 0x03, 0x00-0x0f: 16 inputs from Alice2 Emu32A output
1337 * 0x03, 0x10-0x1f: 16 inputs from Alice2 Emu32B output
1338 * 0x04, 0x00-0x07: Hana ADAT
1339 * 0x05, 0x00: Hana S/PDIF Left
1340 * 0x05, 0x01: Hana S/PDIF Right
1341 * 0x06-0x07: Not used
1342 *
1343 * Hana2 never released, but used Tina
1344 * Not needed.
1345 *
1346 * Hana3, rev2 1010,1212,1616 using Tina
1347 * Sources SRATEX = 1X rates: 44.1 kHz or 48 kHz
1348 * 0x00,0x00-0x1f: Silence
1349 * 0x01, 0x10-0x1f: 32 Elink channels from Audio Dock
1350 * 0x01, 0x00: Dock Mic A
1351 * 0x01, 0x04: Dock Mic B
1352 * 0x01, 0x08: Dock ADC 1 Left
1353 * 0x01, 0x0c: Dock ADC 1 Right
1354 * 0x01, 0x10: Dock ADC 2 Left
1355 * 0x01, 0x12: Dock S/PDIF Left
1356 * 0x01, 0x14: Dock ADC 2 Right
1357 * 0x01, 0x16: Dock S/PDIF Right
1358 * 0x01, 0x18-0x1f: Dock ADAT 0-7
1359 * 0x01, 0x18: Dock ADC 3 Left
1360 * 0x01, 0x1c: Dock ADC 3 Right
1361 * 0x02, 0x00: Hanoa ADC Left
1362 * 0x02, 0x01: Hanoa ADC Right
1363 * 0x03, 0x00-0x0f: 16 inputs from Tina Emu32A output
1364 * 0x03, 0x10-0x1f: 16 inputs from Tina Emu32B output
1365 * 0x04, 0x00-0x07: Hana3 ADAT
1366 * 0x05, 0x00: Hana3 S/PDIF Left
1367 * 0x05, 0x01: Hana3 S/PDIF Right
1368 * 0x06-0x07: Not used
1369 *
1370 * HanaLite, rev1 0404 using Alice2
1371 * Sources SRATEX = 1X rates: 44.1 kHz or 48 kHz
1372 * 0x00,0x00-0x1f: Silence
1373 * 0x01: Not used
1374 * 0x02, 0x00: ADC Left
1375 * 0x02, 0x01: ADC Right
1376 * 0x03, 0x00-0x0f: 16 inputs from Alice2 Emu32A output
1377 * 0x03, 0x10-0x1f: 16 inputs from Alice2 Emu32B output
1378 * 0x04: Not used
1379 * 0x05, 0x00: S/PDIF Left
1380 * 0x05, 0x01: S/PDIF Right
1381 * 0x06-0x07: Not used
1382 *
1383 * HanaLiteLite, rev2 0404 using Alice2
1384 * Sources SRATEX = 1X rates: 44.1 kHz or 48 kHz
1385 * 0x00,0x00-0x1f: Silence
1386 * 0x01: Not used
1387 * 0x02, 0x00: ADC Left
1388 * 0x02, 0x01: ADC Right
1389 * 0x03, 0x00-0x0f: 16 inputs from Alice2 Emu32A output
1390 * 0x03, 0x10-0x1f: 16 inputs from Alice2 Emu32B output
1391 * 0x04: Not used
1392 * 0x05, 0x00: S/PDIF Left
1393 * 0x05, 0x01: S/PDIF Right
1394 * 0x06-0x07: Not used
1395 *
1396 * Mana, Cardbus 1616 using Tina2
1397 * Sources SRATEX = 1X rates: 44.1 kHz or 48 kHz
1398 * 0x00,0x00-0x1f: Silence
1399 * 0x01, 0x10-0x1f: 32 Elink channels from Audio Dock
1400 * 0x01, 0x00: Dock Mic A
1401 * 0x01, 0x04: Dock Mic B
1402 * 0x01, 0x08: Dock ADC 1 Left
1403 * 0x01, 0x0c: Dock ADC 1 Right
1404 * 0x01, 0x10: Dock ADC 2 Left
1405 * 0x01, 0x12: Dock S/PDIF Left
1406 * 0x01, 0x14: Dock ADC 2 Right
1407 * 0x01, 0x16: Dock S/PDIF Right
1408 * 0x01, 0x18-0x1f: Dock ADAT 0-7
1409 * 0x01, 0x18: Dock ADC 3 Left
1410 * 0x01, 0x1c: Dock ADC 3 Right
1411 * 0x02: Not used
1412 * 0x03, 0x00-0x0f: 16 inputs from Tina Emu32A output
1413 * 0x03, 0x10-0x1f: 16 inputs from Tina Emu32B output
1414 * 0x04-0x07: Not used
1415 *
1416 */
1417
1212/* 32-bit sources of signal in the Hana FPGA. The sources are routed to 1418/* 32-bit sources of signal in the Hana FPGA. The sources are routed to
1213 * destinations using mixer control for each destination - see emumixer.c 1419 * destinations using mixer control for each destination - see emumixer.c
1214 * Sources are either physical inputs of FPGA, 1420 * Sources are either physical inputs of FPGA,
@@ -1263,6 +1469,19 @@
1263#define EMU_SRC_HANA_SPDIF_LEFT2 0x0502 /* Hana SPDIF Left, 2nd or 96kHz */ 1469#define EMU_SRC_HANA_SPDIF_LEFT2 0x0502 /* Hana SPDIF Left, 2nd or 96kHz */
1264#define EMU_SRC_HANA_SPDIF_RIGHT1 0x0501 /* Hana SPDIF Right, 1st or 48kHz only */ 1470#define EMU_SRC_HANA_SPDIF_RIGHT1 0x0501 /* Hana SPDIF Right, 1st or 48kHz only */
1265#define EMU_SRC_HANA_SPDIF_RIGHT2 0x0503 /* Hana SPDIF Right, 2nd or 96kHz */ 1471#define EMU_SRC_HANA_SPDIF_RIGHT2 0x0503 /* Hana SPDIF Right, 2nd or 96kHz */
1472
1473/* Additional inputs for 1616(M)/Microdock */
1474/* Microdock S/PDIF Left, 1st or 48kHz only */
1475#define EMU_SRC_MDOCK_SPDIF_LEFT1 0x0112
1476/* Microdock S/PDIF Left, 2nd or 96kHz */
1477#define EMU_SRC_MDOCK_SPDIF_LEFT2 0x0113
1478/* Microdock S/PDIF Right, 1st or 48kHz only */
1479#define EMU_SRC_MDOCK_SPDIF_RIGHT1 0x0116
1480/* Microdock S/PDIF Right, 2nd or 96kHz */
1481#define EMU_SRC_MDOCK_SPDIF_RIGHT2 0x0117
1482/* Microdock ADAT 8 channel in +8 to +f */
1483#define EMU_SRC_MDOCK_ADAT 0x0118
1484
1266/* 0x600 and 0x700 no used */ 1485/* 0x600 and 0x700 no used */
1267 1486
1268/* ------------------- STRUCTURES -------------------- */ 1487/* ------------------- STRUCTURES -------------------- */
@@ -1423,6 +1642,14 @@ struct snd_emu10k1_midi {
1423 void (*interrupt)(struct snd_emu10k1 *emu, unsigned int status); 1642 void (*interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1424}; 1643};
1425 1644
1645enum {
1646 EMU_MODEL_SB,
1647 EMU_MODEL_EMU1010,
1648 EMU_MODEL_EMU1010B,
1649 EMU_MODEL_EMU1616,
1650 EMU_MODEL_EMU0404,
1651};
1652
1426struct snd_emu_chip_details { 1653struct snd_emu_chip_details {
1427 u32 vendor; 1654 u32 vendor;
1428 u32 device; 1655 u32 device;
@@ -1439,7 +1666,7 @@ struct snd_emu_chip_details {
1439 unsigned char spdif_bug; /* Has Spdif phasing bug */ 1666 unsigned char spdif_bug; /* Has Spdif phasing bug */
1440 unsigned char ac97_chip; /* Has an AC97 chip: 1 = mandatory, 2 = optional */ 1667 unsigned char ac97_chip; /* Has an AC97 chip: 1 = mandatory, 2 = optional */
1441 unsigned char ecard; /* APS EEPROM */ 1668 unsigned char ecard; /* APS EEPROM */
1442 unsigned char emu1010; /* EMU 1010m card */ 1669 unsigned char emu_model; /* EMU model type */
1443 unsigned char spi_dac; /* SPI interface for DAC */ 1670 unsigned char spi_dac; /* SPI interface for DAC */
1444 unsigned char i2c_adc; /* I2C interface for ADC */ 1671 unsigned char i2c_adc; /* I2C interface for ADC */
1445 unsigned char adc_1361t; /* Use Philips 1361T ADC */ 1672 unsigned char adc_1361t; /* Use Philips 1361T ADC */
@@ -1515,6 +1742,8 @@ struct snd_emu10k1 {
1515 spinlock_t reg_lock; 1742 spinlock_t reg_lock;
1516 spinlock_t emu_lock; 1743 spinlock_t emu_lock;
1517 spinlock_t voice_lock; 1744 spinlock_t voice_lock;
1745 spinlock_t spi_lock; /* serialises access to spi port */
1746 spinlock_t i2c_lock; /* serialises access to i2c port */
1518 1747
1519 struct snd_emu10k1_voice voices[NUM_G]; 1748 struct snd_emu10k1_voice voices[NUM_G];
1520 struct snd_emu10k1_voice p16v_voices[4]; 1749 struct snd_emu10k1_voice p16v_voices[4];
diff --git a/include/sound/gus.h b/include/sound/gus.h
index e5433d8b78bc..841bb8df38c1 100644
--- a/include/sound/gus.h
+++ b/include/sound/gus.h
@@ -27,13 +27,8 @@
27#include "timer.h" 27#include "timer.h"
28#include "seq_midi_emul.h" 28#include "seq_midi_emul.h"
29#include "seq_device.h" 29#include "seq_device.h"
30#include "ainstr_iw.h"
31#include "ainstr_gf1.h"
32#include "ainstr_simple.h"
33#include <asm/io.h> 30#include <asm/io.h>
34 31
35#define SNDRV_SEQ_DEV_ID_GUS "gus-synth"
36
37/* IO ports */ 32/* IO ports */
38 33
39#define GUSP(gus, x) ((gus)->gf1.port + SNDRV_g_u_s_##x) 34#define GUSP(gus, x) ((gus)->gf1.port + SNDRV_g_u_s_##x)
@@ -234,16 +229,6 @@ struct snd_gus_port {
234 229
235struct snd_gus_voice; 230struct snd_gus_voice;
236 231
237struct snd_gus_sample_ops {
238 void (*sample_start)(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_position_t position);
239 void (*sample_stop)(struct snd_gus_card *gus, struct snd_gus_voice *voice, int mode);
240 void (*sample_freq)(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_frequency_t freq);
241 void (*sample_volume)(struct snd_gus_card *gus, struct snd_gus_voice *voice, struct snd_seq_ev_volume *volume);
242 void (*sample_loop)(struct snd_gus_card *card, struct snd_gus_voice *voice, struct snd_seq_ev_loop *loop);
243 void (*sample_pos)(struct snd_gus_card *card, struct snd_gus_voice *voice, snd_seq_position_t position);
244 void (*sample_private1)(struct snd_gus_card *card, struct snd_gus_voice *voice, unsigned char *data);
245};
246
247#define SNDRV_GF1_VOICE_TYPE_PCM 0 232#define SNDRV_GF1_VOICE_TYPE_PCM 0
248#define SNDRV_GF1_VOICE_TYPE_SYNTH 1 233#define SNDRV_GF1_VOICE_TYPE_SYNTH 1
249#define SNDRV_GF1_VOICE_TYPE_MIDI 2 234#define SNDRV_GF1_VOICE_TYPE_MIDI 2
@@ -284,12 +269,8 @@ struct snd_gus_voice {
284 269
285 struct snd_gus_sample_ops *sample_ops; 270 struct snd_gus_sample_ops *sample_ops;
286 271
287 struct snd_seq_instr instr;
288
289 /* running status / registers */ 272 /* running status / registers */
290 273
291 struct snd_seq_ev_volume sample_volume;
292
293 unsigned short fc_register; 274 unsigned short fc_register;
294 unsigned short fc_lfo; 275 unsigned short fc_lfo;
295 unsigned short gf1_volume; 276 unsigned short gf1_volume;
@@ -382,10 +363,6 @@ struct snd_gf1 {
382 363
383 int seq_client; 364 int seq_client;
384 struct snd_gus_port seq_ports[4]; 365 struct snd_gus_port seq_ports[4];
385 struct snd_seq_kinstr_list *ilist;
386 struct snd_iwffff_ops iwffff_ops;
387 struct snd_gf1_ops gf1_ops;
388 struct snd_simple_ops simple_ops;
389 366
390 /* timer */ 367 /* timer */
391 368
@@ -458,8 +435,6 @@ struct snd_gus_card {
458 struct snd_rawmidi_substream *midi_substream_output; 435 struct snd_rawmidi_substream *midi_substream_output;
459 struct snd_rawmidi_substream *midi_substream_input; 436 struct snd_rawmidi_substream *midi_substream_input;
460 437
461 struct snd_seq_device *seq_dev;
462
463 spinlock_t reg_lock; 438 spinlock_t reg_lock;
464 spinlock_t voice_alloc; 439 spinlock_t voice_alloc;
465 spinlock_t active_voice_lock; 440 spinlock_t active_voice_lock;
@@ -647,48 +622,10 @@ void snd_gus_irq_profile_init(struct snd_gus_card *gus);
647 622
648int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmidi **rrawmidi); 623int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmidi **rrawmidi);
649 624
650#if 0
651extern void snd_engine_instrument_register(unsigned short mode,
652 struct _SND_INSTRUMENT_VOICE_COMMANDS *voice_cmds,
653 struct _SND_INSTRUMENT_NOTE_COMMANDS *note_cmds,
654 struct _SND_INSTRUMENT_CHANNEL_COMMANDS *channel_cmds);
655extern int snd_engine_instrument_register_ask(unsigned short mode);
656#endif
657
658/* gus_dram.c */ 625/* gus_dram.c */
659int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr, 626int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr,
660 unsigned int addr, unsigned int size); 627 unsigned int addr, unsigned int size);
661int snd_gus_dram_read(struct snd_gus_card *gus, char __user *ptr, 628int snd_gus_dram_read(struct snd_gus_card *gus, char __user *ptr,
662 unsigned int addr, unsigned int size, int rom); 629 unsigned int addr, unsigned int size, int rom);
663 630
664#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
665
666/* gus_sample.c */
667void snd_gus_sample_event(struct snd_seq_event *ev, struct snd_gus_port *p);
668
669/* gus_simple.c */
670void snd_gf1_simple_init(struct snd_gus_voice *voice);
671
672/* gus_instr.c */
673int snd_gus_iwffff_put_sample(void *private_data, struct iwffff_wave *wave,
674 char __user *data, long len, int atomic);
675int snd_gus_iwffff_get_sample(void *private_data, struct iwffff_wave *wave,
676 char __user *data, long len, int atomic);
677int snd_gus_iwffff_remove_sample(void *private_data, struct iwffff_wave *wave,
678 int atomic);
679int snd_gus_gf1_put_sample(void *private_data, struct gf1_wave *wave,
680 char __user *data, long len, int atomic);
681int snd_gus_gf1_get_sample(void *private_data, struct gf1_wave *wave,
682 char __user *data, long len, int atomic);
683int snd_gus_gf1_remove_sample(void *private_data, struct gf1_wave *wave,
684 int atomic);
685int snd_gus_simple_put_sample(void *private_data, struct simple_instrument *instr,
686 char __user *data, long len, int atomic);
687int snd_gus_simple_get_sample(void *private_data, struct simple_instrument *instr,
688 char __user *data, long len, int atomic);
689int snd_gus_simple_remove_sample(void *private_data, struct simple_instrument *instr,
690 int atomic);
691
692#endif /* CONFIG_SND_SEQUENCER */
693
694#endif /* __SOUND_GUS_H */ 631#endif /* __SOUND_GUS_H */
diff --git a/include/sound/info.h b/include/sound/info.h
index fecbb1ffd540..8ae72e74f898 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -100,8 +100,10 @@ int snd_info_minor_unregister(void);
100extern struct snd_info_entry *snd_seq_root; 100extern struct snd_info_entry *snd_seq_root;
101#ifdef CONFIG_SND_OSSEMUL 101#ifdef CONFIG_SND_OSSEMUL
102extern struct snd_info_entry *snd_oss_root; 102extern struct snd_info_entry *snd_oss_root;
103void snd_card_info_read_oss(struct snd_info_buffer *buffer);
103#else 104#else
104#define snd_oss_root NULL 105#define snd_oss_root NULL
106static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {}
105#endif 107#endif
106 108
107int snd_iprintf(struct snd_info_buffer * buffer, char *fmt,...) __attribute__ ((format (printf, 2, 3))); 109int snd_iprintf(struct snd_info_buffer * buffer, char *fmt,...) __attribute__ ((format (printf, 2, 3)));
diff --git a/include/sound/opl3.h b/include/sound/opl3.h
index 1d14b3f82393..a0c5febdc4ea 100644
--- a/include/sound/opl3.h
+++ b/include/sound/opl3.h
@@ -51,19 +51,16 @@
51 * 51 *
52 */ 52 */
53 53
54#include "driver.h" 54#include <sound/core.h>
55#include <linux/time.h> 55#include <sound/hwdep.h>
56#include <linux/mutex.h> 56#include <sound/timer.h>
57#include "core.h" 57#include <sound/seq_midi_emul.h>
58#include "hwdep.h"
59#include "timer.h"
60#include "seq_midi_emul.h"
61#ifdef CONFIG_SND_SEQUENCER_OSS 58#ifdef CONFIG_SND_SEQUENCER_OSS
62#include "seq_oss.h" 59#include <sound/seq_oss.h>
63#include "seq_oss_legacy.h" 60#include <sound/seq_oss_legacy.h>
64#endif 61#endif
65#include "seq_device.h" 62#include <sound/seq_device.h>
66#include "ainstr_fm.h" 63#include <sound/asound_fm.h>
67 64
68/* 65/*
69 * Register numbers for the global registers 66 * Register numbers for the global registers
@@ -240,6 +237,47 @@
240struct snd_opl3; 237struct snd_opl3;
241 238
242/* 239/*
240 * Instrument record, aka "Patch"
241 */
242
243/* FM operator */
244struct fm_operator {
245 unsigned char am_vib;
246 unsigned char ksl_level;
247 unsigned char attack_decay;
248 unsigned char sustain_release;
249 unsigned char wave_select;
250} __attribute__((packed));
251
252/* Instrument data */
253struct fm_instrument {
254 struct fm_operator op[4];
255 unsigned char feedback_connection[2];
256 unsigned char echo_delay;
257 unsigned char echo_atten;
258 unsigned char chorus_spread;
259 unsigned char trnsps;
260 unsigned char fix_dur;
261 unsigned char modes;
262 unsigned char fix_key;
263};
264
265/* type */
266#define FM_PATCH_OPL2 0x01 /* OPL2 2 operators FM instrument */
267#define FM_PATCH_OPL3 0x02 /* OPL3 4 operators FM instrument */
268
269/* Instrument record */
270struct fm_patch {
271 unsigned char prog;
272 unsigned char bank;
273 unsigned char type;
274 struct fm_instrument inst;
275 char name[24];
276 struct fm_patch *next;
277};
278
279
280/*
243 * A structure to keep track of each hardware voice 281 * A structure to keep track of each hardware voice
244 */ 282 */
245struct snd_opl3_voice { 283struct snd_opl3_voice {
@@ -277,9 +315,9 @@ struct snd_opl3 {
277 void *private_data; 315 void *private_data;
278 void (*private_free)(struct snd_opl3 *); 316 void (*private_free)(struct snd_opl3 *);
279 317
318 struct snd_hwdep *hwdep;
280 spinlock_t reg_lock; 319 spinlock_t reg_lock;
281 struct snd_card *card; /* The card that this belongs to */ 320 struct snd_card *card; /* The card that this belongs to */
282 int used; /* usage flag - exclusive */
283 unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */ 321 unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */
284 unsigned char rhythm; /* percussion mode flag */ 322 unsigned char rhythm; /* percussion mode flag */
285 unsigned char max_voices; /* max number of voices */ 323 unsigned char max_voices; /* max number of voices */
@@ -297,8 +335,8 @@ struct snd_opl3 {
297 struct snd_midi_channel_set * oss_chset; 335 struct snd_midi_channel_set * oss_chset;
298#endif 336#endif
299 337
300 struct snd_seq_kinstr_ops fm_ops; 338#define OPL3_PATCH_HASH_SIZE 32
301 struct snd_seq_kinstr_list *ilist; 339 struct fm_patch *patch_table[OPL3_PATCH_HASH_SIZE];
302 340
303 struct snd_opl3_voice voices[MAX_OPL3_VOICES]; /* Voices (OPL3 'channel') */ 341 struct snd_opl3_voice voices[MAX_OPL3_VOICES]; /* Voices (OPL3 'channel') */
304 int use_time; /* allocation counter */ 342 int use_time; /* allocation counter */
@@ -312,7 +350,6 @@ struct snd_opl3 {
312 int sys_timer_status; /* system timer run status */ 350 int sys_timer_status; /* system timer run status */
313 spinlock_t sys_timer_lock; /* Lock for system timer access */ 351 spinlock_t sys_timer_lock; /* Lock for system timer access */
314#endif 352#endif
315 struct mutex access_mutex; /* locking */
316}; 353};
317 354
318/* opl3.c */ 355/* opl3.c */
@@ -333,8 +370,19 @@ int snd_opl3_hwdep_new(struct snd_opl3 * opl3, int device, int seq_device,
333int snd_opl3_open(struct snd_hwdep * hw, struct file *file); 370int snd_opl3_open(struct snd_hwdep * hw, struct file *file);
334int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file, 371int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
335 unsigned int cmd, unsigned long arg); 372 unsigned int cmd, unsigned long arg);
373long snd_opl3_write(struct snd_hwdep *hw, const char __user *buf, long count,
374 loff_t *offset);
336int snd_opl3_release(struct snd_hwdep * hw, struct file *file); 375int snd_opl3_release(struct snd_hwdep * hw, struct file *file);
337 376
338void snd_opl3_reset(struct snd_opl3 * opl3); 377void snd_opl3_reset(struct snd_opl3 * opl3);
339 378
379int snd_opl3_load_patch(struct snd_opl3 *opl3,
380 int prog, int bank, int type,
381 const char *name,
382 const unsigned char *ext,
383 const unsigned char *data);
384struct fm_patch *snd_opl3_find_patch(struct snd_opl3 *opl3, int prog, int bank,
385 int create_patch);
386void snd_opl3_clear_patches(struct snd_opl3 *opl3);
387
340#endif /* __SOUND_OPL3_H */ 388#endif /* __SOUND_OPL3_H */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 5e9cc460075e..51d58ccda2d8 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -274,7 +274,6 @@ struct snd_pcm_runtime {
274 snd_pcm_uframes_t period_size; /* period size */ 274 snd_pcm_uframes_t period_size; /* period size */
275 unsigned int periods; /* periods */ 275 unsigned int periods; /* periods */
276 snd_pcm_uframes_t buffer_size; /* buffer size */ 276 snd_pcm_uframes_t buffer_size; /* buffer size */
277 unsigned int tick_time; /* tick time */
278 snd_pcm_uframes_t min_align; /* Min alignment for the format */ 277 snd_pcm_uframes_t min_align; /* Min alignment for the format */
279 size_t byte_align; 278 size_t byte_align;
280 unsigned int frame_bits; 279 unsigned int frame_bits;
@@ -286,8 +285,6 @@ struct snd_pcm_runtime {
286 /* -- SW params -- */ 285 /* -- SW params -- */
287 int tstamp_mode; /* mmap timestamp is updated */ 286 int tstamp_mode; /* mmap timestamp is updated */
288 unsigned int period_step; 287 unsigned int period_step;
289 unsigned int sleep_min; /* min ticks to sleep */
290 snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */
291 snd_pcm_uframes_t start_threshold; 288 snd_pcm_uframes_t start_threshold;
292 snd_pcm_uframes_t stop_threshold; 289 snd_pcm_uframes_t stop_threshold;
293 snd_pcm_uframes_t silence_threshold; /* Silence filling happens when 290 snd_pcm_uframes_t silence_threshold; /* Silence filling happens when
@@ -306,7 +303,6 @@ struct snd_pcm_runtime {
306 303
307 /* -- locking / scheduling -- */ 304 /* -- locking / scheduling -- */
308 wait_queue_head_t sleep; 305 wait_queue_head_t sleep;
309 struct timer_list tick_timer;
310 struct fasync_struct *fasync; 306 struct fasync_struct *fasync;
311 307
312 /* -- private section -- */ 308 /* -- private section -- */
@@ -323,6 +319,7 @@ struct snd_pcm_runtime {
323 319
324 /* -- timer -- */ 320 /* -- timer -- */
325 unsigned int timer_resolution; /* timer resolution */ 321 unsigned int timer_resolution; /* timer resolution */
322 int tstamp_type; /* timestamp type */
326 323
327 /* -- DMA -- */ 324 /* -- DMA -- */
328 unsigned char *dma_area; /* DMA area */ 325 unsigned char *dma_area; /* DMA area */
@@ -810,7 +807,6 @@ static inline const struct snd_interval *hw_param_interval_c(const struct snd_pc
810#define params_periods(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_PERIODS)->min 807#define params_periods(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_PERIODS)->min
811#define params_buffer_size(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_BUFFER_SIZE)->min 808#define params_buffer_size(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_BUFFER_SIZE)->min
812#define params_buffer_bytes(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->min 809#define params_buffer_bytes(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->min
813#define params_tick_time(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_TICK_TIME)->min
814 810
815 811
816int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v); 812int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v);
@@ -908,9 +904,6 @@ int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream);
908int snd_pcm_playback_xrun_asap(struct snd_pcm_substream *substream); 904int snd_pcm_playback_xrun_asap(struct snd_pcm_substream *substream);
909int snd_pcm_capture_xrun_asap(struct snd_pcm_substream *substream); 905int snd_pcm_capture_xrun_asap(struct snd_pcm_substream *substream);
910void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr); 906void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr);
911void snd_pcm_tick_prepare(struct snd_pcm_substream *substream);
912void snd_pcm_tick_set(struct snd_pcm_substream *substream, unsigned long ticks);
913void snd_pcm_tick_elapsed(struct snd_pcm_substream *substream);
914void snd_pcm_period_elapsed(struct snd_pcm_substream *substream); 907void snd_pcm_period_elapsed(struct snd_pcm_substream *substream);
915snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream, 908snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream,
916 const void __user *buf, 909 const void __user *buf,
@@ -952,6 +945,15 @@ void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream);
952void snd_pcm_timer_init(struct snd_pcm_substream *substream); 945void snd_pcm_timer_init(struct snd_pcm_substream *substream);
953void snd_pcm_timer_done(struct snd_pcm_substream *substream); 946void snd_pcm_timer_done(struct snd_pcm_substream *substream);
954 947
948static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime,
949 struct timespec *tv)
950{
951 if (runtime->tstamp_type == SNDRV_PCM_TSTAMP_TYPE_MONOTONIC)
952 do_posix_clock_monotonic_gettime(tv);
953 else
954 getnstimeofday(tv);
955}
956
955/* 957/*
956 * Memory 958 * Memory
957 */ 959 */
diff --git a/include/sound/seq_instr.h b/include/sound/seq_instr.h
deleted file mode 100644
index 93b0c51df5b0..000000000000
--- a/include/sound/seq_instr.h
+++ /dev/null
@@ -1,110 +0,0 @@
1#ifndef __SOUND_SEQ_INSTR_H
2#define __SOUND_SEQ_INSTR_H
3
4/*
5 * Main kernel header file for the ALSA sequencer
6 * Copyright (c) 1999 by Jaroslav Kysela <perex@perex.cz>
7 *
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24#include "seq_kernel.h"
25
26/* Instrument cluster */
27struct snd_seq_kcluster {
28 snd_seq_instr_cluster_t cluster;
29 char name[32];
30 int priority;
31 struct snd_seq_kcluster *next;
32};
33
34/* return pointer to private data */
35#define KINSTR_DATA(kinstr) (void *)(((char *)kinstr) + sizeof(struct snd_seq_kinstr))
36
37/* Instrument structure */
38struct snd_seq_kinstr {
39 struct snd_seq_instr instr;
40 char name[32];
41 int type; /* instrument type */
42 int use; /* use count */
43 int busy; /* not useable */
44 int add_len; /* additional length */
45 struct snd_seq_kinstr_ops *ops; /* operations */
46 struct snd_seq_kinstr *next;
47};
48
49#define SNDRV_SEQ_INSTR_HASH_SIZE 32
50
51/* Instrument flags */
52#define SNDRV_SEQ_INSTR_FLG_DIRECT (1<<0) /* accept only direct events */
53
54/* List of all instruments */
55struct snd_seq_kinstr_list {
56 struct snd_seq_kinstr *hash[SNDRV_SEQ_INSTR_HASH_SIZE];
57 int count; /* count of all instruments */
58
59 struct snd_seq_kcluster *chash[SNDRV_SEQ_INSTR_HASH_SIZE];
60 int ccount; /* count of all clusters */
61
62 int owner; /* current owner of the instrument list */
63 unsigned int flags;
64
65 spinlock_t lock;
66 spinlock_t ops_lock;
67 struct mutex ops_mutex;
68 unsigned long ops_flags;
69};
70
71#define SNDRV_SEQ_INSTR_NOTIFY_REMOVE 0
72#define SNDRV_SEQ_INSTR_NOTIFY_CHANGE 1
73
74struct snd_seq_kinstr_ops {
75 void *private_data;
76 long add_len; /* additional length */
77 char *instr_type;
78 int (*info)(void *private_data, char *info_data, long len);
79 int (*put)(void *private_data, struct snd_seq_kinstr *kinstr,
80 char __user *instr_data, long len, int atomic, int cmd);
81 int (*get)(void *private_data, struct snd_seq_kinstr *kinstr,
82 char __user *instr_data, long len, int atomic, int cmd);
83 int (*get_size)(void *private_data, struct snd_seq_kinstr *kinstr, long *size);
84 int (*remove)(void *private_data, struct snd_seq_kinstr *kinstr, int atomic);
85 void (*notify)(void *private_data, struct snd_seq_kinstr *kinstr, int what);
86 struct snd_seq_kinstr_ops *next;
87};
88
89
90/* instrument operations */
91struct snd_seq_kinstr_list *snd_seq_instr_list_new(void);
92void snd_seq_instr_list_free(struct snd_seq_kinstr_list **list);
93int snd_seq_instr_list_free_cond(struct snd_seq_kinstr_list *list,
94 struct snd_seq_instr_header *ifree,
95 int client,
96 int atomic);
97struct snd_seq_kinstr *snd_seq_instr_find(struct snd_seq_kinstr_list *list,
98 struct snd_seq_instr *instr,
99 int exact,
100 int follow_alias);
101void snd_seq_instr_free_use(struct snd_seq_kinstr_list *list,
102 struct snd_seq_kinstr *instr);
103int snd_seq_instr_event(struct snd_seq_kinstr_ops *ops,
104 struct snd_seq_kinstr_list *list,
105 struct snd_seq_event *ev,
106 int client,
107 int atomic,
108 int hop);
109
110#endif /* __SOUND_SEQ_INSTR_H */
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 2b1ae8edc43c..a105b01e06d5 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -22,7 +22,7 @@
22#define SND_SOC_NOPM -1 22#define SND_SOC_NOPM -1
23 23
24/* 24/*
25 * SoC dynamic audio power managment 25 * SoC dynamic audio power management
26 * 26 *
27 * We can have upto 4 power domains 27 * We can have upto 4 power domains
28 * 1. Codec domain - VREF, VMID 28 * 1. Codec domain - VREF, VMID
@@ -131,18 +131,34 @@
131 .shift = wshift, .invert = winvert} 131 .shift = wshift, .invert = winvert}
132 132
133/* dapm kcontrol types */ 133/* dapm kcontrol types */
134#define SOC_DAPM_SINGLE(xname, reg, shift, mask, invert) \ 134#define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \
135{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 135{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
136 .info = snd_soc_info_volsw, \ 136 .info = snd_soc_info_volsw, \
137 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 137 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
138 .private_value = SOC_SINGLE_VALUE(reg, shift, mask, invert) } 138 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
139#define SOC_DAPM_DOUBLE(xname, reg, shift_left, shift_right, mask, invert, \ 139#define SOC_DAPM_DOUBLE(xname, reg, shift_left, shift_right, max, invert, \
140 power) \ 140 power) \
141{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 141{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
142 .info = snd_soc_info_volsw, \ 142 .info = snd_soc_info_volsw, \
143 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 143 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
144 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\ 144 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
145 ((mask) << 16) | ((invert) << 24) } 145 ((max) << 16) | ((invert) << 24) }
146#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
147{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
148 .info = snd_soc_info_volsw, \
149 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
150 .tlv.p = (tlv_array), \
151 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
152 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
153#define SOC_DAPM_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, \
154 power, tlv_array) \
155{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
156 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
157 .tlv.p = (tlv_array), \
158 .info = snd_soc_info_volsw, \
159 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
160 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
161 ((max) << 16) | ((invert) << 24) }
146#define SOC_DAPM_ENUM(xname, xenum) \ 162#define SOC_DAPM_ENUM(xname, xenum) \
147{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 163{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
148 .info = snd_soc_info_enum_double, \ 164 .info = snd_soc_info_enum_double, \
@@ -199,6 +215,7 @@ void snd_soc_dapm_free(struct snd_soc_device *socdev);
199/* dapm events */ 215/* dapm events */
200int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, 216int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream,
201 int event); 217 int event);
218int snd_soc_dapm_device_event(struct snd_soc_device *socdev, int event);
202 219
203/* dapm sys fs - used by the core */ 220/* dapm sys fs - used by the core */
204int snd_soc_dapm_sys_add(struct device *dev); 221int snd_soc_dapm_sys_add(struct device *dev);
@@ -272,7 +289,7 @@ struct snd_soc_dapm_widget {
272 289
273 /* external events */ 290 /* external events */
274 unsigned short event_flags; /* flags to specify event types */ 291 unsigned short event_flags; /* flags to specify event types */
275 int (*event)(struct snd_soc_dapm_widget*, int); 292 int (*event)(struct snd_soc_dapm_widget*, struct snd_kcontrol *, int);
276 293
277 /* kcontrols that relate to this widget */ 294 /* kcontrols that relate to this widget */
278 int num_kcontrols; 295 int num_kcontrols;
diff --git a/include/sound/soc.h b/include/sound/soc.h
index f47ef1f75f18..e6ea6f750941 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -16,38 +16,63 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/workqueue.h> 18#include <linux/workqueue.h>
19#include <sound/driver.h>
20#include <sound/core.h> 19#include <sound/core.h>
21#include <sound/pcm.h> 20#include <sound/pcm.h>
22#include <sound/control.h> 21#include <sound/control.h>
23#include <sound/ac97_codec.h> 22#include <sound/ac97_codec.h>
24 23
25#define SND_SOC_VERSION "0.13.1" 24#define SND_SOC_VERSION "0.13.2"
26 25
27/* 26/*
28 * Convenience kcontrol builders 27 * Convenience kcontrol builders
29 */ 28 */
30#define SOC_SINGLE_VALUE(reg,shift,mask,invert) ((reg) | ((shift) << 8) |\ 29#define SOC_SINGLE_VALUE(reg, shift, max, invert) ((reg) | ((shift) << 8) |\
31 ((shift) << 12) | ((mask) << 16) | ((invert) << 24)) 30 ((shift) << 12) | ((max) << 16) | ((invert) << 24))
32#define SOC_SINGLE_VALUE_EXT(reg,mask,invert) ((reg) | ((mask) << 16) |\ 31#define SOC_SINGLE_VALUE_EXT(reg, max, invert) ((reg) | ((max) << 16) |\
33 ((invert) << 31)) 32 ((invert) << 31))
34#define SOC_SINGLE(xname, reg, shift, mask, invert) \ 33#define SOC_SINGLE(xname, reg, shift, max, invert) \
35{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 34{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
36 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ 35 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
37 .put = snd_soc_put_volsw, \ 36 .put = snd_soc_put_volsw, \
38 .private_value = SOC_SINGLE_VALUE(reg, shift, mask, invert) } 37 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
39#define SOC_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) \ 38#define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
39{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
40 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
41 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
42 .tlv.p = (tlv_array), \
43 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
44 .put = snd_soc_put_volsw, \
45 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) }
46#define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \
40{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 47{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
41 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ 48 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
42 .put = snd_soc_put_volsw, \ 49 .put = snd_soc_put_volsw, \
43 .private_value = (reg) | ((shift_left) << 8) | \ 50 .private_value = (reg) | ((shift_left) << 8) | \
44 ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) } 51 ((shift_right) << 12) | ((max) << 16) | ((invert) << 24) }
45#define SOC_DOUBLE_R(xname, reg_left, reg_right, shift, mask, invert) \ 52#define SOC_DOUBLE_R(xname, reg_left, reg_right, shift, max, invert) \
46{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 53{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
47 .info = snd_soc_info_volsw_2r, \ 54 .info = snd_soc_info_volsw_2r, \
48 .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ 55 .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \
49 .private_value = (reg_left) | ((shift) << 8) | \ 56 .private_value = (reg_left) | ((shift) << 8) | \
50 ((mask) << 12) | ((invert) << 20) | ((reg_right) << 24) } 57 ((max) << 12) | ((invert) << 20) | ((reg_right) << 24) }
58#define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \
59{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
60 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
61 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
62 .tlv.p = (tlv_array), \
63 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
64 .put = snd_soc_put_volsw, \
65 .private_value = (reg) | ((shift_left) << 8) | \
66 ((shift_right) << 12) | ((max) << 16) | ((invert) << 24) }
67#define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, shift, max, invert, tlv_array) \
68{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
69 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
70 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
71 .tlv.p = (tlv_array), \
72 .info = snd_soc_info_volsw_2r, \
73 .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \
74 .private_value = (reg_left) | ((shift) << 8) | \
75 ((max) << 12) | ((invert) << 20) | ((reg_right) << 24) }
51#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \ 76#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \
52{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ 77{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
53 .mask = xmask, .texts = xtexts } 78 .mask = xmask, .texts = xtexts }
@@ -105,9 +130,21 @@
105#define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated when not Tx/Rx */ 130#define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated when not Tx/Rx */
106 131
107/* 132/*
133 * DAI Sync
134 * Synchronous LR (Left Right) clocks and Frame signals.
135 */
136#define SND_SOC_DAIFMT_SYNC (0 << 5) /* Tx FRM = Rx FRM */
137#define SND_SOC_DAIFMT_ASYNC (1 << 5) /* Tx FRM ~ Rx FRM */
138
139/*
140 * TDM
141 */
142#define SND_SOC_DAIFMT_TDM (1 << 6)
143
144/*
108 * DAI hardware signal inversions 145 * DAI hardware signal inversions
109 */ 146 */
110#define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ 147#define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bclk + frm */
111#define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal bclk + inv frm */ 148#define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal bclk + inv frm */
112#define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert bclk + nor frm */ 149#define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert bclk + nor frm */
113#define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert bclk + frm */ 150#define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert bclk + frm */
@@ -410,6 +447,9 @@ struct snd_soc_dai_link {
410 447
411 /* codec/machine specific init - e.g. add machine controls */ 448 /* codec/machine specific init - e.g. add machine controls */
412 int (*init)(struct snd_soc_codec *codec); 449 int (*init)(struct snd_soc_codec *codec);
450
451 /* DAI pcm */
452 struct snd_pcm *pcm;
413}; 453};
414 454
415/* SoC machine */ 455/* SoC machine */
@@ -426,6 +466,9 @@ struct snd_soc_machine {
426 int (*resume_pre)(struct platform_device *pdev); 466 int (*resume_pre)(struct platform_device *pdev);
427 int (*resume_post)(struct platform_device *pdev); 467 int (*resume_post)(struct platform_device *pdev);
428 468
469 /* callbacks */
470 int (*dapm_event)(struct snd_soc_machine *, int event);
471
429 /* CPU <--> Codec DAI links */ 472 /* CPU <--> Codec DAI links */
430 struct snd_soc_dai_link *dai_link; 473 struct snd_soc_dai_link *dai_link;
431 int num_links; 474 int num_links;
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index e8eeb3a1ed29..b62ce3e077f9 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -30,6 +30,7 @@ struct snd_tea575x;
30struct snd_tea575x_ops { 30struct snd_tea575x_ops {
31 void (*write)(struct snd_tea575x *tea, unsigned int val); 31 void (*write)(struct snd_tea575x *tea, unsigned int val);
32 unsigned int (*read)(struct snd_tea575x *tea); 32 unsigned int (*read)(struct snd_tea575x *tea);
33 void (*mute)(struct snd_tea575x *tea, unsigned int mute);
33}; 34};
34 35
35struct snd_tea575x { 36struct snd_tea575x {
diff --git a/include/sound/trident.h b/include/sound/trident.h
index 9752243241e5..9f191a0a1e19 100644
--- a/include/sound/trident.h
+++ b/include/sound/trident.h
@@ -26,19 +26,12 @@
26#include "pcm.h" 26#include "pcm.h"
27#include "mpu401.h" 27#include "mpu401.h"
28#include "ac97_codec.h" 28#include "ac97_codec.h"
29#include "seq_midi_emul.h"
30#include "seq_device.h"
31#include "util_mem.h" 29#include "util_mem.h"
32//#include "ainstr_iw.h"
33//#include "ainstr_gf1.h"
34#include "ainstr_simple.h"
35 30
36#define TRIDENT_DEVICE_ID_DX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_DX) 31#define TRIDENT_DEVICE_ID_DX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_DX)
37#define TRIDENT_DEVICE_ID_NX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_NX) 32#define TRIDENT_DEVICE_ID_NX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_NX)
38#define TRIDENT_DEVICE_ID_SI7018 ((PCI_VENDOR_ID_SI<<16)|PCI_DEVICE_ID_SI_7018) 33#define TRIDENT_DEVICE_ID_SI7018 ((PCI_VENDOR_ID_SI<<16)|PCI_DEVICE_ID_SI_7018)
39 34
40#define SNDRV_SEQ_DEV_ID_TRIDENT "trident-synth"
41
42#define SNDRV_TRIDENT_VOICE_TYPE_PCM 0 35#define SNDRV_TRIDENT_VOICE_TYPE_PCM 0
43#define SNDRV_TRIDENT_VOICE_TYPE_SYNTH 1 36#define SNDRV_TRIDENT_VOICE_TYPE_SYNTH 1
44#define SNDRV_TRIDENT_VOICE_TYPE_MIDI 2 37#define SNDRV_TRIDENT_VOICE_TYPE_MIDI 2
@@ -257,16 +250,6 @@ struct snd_trident;
257struct snd_trident_voice; 250struct snd_trident_voice;
258struct snd_trident_pcm_mixer; 251struct snd_trident_pcm_mixer;
259 252
260struct snd_trident_sample_ops {
261 void (*sample_start)(struct snd_trident *gus, struct snd_trident_voice *voice, snd_seq_position_t position);
262 void (*sample_stop)(struct snd_trident *gus, struct snd_trident_voice *voice, int mode);
263 void (*sample_freq)(struct snd_trident *gus, struct snd_trident_voice *voice, snd_seq_frequency_t freq);
264 void (*sample_volume)(struct snd_trident *gus, struct snd_trident_voice *voice, struct snd_seq_ev_volume *volume);
265 void (*sample_loop)(struct snd_trident *card, struct snd_trident_voice *voice, struct snd_seq_ev_loop *loop);
266 void (*sample_pos)(struct snd_trident *card, struct snd_trident_voice *voice, snd_seq_position_t position);
267 void (*sample_private1)(struct snd_trident *card, struct snd_trident_voice *voice, unsigned char *data);
268};
269
270struct snd_trident_port { 253struct snd_trident_port {
271 struct snd_midi_channel_set * chset; 254 struct snd_midi_channel_set * chset;
272 struct snd_trident * trident; 255 struct snd_trident * trident;
@@ -300,7 +283,6 @@ struct snd_trident_voice {
300 unsigned char port; 283 unsigned char port;
301 unsigned char index; 284 unsigned char index;
302 285
303 struct snd_seq_instr instr;
304 struct snd_trident_sample_ops *sample_ops; 286 struct snd_trident_sample_ops *sample_ops;
305 287
306 /* channel parameters */ 288 /* channel parameters */
@@ -354,9 +336,6 @@ struct snd_4dwave {
354 int seq_client; 336 int seq_client;
355 337
356 struct snd_trident_port seq_ports[4]; 338 struct snd_trident_port seq_ports[4];
357 struct snd_simple_ops simple_ops;
358 struct snd_seq_kinstr_list *ilist;
359
360 struct snd_trident_voice voices[64]; 339 struct snd_trident_voice voices[64];
361 340
362 int ChanSynthCount; /* number of allocated synth channels */ 341 int ChanSynthCount; /* number of allocated synth channels */
@@ -416,7 +395,6 @@ struct snd_trident {
416 struct snd_pcm *foldback; /* Foldback PCM */ 395 struct snd_pcm *foldback; /* Foldback PCM */
417 struct snd_pcm *spdif; /* SPDIF PCM */ 396 struct snd_pcm *spdif; /* SPDIF PCM */
418 struct snd_rawmidi *rmidi; 397 struct snd_rawmidi *rmidi;
419 struct snd_seq_device *seq_dev;
420 398
421 struct snd_ac97_bus *ac97_bus; 399 struct snd_ac97_bus *ac97_bus;
422 struct snd_ac97 *ac97; 400 struct snd_ac97 *ac97;
diff --git a/include/sound/version.h b/include/sound/version.h
index a9781eb0da09..fac66c49445a 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h. Generated by alsa/ksync script. */ 1/* include/version.h. Generated by alsa/ksync script. */
2#define CONFIG_SND_VERSION "1.0.15" 2#define CONFIG_SND_VERSION "1.0.16rc2"
3#define CONFIG_SND_DATE " (Tue Nov 20 19:16:42 2007 UTC)" 3#define CONFIG_SND_DATE " (Thu Jan 31 16:40:16 2008 UTC)"