diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-01-12 03:59:14 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-01-12 03:59:14 -0500 |
commit | 627b79628f56c3deeb17dec1edf6899b49552fa4 (patch) | |
tree | deac8b2cce5d70708fa944a270ee031f069226d8 /sound | |
parent | 29abceb67f8a230da806db4ed73899595bd2ae76 (diff) | |
parent | 8c3f5d8a9b7d0d8506bc2a0525e012eae02b1853 (diff) |
Merge branch 'topic/misc' into for-linus
Diffstat (limited to 'sound')
164 files changed, 1855 insertions, 911 deletions
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index 5d9411839cd7..3a39626a82d6 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c | |||
@@ -251,18 +251,7 @@ static struct platform_driver pxa2xx_ac97_driver = { | |||
251 | }, | 251 | }, |
252 | }; | 252 | }; |
253 | 253 | ||
254 | static int __init pxa2xx_ac97_init(void) | 254 | module_platform_driver(pxa2xx_ac97_driver); |
255 | { | ||
256 | return platform_driver_register(&pxa2xx_ac97_driver); | ||
257 | } | ||
258 | |||
259 | static void __exit pxa2xx_ac97_exit(void) | ||
260 | { | ||
261 | platform_driver_unregister(&pxa2xx_ac97_driver); | ||
262 | } | ||
263 | |||
264 | module_init(pxa2xx_ac97_init); | ||
265 | module_exit(pxa2xx_ac97_exit); | ||
266 | 255 | ||
267 | MODULE_AUTHOR("Nicolas Pitre"); | 256 | MODULE_AUTHOR("Nicolas Pitre"); |
268 | MODULE_DESCRIPTION("AC97 driver for the Intel PXA2xx chip"); | 257 | MODULE_DESCRIPTION("AC97 driver for the Intel PXA2xx chip"); |
diff --git a/sound/core/Kconfig b/sound/core/Kconfig index 475455c76610..2dc7776e218c 100644 --- a/sound/core/Kconfig +++ b/sound/core/Kconfig | |||
@@ -155,6 +155,16 @@ config SND_DYNAMIC_MINORS | |||
155 | 155 | ||
156 | If you are unsure about this, say N here. | 156 | If you are unsure about this, say N here. |
157 | 157 | ||
158 | config SND_COMPRESS_OFFLOAD | ||
159 | tristate "ALSA Compressed audio offload support" | ||
160 | default n | ||
161 | help | ||
162 | If you want support for offloading compressed audio and have such | ||
163 | a hardware, then you should say Y here and also to the DSP driver | ||
164 | of your platform. | ||
165 | |||
166 | If you are unsure about this, say N here. | ||
167 | |||
158 | config SND_SUPPORT_OLD_API | 168 | config SND_SUPPORT_OLD_API |
159 | bool "Support old ALSA API" | 169 | bool "Support old ALSA API" |
160 | default y | 170 | default y |
diff --git a/sound/core/Makefile b/sound/core/Makefile index 350a08d277f4..67c8e9336611 100644 --- a/sound/core/Makefile +++ b/sound/core/Makefile | |||
@@ -21,6 +21,8 @@ snd-hrtimer-objs := hrtimer.o | |||
21 | snd-rtctimer-objs := rtctimer.o | 21 | snd-rtctimer-objs := rtctimer.o |
22 | snd-hwdep-objs := hwdep.o | 22 | snd-hwdep-objs := hwdep.o |
23 | 23 | ||
24 | snd-compress-objs := compress_offload.o | ||
25 | |||
24 | obj-$(CONFIG_SND) += snd.o | 26 | obj-$(CONFIG_SND) += snd.o |
25 | obj-$(CONFIG_SND_HWDEP) += snd-hwdep.o | 27 | obj-$(CONFIG_SND_HWDEP) += snd-hwdep.o |
26 | obj-$(CONFIG_SND_TIMER) += snd-timer.o | 28 | obj-$(CONFIG_SND_TIMER) += snd-timer.o |
@@ -31,3 +33,5 @@ obj-$(CONFIG_SND_RAWMIDI) += snd-rawmidi.o | |||
31 | 33 | ||
32 | obj-$(CONFIG_SND_OSSEMUL) += oss/ | 34 | obj-$(CONFIG_SND_OSSEMUL) += oss/ |
33 | obj-$(CONFIG_SND_SEQUENCER) += seq/ | 35 | obj-$(CONFIG_SND_SEQUENCER) += seq/ |
36 | |||
37 | obj-$(CONFIG_SND_COMPRESS_OFFLOAD) += snd-compress.o | ||
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c new file mode 100644 index 000000000000..dac3633507c9 --- /dev/null +++ b/sound/core/compress_offload.c | |||
@@ -0,0 +1,765 @@ | |||
1 | /* | ||
2 | * compress_core.c - compress offload core | ||
3 | * | ||
4 | * Copyright (C) 2011 Intel Corporation | ||
5 | * Authors: Vinod Koul <vinod.koul@linux.intel.com> | ||
6 | * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | ||
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; version 2 of the License. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
21 | * | ||
22 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
23 | * | ||
24 | */ | ||
25 | #define FORMAT(fmt) "%s: %d: " fmt, __func__, __LINE__ | ||
26 | #define pr_fmt(fmt) KBUILD_MODNAME ": " FORMAT(fmt) | ||
27 | |||
28 | #include <linux/file.h> | ||
29 | #include <linux/fs.h> | ||
30 | #include <linux/list.h> | ||
31 | #include <linux/mm.h> | ||
32 | #include <linux/mutex.h> | ||
33 | #include <linux/poll.h> | ||
34 | #include <linux/slab.h> | ||
35 | #include <linux/sched.h> | ||
36 | #include <linux/uio.h> | ||
37 | #include <linux/uaccess.h> | ||
38 | #include <linux/module.h> | ||
39 | #include <sound/core.h> | ||
40 | #include <sound/initval.h> | ||
41 | #include <sound/compress_params.h> | ||
42 | #include <sound/compress_offload.h> | ||
43 | #include <sound/compress_driver.h> | ||
44 | |||
45 | /* TODO: | ||
46 | * - add substream support for multiple devices in case of | ||
47 | * SND_DYNAMIC_MINORS is not used | ||
48 | * - Multiple node representation | ||
49 | * driver should be able to register multiple nodes | ||
50 | */ | ||
51 | |||
52 | static DEFINE_MUTEX(device_mutex); | ||
53 | |||
54 | struct snd_compr_file { | ||
55 | unsigned long caps; | ||
56 | struct snd_compr_stream stream; | ||
57 | }; | ||
58 | |||
59 | /* | ||
60 | * a note on stream states used: | ||
61 | * we use follwing states in the compressed core | ||
62 | * SNDRV_PCM_STATE_OPEN: When stream has been opened. | ||
63 | * SNDRV_PCM_STATE_SETUP: When stream has been initialized. This is done by | ||
64 | * calling SNDRV_COMPRESS_SET_PARAMS. running streams will come to this | ||
65 | * state at stop by calling SNDRV_COMPRESS_STOP, or at end of drain. | ||
66 | * SNDRV_PCM_STATE_RUNNING: When stream has been started and is | ||
67 | * decoding/encoding and rendering/capturing data. | ||
68 | * SNDRV_PCM_STATE_DRAINING: When stream is draining current data. This is done | ||
69 | * by calling SNDRV_COMPRESS_DRAIN. | ||
70 | * SNDRV_PCM_STATE_PAUSED: When stream is paused. This is done by calling | ||
71 | * SNDRV_COMPRESS_PAUSE. It can be stopped or resumed by calling | ||
72 | * SNDRV_COMPRESS_STOP or SNDRV_COMPRESS_RESUME respectively. | ||
73 | */ | ||
74 | static int snd_compr_open(struct inode *inode, struct file *f) | ||
75 | { | ||
76 | struct snd_compr *compr; | ||
77 | struct snd_compr_file *data; | ||
78 | struct snd_compr_runtime *runtime; | ||
79 | enum snd_compr_direction dirn; | ||
80 | int maj = imajor(inode); | ||
81 | int ret; | ||
82 | |||
83 | if (f->f_flags & O_WRONLY) | ||
84 | dirn = SND_COMPRESS_PLAYBACK; | ||
85 | else if (f->f_flags & O_RDONLY) | ||
86 | dirn = SND_COMPRESS_CAPTURE; | ||
87 | else { | ||
88 | pr_err("invalid direction\n"); | ||
89 | return -EINVAL; | ||
90 | } | ||
91 | |||
92 | if (maj == snd_major) | ||
93 | compr = snd_lookup_minor_data(iminor(inode), | ||
94 | SNDRV_DEVICE_TYPE_COMPRESS); | ||
95 | else | ||
96 | return -EBADFD; | ||
97 | |||
98 | if (compr == NULL) { | ||
99 | pr_err("no device data!!!\n"); | ||
100 | return -ENODEV; | ||
101 | } | ||
102 | |||
103 | if (dirn != compr->direction) { | ||
104 | pr_err("this device doesn't support this direction\n"); | ||
105 | return -EINVAL; | ||
106 | } | ||
107 | |||
108 | data = kzalloc(sizeof(*data), GFP_KERNEL); | ||
109 | if (!data) | ||
110 | return -ENOMEM; | ||
111 | data->stream.ops = compr->ops; | ||
112 | data->stream.direction = dirn; | ||
113 | data->stream.private_data = compr->private_data; | ||
114 | data->stream.device = compr; | ||
115 | runtime = kzalloc(sizeof(*runtime), GFP_KERNEL); | ||
116 | if (!runtime) { | ||
117 | kfree(data); | ||
118 | return -ENOMEM; | ||
119 | } | ||
120 | runtime->state = SNDRV_PCM_STATE_OPEN; | ||
121 | init_waitqueue_head(&runtime->sleep); | ||
122 | data->stream.runtime = runtime; | ||
123 | f->private_data = (void *)data; | ||
124 | mutex_lock(&compr->lock); | ||
125 | ret = compr->ops->open(&data->stream); | ||
126 | mutex_unlock(&compr->lock); | ||
127 | if (ret) { | ||
128 | kfree(runtime); | ||
129 | kfree(data); | ||
130 | } | ||
131 | return ret; | ||
132 | } | ||
133 | |||
134 | static int snd_compr_free(struct inode *inode, struct file *f) | ||
135 | { | ||
136 | struct snd_compr_file *data = f->private_data; | ||
137 | data->stream.ops->free(&data->stream); | ||
138 | kfree(data->stream.runtime->buffer); | ||
139 | kfree(data->stream.runtime); | ||
140 | kfree(data); | ||
141 | return 0; | ||
142 | } | ||
143 | |||
144 | static void snd_compr_update_tstamp(struct snd_compr_stream *stream, | ||
145 | struct snd_compr_tstamp *tstamp) | ||
146 | { | ||
147 | if (!stream->ops->pointer) | ||
148 | return; | ||
149 | stream->ops->pointer(stream, tstamp); | ||
150 | pr_debug("dsp consumed till %d total %d bytes\n", | ||
151 | tstamp->byte_offset, tstamp->copied_total); | ||
152 | stream->runtime->hw_pointer = tstamp->byte_offset; | ||
153 | stream->runtime->total_bytes_transferred = tstamp->copied_total; | ||
154 | } | ||
155 | |||
156 | static size_t snd_compr_calc_avail(struct snd_compr_stream *stream, | ||
157 | struct snd_compr_avail *avail) | ||
158 | { | ||
159 | long avail_calc; /*this needs to be signed variable */ | ||
160 | |||
161 | snd_compr_update_tstamp(stream, &avail->tstamp); | ||
162 | |||
163 | /* FIXME: This needs to be different for capture stream, | ||
164 | available is # of compressed data, for playback it's | ||
165 | remainder of buffer */ | ||
166 | |||
167 | if (stream->runtime->total_bytes_available == 0 && | ||
168 | stream->runtime->state == SNDRV_PCM_STATE_SETUP) { | ||
169 | pr_debug("detected init and someone forgot to do a write\n"); | ||
170 | return stream->runtime->buffer_size; | ||
171 | } | ||
172 | pr_debug("app wrote %lld, DSP consumed %lld\n", | ||
173 | stream->runtime->total_bytes_available, | ||
174 | stream->runtime->total_bytes_transferred); | ||
175 | if (stream->runtime->total_bytes_available == | ||
176 | stream->runtime->total_bytes_transferred) { | ||
177 | pr_debug("both pointers are same, returning full avail\n"); | ||
178 | return stream->runtime->buffer_size; | ||
179 | } | ||
180 | |||
181 | /* FIXME: this routine isn't consistent, in one test we use | ||
182 | * cumulative values and in the other byte offsets. Do we | ||
183 | * really need the byte offsets if the cumulative values have | ||
184 | * been updated? In the PCM interface app_ptr and hw_ptr are | ||
185 | * already cumulative */ | ||
186 | |||
187 | avail_calc = stream->runtime->buffer_size - | ||
188 | (stream->runtime->app_pointer - stream->runtime->hw_pointer); | ||
189 | pr_debug("calc avail as %ld, app_ptr %lld, hw+ptr %lld\n", avail_calc, | ||
190 | stream->runtime->app_pointer, | ||
191 | stream->runtime->hw_pointer); | ||
192 | if (avail_calc >= stream->runtime->buffer_size) | ||
193 | avail_calc -= stream->runtime->buffer_size; | ||
194 | pr_debug("ret avail as %ld\n", avail_calc); | ||
195 | avail->avail = avail_calc; | ||
196 | return avail_calc; | ||
197 | } | ||
198 | |||
199 | static inline size_t snd_compr_get_avail(struct snd_compr_stream *stream) | ||
200 | { | ||
201 | struct snd_compr_avail avail; | ||
202 | |||
203 | return snd_compr_calc_avail(stream, &avail); | ||
204 | } | ||
205 | |||
206 | static int | ||
207 | snd_compr_ioctl_avail(struct snd_compr_stream *stream, unsigned long arg) | ||
208 | { | ||
209 | struct snd_compr_avail ioctl_avail; | ||
210 | size_t avail; | ||
211 | |||
212 | avail = snd_compr_calc_avail(stream, &ioctl_avail); | ||
213 | ioctl_avail.avail = avail; | ||
214 | |||
215 | if (copy_to_user((__u64 __user *)arg, | ||
216 | &ioctl_avail, sizeof(ioctl_avail))) | ||
217 | return -EFAULT; | ||
218 | return 0; | ||
219 | } | ||
220 | |||
221 | static int snd_compr_write_data(struct snd_compr_stream *stream, | ||
222 | const char __user *buf, size_t count) | ||
223 | { | ||
224 | void *dstn; | ||
225 | size_t copy; | ||
226 | struct snd_compr_runtime *runtime = stream->runtime; | ||
227 | |||
228 | dstn = runtime->buffer + runtime->app_pointer; | ||
229 | pr_debug("copying %ld at %lld\n", | ||
230 | (unsigned long)count, runtime->app_pointer); | ||
231 | if (count < runtime->buffer_size - runtime->app_pointer) { | ||
232 | if (copy_from_user(dstn, buf, count)) | ||
233 | return -EFAULT; | ||
234 | runtime->app_pointer += count; | ||
235 | } else { | ||
236 | copy = runtime->buffer_size - runtime->app_pointer; | ||
237 | if (copy_from_user(dstn, buf, copy)) | ||
238 | return -EFAULT; | ||
239 | if (copy_from_user(runtime->buffer, buf + copy, count - copy)) | ||
240 | return -EFAULT; | ||
241 | runtime->app_pointer = count - copy; | ||
242 | } | ||
243 | /* if DSP cares, let it know data has been written */ | ||
244 | if (stream->ops->ack) | ||
245 | stream->ops->ack(stream, count); | ||
246 | return count; | ||
247 | } | ||
248 | |||
249 | static ssize_t snd_compr_write(struct file *f, const char __user *buf, | ||
250 | size_t count, loff_t *offset) | ||
251 | { | ||
252 | struct snd_compr_file *data = f->private_data; | ||
253 | struct snd_compr_stream *stream; | ||
254 | size_t avail; | ||
255 | int retval; | ||
256 | |||
257 | if (snd_BUG_ON(!data)) | ||
258 | return -EFAULT; | ||
259 | |||
260 | stream = &data->stream; | ||
261 | mutex_lock(&stream->device->lock); | ||
262 | /* write is allowed when stream is running or has been steup */ | ||
263 | if (stream->runtime->state != SNDRV_PCM_STATE_SETUP && | ||
264 | stream->runtime->state != SNDRV_PCM_STATE_RUNNING) { | ||
265 | mutex_unlock(&stream->device->lock); | ||
266 | return -EBADFD; | ||
267 | } | ||
268 | |||
269 | avail = snd_compr_get_avail(stream); | ||
270 | pr_debug("avail returned %ld\n", (unsigned long)avail); | ||
271 | /* calculate how much we can write to buffer */ | ||
272 | if (avail > count) | ||
273 | avail = count; | ||
274 | |||
275 | if (stream->ops->copy) | ||
276 | retval = stream->ops->copy(stream, buf, avail); | ||
277 | else | ||
278 | retval = snd_compr_write_data(stream, buf, avail); | ||
279 | if (retval > 0) | ||
280 | stream->runtime->total_bytes_available += retval; | ||
281 | |||
282 | /* while initiating the stream, write should be called before START | ||
283 | * call, so in setup move state */ | ||
284 | if (stream->runtime->state == SNDRV_PCM_STATE_SETUP) { | ||
285 | stream->runtime->state = SNDRV_PCM_STATE_PREPARED; | ||
286 | pr_debug("stream prepared, Houston we are good to go\n"); | ||
287 | } | ||
288 | |||
289 | mutex_unlock(&stream->device->lock); | ||
290 | return retval; | ||
291 | } | ||
292 | |||
293 | |||
294 | static ssize_t snd_compr_read(struct file *f, char __user *buf, | ||
295 | size_t count, loff_t *offset) | ||
296 | { | ||
297 | return -ENXIO; | ||
298 | } | ||
299 | |||
300 | static int snd_compr_mmap(struct file *f, struct vm_area_struct *vma) | ||
301 | { | ||
302 | return -ENXIO; | ||
303 | } | ||
304 | |||
305 | static inline int snd_compr_get_poll(struct snd_compr_stream *stream) | ||
306 | { | ||
307 | if (stream->direction == SND_COMPRESS_PLAYBACK) | ||
308 | return POLLOUT | POLLWRNORM; | ||
309 | else | ||
310 | return POLLIN | POLLRDNORM; | ||
311 | } | ||
312 | |||
313 | static unsigned int snd_compr_poll(struct file *f, poll_table *wait) | ||
314 | { | ||
315 | struct snd_compr_file *data = f->private_data; | ||
316 | struct snd_compr_stream *stream; | ||
317 | size_t avail; | ||
318 | int retval = 0; | ||
319 | |||
320 | if (snd_BUG_ON(!data)) | ||
321 | return -EFAULT; | ||
322 | stream = &data->stream; | ||
323 | if (snd_BUG_ON(!stream)) | ||
324 | return -EFAULT; | ||
325 | |||
326 | mutex_lock(&stream->device->lock); | ||
327 | if (stream->runtime->state == SNDRV_PCM_STATE_PAUSED || | ||
328 | stream->runtime->state == SNDRV_PCM_STATE_OPEN) { | ||
329 | retval = -EBADFD; | ||
330 | goto out; | ||
331 | } | ||
332 | poll_wait(f, &stream->runtime->sleep, wait); | ||
333 | |||
334 | avail = snd_compr_get_avail(stream); | ||
335 | pr_debug("avail is %ld\n", (unsigned long)avail); | ||
336 | /* check if we have at least one fragment to fill */ | ||
337 | switch (stream->runtime->state) { | ||
338 | case SNDRV_PCM_STATE_DRAINING: | ||
339 | /* stream has been woken up after drain is complete | ||
340 | * draining done so set stream state to stopped | ||
341 | */ | ||
342 | retval = snd_compr_get_poll(stream); | ||
343 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; | ||
344 | break; | ||
345 | case SNDRV_PCM_STATE_RUNNING: | ||
346 | case SNDRV_PCM_STATE_PREPARED: | ||
347 | case SNDRV_PCM_STATE_PAUSED: | ||
348 | if (avail >= stream->runtime->fragment_size) | ||
349 | retval = snd_compr_get_poll(stream); | ||
350 | break; | ||
351 | default: | ||
352 | if (stream->direction == SND_COMPRESS_PLAYBACK) | ||
353 | retval = POLLOUT | POLLWRNORM | POLLERR; | ||
354 | else | ||
355 | retval = POLLIN | POLLRDNORM | POLLERR; | ||
356 | break; | ||
357 | } | ||
358 | out: | ||
359 | mutex_unlock(&stream->device->lock); | ||
360 | return retval; | ||
361 | } | ||
362 | |||
363 | static int | ||
364 | snd_compr_get_caps(struct snd_compr_stream *stream, unsigned long arg) | ||
365 | { | ||
366 | int retval; | ||
367 | struct snd_compr_caps caps; | ||
368 | |||
369 | if (!stream->ops->get_caps) | ||
370 | return -ENXIO; | ||
371 | |||
372 | retval = stream->ops->get_caps(stream, &caps); | ||
373 | if (retval) | ||
374 | goto out; | ||
375 | if (copy_to_user((void __user *)arg, &caps, sizeof(caps))) | ||
376 | retval = -EFAULT; | ||
377 | out: | ||
378 | return retval; | ||
379 | } | ||
380 | |||
381 | static int | ||
382 | snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg) | ||
383 | { | ||
384 | int retval; | ||
385 | struct snd_compr_codec_caps *caps; | ||
386 | |||
387 | if (!stream->ops->get_codec_caps) | ||
388 | return -ENXIO; | ||
389 | |||
390 | caps = kmalloc(sizeof(*caps), GFP_KERNEL); | ||
391 | if (!caps) | ||
392 | return -ENOMEM; | ||
393 | |||
394 | retval = stream->ops->get_codec_caps(stream, caps); | ||
395 | if (retval) | ||
396 | goto out; | ||
397 | if (copy_to_user((void __user *)arg, caps, sizeof(*caps))) | ||
398 | retval = -EFAULT; | ||
399 | |||
400 | out: | ||
401 | kfree(caps); | ||
402 | return retval; | ||
403 | } | ||
404 | |||
405 | /* revisit this with snd_pcm_preallocate_xxx */ | ||
406 | static int snd_compr_allocate_buffer(struct snd_compr_stream *stream, | ||
407 | struct snd_compr_params *params) | ||
408 | { | ||
409 | unsigned int buffer_size; | ||
410 | void *buffer; | ||
411 | |||
412 | buffer_size = params->buffer.fragment_size * params->buffer.fragments; | ||
413 | if (stream->ops->copy) { | ||
414 | buffer = NULL; | ||
415 | /* if copy is defined the driver will be required to copy | ||
416 | * the data from core | ||
417 | */ | ||
418 | } else { | ||
419 | buffer = kmalloc(buffer_size, GFP_KERNEL); | ||
420 | if (!buffer) | ||
421 | return -ENOMEM; | ||
422 | } | ||
423 | stream->runtime->fragment_size = params->buffer.fragment_size; | ||
424 | stream->runtime->fragments = params->buffer.fragments; | ||
425 | stream->runtime->buffer = buffer; | ||
426 | stream->runtime->buffer_size = buffer_size; | ||
427 | return 0; | ||
428 | } | ||
429 | |||
430 | static int | ||
431 | snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg) | ||
432 | { | ||
433 | struct snd_compr_params *params; | ||
434 | int retval; | ||
435 | |||
436 | if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) { | ||
437 | /* | ||
438 | * we should allow parameter change only when stream has been | ||
439 | * opened not in other cases | ||
440 | */ | ||
441 | params = kmalloc(sizeof(*params), GFP_KERNEL); | ||
442 | if (!params) | ||
443 | return -ENOMEM; | ||
444 | if (copy_from_user(params, (void __user *)arg, sizeof(*params))) | ||
445 | return -EFAULT; | ||
446 | retval = snd_compr_allocate_buffer(stream, params); | ||
447 | if (retval) { | ||
448 | kfree(params); | ||
449 | return -ENOMEM; | ||
450 | } | ||
451 | retval = stream->ops->set_params(stream, params); | ||
452 | if (retval) | ||
453 | goto out; | ||
454 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; | ||
455 | } else | ||
456 | return -EPERM; | ||
457 | out: | ||
458 | kfree(params); | ||
459 | return retval; | ||
460 | } | ||
461 | |||
462 | static int | ||
463 | snd_compr_get_params(struct snd_compr_stream *stream, unsigned long arg) | ||
464 | { | ||
465 | struct snd_codec *params; | ||
466 | int retval; | ||
467 | |||
468 | if (!stream->ops->get_params) | ||
469 | return -EBADFD; | ||
470 | |||
471 | params = kmalloc(sizeof(*params), GFP_KERNEL); | ||
472 | if (!params) | ||
473 | return -ENOMEM; | ||
474 | retval = stream->ops->get_params(stream, params); | ||
475 | if (retval) | ||
476 | goto out; | ||
477 | if (copy_to_user((char __user *)arg, params, sizeof(*params))) | ||
478 | retval = -EFAULT; | ||
479 | |||
480 | out: | ||
481 | kfree(params); | ||
482 | return retval; | ||
483 | } | ||
484 | |||
485 | static inline int | ||
486 | snd_compr_tstamp(struct snd_compr_stream *stream, unsigned long arg) | ||
487 | { | ||
488 | struct snd_compr_tstamp tstamp; | ||
489 | |||
490 | snd_compr_update_tstamp(stream, &tstamp); | ||
491 | return copy_to_user((struct snd_compr_tstamp __user *)arg, | ||
492 | &tstamp, sizeof(tstamp)) ? -EFAULT : 0; | ||
493 | } | ||
494 | |||
495 | static int snd_compr_pause(struct snd_compr_stream *stream) | ||
496 | { | ||
497 | int retval; | ||
498 | |||
499 | if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING) | ||
500 | return -EPERM; | ||
501 | retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_PUSH); | ||
502 | if (!retval) { | ||
503 | stream->runtime->state = SNDRV_PCM_STATE_PAUSED; | ||
504 | wake_up(&stream->runtime->sleep); | ||
505 | } | ||
506 | return retval; | ||
507 | } | ||
508 | |||
509 | static int snd_compr_resume(struct snd_compr_stream *stream) | ||
510 | { | ||
511 | int retval; | ||
512 | |||
513 | if (stream->runtime->state != SNDRV_PCM_STATE_PAUSED) | ||
514 | return -EPERM; | ||
515 | retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_RELEASE); | ||
516 | if (!retval) | ||
517 | stream->runtime->state = SNDRV_PCM_STATE_RUNNING; | ||
518 | return retval; | ||
519 | } | ||
520 | |||
521 | static int snd_compr_start(struct snd_compr_stream *stream) | ||
522 | { | ||
523 | int retval; | ||
524 | |||
525 | if (stream->runtime->state != SNDRV_PCM_STATE_PREPARED) | ||
526 | return -EPERM; | ||
527 | retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_START); | ||
528 | if (!retval) | ||
529 | stream->runtime->state = SNDRV_PCM_STATE_RUNNING; | ||
530 | return retval; | ||
531 | } | ||
532 | |||
533 | static int snd_compr_stop(struct snd_compr_stream *stream) | ||
534 | { | ||
535 | int retval; | ||
536 | |||
537 | if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED || | ||
538 | stream->runtime->state == SNDRV_PCM_STATE_SETUP) | ||
539 | return -EPERM; | ||
540 | retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_STOP); | ||
541 | if (!retval) { | ||
542 | stream->runtime->state = SNDRV_PCM_STATE_SETUP; | ||
543 | wake_up(&stream->runtime->sleep); | ||
544 | } | ||
545 | return retval; | ||
546 | } | ||
547 | |||
548 | static int snd_compr_drain(struct snd_compr_stream *stream) | ||
549 | { | ||
550 | int retval; | ||
551 | |||
552 | if (stream->runtime->state == SNDRV_PCM_STATE_PREPARED || | ||
553 | stream->runtime->state == SNDRV_PCM_STATE_SETUP) | ||
554 | return -EPERM; | ||
555 | retval = stream->ops->trigger(stream, SND_COMPR_TRIGGER_DRAIN); | ||
556 | if (!retval) { | ||
557 | stream->runtime->state = SNDRV_PCM_STATE_DRAINING; | ||
558 | wake_up(&stream->runtime->sleep); | ||
559 | } | ||
560 | return retval; | ||
561 | } | ||
562 | |||
563 | static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg) | ||
564 | { | ||
565 | struct snd_compr_file *data = f->private_data; | ||
566 | struct snd_compr_stream *stream; | ||
567 | int retval = -ENOTTY; | ||
568 | |||
569 | if (snd_BUG_ON(!data)) | ||
570 | return -EFAULT; | ||
571 | stream = &data->stream; | ||
572 | if (snd_BUG_ON(!stream)) | ||
573 | return -EFAULT; | ||
574 | mutex_lock(&stream->device->lock); | ||
575 | switch (_IOC_NR(cmd)) { | ||
576 | case _IOC_NR(SNDRV_COMPRESS_IOCTL_VERSION): | ||
577 | put_user(SNDRV_COMPRESS_VERSION, | ||
578 | (int __user *)arg) ? -EFAULT : 0; | ||
579 | break; | ||
580 | case _IOC_NR(SNDRV_COMPRESS_GET_CAPS): | ||
581 | retval = snd_compr_get_caps(stream, arg); | ||
582 | break; | ||
583 | case _IOC_NR(SNDRV_COMPRESS_GET_CODEC_CAPS): | ||
584 | retval = snd_compr_get_codec_caps(stream, arg); | ||
585 | break; | ||
586 | case _IOC_NR(SNDRV_COMPRESS_SET_PARAMS): | ||
587 | retval = snd_compr_set_params(stream, arg); | ||
588 | break; | ||
589 | case _IOC_NR(SNDRV_COMPRESS_GET_PARAMS): | ||
590 | retval = snd_compr_get_params(stream, arg); | ||
591 | break; | ||
592 | case _IOC_NR(SNDRV_COMPRESS_TSTAMP): | ||
593 | retval = snd_compr_tstamp(stream, arg); | ||
594 | break; | ||
595 | case _IOC_NR(SNDRV_COMPRESS_AVAIL): | ||
596 | retval = snd_compr_ioctl_avail(stream, arg); | ||
597 | break; | ||
598 | case _IOC_NR(SNDRV_COMPRESS_PAUSE): | ||
599 | retval = snd_compr_pause(stream); | ||
600 | break; | ||
601 | case _IOC_NR(SNDRV_COMPRESS_RESUME): | ||
602 | retval = snd_compr_resume(stream); | ||
603 | break; | ||
604 | case _IOC_NR(SNDRV_COMPRESS_START): | ||
605 | retval = snd_compr_start(stream); | ||
606 | break; | ||
607 | case _IOC_NR(SNDRV_COMPRESS_STOP): | ||
608 | retval = snd_compr_stop(stream); | ||
609 | break; | ||
610 | case _IOC_NR(SNDRV_COMPRESS_DRAIN): | ||
611 | retval = snd_compr_drain(stream); | ||
612 | break; | ||
613 | } | ||
614 | mutex_unlock(&stream->device->lock); | ||
615 | return retval; | ||
616 | } | ||
617 | |||
618 | static const struct file_operations snd_compr_file_ops = { | ||
619 | .owner = THIS_MODULE, | ||
620 | .open = snd_compr_open, | ||
621 | .release = snd_compr_free, | ||
622 | .write = snd_compr_write, | ||
623 | .read = snd_compr_read, | ||
624 | .unlocked_ioctl = snd_compr_ioctl, | ||
625 | .mmap = snd_compr_mmap, | ||
626 | .poll = snd_compr_poll, | ||
627 | }; | ||
628 | |||
629 | static int snd_compress_dev_register(struct snd_device *device) | ||
630 | { | ||
631 | int ret = -EINVAL; | ||
632 | char str[16]; | ||
633 | struct snd_compr *compr; | ||
634 | |||
635 | if (snd_BUG_ON(!device || !device->device_data)) | ||
636 | return -EBADFD; | ||
637 | compr = device->device_data; | ||
638 | |||
639 | sprintf(str, "comprC%iD%i", compr->card->number, compr->device); | ||
640 | pr_debug("reg %s for device %s, direction %d\n", str, compr->name, | ||
641 | compr->direction); | ||
642 | /* register compressed device */ | ||
643 | ret = snd_register_device(SNDRV_DEVICE_TYPE_COMPRESS, compr->card, | ||
644 | compr->device, &snd_compr_file_ops, compr, str); | ||
645 | if (ret < 0) { | ||
646 | pr_err("snd_register_device failed\n %d", ret); | ||
647 | return ret; | ||
648 | } | ||
649 | return ret; | ||
650 | |||
651 | } | ||
652 | |||
653 | static int snd_compress_dev_disconnect(struct snd_device *device) | ||
654 | { | ||
655 | struct snd_compr *compr; | ||
656 | |||
657 | compr = device->device_data; | ||
658 | snd_unregister_device(compr->direction, compr->card, compr->device); | ||
659 | return 0; | ||
660 | } | ||
661 | |||
662 | /* | ||
663 | * snd_compress_new: create new compress device | ||
664 | * @card: sound card pointer | ||
665 | * @device: device number | ||
666 | * @dirn: device direction, should be of type enum snd_compr_direction | ||
667 | * @compr: compress device pointer | ||
668 | */ | ||
669 | int snd_compress_new(struct snd_card *card, int device, | ||
670 | int dirn, struct snd_compr *compr) | ||
671 | { | ||
672 | static struct snd_device_ops ops = { | ||
673 | .dev_free = NULL, | ||
674 | .dev_register = snd_compress_dev_register, | ||
675 | .dev_disconnect = snd_compress_dev_disconnect, | ||
676 | }; | ||
677 | |||
678 | compr->card = card; | ||
679 | compr->device = device; | ||
680 | compr->direction = dirn; | ||
681 | return snd_device_new(card, SNDRV_DEV_COMPRESS, compr, &ops); | ||
682 | } | ||
683 | EXPORT_SYMBOL_GPL(snd_compress_new); | ||
684 | |||
685 | static int snd_compress_add_device(struct snd_compr *device) | ||
686 | { | ||
687 | int ret; | ||
688 | |||
689 | if (!device->card) | ||
690 | return -EINVAL; | ||
691 | |||
692 | /* register the card */ | ||
693 | ret = snd_card_register(device->card); | ||
694 | if (ret) | ||
695 | goto out; | ||
696 | return 0; | ||
697 | |||
698 | out: | ||
699 | pr_err("failed with %d\n", ret); | ||
700 | return ret; | ||
701 | |||
702 | } | ||
703 | |||
704 | static int snd_compress_remove_device(struct snd_compr *device) | ||
705 | { | ||
706 | return snd_card_free(device->card); | ||
707 | } | ||
708 | |||
709 | /** | ||
710 | * snd_compress_register - register compressed device | ||
711 | * | ||
712 | * @device: compressed device to register | ||
713 | */ | ||
714 | int snd_compress_register(struct snd_compr *device) | ||
715 | { | ||
716 | int retval; | ||
717 | |||
718 | if (device->name == NULL || device->dev == NULL || device->ops == NULL) | ||
719 | return -EINVAL; | ||
720 | |||
721 | pr_debug("Registering compressed device %s\n", device->name); | ||
722 | if (snd_BUG_ON(!device->ops->open)) | ||
723 | return -EINVAL; | ||
724 | if (snd_BUG_ON(!device->ops->free)) | ||
725 | return -EINVAL; | ||
726 | if (snd_BUG_ON(!device->ops->set_params)) | ||
727 | return -EINVAL; | ||
728 | if (snd_BUG_ON(!device->ops->trigger)) | ||
729 | return -EINVAL; | ||
730 | |||
731 | mutex_init(&device->lock); | ||
732 | |||
733 | /* register a compressed card */ | ||
734 | mutex_lock(&device_mutex); | ||
735 | retval = snd_compress_add_device(device); | ||
736 | mutex_unlock(&device_mutex); | ||
737 | return retval; | ||
738 | } | ||
739 | EXPORT_SYMBOL_GPL(snd_compress_register); | ||
740 | |||
741 | int snd_compress_deregister(struct snd_compr *device) | ||
742 | { | ||
743 | pr_debug("Removing compressed device %s\n", device->name); | ||
744 | mutex_lock(&device_mutex); | ||
745 | snd_compress_remove_device(device); | ||
746 | mutex_unlock(&device_mutex); | ||
747 | return 0; | ||
748 | } | ||
749 | EXPORT_SYMBOL_GPL(snd_compress_deregister); | ||
750 | |||
751 | static int __init snd_compress_init(void) | ||
752 | { | ||
753 | return 0; | ||
754 | } | ||
755 | |||
756 | static void __exit snd_compress_exit(void) | ||
757 | { | ||
758 | } | ||
759 | |||
760 | module_init(snd_compress_init); | ||
761 | module_exit(snd_compress_exit); | ||
762 | |||
763 | MODULE_DESCRIPTION("ALSA Compressed offload framework"); | ||
764 | MODULE_AUTHOR("Vinod Koul <vinod.koul@linux.intel.com>"); | ||
765 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 3cc4b86dfb7e..08fde0060fd9 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c | |||
@@ -47,7 +47,7 @@ | |||
47 | 47 | ||
48 | static int dsp_map[SNDRV_CARDS]; | 48 | static int dsp_map[SNDRV_CARDS]; |
49 | static int adsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1}; | 49 | static int adsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1}; |
50 | static int nonblock_open = 1; | 50 | static bool nonblock_open = 1; |
51 | 51 | ||
52 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Abramo Bagnara <abramo@alsa-project.org>"); | 52 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Abramo Bagnara <abramo@alsa-project.org>"); |
53 | MODULE_DESCRIPTION("PCM OSS emulation for ALSA."); | 53 | MODULE_DESCRIPTION("PCM OSS emulation for ALSA."); |
diff --git a/sound/core/seq/seq_dummy.c b/sound/core/seq/seq_dummy.c index b9b2235d9ab1..bbe32d2177d9 100644 --- a/sound/core/seq/seq_dummy.c +++ b/sound/core/seq/seq_dummy.c | |||
@@ -65,7 +65,7 @@ MODULE_LICENSE("GPL"); | |||
65 | MODULE_ALIAS("snd-seq-client-" __stringify(SNDRV_SEQ_CLIENT_DUMMY)); | 65 | MODULE_ALIAS("snd-seq-client-" __stringify(SNDRV_SEQ_CLIENT_DUMMY)); |
66 | 66 | ||
67 | static int ports = 1; | 67 | static int ports = 1; |
68 | static int duplex; | 68 | static bool duplex; |
69 | 69 | ||
70 | module_param(ports, int, 0444); | 70 | module_param(ports, int, 0444); |
71 | MODULE_PARM_DESC(ports, "number of ports to be created"); | 71 | MODULE_PARM_DESC(ports, "number of ports to be created"); |
diff --git a/sound/core/sound.c b/sound/core/sound.c index 828af353ea9f..28f35593a750 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
@@ -229,6 +229,7 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev) | |||
229 | case SNDRV_DEVICE_TYPE_RAWMIDI: | 229 | case SNDRV_DEVICE_TYPE_RAWMIDI: |
230 | case SNDRV_DEVICE_TYPE_PCM_PLAYBACK: | 230 | case SNDRV_DEVICE_TYPE_PCM_PLAYBACK: |
231 | case SNDRV_DEVICE_TYPE_PCM_CAPTURE: | 231 | case SNDRV_DEVICE_TYPE_PCM_CAPTURE: |
232 | case SNDRV_DEVICE_TYPE_COMPRESS: | ||
232 | if (snd_BUG_ON(!card)) | 233 | if (snd_BUG_ON(!card)) |
233 | return -EINVAL; | 234 | return -EINVAL; |
234 | minor = SNDRV_MINOR(card->number, type + dev); | 235 | minor = SNDRV_MINOR(card->number, type + dev); |
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index d83bafc5d8b5..ad079b63b8ba 100644 --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c | |||
@@ -51,7 +51,7 @@ MODULE_SUPPORTED_DEVICE("{{ALSA,Loopback soundcard}}"); | |||
51 | 51 | ||
52 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 52 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
53 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 53 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
54 | static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0}; | 54 | static bool enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0}; |
55 | static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8}; | 55 | static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8}; |
56 | static int pcm_notify[SNDRV_CARDS]; | 56 | static int pcm_notify[SNDRV_CARDS]; |
57 | 57 | ||
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index 97f1f93ed275..ad9434fd6370 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c | |||
@@ -60,15 +60,15 @@ MODULE_SUPPORTED_DEVICE("{{ALSA,Dummy soundcard}}"); | |||
60 | 60 | ||
61 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 61 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
62 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 62 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
63 | static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0}; | 63 | static bool enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0}; |
64 | static char *model[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = NULL}; | 64 | static char *model[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = NULL}; |
65 | static int pcm_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 65 | static int pcm_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
66 | static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8}; | 66 | static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8}; |
67 | //static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; | 67 | //static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; |
68 | #ifdef CONFIG_HIGH_RES_TIMERS | 68 | #ifdef CONFIG_HIGH_RES_TIMERS |
69 | static int hrtimer = 1; | 69 | static bool hrtimer = 1; |
70 | #endif | 70 | #endif |
71 | static int fake_buffer = 1; | 71 | static bool fake_buffer = 1; |
72 | 72 | ||
73 | module_param_array(index, int, NULL, 0444); | 73 | module_param_array(index, int, NULL, 0444); |
74 | MODULE_PARM_DESC(index, "Index value for dummy soundcard."); | 74 | MODULE_PARM_DESC(index, "Index value for dummy soundcard."); |
diff --git a/sound/drivers/ml403-ac97cr.c b/sound/drivers/ml403-ac97cr.c index 2ee82c5d9ee5..6c83b1aed288 100644 --- a/sound/drivers/ml403-ac97cr.c +++ b/sound/drivers/ml403-ac97cr.c | |||
@@ -73,7 +73,7 @@ MODULE_SUPPORTED_DEVICE("{{Xilinx,ML403 AC97 Controller Reference}}"); | |||
73 | 73 | ||
74 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 74 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
75 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 75 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
76 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; | 76 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; |
77 | 77 | ||
78 | module_param_array(index, int, NULL, 0444); | 78 | module_param_array(index, int, NULL, 0444); |
79 | MODULE_PARM_DESC(index, "Index value for ML403 AC97 Controller Reference."); | 79 | MODULE_PARM_DESC(index, "Index value for ML403 AC97 Controller Reference."); |
@@ -1341,15 +1341,4 @@ static struct platform_driver snd_ml403_ac97cr_driver = { | |||
1341 | }, | 1341 | }, |
1342 | }; | 1342 | }; |
1343 | 1343 | ||
1344 | static int __init alsa_card_ml403_ac97cr_init(void) | 1344 | module_platform_driver(snd_ml403_ac97cr_driver); |
1345 | { | ||
1346 | return platform_driver_register(&snd_ml403_ac97cr_driver); | ||
1347 | } | ||
1348 | |||
1349 | static void __exit alsa_card_ml403_ac97cr_exit(void) | ||
1350 | { | ||
1351 | platform_driver_unregister(&snd_ml403_ac97cr_driver); | ||
1352 | } | ||
1353 | |||
1354 | module_init(alsa_card_ml403_ac97cr_init) | ||
1355 | module_exit(alsa_card_ml403_ac97cr_exit) | ||
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index 257569014f23..86f5fbc2da72 100644 --- a/sound/drivers/mpu401/mpu401.c +++ b/sound/drivers/mpu401/mpu401.c | |||
@@ -35,13 +35,13 @@ MODULE_LICENSE("GPL"); | |||
35 | 35 | ||
36 | static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* exclude the first card */ | 36 | static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* exclude the first card */ |
37 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 37 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
38 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 38 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
39 | #ifdef CONFIG_PNP | 39 | #ifdef CONFIG_PNP |
40 | static int pnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 40 | static bool pnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
41 | #endif | 41 | #endif |
42 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* MPU-401 port number */ | 42 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* MPU-401 port number */ |
43 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* MPU-401 IRQ */ | 43 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* MPU-401 IRQ */ |
44 | static int uart_enter[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 44 | static bool uart_enter[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
45 | 45 | ||
46 | module_param_array(index, int, NULL, 0444); | 46 | module_param_array(index, int, NULL, 0444); |
47 | MODULE_PARM_DESC(index, "Index value for MPU-401 device."); | 47 | MODULE_PARM_DESC(index, "Index value for MPU-401 device."); |
diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index f24bf9a06cff..621e60e2029f 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c | |||
@@ -36,7 +36,7 @@ | |||
36 | 36 | ||
37 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 37 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
38 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 38 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
39 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 39 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
40 | 40 | ||
41 | static struct platform_device *platform_devices[SNDRV_CARDS]; | 41 | static struct platform_device *platform_devices[SNDRV_CARDS]; |
42 | static int device_count; | 42 | static int device_count; |
diff --git a/sound/drivers/opl3/opl3_midi.c b/sound/drivers/opl3/opl3_midi.c index 7d722a025d0d..2bfe4bcb7a7d 100644 --- a/sound/drivers/opl3/opl3_midi.c +++ b/sound/drivers/opl3/opl3_midi.c | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | extern char snd_opl3_regmap[MAX_OPL2_VOICES][4]; | 28 | extern char snd_opl3_regmap[MAX_OPL2_VOICES][4]; |
29 | 29 | ||
30 | extern int use_internal_drums; | 30 | extern bool use_internal_drums; |
31 | 31 | ||
32 | static void snd_opl3_note_off_unsafe(void *p, int note, int vel, | 32 | static void snd_opl3_note_off_unsafe(void *p, int note, int vel, |
33 | struct snd_midi_channel *chan); | 33 | struct snd_midi_channel *chan); |
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c index 723562e34fcc..68399538e435 100644 --- a/sound/drivers/opl3/opl3_seq.c +++ b/sound/drivers/opl3/opl3_seq.c | |||
@@ -32,7 +32,7 @@ MODULE_AUTHOR("Uros Bizjak <uros@kss-loka.si>"); | |||
32 | MODULE_LICENSE("GPL"); | 32 | MODULE_LICENSE("GPL"); |
33 | MODULE_DESCRIPTION("ALSA driver for OPL3 FM synth"); | 33 | MODULE_DESCRIPTION("ALSA driver for OPL3 FM synth"); |
34 | 34 | ||
35 | int use_internal_drums = 0; | 35 | bool use_internal_drums = 0; |
36 | module_param(use_internal_drums, bool, 0444); | 36 | module_param(use_internal_drums, bool, 0444); |
37 | MODULE_PARM_DESC(use_internal_drums, "Enable internal OPL2/3 drums."); | 37 | MODULE_PARM_DESC(use_internal_drums, "Enable internal OPL2/3 drums."); |
38 | 38 | ||
diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c index 946a0cb996a9..99704e6a2e26 100644 --- a/sound/drivers/pcsp/pcsp.c +++ b/sound/drivers/pcsp/pcsp.c | |||
@@ -25,8 +25,8 @@ MODULE_ALIAS("platform:pcspkr"); | |||
25 | 25 | ||
26 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ | 26 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
27 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ | 27 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
28 | static int enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */ | 28 | static bool enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */ |
29 | static int nopcm; /* Disable PCM capability of the driver */ | 29 | static bool nopcm; /* Disable PCM capability of the driver */ |
30 | 30 | ||
31 | module_param(index, int, 0444); | 31 | module_param(index, int, 0444); |
32 | MODULE_PARM_DESC(index, "Index value for pcsp soundcard."); | 32 | MODULE_PARM_DESC(index, "Index value for pcsp soundcard."); |
diff --git a/sound/drivers/pcsp/pcsp_lib.c b/sound/drivers/pcsp/pcsp_lib.c index ce9e7d170c0d..434981dd4a61 100644 --- a/sound/drivers/pcsp/pcsp_lib.c +++ b/sound/drivers/pcsp/pcsp_lib.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <asm/io.h> | 14 | #include <asm/io.h> |
15 | #include "pcsp.h" | 15 | #include "pcsp.h" |
16 | 16 | ||
17 | static int nforce_wa; | 17 | static bool nforce_wa; |
18 | module_param(nforce_wa, bool, 0444); | 18 | module_param(nforce_wa, bool, 0444); |
19 | MODULE_PARM_DESC(nforce_wa, "Apply NForce chipset workaround " | 19 | MODULE_PARM_DESC(nforce_wa, "Apply NForce chipset workaround " |
20 | "(expect bad sound)"); | 20 | "(expect bad sound)"); |
diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c index f664823a9635..3e32bd3d95d9 100644 --- a/sound/drivers/portman2x4.c +++ b/sound/drivers/portman2x4.c | |||
@@ -55,7 +55,7 @@ | |||
55 | 55 | ||
56 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 56 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
57 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 57 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
58 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 58 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
59 | 59 | ||
60 | static struct platform_device *platform_devices[SNDRV_CARDS]; | 60 | static struct platform_device *platform_devices[SNDRV_CARDS]; |
61 | static int device_count; | 61 | static int device_count; |
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 85aad43f0b1e..b2d0e8e49bed 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c | |||
@@ -69,7 +69,7 @@ static char *adaptor_names[] = { | |||
69 | 69 | ||
70 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 70 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
71 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 71 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
72 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 72 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
73 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x3f8,0x2f8,0x3e8,0x2e8 */ | 73 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x3f8,0x2f8,0x3e8,0x2e8 */ |
74 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 3,4,5,7,9,10,11,14,15 */ | 74 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 3,4,5,7,9,10,11,14,15 */ |
75 | static int speed[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 38400}; /* 9600,19200,38400,57600,115200 */ | 75 | static int speed[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 38400}; /* 9600,19200,38400,57600,115200 */ |
@@ -77,7 +77,7 @@ static int base[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 115200}; /* baud bas | |||
77 | static int outs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */ | 77 | static int outs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */ |
78 | static int ins[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */ | 78 | static int ins[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */ |
79 | static int adaptor[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = SNDRV_SERIAL_SOUNDCANVAS}; | 79 | static int adaptor[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = SNDRV_SERIAL_SOUNDCANVAS}; |
80 | static int droponfull[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS -1)] = SNDRV_SERIAL_NORMALBUFF }; | 80 | static bool droponfull[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS -1)] = SNDRV_SERIAL_NORMALBUFF }; |
81 | 81 | ||
82 | module_param_array(index, int, NULL, 0444); | 82 | module_param_array(index, int, NULL, 0444); |
83 | MODULE_PARM_DESC(index, "Index value for Serial MIDI."); | 83 | MODULE_PARM_DESC(index, "Index value for Serial MIDI."); |
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c index d79d6edc0f52..9d97478a18b3 100644 --- a/sound/drivers/virmidi.c +++ b/sound/drivers/virmidi.c | |||
@@ -63,7 +63,7 @@ MODULE_SUPPORTED_DEVICE("{{ALSA,Virtual rawmidi device}}"); | |||
63 | 63 | ||
64 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 64 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
65 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 65 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
66 | static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0}; | 66 | static bool enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0}; |
67 | static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4}; | 67 | static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4}; |
68 | 68 | ||
69 | module_param_array(index, int, NULL, 0444); | 69 | module_param_array(index, int, NULL, 0444); |
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c index cd44c74207d8..94b83b6e46a3 100644 --- a/sound/isa/ad1816a/ad1816a.c +++ b/sound/isa/ad1816a/ad1816a.c | |||
@@ -44,7 +44,7 @@ MODULE_SUPPORTED_DEVICE("{{Highscreen,Sound-Boostar 16 3D}," | |||
44 | 44 | ||
45 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */ | 45 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */ |
46 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 46 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
47 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ | 47 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ |
48 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 48 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
49 | static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 49 | static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
50 | static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 50 | static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c index 34ab69bdffc0..2af77faefbb1 100644 --- a/sound/isa/ad1848/ad1848.c +++ b/sound/isa/ad1848/ad1848.c | |||
@@ -43,11 +43,11 @@ MODULE_SUPPORTED_DEVICE("{{Analog Devices,AD1848}," | |||
43 | 43 | ||
44 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 44 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
45 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 45 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
46 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 46 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
47 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 47 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
48 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */ | 48 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */ |
49 | static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ | 49 | static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ |
50 | static int thinkpad[SNDRV_CARDS]; /* Thinkpad special case */ | 50 | static bool thinkpad[SNDRV_CARDS]; /* Thinkpad special case */ |
51 | 51 | ||
52 | module_param_array(index, int, NULL, 0444); | 52 | module_param_array(index, int, NULL, 0444); |
53 | MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard."); | 53 | MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard."); |
diff --git a/sound/isa/adlib.c b/sound/isa/adlib.c index 7465ae036e0b..4d50c69f3290 100644 --- a/sound/isa/adlib.c +++ b/sound/isa/adlib.c | |||
@@ -18,7 +18,7 @@ MODULE_LICENSE("GPL"); | |||
18 | 18 | ||
19 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 19 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
20 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 20 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
21 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; | 21 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; |
22 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; | 22 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; |
23 | 23 | ||
24 | module_param_array(index, int, NULL, 0444); | 24 | module_param_array(index, int, NULL, 0444); |
diff --git a/sound/isa/als100.c b/sound/isa/als100.c index fc5b38fd2652..d1f4351fb6ee 100644 --- a/sound/isa/als100.c +++ b/sound/isa/als100.c | |||
@@ -54,7 +54,7 @@ MODULE_LICENSE("GPL"); | |||
54 | 54 | ||
55 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 55 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
56 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 56 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
57 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 57 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
58 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 58 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
59 | static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 59 | static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
60 | static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 60 | static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
diff --git a/sound/isa/azt2320.c b/sound/isa/azt2320.c index e55f3ebe87b9..6a2c78ef1d8f 100644 --- a/sound/isa/azt2320.c +++ b/sound/isa/azt2320.c | |||
@@ -55,7 +55,7 @@ MODULE_SUPPORTED_DEVICE("{{Aztech Systems,PRO16V}," | |||
55 | 55 | ||
56 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 56 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
57 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 57 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
58 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ | 58 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ |
59 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 59 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
60 | static long wss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 60 | static long wss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
61 | static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 61 | static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index c94578d40b1a..7bd5e337ee93 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c | |||
@@ -69,9 +69,9 @@ MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8330,isapnp:{CMI0001,@@@0001,@X@0001}}}"); | |||
69 | 69 | ||
70 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 70 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
71 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 71 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
72 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; | 72 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; |
73 | #ifdef CONFIG_PNP | 73 | #ifdef CONFIG_PNP |
74 | static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 74 | static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
75 | #endif | 75 | #endif |
76 | static long sbport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; | 76 | static long sbport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; |
77 | static int sbirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; | 77 | static int sbirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; |
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c index 6d81fa75c33d..99dda45e82f5 100644 --- a/sound/isa/cs423x/cs4231.c +++ b/sound/isa/cs423x/cs4231.c | |||
@@ -41,7 +41,7 @@ MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4231}}"); | |||
41 | 41 | ||
42 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 42 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
43 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 43 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
44 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 44 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
45 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 45 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
46 | static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 46 | static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
47 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */ | 47 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */ |
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index f5a94b6e6245..740c51a1ed7b 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c | |||
@@ -74,9 +74,9 @@ MODULE_ALIAS("snd_cs4232"); | |||
74 | 74 | ||
75 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 75 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
76 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 76 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
77 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ | 77 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ |
78 | #ifdef CONFIG_PNP | 78 | #ifdef CONFIG_PNP |
79 | static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 79 | static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
80 | #endif | 80 | #endif |
81 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 81 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
82 | static long cport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 82 | static long cport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c index 9a1a6f2c4484..b036e60f62d1 100644 --- a/sound/isa/es1688/es1688.c +++ b/sound/isa/es1688/es1688.c | |||
@@ -51,9 +51,9 @@ MODULE_ALIAS("snd_es968"); | |||
51 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 51 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
52 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 52 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
53 | #ifdef CONFIG_PNP | 53 | #ifdef CONFIG_PNP |
54 | static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; | 54 | static bool isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; |
55 | #endif | 55 | #endif |
56 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 56 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
57 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ | 57 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ |
58 | static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* Usually 0x388 */ | 58 | static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* Usually 0x388 */ |
59 | static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; | 59 | static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; |
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index 98e3ac1cfa08..c20baafd9b7c 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c | |||
@@ -1964,9 +1964,9 @@ MODULE_SUPPORTED_DEVICE("{{ESS,ES1868 PnP AudioDrive}," | |||
1964 | 1964 | ||
1965 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 1965 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
1966 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 1966 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
1967 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ | 1967 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ |
1968 | #ifdef CONFIG_PNP | 1968 | #ifdef CONFIG_PNP |
1969 | static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; | 1969 | static bool isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; |
1970 | #endif | 1970 | #endif |
1971 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */ | 1971 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */ |
1972 | #ifndef CONFIG_PNP | 1972 | #ifndef CONFIG_PNP |
diff --git a/sound/isa/galaxy/galaxy.c b/sound/isa/galaxy/galaxy.c index e51d3244742a..55e20782858d 100644 --- a/sound/isa/galaxy/galaxy.c +++ b/sound/isa/galaxy/galaxy.c | |||
@@ -35,7 +35,7 @@ MODULE_LICENSE("GPL"); | |||
35 | 35 | ||
36 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 36 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
37 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 37 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
38 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; | 38 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; |
39 | 39 | ||
40 | module_param_array(index, int, NULL, 0444); | 40 | module_param_array(index, int, NULL, 0444); |
41 | MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard."); | 41 | MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard."); |
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c index d7296500bce8..bf6333671613 100644 --- a/sound/isa/gus/gusclassic.c +++ b/sound/isa/gus/gusclassic.c | |||
@@ -42,7 +42,7 @@ MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Classic}}"); | |||
42 | 42 | ||
43 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 43 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
44 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 44 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
45 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 45 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
46 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */ | 46 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */ |
47 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 3,5,9,11,12,15 */ | 47 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 3,5,9,11,12,15 */ |
48 | static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3,5,6,7 */ | 48 | static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3,5,6,7 */ |
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c index 597accdb15d2..bc10cc26e5f9 100644 --- a/sound/isa/gus/gusextreme.c +++ b/sound/isa/gus/gusextreme.c | |||
@@ -46,7 +46,7 @@ MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Extreme}}"); | |||
46 | 46 | ||
47 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 47 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
48 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 48 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
49 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 49 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
50 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ | 50 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ |
51 | static long gf1_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x210,0x220,0x230,0x240,0x250,0x260,0x270 */ | 51 | static long gf1_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x210,0x220,0x230,0x240,0x250,0x260,0x270 */ |
52 | static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x300,0x310,0x320 */ | 52 | static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x300,0x310,0x320 */ |
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c index 933cb0f4c549..41c3f448745f 100644 --- a/sound/isa/gus/gusmax.c +++ b/sound/isa/gus/gusmax.c | |||
@@ -40,7 +40,7 @@ MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound MAX}}"); | |||
40 | 40 | ||
41 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 41 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
42 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 42 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
43 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 43 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
44 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */ | 44 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */ |
45 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,3,5,9,11,12,15 */ | 45 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,3,5,9,11,12,15 */ |
46 | static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3,5,6,7 */ | 46 | static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3,5,6,7 */ |
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index 8e7e19484dac..a76bc8d27c1d 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c | |||
@@ -55,9 +55,9 @@ MODULE_SUPPORTED_DEVICE("{{AMD,InterWave STB with TEA6330T}}"); | |||
55 | 55 | ||
56 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 56 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
57 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 57 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
58 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ | 58 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ |
59 | #ifdef CONFIG_PNP | 59 | #ifdef CONFIG_PNP |
60 | static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 60 | static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
61 | #endif | 61 | #endif |
62 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x210,0x220,0x230,0x240,0x250,0x260 */ | 62 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x210,0x220,0x230,0x240,0x250,0x260 */ |
63 | #ifdef SNDRV_STB | 63 | #ifdef SNDRV_STB |
diff --git a/sound/isa/msnd/msnd_pinnacle.c b/sound/isa/msnd/msnd_pinnacle.c index 0961e2cf20ca..29cc8e162b02 100644 --- a/sound/isa/msnd/msnd_pinnacle.c +++ b/sound/isa/msnd/msnd_pinnacle.c | |||
@@ -785,7 +785,7 @@ static int write_ndelay[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 1 }; | |||
785 | static int calibrate_signal; | 785 | static int calibrate_signal; |
786 | 786 | ||
787 | #ifdef CONFIG_PNP | 787 | #ifdef CONFIG_PNP |
788 | static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 788 | static bool isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
789 | module_param_array(isapnp, bool, NULL, 0444); | 789 | module_param_array(isapnp, bool, NULL, 0444); |
790 | MODULE_PARM_DESC(isapnp, "ISA PnP detection for specified soundcard."); | 790 | MODULE_PARM_DESC(isapnp, "ISA PnP detection for specified soundcard."); |
791 | #define has_isapnp(x) isapnp[x] | 791 | #define has_isapnp(x) isapnp[x] |
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 64a9a2177f4b..f6cc0b917ef0 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c | |||
@@ -46,9 +46,9 @@ MODULE_SUPPORTED_DEVICE("{{Yamaha,YMF719E-S}," | |||
46 | 46 | ||
47 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 47 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
48 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 48 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
49 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ | 49 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ |
50 | #ifdef CONFIG_PNP | 50 | #ifdef CONFIG_PNP |
51 | static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 51 | static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
52 | #endif | 52 | #endif |
53 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0xf86,0x370,0x100 */ | 53 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0xf86,0x370,0x100 */ |
54 | static long sb_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ | 54 | static long sb_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ |
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c index 3785b7a784c9..c24594c866f4 100644 --- a/sound/isa/opti9xx/miro.c +++ b/sound/isa/opti9xx/miro.c | |||
@@ -61,7 +61,7 @@ static int dma2 = SNDRV_DEFAULT_DMA1; /* 0,1,3 */ | |||
61 | static int wss; | 61 | static int wss; |
62 | static int ide; | 62 | static int ide; |
63 | #ifdef CONFIG_PNP | 63 | #ifdef CONFIG_PNP |
64 | static int isapnp = 1; /* Enable ISA PnP detection */ | 64 | static bool isapnp = 1; /* Enable ISA PnP detection */ |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | module_param(index, int, 0444); | 67 | module_param(index, int, 0444); |
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index 97871bebea90..babaedd242f7 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -63,7 +63,7 @@ MODULE_SUPPORTED_DEVICE("{{OPTi,82C924 (AD1848)}," | |||
63 | 63 | ||
64 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ | 64 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
65 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ | 65 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
66 | //static int enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */ | 66 | //static bool enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */ |
67 | #ifdef CONFIG_PNP | 67 | #ifdef CONFIG_PNP |
68 | static int isapnp = 1; /* Enable ISA PnP detection */ | 68 | static int isapnp = 1; /* Enable ISA PnP detection */ |
69 | #endif | 69 | #endif |
diff --git a/sound/isa/sb/jazz16.c b/sound/isa/sb/jazz16.c index 54e3c2c18060..410758c68090 100644 --- a/sound/isa/sb/jazz16.c +++ b/sound/isa/sb/jazz16.c | |||
@@ -36,7 +36,7 @@ MODULE_LICENSE("GPL"); | |||
36 | 36 | ||
37 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 37 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
38 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 38 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
39 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 39 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
40 | static unsigned long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; | 40 | static unsigned long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; |
41 | static unsigned long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; | 41 | static unsigned long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; |
42 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; | 42 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; |
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c index 115c7748204f..39b8eca15213 100644 --- a/sound/isa/sb/sb16.c +++ b/sound/isa/sb/sb16.c | |||
@@ -68,9 +68,9 @@ MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB AWE 32}," | |||
68 | 68 | ||
69 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 69 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
70 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 70 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
71 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ | 71 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ |
72 | #ifdef CONFIG_PNP | 72 | #ifdef CONFIG_PNP |
73 | static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 73 | static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
74 | #endif | 74 | #endif |
75 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */ | 75 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */ |
76 | static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x330,0x300 */ | 76 | static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x330,0x300 */ |
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c index 453ef283491d..ab5cebea52e1 100644 --- a/sound/isa/sb/sb8.c +++ b/sound/isa/sb/sb8.c | |||
@@ -36,7 +36,7 @@ MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB 1.0/SB 2.0/SB Pro}}"); | |||
36 | 36 | ||
37 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 37 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
38 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 38 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
39 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 39 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
40 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ | 40 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ |
41 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ | 41 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ |
42 | static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3 */ | 42 | static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3 */ |
diff --git a/sound/isa/sc6000.c b/sound/isa/sc6000.c index 207c161f100c..d97d0f381817 100644 --- a/sound/isa/sc6000.c +++ b/sound/isa/sc6000.c | |||
@@ -48,7 +48,7 @@ MODULE_SUPPORTED_DEVICE("{{Gallant, SC-6000}," | |||
48 | 48 | ||
49 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 49 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
50 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 50 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
51 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 51 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
52 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220, 0x240 */ | 52 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220, 0x240 */ |
53 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 11 */ | 53 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 11 */ |
54 | static long mss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x530, 0xe80 */ | 54 | static long mss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x530, 0xe80 */ |
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c index 150b96b3ea10..e0a73271cb91 100644 --- a/sound/isa/wavefront/wavefront.c +++ b/sound/isa/wavefront/wavefront.c | |||
@@ -38,9 +38,9 @@ MODULE_SUPPORTED_DEVICE("{{Turtle Beach,Maui/Tropez/Tropez+}}"); | |||
38 | 38 | ||
39 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 39 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
40 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 40 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
41 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 41 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
42 | #ifdef CONFIG_PNP | 42 | #ifdef CONFIG_PNP |
43 | static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 43 | static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
44 | #endif | 44 | #endif |
45 | static long cs4232_pcm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 45 | static long cs4232_pcm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
46 | static int cs4232_pcm_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */ | 46 | static int cs4232_pcm_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */ |
@@ -51,7 +51,7 @@ static int ics2115_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,9,11,12,15 */ | |||
51 | static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ | 51 | static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ |
52 | static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ | 52 | static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ |
53 | static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ | 53 | static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ |
54 | static int use_cs4232_midi[SNDRV_CARDS]; | 54 | static bool use_cs4232_midi[SNDRV_CARDS]; |
55 | 55 | ||
56 | module_param_array(index, int, NULL, 0444); | 56 | module_param_array(index, int, NULL, 0444); |
57 | MODULE_PARM_DESC(index, "Index value for WaveFront soundcard."); | 57 | MODULE_PARM_DESC(index, "Index value for WaveFront soundcard."); |
diff --git a/sound/mips/hal2.c b/sound/mips/hal2.c index 2e6c85894e0b..5f88d1f09ffe 100644 --- a/sound/mips/hal2.c +++ b/sound/mips/hal2.c | |||
@@ -935,15 +935,4 @@ static struct platform_driver hal2_driver = { | |||
935 | } | 935 | } |
936 | }; | 936 | }; |
937 | 937 | ||
938 | static int __init alsa_card_hal2_init(void) | 938 | module_platform_driver(hal2_driver); |
939 | { | ||
940 | return platform_driver_register(&hal2_driver); | ||
941 | } | ||
942 | |||
943 | static void __exit alsa_card_hal2_exit(void) | ||
944 | { | ||
945 | platform_driver_unregister(&hal2_driver); | ||
946 | } | ||
947 | |||
948 | module_init(alsa_card_hal2_init); | ||
949 | module_exit(alsa_card_hal2_exit); | ||
diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c index 69425d4c91fd..ceaa593ea4ef 100644 --- a/sound/mips/sgio2audio.c +++ b/sound/mips/sgio2audio.c | |||
@@ -976,15 +976,4 @@ static struct platform_driver sgio2audio_driver = { | |||
976 | } | 976 | } |
977 | }; | 977 | }; |
978 | 978 | ||
979 | static int __init alsa_card_sgio2audio_init(void) | 979 | module_platform_driver(sgio2audio_driver); |
980 | { | ||
981 | return platform_driver_register(&sgio2audio_driver); | ||
982 | } | ||
983 | |||
984 | static void __exit alsa_card_sgio2audio_exit(void) | ||
985 | { | ||
986 | platform_driver_unregister(&sgio2audio_driver); | ||
987 | } | ||
988 | |||
989 | module_init(alsa_card_sgio2audio_init) | ||
990 | module_exit(alsa_card_sgio2audio_exit) | ||
diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c index 8a197fd3c57e..98d23bdcaf21 100644 --- a/sound/oss/ad1848.c +++ b/sound/oss/ad1848.c | |||
@@ -119,9 +119,9 @@ ad1848_port_info; | |||
119 | static struct address_info cfg; | 119 | static struct address_info cfg; |
120 | static int nr_ad1848_devs; | 120 | static int nr_ad1848_devs; |
121 | 121 | ||
122 | static int deskpro_xl; | 122 | static bool deskpro_xl; |
123 | static int deskpro_m; | 123 | static bool deskpro_m; |
124 | static int soundpro; | 124 | static bool soundpro; |
125 | 125 | ||
126 | static volatile signed char irq2dev[17] = { | 126 | static volatile signed char irq2dev[17] = { |
127 | -1, -1, -1, -1, -1, -1, -1, -1, | 127 | -1, -1, -1, -1, -1, -1, -1, -1, |
@@ -177,7 +177,7 @@ static struct { | |||
177 | #ifdef CONFIG_PNP | 177 | #ifdef CONFIG_PNP |
178 | static int isapnp = 1; | 178 | static int isapnp = 1; |
179 | static int isapnpjump; | 179 | static int isapnpjump; |
180 | static int reverse; | 180 | static bool reverse; |
181 | 181 | ||
182 | static int audio_activated; | 182 | static int audio_activated; |
183 | #else | 183 | #else |
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c index 7b5c77b32a90..eba734560f6f 100644 --- a/sound/oss/msnd_pinnacle.c +++ b/sound/oss/msnd_pinnacle.c | |||
@@ -1701,7 +1701,7 @@ static int joystick_io __initdata = CONFIG_MSNDPIN_JOYSTICK_IO; | |||
1701 | #ifndef CONFIG_MSNDPIN_DIGITAL | 1701 | #ifndef CONFIG_MSNDPIN_DIGITAL |
1702 | # define CONFIG_MSNDPIN_DIGITAL 0 | 1702 | # define CONFIG_MSNDPIN_DIGITAL 0 |
1703 | #endif | 1703 | #endif |
1704 | static int digital __initdata = CONFIG_MSNDPIN_DIGITAL; | 1704 | static bool digital __initdata = CONFIG_MSNDPIN_DIGITAL; |
1705 | 1705 | ||
1706 | #endif /* MSND_CLASSIC */ | 1706 | #endif /* MSND_CLASSIC */ |
1707 | 1707 | ||
diff --git a/sound/oss/pas2_card.c b/sound/oss/pas2_card.c index 7f377ec3486d..dabf8a871dcc 100644 --- a/sound/oss/pas2_card.c +++ b/sound/oss/pas2_card.c | |||
@@ -41,19 +41,19 @@ static int pas_irq; | |||
41 | static int pas_sb_base; | 41 | static int pas_sb_base; |
42 | DEFINE_SPINLOCK(pas_lock); | 42 | DEFINE_SPINLOCK(pas_lock); |
43 | #ifndef CONFIG_PAS_JOYSTICK | 43 | #ifndef CONFIG_PAS_JOYSTICK |
44 | static int joystick; | 44 | static bool joystick; |
45 | #else | 45 | #else |
46 | static int joystick = 1; | 46 | static bool joystick = 1; |
47 | #endif | 47 | #endif |
48 | #ifdef SYMPHONY_PAS | 48 | #ifdef SYMPHONY_PAS |
49 | static int symphony = 1; | 49 | static bool symphony = 1; |
50 | #else | 50 | #else |
51 | static int symphony; | 51 | static bool symphony; |
52 | #endif | 52 | #endif |
53 | #ifdef BROKEN_BUS_CLOCK | 53 | #ifdef BROKEN_BUS_CLOCK |
54 | static int broken_bus_clock = 1; | 54 | static bool broken_bus_clock = 1; |
55 | #else | 55 | #else |
56 | static int broken_bus_clock; | 56 | static bool broken_bus_clock; |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | static struct address_info cfg; | 59 | static struct address_info cfg; |
diff --git a/sound/oss/pss.c b/sound/oss/pss.c index 2fc0624024b5..0f32a561f15f 100644 --- a/sound/oss/pss.c +++ b/sound/oss/pss.c | |||
@@ -117,9 +117,9 @@ | |||
117 | 117 | ||
118 | /* If compiled into kernel, it enable or disable pss mixer */ | 118 | /* If compiled into kernel, it enable or disable pss mixer */ |
119 | #ifdef CONFIG_PSS_MIXER | 119 | #ifdef CONFIG_PSS_MIXER |
120 | static int pss_mixer = 1; | 120 | static bool pss_mixer = 1; |
121 | #else | 121 | #else |
122 | static int pss_mixer; | 122 | static bool pss_mixer; |
123 | #endif | 123 | #endif |
124 | 124 | ||
125 | 125 | ||
@@ -147,7 +147,7 @@ static DEFINE_SPINLOCK(lock); | |||
147 | static int pss_initialized; | 147 | static int pss_initialized; |
148 | static int nonstandard_microcode; | 148 | static int nonstandard_microcode; |
149 | static int pss_cdrom_port = -1; /* Parameter for the PSS cdrom port */ | 149 | static int pss_cdrom_port = -1; /* Parameter for the PSS cdrom port */ |
150 | static int pss_enable_joystick; /* Parameter for enabling the joystick */ | 150 | static bool pss_enable_joystick; /* Parameter for enabling the joystick */ |
151 | static coproc_operations pss_coproc_operations; | 151 | static coproc_operations pss_coproc_operations; |
152 | 152 | ||
153 | static void pss_write(pss_confdata *devc, int data) | 153 | static void pss_write(pss_confdata *devc, int data) |
@@ -1133,8 +1133,8 @@ static int mss_irq __initdata = -1; | |||
1133 | static int mss_dma __initdata = -1; | 1133 | static int mss_dma __initdata = -1; |
1134 | static int mpu_io __initdata = -1; | 1134 | static int mpu_io __initdata = -1; |
1135 | static int mpu_irq __initdata = -1; | 1135 | static int mpu_irq __initdata = -1; |
1136 | static int pss_no_sound = 0; /* Just configure non-sound components */ | 1136 | static bool pss_no_sound = 0; /* Just configure non-sound components */ |
1137 | static int pss_keep_settings = 1; /* Keep hardware settings at module exit */ | 1137 | static bool pss_keep_settings = 1; /* Keep hardware settings at module exit */ |
1138 | static char *pss_firmware = "/etc/sound/pss_synth"; | 1138 | static char *pss_firmware = "/etc/sound/pss_synth"; |
1139 | 1139 | ||
1140 | module_param(pss_io, int, 0); | 1140 | module_param(pss_io, int, 0); |
diff --git a/sound/oss/trix.c b/sound/oss/trix.c index e04169e8e3f8..944e0c015485 100644 --- a/sound/oss/trix.c +++ b/sound/oss/trix.c | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | static int mpu; | 32 | static int mpu; |
33 | 33 | ||
34 | static int joystick; | 34 | static bool joystick; |
35 | 35 | ||
36 | static unsigned char trix_read(int addr) | 36 | static unsigned char trix_read(int addr) |
37 | { | 37 | { |
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index fac51eef2725..9473fca9681d 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c | |||
@@ -42,7 +42,7 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); | |||
42 | MODULE_DESCRIPTION("Universal interface for Audio Codec '97"); | 42 | MODULE_DESCRIPTION("Universal interface for Audio Codec '97"); |
43 | MODULE_LICENSE("GPL"); | 43 | MODULE_LICENSE("GPL"); |
44 | 44 | ||
45 | static int enable_loopback; | 45 | static bool enable_loopback; |
46 | 46 | ||
47 | module_param(enable_loopback, bool, 0444); | 47 | module_param(enable_loopback, bool, 0444); |
48 | MODULE_PARM_DESC(enable_loopback, "Enable AC97 ADC/DAC Loopback Control"); | 48 | MODULE_PARM_DESC(enable_loopback, "Enable AC97 ADC/DAC Loopback Control"); |
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c index 6e311184bb10..9d91d61902b4 100644 --- a/sound/pci/ad1889.c +++ b/sound/pci/ad1889.c | |||
@@ -66,7 +66,7 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | |||
66 | module_param_array(id, charp, NULL, 0444); | 66 | module_param_array(id, charp, NULL, 0444); |
67 | MODULE_PARM_DESC(id, "ID string for the AD1889 soundcard."); | 67 | MODULE_PARM_DESC(id, "ID string for the AD1889 soundcard."); |
68 | 68 | ||
69 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 69 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
70 | module_param_array(enable, bool, NULL, 0444); | 70 | module_param_array(enable, bool, NULL, 0444); |
71 | MODULE_PARM_DESC(enable, "Enable AD1889 soundcard."); | 71 | MODULE_PARM_DESC(enable, "Enable AD1889 soundcard."); |
72 | 72 | ||
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index ef85ac5d9007..bdd6164e9c7e 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c | |||
@@ -48,7 +48,7 @@ MODULE_SUPPORTED_DEVICE("{{ALI,M5451,pci},{ALI,M5451}}"); | |||
48 | static int index = SNDRV_DEFAULT_IDX1; /* Index */ | 48 | static int index = SNDRV_DEFAULT_IDX1; /* Index */ |
49 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ | 49 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
50 | static int pcm_channels = 32; | 50 | static int pcm_channels = 32; |
51 | static int spdif; | 51 | static bool spdif; |
52 | 52 | ||
53 | module_param(index, int, 0444); | 53 | module_param(index, int, 0444); |
54 | MODULE_PARM_DESC(index, "Index value for ALI M5451 PCI Audio."); | 54 | MODULE_PARM_DESC(index, "Index value for ALI M5451 PCI Audio."); |
@@ -60,7 +60,7 @@ module_param(spdif, bool, 0444); | |||
60 | MODULE_PARM_DESC(spdif, "Support SPDIF I/O"); | 60 | MODULE_PARM_DESC(spdif, "Support SPDIF I/O"); |
61 | 61 | ||
62 | /* just for backward compatibility */ | 62 | /* just for backward compatibility */ |
63 | static int enable; | 63 | static bool enable; |
64 | module_param(enable, bool, 0444); | 64 | module_param(enable, bool, 0444); |
65 | 65 | ||
66 | 66 | ||
diff --git a/sound/pci/als300.c b/sound/pci/als300.c index 8dc77a0a5d8b..8196e229b2df 100644 --- a/sound/pci/als300.c +++ b/sound/pci/als300.c | |||
@@ -115,7 +115,14 @@ MODULE_SUPPORTED_DEVICE("{{Avance Logic,ALS300},{Avance Logic,ALS300+}}"); | |||
115 | 115 | ||
116 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 116 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
117 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 117 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
118 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 118 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
119 | |||
120 | module_param_array(index, int, NULL, 0444); | ||
121 | MODULE_PARM_DESC(index, "Index value for ALS300 sound card."); | ||
122 | module_param_array(id, charp, NULL, 0444); | ||
123 | MODULE_PARM_DESC(id, "ID string for ALS300 sound card."); | ||
124 | module_param_array(enable, bool, NULL, 0444); | ||
125 | MODULE_PARM_DESC(enable, "Enable ALS300 sound card."); | ||
119 | 126 | ||
120 | struct snd_als300 { | 127 | struct snd_als300 { |
121 | unsigned long port; | 128 | unsigned long port; |
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c index 28ef40e01cc2..3269b8011ea9 100644 --- a/sound/pci/als4000.c +++ b/sound/pci/als4000.c | |||
@@ -90,7 +90,7 @@ MODULE_SUPPORTED_DEVICE("{{Avance Logic,ALS4000}}"); | |||
90 | 90 | ||
91 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 91 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
92 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 92 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
93 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 93 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
94 | #ifdef SUPPORT_JOYSTICK | 94 | #ifdef SUPPORT_JOYSTICK |
95 | static int joystick_port[SNDRV_CARDS]; | 95 | static int joystick_port[SNDRV_CARDS]; |
96 | #endif | 96 | #endif |
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index f4b9e2b7ae87..e8de831f98bc 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c | |||
@@ -23,8 +23,11 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "hpi_internal.h" | 25 | #include "hpi_internal.h" |
26 | #include "hpi_version.h" | ||
26 | #include "hpimsginit.h" | 27 | #include "hpimsginit.h" |
27 | #include "hpioctl.h" | 28 | #include "hpioctl.h" |
29 | #include "hpicmn.h" | ||
30 | |||
28 | 31 | ||
29 | #include <linux/pci.h> | 32 | #include <linux/pci.h> |
30 | #include <linux/init.h> | 33 | #include <linux/init.h> |
@@ -44,7 +47,8 @@ | |||
44 | 47 | ||
45 | MODULE_LICENSE("GPL"); | 48 | MODULE_LICENSE("GPL"); |
46 | MODULE_AUTHOR("AudioScience inc. <support@audioscience.com>"); | 49 | MODULE_AUTHOR("AudioScience inc. <support@audioscience.com>"); |
47 | MODULE_DESCRIPTION("AudioScience ALSA ASI5000 ASI6000 ASI87xx ASI89xx"); | 50 | MODULE_DESCRIPTION("AudioScience ALSA ASI5000 ASI6000 ASI87xx ASI89xx " |
51 | HPI_VER_STRING); | ||
48 | 52 | ||
49 | #if defined CONFIG_SND_DEBUG_VERBOSE | 53 | #if defined CONFIG_SND_DEBUG_VERBOSE |
50 | /** | 54 | /** |
@@ -63,8 +67,8 @@ MODULE_DESCRIPTION("AudioScience ALSA ASI5000 ASI6000 ASI87xx ASI89xx"); | |||
63 | 67 | ||
64 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* index 0-MAX */ | 68 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* index 0-MAX */ |
65 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 69 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
66 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 70 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
67 | static int enable_hpi_hwdep = 1; | 71 | static bool enable_hpi_hwdep = 1; |
68 | 72 | ||
69 | module_param_array(index, int, NULL, S_IRUGO); | 73 | module_param_array(index, int, NULL, S_IRUGO); |
70 | MODULE_PARM_DESC(index, "ALSA index value for AudioScience soundcard."); | 74 | MODULE_PARM_DESC(index, "ALSA index value for AudioScience soundcard."); |
@@ -119,12 +123,7 @@ struct clk_cache { | |||
119 | struct snd_card_asihpi { | 123 | struct snd_card_asihpi { |
120 | struct snd_card *card; | 124 | struct snd_card *card; |
121 | struct pci_dev *pci; | 125 | struct pci_dev *pci; |
122 | u16 adapter_index; | 126 | struct hpi_adapter *hpi; |
123 | u32 serial_number; | ||
124 | u16 type; | ||
125 | u16 version; | ||
126 | u16 num_outstreams; | ||
127 | u16 num_instreams; | ||
128 | 127 | ||
129 | u32 h_mixer; | 128 | u32 h_mixer; |
130 | struct clk_cache cc; | 129 | struct clk_cache cc; |
@@ -135,6 +134,8 @@ struct snd_card_asihpi { | |||
135 | u16 update_interval_frames; | 134 | u16 update_interval_frames; |
136 | u16 in_max_chans; | 135 | u16 in_max_chans; |
137 | u16 out_max_chans; | 136 | u16 out_max_chans; |
137 | u16 in_min_chans; | ||
138 | u16 out_min_chans; | ||
138 | }; | 139 | }; |
139 | 140 | ||
140 | /* Per stream data */ | 141 | /* Per stream data */ |
@@ -495,6 +496,7 @@ static int snd_card_asihpi_pcm_hw_params(struct snd_pcm_substream *substream, | |||
495 | 496 | ||
496 | snd_printdd("stream_host_buffer_attach status 0x%x\n", | 497 | snd_printdd("stream_host_buffer_attach status 0x%x\n", |
497 | dpcm->hpi_buffer_attached); | 498 | dpcm->hpi_buffer_attached); |
499 | |||
498 | } | 500 | } |
499 | bytes_per_sec = params_rate(params) * params_channels(params); | 501 | bytes_per_sec = params_rate(params) * params_channels(params); |
500 | width = snd_pcm_format_width(params_format(params)); | 502 | width = snd_pcm_format_width(params_format(params)); |
@@ -757,8 +759,7 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
757 | if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 759 | if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
758 | pcm_buf_dma_ofs = ds->pcm_buf_host_rw_ofs - bytes_avail; | 760 | pcm_buf_dma_ofs = ds->pcm_buf_host_rw_ofs - bytes_avail; |
759 | if (state == HPI_STATE_STOPPED) { | 761 | if (state == HPI_STATE_STOPPED) { |
760 | if ((bytes_avail == 0) && | 762 | if (bytes_avail == 0) { |
761 | (on_card_bytes < ds->pcm_buf_host_rw_ofs)) { | ||
762 | hpi_handle_error(hpi_stream_start(ds->h_stream)); | 763 | hpi_handle_error(hpi_stream_start(ds->h_stream)); |
763 | snd_printdd("P%d start\n", s->number); | 764 | snd_printdd("P%d start\n", s->number); |
764 | ds->drained_count = 0; | 765 | ds->drained_count = 0; |
@@ -767,7 +768,7 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
767 | snd_printd(KERN_WARNING "P%d drained\n", | 768 | snd_printd(KERN_WARNING "P%d drained\n", |
768 | s->number); | 769 | s->number); |
769 | ds->drained_count++; | 770 | ds->drained_count++; |
770 | if (ds->drained_count > 2) { | 771 | if (ds->drained_count > 20) { |
771 | snd_pcm_stop(s, SNDRV_PCM_STATE_XRUN); | 772 | snd_pcm_stop(s, SNDRV_PCM_STATE_XRUN); |
772 | continue; | 773 | continue; |
773 | } | 774 | } |
@@ -888,8 +889,8 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
888 | pd, xfer2)); | 889 | pd, xfer2)); |
889 | } | 890 | } |
890 | } | 891 | } |
891 | ds->pcm_buf_host_rw_ofs = ds->pcm_buf_host_rw_ofs + xfercount; | 892 | ds->pcm_buf_host_rw_ofs += xfercount; |
892 | ds->pcm_buf_elapsed_dma_ofs = pcm_buf_dma_ofs; | 893 | ds->pcm_buf_elapsed_dma_ofs += xfercount; |
893 | snd_pcm_period_elapsed(s); | 894 | snd_pcm_period_elapsed(s); |
894 | } | 895 | } |
895 | } | 896 | } |
@@ -902,7 +903,9 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
902 | static int snd_card_asihpi_playback_ioctl(struct snd_pcm_substream *substream, | 903 | static int snd_card_asihpi_playback_ioctl(struct snd_pcm_substream *substream, |
903 | unsigned int cmd, void *arg) | 904 | unsigned int cmd, void *arg) |
904 | { | 905 | { |
905 | snd_printddd(KERN_INFO "P%d ioctl %d\n", substream->number, cmd); | 906 | char name[16]; |
907 | snd_pcm_debug_name(substream, name, sizeof(name)); | ||
908 | snd_printddd(KERN_INFO "%s ioctl %d\n", name, cmd); | ||
906 | return snd_pcm_lib_ioctl(substream, cmd, arg); | 909 | return snd_pcm_lib_ioctl(substream, cmd, arg); |
907 | } | 910 | } |
908 | 911 | ||
@@ -927,21 +930,23 @@ snd_card_asihpi_playback_pointer(struct snd_pcm_substream *substream) | |||
927 | struct snd_pcm_runtime *runtime = substream->runtime; | 930 | struct snd_pcm_runtime *runtime = substream->runtime; |
928 | struct snd_card_asihpi_pcm *dpcm = runtime->private_data; | 931 | struct snd_card_asihpi_pcm *dpcm = runtime->private_data; |
929 | snd_pcm_uframes_t ptr; | 932 | snd_pcm_uframes_t ptr; |
933 | char name[16]; | ||
934 | snd_pcm_debug_name(substream, name, sizeof(name)); | ||
930 | 935 | ||
931 | ptr = bytes_to_frames(runtime, dpcm->pcm_buf_dma_ofs % dpcm->buffer_bytes); | 936 | ptr = bytes_to_frames(runtime, dpcm->pcm_buf_dma_ofs % dpcm->buffer_bytes); |
932 | snd_printddd("P%d pointer = 0x%04lx\n", substream->number, (unsigned long)ptr); | 937 | snd_printddd("%s pointer = 0x%04lx\n", name, (unsigned long)ptr); |
933 | return ptr; | 938 | return ptr; |
934 | } | 939 | } |
935 | 940 | ||
936 | static void snd_card_asihpi_playback_format(struct snd_card_asihpi *asihpi, | 941 | static u64 snd_card_asihpi_playback_formats(struct snd_card_asihpi *asihpi, |
937 | u32 h_stream, | 942 | u32 h_stream) |
938 | struct snd_pcm_hardware *pcmhw) | ||
939 | { | 943 | { |
940 | struct hpi_format hpi_format; | 944 | struct hpi_format hpi_format; |
941 | u16 format; | 945 | u16 format; |
942 | u16 err; | 946 | u16 err; |
943 | u32 h_control; | 947 | u32 h_control; |
944 | u32 sample_rate = 48000; | 948 | u32 sample_rate = 48000; |
949 | u64 formats = 0; | ||
945 | 950 | ||
946 | /* on cards without SRC, must query at valid rate, | 951 | /* on cards without SRC, must query at valid rate, |
947 | * maybe set by external sync | 952 | * maybe set by external sync |
@@ -956,41 +961,29 @@ static void snd_card_asihpi_playback_format(struct snd_card_asihpi *asihpi, | |||
956 | 961 | ||
957 | for (format = HPI_FORMAT_PCM8_UNSIGNED; | 962 | for (format = HPI_FORMAT_PCM8_UNSIGNED; |
958 | format <= HPI_FORMAT_PCM24_SIGNED; format++) { | 963 | format <= HPI_FORMAT_PCM24_SIGNED; format++) { |
959 | err = hpi_format_create(&hpi_format, | 964 | err = hpi_format_create(&hpi_format, asihpi->out_max_chans, |
960 | 2, format, sample_rate, 128000, 0); | 965 | format, sample_rate, 128000, 0); |
961 | if (!err) | 966 | if (!err) |
962 | err = hpi_outstream_query_format(h_stream, | 967 | err = hpi_outstream_query_format(h_stream, &hpi_format); |
963 | &hpi_format); | ||
964 | if (!err && (hpi_to_alsa_formats[format] != -1)) | 968 | if (!err && (hpi_to_alsa_formats[format] != -1)) |
965 | pcmhw->formats |= | 969 | formats |= (1ULL << hpi_to_alsa_formats[format]); |
966 | (1ULL << hpi_to_alsa_formats[format]); | ||
967 | } | 970 | } |
971 | return formats; | ||
968 | } | 972 | } |
969 | 973 | ||
970 | static struct snd_pcm_hardware snd_card_asihpi_playback = { | ||
971 | .channels_min = 1, | ||
972 | .channels_max = 2, | ||
973 | .buffer_bytes_max = BUFFER_BYTES_MAX, | ||
974 | .period_bytes_min = PERIOD_BYTES_MIN, | ||
975 | .period_bytes_max = BUFFER_BYTES_MAX / PERIODS_MIN, | ||
976 | .periods_min = PERIODS_MIN, | ||
977 | .periods_max = BUFFER_BYTES_MAX / PERIOD_BYTES_MIN, | ||
978 | .fifo_size = 0, | ||
979 | }; | ||
980 | |||
981 | static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream) | 974 | static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream) |
982 | { | 975 | { |
983 | struct snd_pcm_runtime *runtime = substream->runtime; | 976 | struct snd_pcm_runtime *runtime = substream->runtime; |
984 | struct snd_card_asihpi_pcm *dpcm; | 977 | struct snd_card_asihpi_pcm *dpcm; |
985 | struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); | 978 | struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); |
979 | struct snd_pcm_hardware snd_card_asihpi_playback; | ||
986 | int err; | 980 | int err; |
987 | 981 | ||
988 | dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); | 982 | dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); |
989 | if (dpcm == NULL) | 983 | if (dpcm == NULL) |
990 | return -ENOMEM; | 984 | return -ENOMEM; |
991 | 985 | ||
992 | err = | 986 | err = hpi_outstream_open(card->hpi->adapter->index, |
993 | hpi_outstream_open(card->adapter_index, | ||
994 | substream->number, &dpcm->h_stream); | 987 | substream->number, &dpcm->h_stream); |
995 | hpi_handle_error(err); | 988 | hpi_handle_error(err); |
996 | if (err) | 989 | if (err) |
@@ -1012,12 +1005,19 @@ static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream) | |||
1012 | runtime->private_data = dpcm; | 1005 | runtime->private_data = dpcm; |
1013 | runtime->private_free = snd_card_asihpi_runtime_free; | 1006 | runtime->private_free = snd_card_asihpi_runtime_free; |
1014 | 1007 | ||
1015 | snd_card_asihpi_playback.channels_max = card->out_max_chans; | 1008 | memset(&snd_card_asihpi_playback, 0, sizeof(snd_card_asihpi_playback)); |
1009 | snd_card_asihpi_playback.buffer_bytes_max = BUFFER_BYTES_MAX; | ||
1010 | snd_card_asihpi_playback.period_bytes_min = PERIOD_BYTES_MIN; | ||
1016 | /*?snd_card_asihpi_playback.period_bytes_min = | 1011 | /*?snd_card_asihpi_playback.period_bytes_min = |
1017 | card->out_max_chans * 4096; */ | 1012 | card->out_max_chans * 4096; */ |
1018 | 1013 | snd_card_asihpi_playback.period_bytes_max = BUFFER_BYTES_MAX / PERIODS_MIN; | |
1019 | snd_card_asihpi_playback_format(card, dpcm->h_stream, | 1014 | snd_card_asihpi_playback.periods_min = PERIODS_MIN; |
1020 | &snd_card_asihpi_playback); | 1015 | snd_card_asihpi_playback.periods_max = BUFFER_BYTES_MAX / PERIOD_BYTES_MIN; |
1016 | /* snd_card_asihpi_playback.fifo_size = 0; */ | ||
1017 | snd_card_asihpi_playback.channels_max = card->out_max_chans; | ||
1018 | snd_card_asihpi_playback.channels_min = card->out_min_chans; | ||
1019 | snd_card_asihpi_playback.formats = | ||
1020 | snd_card_asihpi_playback_formats(card, dpcm->h_stream); | ||
1021 | 1021 | ||
1022 | snd_card_asihpi_pcm_samplerates(card, &snd_card_asihpi_playback); | 1022 | snd_card_asihpi_pcm_samplerates(card, &snd_card_asihpi_playback); |
1023 | 1023 | ||
@@ -1029,8 +1029,10 @@ static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream) | |||
1029 | SNDRV_PCM_INFO_MMAP | | 1029 | SNDRV_PCM_INFO_MMAP | |
1030 | SNDRV_PCM_INFO_MMAP_VALID; | 1030 | SNDRV_PCM_INFO_MMAP_VALID; |
1031 | 1031 | ||
1032 | if (card->support_grouping) | 1032 | if (card->support_grouping) { |
1033 | snd_card_asihpi_playback.info |= SNDRV_PCM_INFO_SYNC_START; | 1033 | snd_card_asihpi_playback.info |= SNDRV_PCM_INFO_SYNC_START; |
1034 | snd_pcm_set_sync(substream); | ||
1035 | } | ||
1034 | 1036 | ||
1035 | /* struct is copied, so can create initializer dynamically */ | 1037 | /* struct is copied, so can create initializer dynamically */ |
1036 | runtime->hw = snd_card_asihpi_playback; | 1038 | runtime->hw = snd_card_asihpi_playback; |
@@ -1047,8 +1049,6 @@ static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream) | |||
1047 | snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, | 1049 | snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, |
1048 | card->update_interval_frames * 2, UINT_MAX); | 1050 | card->update_interval_frames * 2, UINT_MAX); |
1049 | 1051 | ||
1050 | snd_pcm_set_sync(substream); | ||
1051 | |||
1052 | snd_printdd("playback open\n"); | 1052 | snd_printdd("playback open\n"); |
1053 | 1053 | ||
1054 | return 0; | 1054 | return 0; |
@@ -1114,15 +1114,15 @@ static int snd_card_asihpi_capture_prepare(struct snd_pcm_substream *substream) | |||
1114 | 1114 | ||
1115 | 1115 | ||
1116 | 1116 | ||
1117 | static void snd_card_asihpi_capture_format(struct snd_card_asihpi *asihpi, | 1117 | static u64 snd_card_asihpi_capture_formats(struct snd_card_asihpi *asihpi, |
1118 | u32 h_stream, | 1118 | u32 h_stream) |
1119 | struct snd_pcm_hardware *pcmhw) | ||
1120 | { | 1119 | { |
1121 | struct hpi_format hpi_format; | 1120 | struct hpi_format hpi_format; |
1122 | u16 format; | 1121 | u16 format; |
1123 | u16 err; | 1122 | u16 err; |
1124 | u32 h_control; | 1123 | u32 h_control; |
1125 | u32 sample_rate = 48000; | 1124 | u32 sample_rate = 48000; |
1125 | u64 formats = 0; | ||
1126 | 1126 | ||
1127 | /* on cards without SRC, must query at valid rate, | 1127 | /* on cards without SRC, must query at valid rate, |
1128 | maybe set by external sync */ | 1128 | maybe set by external sync */ |
@@ -1137,34 +1137,22 @@ static void snd_card_asihpi_capture_format(struct snd_card_asihpi *asihpi, | |||
1137 | for (format = HPI_FORMAT_PCM8_UNSIGNED; | 1137 | for (format = HPI_FORMAT_PCM8_UNSIGNED; |
1138 | format <= HPI_FORMAT_PCM24_SIGNED; format++) { | 1138 | format <= HPI_FORMAT_PCM24_SIGNED; format++) { |
1139 | 1139 | ||
1140 | err = hpi_format_create(&hpi_format, 2, format, | 1140 | err = hpi_format_create(&hpi_format, asihpi->in_max_chans, |
1141 | sample_rate, 128000, 0); | 1141 | format, sample_rate, 128000, 0); |
1142 | if (!err) | 1142 | if (!err) |
1143 | err = hpi_instream_query_format(h_stream, | 1143 | err = hpi_instream_query_format(h_stream, &hpi_format); |
1144 | &hpi_format); | ||
1145 | if (!err) | 1144 | if (!err) |
1146 | pcmhw->formats |= | 1145 | formats |= (1ULL << hpi_to_alsa_formats[format]); |
1147 | (1ULL << hpi_to_alsa_formats[format]); | ||
1148 | } | 1146 | } |
1147 | return formats; | ||
1149 | } | 1148 | } |
1150 | 1149 | ||
1151 | |||
1152 | static struct snd_pcm_hardware snd_card_asihpi_capture = { | ||
1153 | .channels_min = 1, | ||
1154 | .channels_max = 2, | ||
1155 | .buffer_bytes_max = BUFFER_BYTES_MAX, | ||
1156 | .period_bytes_min = PERIOD_BYTES_MIN, | ||
1157 | .period_bytes_max = BUFFER_BYTES_MAX / PERIODS_MIN, | ||
1158 | .periods_min = PERIODS_MIN, | ||
1159 | .periods_max = BUFFER_BYTES_MAX / PERIOD_BYTES_MIN, | ||
1160 | .fifo_size = 0, | ||
1161 | }; | ||
1162 | |||
1163 | static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream) | 1150 | static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream) |
1164 | { | 1151 | { |
1165 | struct snd_pcm_runtime *runtime = substream->runtime; | 1152 | struct snd_pcm_runtime *runtime = substream->runtime; |
1166 | struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); | 1153 | struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); |
1167 | struct snd_card_asihpi_pcm *dpcm; | 1154 | struct snd_card_asihpi_pcm *dpcm; |
1155 | struct snd_pcm_hardware snd_card_asihpi_capture; | ||
1168 | int err; | 1156 | int err; |
1169 | 1157 | ||
1170 | dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); | 1158 | dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); |
@@ -1172,10 +1160,10 @@ static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream) | |||
1172 | return -ENOMEM; | 1160 | return -ENOMEM; |
1173 | 1161 | ||
1174 | snd_printdd("capture open adapter %d stream %d\n", | 1162 | snd_printdd("capture open adapter %d stream %d\n", |
1175 | card->adapter_index, substream->number); | 1163 | card->hpi->adapter->index, substream->number); |
1176 | 1164 | ||
1177 | err = hpi_handle_error( | 1165 | err = hpi_handle_error( |
1178 | hpi_instream_open(card->adapter_index, | 1166 | hpi_instream_open(card->hpi->adapter->index, |
1179 | substream->number, &dpcm->h_stream)); | 1167 | substream->number, &dpcm->h_stream)); |
1180 | if (err) | 1168 | if (err) |
1181 | kfree(dpcm); | 1169 | kfree(dpcm); |
@@ -1184,7 +1172,6 @@ static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream) | |||
1184 | if (err) | 1172 | if (err) |
1185 | return -EIO; | 1173 | return -EIO; |
1186 | 1174 | ||
1187 | |||
1188 | init_timer(&dpcm->timer); | 1175 | init_timer(&dpcm->timer); |
1189 | dpcm->timer.data = (unsigned long) dpcm; | 1176 | dpcm->timer.data = (unsigned long) dpcm; |
1190 | dpcm->timer.function = snd_card_asihpi_timer_function; | 1177 | dpcm->timer.function = snd_card_asihpi_timer_function; |
@@ -1192,9 +1179,17 @@ static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream) | |||
1192 | runtime->private_data = dpcm; | 1179 | runtime->private_data = dpcm; |
1193 | runtime->private_free = snd_card_asihpi_runtime_free; | 1180 | runtime->private_free = snd_card_asihpi_runtime_free; |
1194 | 1181 | ||
1182 | memset(&snd_card_asihpi_capture, 0, sizeof(snd_card_asihpi_capture)); | ||
1183 | snd_card_asihpi_capture.buffer_bytes_max = BUFFER_BYTES_MAX; | ||
1184 | snd_card_asihpi_capture.period_bytes_min = PERIOD_BYTES_MIN; | ||
1185 | snd_card_asihpi_capture.period_bytes_max = BUFFER_BYTES_MAX / PERIODS_MIN; | ||
1186 | snd_card_asihpi_capture.periods_min = PERIODS_MIN; | ||
1187 | snd_card_asihpi_capture.periods_max = BUFFER_BYTES_MAX / PERIOD_BYTES_MIN; | ||
1188 | /* snd_card_asihpi_capture.fifo_size = 0; */ | ||
1195 | snd_card_asihpi_capture.channels_max = card->in_max_chans; | 1189 | snd_card_asihpi_capture.channels_max = card->in_max_chans; |
1196 | snd_card_asihpi_capture_format(card, dpcm->h_stream, | 1190 | snd_card_asihpi_capture.channels_min = card->in_min_chans; |
1197 | &snd_card_asihpi_capture); | 1191 | snd_card_asihpi_capture.formats = |
1192 | snd_card_asihpi_capture_formats(card, dpcm->h_stream); | ||
1198 | snd_card_asihpi_pcm_samplerates(card, &snd_card_asihpi_capture); | 1193 | snd_card_asihpi_pcm_samplerates(card, &snd_card_asihpi_capture); |
1199 | snd_card_asihpi_capture.info = SNDRV_PCM_INFO_INTERLEAVED | | 1194 | snd_card_asihpi_capture.info = SNDRV_PCM_INFO_INTERLEAVED | |
1200 | SNDRV_PCM_INFO_MMAP | | 1195 | SNDRV_PCM_INFO_MMAP | |
@@ -1240,15 +1235,20 @@ static struct snd_pcm_ops snd_card_asihpi_capture_mmap_ops = { | |||
1240 | .pointer = snd_card_asihpi_capture_pointer, | 1235 | .pointer = snd_card_asihpi_capture_pointer, |
1241 | }; | 1236 | }; |
1242 | 1237 | ||
1243 | static int __devinit snd_card_asihpi_pcm_new(struct snd_card_asihpi *asihpi, | 1238 | static int __devinit snd_card_asihpi_pcm_new( |
1244 | int device, int substreams) | 1239 | struct snd_card_asihpi *asihpi, int device) |
1245 | { | 1240 | { |
1246 | struct snd_pcm *pcm; | 1241 | struct snd_pcm *pcm; |
1247 | int err; | 1242 | int err; |
1243 | u16 num_instreams, num_outstreams, x16; | ||
1244 | u32 x32; | ||
1245 | |||
1246 | err = hpi_adapter_get_info(asihpi->hpi->adapter->index, | ||
1247 | &num_outstreams, &num_instreams, | ||
1248 | &x16, &x32, &x16); | ||
1248 | 1249 | ||
1249 | err = snd_pcm_new(asihpi->card, "Asihpi PCM", device, | 1250 | err = snd_pcm_new(asihpi->card, "Asihpi PCM", device, |
1250 | asihpi->num_outstreams, asihpi->num_instreams, | 1251 | num_outstreams, num_instreams, &pcm); |
1251 | &pcm); | ||
1252 | if (err < 0) | 1252 | if (err < 0) |
1253 | return err; | 1253 | return err; |
1254 | /* pointer to ops struct is stored, dont change ops afterwards! */ | 1254 | /* pointer to ops struct is stored, dont change ops afterwards! */ |
@@ -1314,7 +1314,7 @@ static const char * const asihpi_src_names[] = { | |||
1314 | "Analog", | 1314 | "Analog", |
1315 | "Adapter", | 1315 | "Adapter", |
1316 | "RTP", | 1316 | "RTP", |
1317 | "GPI", | 1317 | "Internal" |
1318 | }; | 1318 | }; |
1319 | 1319 | ||
1320 | compile_time_assert( | 1320 | compile_time_assert( |
@@ -1332,7 +1332,6 @@ static const char * const asihpi_dst_names[] = { | |||
1332 | "Net", | 1332 | "Net", |
1333 | "Analog", | 1333 | "Analog", |
1334 | "RTP", | 1334 | "RTP", |
1335 | "GPO", | ||
1336 | }; | 1335 | }; |
1337 | 1336 | ||
1338 | compile_time_assert( | 1337 | compile_time_assert( |
@@ -1410,6 +1409,7 @@ static int snd_asihpi_volume_info(struct snd_kcontrol *kcontrol, | |||
1410 | struct snd_ctl_elem_info *uinfo) | 1409 | struct snd_ctl_elem_info *uinfo) |
1411 | { | 1410 | { |
1412 | u32 h_control = kcontrol->private_value; | 1411 | u32 h_control = kcontrol->private_value; |
1412 | u32 count; | ||
1413 | u16 err; | 1413 | u16 err; |
1414 | /* native gains are in millibels */ | 1414 | /* native gains are in millibels */ |
1415 | short min_gain_mB; | 1415 | short min_gain_mB; |
@@ -1424,8 +1424,12 @@ static int snd_asihpi_volume_info(struct snd_kcontrol *kcontrol, | |||
1424 | step_gain_mB = VOL_STEP_mB; | 1424 | step_gain_mB = VOL_STEP_mB; |
1425 | } | 1425 | } |
1426 | 1426 | ||
1427 | err = hpi_meter_query_channels(h_control, &count); | ||
1428 | if (err) | ||
1429 | count = HPI_MAX_CHANNELS; | ||
1430 | |||
1427 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 1431 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
1428 | uinfo->count = 2; | 1432 | uinfo->count = count; |
1429 | uinfo->value.integer.min = min_gain_mB / VOL_STEP_mB; | 1433 | uinfo->value.integer.min = min_gain_mB / VOL_STEP_mB; |
1430 | uinfo->value.integer.max = max_gain_mB / VOL_STEP_mB; | 1434 | uinfo->value.integer.max = max_gain_mB / VOL_STEP_mB; |
1431 | uinfo->value.integer.step = step_gain_mB / VOL_STEP_mB; | 1435 | uinfo->value.integer.step = step_gain_mB / VOL_STEP_mB; |
@@ -2033,8 +2037,15 @@ static int __devinit snd_asihpi_tuner_add(struct snd_card_asihpi *asihpi, | |||
2033 | static int snd_asihpi_meter_info(struct snd_kcontrol *kcontrol, | 2037 | static int snd_asihpi_meter_info(struct snd_kcontrol *kcontrol, |
2034 | struct snd_ctl_elem_info *uinfo) | 2038 | struct snd_ctl_elem_info *uinfo) |
2035 | { | 2039 | { |
2040 | u32 h_control = kcontrol->private_value; | ||
2041 | u32 count; | ||
2042 | u16 err; | ||
2043 | err = hpi_meter_query_channels(h_control, &count); | ||
2044 | if (err) | ||
2045 | count = HPI_MAX_CHANNELS; | ||
2046 | |||
2036 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 2047 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
2037 | uinfo->count = HPI_MAX_CHANNELS; | 2048 | uinfo->count = count; |
2038 | uinfo->value.integer.min = 0; | 2049 | uinfo->value.integer.min = 0; |
2039 | uinfo->value.integer.max = 0x7FFFFFFF; | 2050 | uinfo->value.integer.max = 0x7FFFFFFF; |
2040 | return 0; | 2051 | return 0; |
@@ -2248,6 +2259,9 @@ static int snd_asihpi_cmode_info(struct snd_kcontrol *kcontrol, | |||
2248 | valid_modes++; | 2259 | valid_modes++; |
2249 | } | 2260 | } |
2250 | 2261 | ||
2262 | if (!valid_modes) | ||
2263 | return -EINVAL; | ||
2264 | |||
2251 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 2265 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
2252 | uinfo->count = 1; | 2266 | uinfo->count = 1; |
2253 | uinfo->value.enumerated.items = valid_modes; | 2267 | uinfo->value.enumerated.items = valid_modes; |
@@ -2547,7 +2561,7 @@ static int __devinit snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi) | |||
2547 | strcpy(card->mixername, "Asihpi Mixer"); | 2561 | strcpy(card->mixername, "Asihpi Mixer"); |
2548 | 2562 | ||
2549 | err = | 2563 | err = |
2550 | hpi_mixer_open(asihpi->adapter_index, | 2564 | hpi_mixer_open(asihpi->hpi->adapter->index, |
2551 | &asihpi->h_mixer); | 2565 | &asihpi->h_mixer); |
2552 | hpi_handle_error(err); | 2566 | hpi_handle_error(err); |
2553 | if (err) | 2567 | if (err) |
@@ -2665,24 +2679,33 @@ snd_asihpi_proc_read(struct snd_info_entry *entry, | |||
2665 | struct snd_info_buffer *buffer) | 2679 | struct snd_info_buffer *buffer) |
2666 | { | 2680 | { |
2667 | struct snd_card_asihpi *asihpi = entry->private_data; | 2681 | struct snd_card_asihpi *asihpi = entry->private_data; |
2668 | u16 version; | ||
2669 | u32 h_control; | 2682 | u32 h_control; |
2670 | u32 rate = 0; | 2683 | u32 rate = 0; |
2671 | u16 source = 0; | 2684 | u16 source = 0; |
2685 | |||
2686 | u16 num_outstreams; | ||
2687 | u16 num_instreams; | ||
2688 | u16 version; | ||
2689 | u32 serial_number; | ||
2690 | u16 type; | ||
2691 | |||
2672 | int err; | 2692 | int err; |
2673 | 2693 | ||
2674 | snd_iprintf(buffer, "ASIHPI driver proc file\n"); | 2694 | snd_iprintf(buffer, "ASIHPI driver proc file\n"); |
2695 | |||
2696 | hpi_handle_error(hpi_adapter_get_info(asihpi->hpi->adapter->index, | ||
2697 | &num_outstreams, &num_instreams, | ||
2698 | &version, &serial_number, &type)); | ||
2699 | |||
2675 | snd_iprintf(buffer, | 2700 | snd_iprintf(buffer, |
2676 | "adapter ID=%4X\n_index=%d\n" | 2701 | "Adapter type ASI%4X\nHardware Index %d\n" |
2677 | "num_outstreams=%d\n_num_instreams=%d\n", | 2702 | "%d outstreams\n%d instreams\n", |
2678 | asihpi->type, asihpi->adapter_index, | 2703 | type, asihpi->hpi->adapter->index, |
2679 | asihpi->num_outstreams, asihpi->num_instreams); | 2704 | num_outstreams, num_instreams); |
2680 | 2705 | ||
2681 | version = asihpi->version; | ||
2682 | snd_iprintf(buffer, | 2706 | snd_iprintf(buffer, |
2683 | "serial#=%d\n_hw version %c%d\nDSP code version %03d\n", | 2707 | "Serial#%d\nHardware version %c%d\nDSP code version %03d\n", |
2684 | asihpi->serial_number, ((version >> 3) & 0xf) + 'A', | 2708 | serial_number, ((version >> 3) & 0xf) + 'A', version & 0x7, |
2685 | version & 0x7, | ||
2686 | ((version >> 13) * 100) + ((version >> 7) & 0x3f)); | 2709 | ((version >> 13) * 100) + ((version >> 7) & 0x3f)); |
2687 | 2710 | ||
2688 | err = hpi_mixer_get_control(asihpi->h_mixer, | 2711 | err = hpi_mixer_get_control(asihpi->h_mixer, |
@@ -2690,18 +2713,15 @@ snd_asihpi_proc_read(struct snd_info_entry *entry, | |||
2690 | HPI_CONTROL_SAMPLECLOCK, &h_control); | 2713 | HPI_CONTROL_SAMPLECLOCK, &h_control); |
2691 | 2714 | ||
2692 | if (!err) { | 2715 | if (!err) { |
2693 | err = hpi_sample_clock_get_sample_rate( | 2716 | err = hpi_sample_clock_get_sample_rate(h_control, &rate); |
2694 | h_control, &rate); | ||
2695 | err += hpi_sample_clock_get_source(h_control, &source); | 2717 | err += hpi_sample_clock_get_source(h_control, &source); |
2696 | 2718 | ||
2697 | if (!err) | 2719 | if (!err) |
2698 | snd_iprintf(buffer, "sample_clock=%d_hz, source %s\n", | 2720 | snd_iprintf(buffer, "Sample Clock %dHz, source %s\n", |
2699 | rate, sampleclock_sources[source]); | 2721 | rate, sampleclock_sources[source]); |
2700 | } | 2722 | } |
2701 | |||
2702 | } | 2723 | } |
2703 | 2724 | ||
2704 | |||
2705 | static void __devinit snd_asihpi_proc_init(struct snd_card_asihpi *asihpi) | 2725 | static void __devinit snd_asihpi_proc_init(struct snd_card_asihpi *asihpi) |
2706 | { | 2726 | { |
2707 | struct snd_info_entry *entry; | 2727 | struct snd_info_entry *entry; |
@@ -2773,35 +2793,34 @@ static int __devinit snd_asihpi_probe(struct pci_dev *pci_dev, | |||
2773 | const struct pci_device_id *pci_id) | 2793 | const struct pci_device_id *pci_id) |
2774 | { | 2794 | { |
2775 | int err; | 2795 | int err; |
2776 | 2796 | struct hpi_adapter *hpi; | |
2777 | u16 version; | ||
2778 | int pcm_substreams; | ||
2779 | |||
2780 | struct hpi_adapter *hpi_card; | ||
2781 | struct snd_card *card; | 2797 | struct snd_card *card; |
2782 | struct snd_card_asihpi *asihpi; | 2798 | struct snd_card_asihpi *asihpi; |
2783 | 2799 | ||
2784 | u32 h_control; | 2800 | u32 h_control; |
2785 | u32 h_stream; | 2801 | u32 h_stream; |
2802 | u32 adapter_index; | ||
2786 | 2803 | ||
2787 | static int dev; | 2804 | static int dev; |
2788 | if (dev >= SNDRV_CARDS) | 2805 | if (dev >= SNDRV_CARDS) |
2789 | return -ENODEV; | 2806 | return -ENODEV; |
2790 | 2807 | ||
2791 | /* Should this be enable[hpi_card->index] ? */ | 2808 | /* Should this be enable[hpi->index] ? */ |
2792 | if (!enable[dev]) { | 2809 | if (!enable[dev]) { |
2793 | dev++; | 2810 | dev++; |
2794 | return -ENOENT; | 2811 | return -ENOENT; |
2795 | } | 2812 | } |
2796 | 2813 | ||
2814 | /* Initialise low-level HPI driver */ | ||
2797 | err = asihpi_adapter_probe(pci_dev, pci_id); | 2815 | err = asihpi_adapter_probe(pci_dev, pci_id); |
2798 | if (err < 0) | 2816 | if (err < 0) |
2799 | return err; | 2817 | return err; |
2800 | 2818 | ||
2801 | hpi_card = pci_get_drvdata(pci_dev); | 2819 | hpi = pci_get_drvdata(pci_dev); |
2820 | adapter_index = hpi->adapter->index; | ||
2802 | /* first try to give the card the same index as its hardware index */ | 2821 | /* first try to give the card the same index as its hardware index */ |
2803 | err = snd_card_create(hpi_card->index, | 2822 | err = snd_card_create(adapter_index, |
2804 | id[hpi_card->index], THIS_MODULE, | 2823 | id[adapter_index], THIS_MODULE, |
2805 | sizeof(struct snd_card_asihpi), | 2824 | sizeof(struct snd_card_asihpi), |
2806 | &card); | 2825 | &card); |
2807 | if (err < 0) { | 2826 | if (err < 0) { |
@@ -2815,50 +2834,32 @@ static int __devinit snd_asihpi_probe(struct pci_dev *pci_dev, | |||
2815 | return err; | 2834 | return err; |
2816 | snd_printk(KERN_WARNING | 2835 | snd_printk(KERN_WARNING |
2817 | "**** WARNING **** Adapter index %d->ALSA index %d\n", | 2836 | "**** WARNING **** Adapter index %d->ALSA index %d\n", |
2818 | hpi_card->index, card->number); | 2837 | adapter_index, card->number); |
2819 | } | 2838 | } |
2820 | 2839 | ||
2821 | snd_card_set_dev(card, &pci_dev->dev); | 2840 | snd_card_set_dev(card, &pci_dev->dev); |
2822 | 2841 | ||
2823 | asihpi = (struct snd_card_asihpi *) card->private_data; | 2842 | asihpi = card->private_data; |
2824 | asihpi->card = card; | 2843 | asihpi->card = card; |
2825 | asihpi->pci = pci_dev; | 2844 | asihpi->pci = pci_dev; |
2826 | asihpi->adapter_index = hpi_card->index; | 2845 | asihpi->hpi = hpi; |
2827 | hpi_handle_error(hpi_adapter_get_info( | 2846 | |
2828 | asihpi->adapter_index, | 2847 | snd_printk(KERN_INFO "adapter ID=%4X index=%d\n", |
2829 | &asihpi->num_outstreams, | 2848 | asihpi->hpi->adapter->type, adapter_index); |
2830 | &asihpi->num_instreams, | 2849 | |
2831 | &asihpi->version, | 2850 | err = hpi_adapter_get_property(adapter_index, |
2832 | &asihpi->serial_number, &asihpi->type)); | ||
2833 | |||
2834 | version = asihpi->version; | ||
2835 | snd_printk(KERN_INFO "adapter ID=%4X index=%d num_outstreams=%d " | ||
2836 | "num_instreams=%d S/N=%d\n" | ||
2837 | "Hw Version %c%d DSP code version %03d\n", | ||
2838 | asihpi->type, asihpi->adapter_index, | ||
2839 | asihpi->num_outstreams, | ||
2840 | asihpi->num_instreams, asihpi->serial_number, | ||
2841 | ((version >> 3) & 0xf) + 'A', | ||
2842 | version & 0x7, | ||
2843 | ((version >> 13) * 100) + ((version >> 7) & 0x3f)); | ||
2844 | |||
2845 | pcm_substreams = asihpi->num_outstreams; | ||
2846 | if (pcm_substreams < asihpi->num_instreams) | ||
2847 | pcm_substreams = asihpi->num_instreams; | ||
2848 | |||
2849 | err = hpi_adapter_get_property(asihpi->adapter_index, | ||
2850 | HPI_ADAPTER_PROPERTY_CAPS1, | 2851 | HPI_ADAPTER_PROPERTY_CAPS1, |
2851 | NULL, &asihpi->support_grouping); | 2852 | NULL, &asihpi->support_grouping); |
2852 | if (err) | 2853 | if (err) |
2853 | asihpi->support_grouping = 0; | 2854 | asihpi->support_grouping = 0; |
2854 | 2855 | ||
2855 | err = hpi_adapter_get_property(asihpi->adapter_index, | 2856 | err = hpi_adapter_get_property(adapter_index, |
2856 | HPI_ADAPTER_PROPERTY_CAPS2, | 2857 | HPI_ADAPTER_PROPERTY_CAPS2, |
2857 | &asihpi->support_mrx, NULL); | 2858 | &asihpi->support_mrx, NULL); |
2858 | if (err) | 2859 | if (err) |
2859 | asihpi->support_mrx = 0; | 2860 | asihpi->support_mrx = 0; |
2860 | 2861 | ||
2861 | err = hpi_adapter_get_property(asihpi->adapter_index, | 2862 | err = hpi_adapter_get_property(adapter_index, |
2862 | HPI_ADAPTER_PROPERTY_INTERVAL, | 2863 | HPI_ADAPTER_PROPERTY_INTERVAL, |
2863 | NULL, &asihpi->update_interval_frames); | 2864 | NULL, &asihpi->update_interval_frames); |
2864 | if (err) | 2865 | if (err) |
@@ -2867,7 +2868,7 @@ static int __devinit snd_asihpi_probe(struct pci_dev *pci_dev, | |||
2867 | if (!asihpi->can_dma) | 2868 | if (!asihpi->can_dma) |
2868 | asihpi->update_interval_frames *= 2; | 2869 | asihpi->update_interval_frames *= 2; |
2869 | 2870 | ||
2870 | hpi_handle_error(hpi_instream_open(asihpi->adapter_index, | 2871 | hpi_handle_error(hpi_instream_open(adapter_index, |
2871 | 0, &h_stream)); | 2872 | 0, &h_stream)); |
2872 | 2873 | ||
2873 | err = hpi_instream_host_buffer_free(h_stream); | 2874 | err = hpi_instream_host_buffer_free(h_stream); |
@@ -2875,7 +2876,7 @@ static int __devinit snd_asihpi_probe(struct pci_dev *pci_dev, | |||
2875 | 2876 | ||
2876 | hpi_handle_error(hpi_instream_close(h_stream)); | 2877 | hpi_handle_error(hpi_instream_close(h_stream)); |
2877 | 2878 | ||
2878 | err = hpi_adapter_get_property(asihpi->adapter_index, | 2879 | err = hpi_adapter_get_property(adapter_index, |
2879 | HPI_ADAPTER_PROPERTY_CURCHANNELS, | 2880 | HPI_ADAPTER_PROPERTY_CURCHANNELS, |
2880 | &asihpi->in_max_chans, &asihpi->out_max_chans); | 2881 | &asihpi->in_max_chans, &asihpi->out_max_chans); |
2881 | if (err) { | 2882 | if (err) { |
@@ -2883,13 +2884,22 @@ static int __devinit snd_asihpi_probe(struct pci_dev *pci_dev, | |||
2883 | asihpi->out_max_chans = 2; | 2884 | asihpi->out_max_chans = 2; |
2884 | } | 2885 | } |
2885 | 2886 | ||
2886 | snd_printk(KERN_INFO "has dma:%d, grouping:%d, mrx:%d\n", | 2887 | if (asihpi->out_max_chans > 2) { /* assume LL mode */ |
2888 | asihpi->out_min_chans = asihpi->out_max_chans; | ||
2889 | asihpi->in_min_chans = asihpi->in_max_chans; | ||
2890 | asihpi->support_grouping = 0; | ||
2891 | } else { | ||
2892 | asihpi->out_min_chans = 1; | ||
2893 | asihpi->in_min_chans = 1; | ||
2894 | } | ||
2895 | |||
2896 | snd_printk(KERN_INFO "Has dma:%d, grouping:%d, mrx:%d\n", | ||
2887 | asihpi->can_dma, | 2897 | asihpi->can_dma, |
2888 | asihpi->support_grouping, | 2898 | asihpi->support_grouping, |
2889 | asihpi->support_mrx | 2899 | asihpi->support_mrx |
2890 | ); | 2900 | ); |
2891 | 2901 | ||
2892 | err = snd_card_asihpi_pcm_new(asihpi, 0, pcm_substreams); | 2902 | err = snd_card_asihpi_pcm_new(asihpi, 0); |
2893 | if (err < 0) { | 2903 | if (err < 0) { |
2894 | snd_printk(KERN_ERR "pcm_new failed\n"); | 2904 | snd_printk(KERN_ERR "pcm_new failed\n"); |
2895 | goto __nodev; | 2905 | goto __nodev; |
@@ -2916,13 +2926,14 @@ static int __devinit snd_asihpi_probe(struct pci_dev *pci_dev, | |||
2916 | 2926 | ||
2917 | strcpy(card->driver, "ASIHPI"); | 2927 | strcpy(card->driver, "ASIHPI"); |
2918 | 2928 | ||
2919 | sprintf(card->shortname, "AudioScience ASI%4X", asihpi->type); | 2929 | sprintf(card->shortname, "AudioScience ASI%4X", |
2930 | asihpi->hpi->adapter->type); | ||
2920 | sprintf(card->longname, "%s %i", | 2931 | sprintf(card->longname, "%s %i", |
2921 | card->shortname, asihpi->adapter_index); | 2932 | card->shortname, adapter_index); |
2922 | err = snd_card_register(card); | 2933 | err = snd_card_register(card); |
2923 | 2934 | ||
2924 | if (!err) { | 2935 | if (!err) { |
2925 | hpi_card->snd_card_asihpi = card; | 2936 | hpi->snd_card = card; |
2926 | dev++; | 2937 | dev++; |
2927 | return 0; | 2938 | return 0; |
2928 | } | 2939 | } |
@@ -2935,10 +2946,9 @@ __nodev: | |||
2935 | 2946 | ||
2936 | static void __devexit snd_asihpi_remove(struct pci_dev *pci_dev) | 2947 | static void __devexit snd_asihpi_remove(struct pci_dev *pci_dev) |
2937 | { | 2948 | { |
2938 | struct hpi_adapter *hpi_card = pci_get_drvdata(pci_dev); | 2949 | struct hpi_adapter *hpi = pci_get_drvdata(pci_dev); |
2939 | 2950 | snd_card_free(hpi->snd_card); | |
2940 | snd_card_free(hpi_card->snd_card_asihpi); | 2951 | hpi->snd_card = NULL; |
2941 | hpi_card->snd_card_asihpi = NULL; | ||
2942 | asihpi_adapter_remove(pci_dev); | 2952 | asihpi_adapter_remove(pci_dev); |
2943 | } | 2953 | } |
2944 | 2954 | ||
diff --git a/sound/pci/asihpi/hpi.h b/sound/pci/asihpi/hpi.h index f20727288994..20887241a3ae 100644 --- a/sound/pci/asihpi/hpi.h +++ b/sound/pci/asihpi/hpi.h | |||
@@ -30,26 +30,8 @@ | |||
30 | 30 | ||
31 | #ifndef _HPI_H_ | 31 | #ifndef _HPI_H_ |
32 | #define _HPI_H_ | 32 | #define _HPI_H_ |
33 | /* HPI Version | ||
34 | If HPI_VER_MINOR is odd then its a development release not intended for the | ||
35 | public. If HPI_VER_MINOR is even then is a release version | ||
36 | i.e 3.05.02 is a development version | ||
37 | */ | ||
38 | #define HPI_VERSION_CONSTRUCTOR(maj, min, rel) \ | ||
39 | ((maj << 16) + (min << 8) + rel) | ||
40 | |||
41 | #define HPI_VER_MAJOR(v) ((int)(v >> 16)) | ||
42 | #define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF)) | ||
43 | #define HPI_VER_RELEASE(v) ((int)(v & 0xFF)) | ||
44 | |||
45 | #define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 8, 0) | ||
46 | #define HPI_VER_STRING "4.08.00" | ||
47 | |||
48 | /* Library version as documented in hpi-api-versions.txt */ | ||
49 | #define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(10, 0, 0) | ||
50 | 33 | ||
51 | #include <linux/types.h> | 34 | #include <linux/types.h> |
52 | #define HPI_BUILD_EXCLUDE_DEPRECATED | ||
53 | #define HPI_BUILD_KERNEL_MODE | 35 | #define HPI_BUILD_KERNEL_MODE |
54 | 36 | ||
55 | /******************************************************************************/ | 37 | /******************************************************************************/ |
@@ -213,7 +195,7 @@ enum HPI_SOURCENODES { | |||
213 | /** RTP stream input node - This node is a destination for | 195 | /** RTP stream input node - This node is a destination for |
214 | packets of RTP audio samples from other devices. */ | 196 | packets of RTP audio samples from other devices. */ |
215 | HPI_SOURCENODE_RTP_DESTINATION = 112, | 197 | HPI_SOURCENODE_RTP_DESTINATION = 112, |
216 | HPI_SOURCENODE_GP_IN = 113, /**< general purpose input. */ | 198 | HPI_SOURCENODE_INTERNAL = 113, /**< node internal to the device. */ |
217 | /* !!!Update this AND hpidebug.h if you add a new sourcenode type!!! */ | 199 | /* !!!Update this AND hpidebug.h if you add a new sourcenode type!!! */ |
218 | HPI_SOURCENODE_LAST_INDEX = 113 /**< largest ID */ | 200 | HPI_SOURCENODE_LAST_INDEX = 113 /**< largest ID */ |
219 | /* AX6 max sourcenode types = 15 */ | 201 | /* AX6 max sourcenode types = 15 */ |
@@ -242,9 +224,8 @@ enum HPI_DESTNODES { | |||
242 | /** RTP stream output node - This node is a source for | 224 | /** RTP stream output node - This node is a source for |
243 | packets of RTP audio samples that are sent to other devices. */ | 225 | packets of RTP audio samples that are sent to other devices. */ |
244 | HPI_DESTNODE_RTP_SOURCE = 208, | 226 | HPI_DESTNODE_RTP_SOURCE = 208, |
245 | HPI_DESTNODE_GP_OUT = 209, /**< general purpose output node. */ | ||
246 | /* !!!Update this AND hpidebug.h if you add a new destnode type!!! */ | 227 | /* !!!Update this AND hpidebug.h if you add a new destnode type!!! */ |
247 | HPI_DESTNODE_LAST_INDEX = 209 /**< largest ID */ | 228 | HPI_DESTNODE_LAST_INDEX = 208 /**< largest ID */ |
248 | /* AX6 max destnode types = 15 */ | 229 | /* AX6 max destnode types = 15 */ |
249 | }; | 230 | }; |
250 | 231 | ||
@@ -450,7 +431,19 @@ Indicates that the adapter in it's current mode supports interrupts | |||
450 | across the host bus. Note, this does not imply that interrupts are | 431 | across the host bus. Note, this does not imply that interrupts are |
451 | enabled. Instead it indicates that they can be enabled. | 432 | enabled. Instead it indicates that they can be enabled. |
452 | */ | 433 | */ |
453 | HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ = 272 | 434 | HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ = 272, |
435 | /** Readonly supports firmware updating. | ||
436 | Indicates that the adapter implements an interface to update firmware | ||
437 | on the adapter. | ||
438 | */ | ||
439 | HPI_ADAPTER_PROPERTY_SUPPORTS_FW_UPDATE = 273, | ||
440 | /** Readonly Firmware IDs | ||
441 | Identifiy firmware independent of individual adapter type. | ||
442 | May be used as a filter for firmware update images. | ||
443 | Property 1 = Bootloader ID | ||
444 | Property 2 = Main program ID | ||
445 | */ | ||
446 | HPI_ADAPTER_PROPERTY_FIRMWARE_ID = 274 | ||
454 | }; | 447 | }; |
455 | 448 | ||
456 | /** Adapter mode commands | 449 | /** Adapter mode commands |
@@ -638,7 +631,7 @@ enum HPI_MIXER_STORE_COMMAND { | |||
638 | HPI_MIXER_STORE_ENABLE = 4, | 631 | HPI_MIXER_STORE_ENABLE = 4, |
639 | /** Disable auto storage of some control settings. */ | 632 | /** Disable auto storage of some control settings. */ |
640 | HPI_MIXER_STORE_DISABLE = 5, | 633 | HPI_MIXER_STORE_DISABLE = 5, |
641 | /** Save the attributes of a single control. */ | 634 | /** Unimplemented - save the attributes of a single control. */ |
642 | HPI_MIXER_STORE_SAVE_SINGLE = 6 | 635 | HPI_MIXER_STORE_SAVE_SINGLE = 6 |
643 | }; | 636 | }; |
644 | 637 | ||
@@ -941,7 +934,7 @@ enum HPI_ERROR_CODES { | |||
941 | HPI_ERROR_BAD_ADAPTER_NUMBER = 202, | 934 | HPI_ERROR_BAD_ADAPTER_NUMBER = 202, |
942 | /** 2 adapters with the same adapter number. */ | 935 | /** 2 adapters with the same adapter number. */ |
943 | HPI_ERROR_DUPLICATE_ADAPTER_NUMBER = 203, | 936 | HPI_ERROR_DUPLICATE_ADAPTER_NUMBER = 203, |
944 | /** DSP code failed to bootload. (unused?) */ | 937 | /** DSP code failed to bootload. Usually a DSP memory test failure. */ |
945 | HPI_ERROR_DSP_BOOTLOAD = 204, | 938 | HPI_ERROR_DSP_BOOTLOAD = 204, |
946 | /** Couldn't find or open the DSP code file. */ | 939 | /** Couldn't find or open the DSP code file. */ |
947 | HPI_ERROR_DSP_FILE_NOT_FOUND = 206, | 940 | HPI_ERROR_DSP_FILE_NOT_FOUND = 206, |
@@ -978,6 +971,9 @@ enum HPI_ERROR_CODES { | |||
978 | HPI_ERROR_FLASH_VERIFY = 225, | 971 | HPI_ERROR_FLASH_VERIFY = 225, |
979 | HPI_ERROR_FLASH_TYPE = 226, | 972 | HPI_ERROR_FLASH_TYPE = 226, |
980 | HPI_ERROR_FLASH_START = 227, | 973 | HPI_ERROR_FLASH_START = 227, |
974 | HPI_ERROR_FLASH_READ = 228, | ||
975 | HPI_ERROR_FLASH_READ_NO_FILE = 229, | ||
976 | HPI_ERROR_FLASH_SIZE = 230, | ||
981 | 977 | ||
982 | /** Reserved for OEMs. */ | 978 | /** Reserved for OEMs. */ |
983 | HPI_ERROR_RESERVED_1 = 290, | 979 | HPI_ERROR_RESERVED_1 = 290, |
@@ -1020,6 +1016,8 @@ enum HPI_ERROR_CODES { | |||
1020 | HPI_ERROR_NO_INTERDSP_GROUPS = 315, | 1016 | HPI_ERROR_NO_INTERDSP_GROUPS = 315, |
1021 | /** Stream wait cancelled before threshold reached. */ | 1017 | /** Stream wait cancelled before threshold reached. */ |
1022 | HPI_ERROR_WAIT_CANCELLED = 316, | 1018 | HPI_ERROR_WAIT_CANCELLED = 316, |
1019 | /** A character string is invalid. */ | ||
1020 | HPI_ERROR_INVALID_STRING = 317, | ||
1023 | 1021 | ||
1024 | /** Invalid mixer node for this adapter. */ | 1022 | /** Invalid mixer node for this adapter. */ |
1025 | HPI_ERROR_INVALID_NODE = 400, | 1023 | HPI_ERROR_INVALID_NODE = 400, |
@@ -1046,11 +1044,15 @@ enum HPI_ERROR_CODES { | |||
1046 | /** I2C */ | 1044 | /** I2C */ |
1047 | HPI_ERROR_I2C_BAD_ADR = 460, | 1045 | HPI_ERROR_I2C_BAD_ADR = 460, |
1048 | 1046 | ||
1049 | /** Entity errors */ | 1047 | /** Entity type did not match requested type */ |
1050 | HPI_ERROR_ENTITY_TYPE_MISMATCH = 470, | 1048 | HPI_ERROR_ENTITY_TYPE_MISMATCH = 470, |
1049 | /** Entity item count did not match requested count */ | ||
1051 | HPI_ERROR_ENTITY_ITEM_COUNT = 471, | 1050 | HPI_ERROR_ENTITY_ITEM_COUNT = 471, |
1051 | /** Entity type is not one of the valid types */ | ||
1052 | HPI_ERROR_ENTITY_TYPE_INVALID = 472, | 1052 | HPI_ERROR_ENTITY_TYPE_INVALID = 472, |
1053 | /** Entity role is not one of the valid roles */ | ||
1053 | HPI_ERROR_ENTITY_ROLE_INVALID = 473, | 1054 | HPI_ERROR_ENTITY_ROLE_INVALID = 473, |
1055 | /** Entity size doesn't match target size */ | ||
1054 | HPI_ERROR_ENTITY_SIZE_MISMATCH = 474, | 1056 | HPI_ERROR_ENTITY_SIZE_MISMATCH = 474, |
1055 | 1057 | ||
1056 | /* AES18 specific errors were 500..507 */ | 1058 | /* AES18 specific errors were 500..507 */ |
@@ -1078,8 +1080,7 @@ enum HPI_ERROR_CODES { | |||
1078 | /** \defgroup maximums HPI maximum values | 1080 | /** \defgroup maximums HPI maximum values |
1079 | \{ | 1081 | \{ |
1080 | */ | 1082 | */ |
1081 | /** Maximum number of adapters per HPI sub-system | 1083 | /** Maximum number of PCI HPI adapters */ |
1082 | WARNING: modifying this value changes the response structure size.*/ | ||
1083 | #define HPI_MAX_ADAPTERS 20 | 1084 | #define HPI_MAX_ADAPTERS 20 |
1084 | /** Maximum number of in or out streams per adapter */ | 1085 | /** Maximum number of in or out streams per adapter */ |
1085 | #define HPI_MAX_STREAMS 16 | 1086 | #define HPI_MAX_STREAMS 16 |
@@ -1090,6 +1091,9 @@ enum HPI_ERROR_CODES { | |||
1090 | #define HPI_MAX_ANC_BYTES_PER_FRAME (64) | 1091 | #define HPI_MAX_ANC_BYTES_PER_FRAME (64) |
1091 | #define HPI_STRING_LEN 16 | 1092 | #define HPI_STRING_LEN 16 |
1092 | 1093 | ||
1094 | /** Networked adapters have index >= 100 */ | ||
1095 | #define HPI_MIN_NETWORK_ADAPTER_IDX 100 | ||
1096 | |||
1093 | /** Velocity units */ | 1097 | /** Velocity units */ |
1094 | #define HPI_OSTREAM_VELOCITY_UNITS 4096 | 1098 | #define HPI_OSTREAM_VELOCITY_UNITS 4096 |
1095 | /** OutStream timescale units */ | 1099 | /** OutStream timescale units */ |
@@ -1111,14 +1115,14 @@ enum HPI_ERROR_CODES { | |||
1111 | struct hpi_format { | 1115 | struct hpi_format { |
1112 | u32 sample_rate; | 1116 | u32 sample_rate; |
1113 | /**< 11025, 32000, 44100 ... */ | 1117 | /**< 11025, 32000, 44100 ... */ |
1114 | u32 bit_rate; /**< for MPEG */ | 1118 | u32 bit_rate; /**< for MPEG */ |
1115 | u32 attributes; | 1119 | u32 attributes; |
1116 | /**< Stereo/JointStereo/Mono */ | 1120 | /**< Stereo/JointStereo/Mono */ |
1117 | u16 mode_legacy; | 1121 | u16 mode_legacy; |
1118 | /**< Legacy ancillary mode or idle bit */ | 1122 | /**< Legacy ancillary mode or idle bit */ |
1119 | u16 unused; /**< Unused */ | 1123 | u16 unused; /**< Unused */ |
1120 | u16 channels; /**< 1,2..., (or ancillary mode or idle bit */ | 1124 | u16 channels; /**< 1,2..., (or ancillary mode or idle bit */ |
1121 | u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */ | 1125 | u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see #HPI_FORMATS. */ |
1122 | }; | 1126 | }; |
1123 | 1127 | ||
1124 | struct hpi_anc_frame { | 1128 | struct hpi_anc_frame { |
@@ -1144,9 +1148,6 @@ struct hpi_async_event { | |||
1144 | } u; | 1148 | } u; |
1145 | }; | 1149 | }; |
1146 | 1150 | ||
1147 | /* skip host side function declarations for | ||
1148 | DSP compile and documentation extraction */ | ||
1149 | |||
1150 | #ifndef DISABLE_PRAGMA_PACK1 | 1151 | #ifndef DISABLE_PRAGMA_PACK1 |
1151 | #pragma pack(pop) | 1152 | #pragma pack(pop) |
1152 | #endif | 1153 | #endif |
@@ -1357,7 +1358,7 @@ u16 hpi_volume_get_mute(u32 h_control, u32 *mute); | |||
1357 | u16 hpi_volume_query_range(u32 h_control, short *min_gain_01dB, | 1358 | u16 hpi_volume_query_range(u32 h_control, short *min_gain_01dB, |
1358 | short *max_gain_01dB, short *step_gain_01dB); | 1359 | short *max_gain_01dB, short *step_gain_01dB); |
1359 | 1360 | ||
1360 | u16 hpi_volume_query_channels(const u32 h_volume, u32 *p_channels); | 1361 | u16 hpi_volume_query_channels(const u32 h_control, u32 *p_channels); |
1361 | 1362 | ||
1362 | u16 hpi_volume_auto_fade(u32 h_control, | 1363 | u16 hpi_volume_auto_fade(u32 h_control, |
1363 | short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms); | 1364 | short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms); |
@@ -1366,6 +1367,9 @@ u16 hpi_volume_auto_fade_profile(u32 h_control, | |||
1366 | short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms, | 1367 | short an_stop_gain0_01dB[HPI_MAX_CHANNELS], u32 duration_ms, |
1367 | u16 profile); | 1368 | u16 profile); |
1368 | 1369 | ||
1370 | u16 hpi_volume_query_auto_fade_profile(const u32 h_control, const u32 i, | ||
1371 | u16 *profile); | ||
1372 | |||
1369 | /*****************/ | 1373 | /*****************/ |
1370 | /* Level control */ | 1374 | /* Level control */ |
1371 | /*****************/ | 1375 | /*****************/ |
diff --git a/sound/pci/asihpi/hpi6000.c b/sound/pci/asihpi/hpi6000.c index 3cc6f11c20aa..2414d7a2239d 100644 --- a/sound/pci/asihpi/hpi6000.c +++ b/sound/pci/asihpi/hpi6000.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
@@ -231,6 +231,8 @@ static void subsys_message(struct hpi_message *phm, struct hpi_response *phr) | |||
231 | static void control_message(struct hpi_adapter_obj *pao, | 231 | static void control_message(struct hpi_adapter_obj *pao, |
232 | struct hpi_message *phm, struct hpi_response *phr) | 232 | struct hpi_message *phm, struct hpi_response *phr) |
233 | { | 233 | { |
234 | struct hpi_hw_obj *phw = pao->priv; | ||
235 | |||
234 | switch (phm->function) { | 236 | switch (phm->function) { |
235 | case HPI_CONTROL_GET_STATE: | 237 | case HPI_CONTROL_GET_STATE: |
236 | if (pao->has_control_cache) { | 238 | if (pao->has_control_cache) { |
@@ -248,17 +250,14 @@ static void control_message(struct hpi_adapter_obj *pao, | |||
248 | break; | 250 | break; |
249 | } | 251 | } |
250 | 252 | ||
251 | if (hpi_check_control_cache(((struct hpi_hw_obj *) | 253 | if (hpi_check_control_cache(phw->p_cache, phm, phr)) |
252 | pao->priv)->p_cache, phm, | ||
253 | phr)) | ||
254 | break; | 254 | break; |
255 | } | 255 | } |
256 | hw_message(pao, phm, phr); | 256 | hw_message(pao, phm, phr); |
257 | break; | 257 | break; |
258 | case HPI_CONTROL_SET_STATE: | 258 | case HPI_CONTROL_SET_STATE: |
259 | hw_message(pao, phm, phr); | 259 | hw_message(pao, phm, phr); |
260 | hpi_cmn_control_cache_sync_to_msg(((struct hpi_hw_obj *)pao-> | 260 | hpi_cmn_control_cache_sync_to_msg(phw->p_cache, phm, phr); |
261 | priv)->p_cache, phm, phr); | ||
262 | break; | 261 | break; |
263 | 262 | ||
264 | case HPI_CONTROL_GET_INFO: | 263 | case HPI_CONTROL_GET_INFO: |
@@ -451,11 +450,11 @@ static void subsys_create_adapter(struct hpi_message *phm, | |||
451 | } | 450 | } |
452 | 451 | ||
453 | for (dsp_index = 0; dsp_index < MAX_DSPS; dsp_index++) { | 452 | for (dsp_index = 0; dsp_index < MAX_DSPS; dsp_index++) { |
454 | struct hpi_hw_obj *phw = (struct hpi_hw_obj *)pao->priv; | 453 | struct hpi_hw_obj *phw = pao->priv; |
455 | phw->ado[dsp_index].pa_parent_adapter = pao; | 454 | phw->ado[dsp_index].pa_parent_adapter = pao; |
456 | } | 455 | } |
457 | 456 | ||
458 | phr->u.s.adapter_type = ao.adapter_type; | 457 | phr->u.s.adapter_type = ao.type; |
459 | phr->u.s.adapter_index = ao.index; | 458 | phr->u.s.adapter_index = ao.index; |
460 | phr->error = 0; | 459 | phr->error = 0; |
461 | } | 460 | } |
@@ -476,7 +475,7 @@ static short create_adapter_obj(struct hpi_adapter_obj *pao, | |||
476 | u32 dsp_index = 0; | 475 | u32 dsp_index = 0; |
477 | u32 control_cache_size = 0; | 476 | u32 control_cache_size = 0; |
478 | u32 control_cache_count = 0; | 477 | u32 control_cache_count = 0; |
479 | struct hpi_hw_obj *phw = (struct hpi_hw_obj *)pao->priv; | 478 | struct hpi_hw_obj *phw = pao->priv; |
480 | 479 | ||
481 | /* The PCI2040 has the following address map */ | 480 | /* The PCI2040 has the following address map */ |
482 | /* BAR0 - 4K = HPI control and status registers on PCI2040 (HPI CSR) */ | 481 | /* BAR0 - 4K = HPI control and status registers on PCI2040 (HPI CSR) */ |
@@ -559,7 +558,7 @@ static short create_adapter_obj(struct hpi_adapter_obj *pao, | |||
559 | if (error) | 558 | if (error) |
560 | return error; | 559 | return error; |
561 | } | 560 | } |
562 | pao->adapter_type = hr0.u.ax.info.adapter_type; | 561 | pao->type = hr0.u.ax.info.adapter_type; |
563 | pao->index = hr0.u.ax.info.adapter_index; | 562 | pao->index = hr0.u.ax.info.adapter_index; |
564 | } | 563 | } |
565 | 564 | ||
@@ -584,9 +583,8 @@ static short create_adapter_obj(struct hpi_adapter_obj *pao, | |||
584 | pao->has_control_cache = 1; | 583 | pao->has_control_cache = 1; |
585 | } | 584 | } |
586 | 585 | ||
587 | HPI_DEBUG_LOG(DEBUG, "get adapter info ASI%04X index %d\n", | 586 | HPI_DEBUG_LOG(DEBUG, "get adapter info ASI%04X index %d\n", pao->type, |
588 | pao->adapter_type, pao->index); | 587 | pao->index); |
589 | pao->open = 0; /* upon creation the adapter is closed */ | ||
590 | 588 | ||
591 | if (phw->p_cache) | 589 | if (phw->p_cache) |
592 | phw->p_cache->adap_idx = pao->index; | 590 | phw->p_cache->adap_idx = pao->index; |
@@ -596,7 +594,7 @@ static short create_adapter_obj(struct hpi_adapter_obj *pao, | |||
596 | 594 | ||
597 | static void delete_adapter_obj(struct hpi_adapter_obj *pao) | 595 | static void delete_adapter_obj(struct hpi_adapter_obj *pao) |
598 | { | 596 | { |
599 | struct hpi_hw_obj *phw = (struct hpi_hw_obj *)pao->priv; | 597 | struct hpi_hw_obj *phw = pao->priv; |
600 | 598 | ||
601 | if (pao->has_control_cache) | 599 | if (pao->has_control_cache) |
602 | hpi_free_control_cache(phw->p_cache); | 600 | hpi_free_control_cache(phw->p_cache); |
@@ -639,7 +637,7 @@ static void adapter_get_asserts(struct hpi_adapter_obj *pao, | |||
639 | static short hpi6000_adapter_boot_load_dsp(struct hpi_adapter_obj *pao, | 637 | static short hpi6000_adapter_boot_load_dsp(struct hpi_adapter_obj *pao, |
640 | u32 *pos_error_code) | 638 | u32 *pos_error_code) |
641 | { | 639 | { |
642 | struct hpi_hw_obj *phw = (struct hpi_hw_obj *)pao->priv; | 640 | struct hpi_hw_obj *phw = pao->priv; |
643 | short error; | 641 | short error; |
644 | u32 timeout; | 642 | u32 timeout; |
645 | u32 read = 0; | 643 | u32 read = 0; |
@@ -1220,8 +1218,8 @@ static void hpi_read_block(struct dsp_obj *pdo, u32 address, u32 *pdata, | |||
1220 | static u16 hpi6000_dsp_block_write32(struct hpi_adapter_obj *pao, | 1218 | static u16 hpi6000_dsp_block_write32(struct hpi_adapter_obj *pao, |
1221 | u16 dsp_index, u32 hpi_address, u32 *source, u32 count) | 1219 | u16 dsp_index, u32 hpi_address, u32 *source, u32 count) |
1222 | { | 1220 | { |
1223 | struct dsp_obj *pdo = | 1221 | struct hpi_hw_obj *phw = pao->priv; |
1224 | &(*(struct hpi_hw_obj *)pao->priv).ado[dsp_index]; | 1222 | struct dsp_obj *pdo = &phw->ado[dsp_index]; |
1225 | u32 time_out = PCI_TIMEOUT; | 1223 | u32 time_out = PCI_TIMEOUT; |
1226 | int c6711_burst_size = 128; | 1224 | int c6711_burst_size = 128; |
1227 | u32 local_hpi_address = hpi_address; | 1225 | u32 local_hpi_address = hpi_address; |
@@ -1258,8 +1256,8 @@ static u16 hpi6000_dsp_block_write32(struct hpi_adapter_obj *pao, | |||
1258 | static u16 hpi6000_dsp_block_read32(struct hpi_adapter_obj *pao, | 1256 | static u16 hpi6000_dsp_block_read32(struct hpi_adapter_obj *pao, |
1259 | u16 dsp_index, u32 hpi_address, u32 *dest, u32 count) | 1257 | u16 dsp_index, u32 hpi_address, u32 *dest, u32 count) |
1260 | { | 1258 | { |
1261 | struct dsp_obj *pdo = | 1259 | struct hpi_hw_obj *phw = pao->priv; |
1262 | &(*(struct hpi_hw_obj *)pao->priv).ado[dsp_index]; | 1260 | struct dsp_obj *pdo = &phw->ado[dsp_index]; |
1263 | u32 time_out = PCI_TIMEOUT; | 1261 | u32 time_out = PCI_TIMEOUT; |
1264 | int c6711_burst_size = 16; | 1262 | int c6711_burst_size = 16; |
1265 | u32 local_hpi_address = hpi_address; | 1263 | u32 local_hpi_address = hpi_address; |
@@ -1298,7 +1296,7 @@ static u16 hpi6000_dsp_block_read32(struct hpi_adapter_obj *pao, | |||
1298 | static short hpi6000_message_response_sequence(struct hpi_adapter_obj *pao, | 1296 | static short hpi6000_message_response_sequence(struct hpi_adapter_obj *pao, |
1299 | u16 dsp_index, struct hpi_message *phm, struct hpi_response *phr) | 1297 | u16 dsp_index, struct hpi_message *phm, struct hpi_response *phr) |
1300 | { | 1298 | { |
1301 | struct hpi_hw_obj *phw = (struct hpi_hw_obj *)pao->priv; | 1299 | struct hpi_hw_obj *phw = pao->priv; |
1302 | struct dsp_obj *pdo = &phw->ado[dsp_index]; | 1300 | struct dsp_obj *pdo = &phw->ado[dsp_index]; |
1303 | u32 timeout; | 1301 | u32 timeout; |
1304 | u16 ack; | 1302 | u16 ack; |
@@ -1414,8 +1412,8 @@ static short hpi6000_send_data_check_adr(u32 address, u32 length_in_dwords) | |||
1414 | static short hpi6000_send_data(struct hpi_adapter_obj *pao, u16 dsp_index, | 1412 | static short hpi6000_send_data(struct hpi_adapter_obj *pao, u16 dsp_index, |
1415 | struct hpi_message *phm, struct hpi_response *phr) | 1413 | struct hpi_message *phm, struct hpi_response *phr) |
1416 | { | 1414 | { |
1417 | struct dsp_obj *pdo = | 1415 | struct hpi_hw_obj *phw = pao->priv; |
1418 | &(*(struct hpi_hw_obj *)pao->priv).ado[dsp_index]; | 1416 | struct dsp_obj *pdo = &phw->ado[dsp_index]; |
1419 | u32 data_sent = 0; | 1417 | u32 data_sent = 0; |
1420 | u16 ack; | 1418 | u16 ack; |
1421 | u32 length, address; | 1419 | u32 length, address; |
@@ -1487,8 +1485,8 @@ static short hpi6000_send_data(struct hpi_adapter_obj *pao, u16 dsp_index, | |||
1487 | static short hpi6000_get_data(struct hpi_adapter_obj *pao, u16 dsp_index, | 1485 | static short hpi6000_get_data(struct hpi_adapter_obj *pao, u16 dsp_index, |
1488 | struct hpi_message *phm, struct hpi_response *phr) | 1486 | struct hpi_message *phm, struct hpi_response *phr) |
1489 | { | 1487 | { |
1490 | struct dsp_obj *pdo = | 1488 | struct hpi_hw_obj *phw = pao->priv; |
1491 | &(*(struct hpi_hw_obj *)pao->priv).ado[dsp_index]; | 1489 | struct dsp_obj *pdo = &phw->ado[dsp_index]; |
1492 | u32 data_got = 0; | 1490 | u32 data_got = 0; |
1493 | u16 ack; | 1491 | u16 ack; |
1494 | u32 length, address; | 1492 | u32 length, address; |
@@ -1551,8 +1549,8 @@ static void hpi6000_send_dsp_interrupt(struct dsp_obj *pdo) | |||
1551 | static short hpi6000_send_host_command(struct hpi_adapter_obj *pao, | 1549 | static short hpi6000_send_host_command(struct hpi_adapter_obj *pao, |
1552 | u16 dsp_index, u32 host_cmd) | 1550 | u16 dsp_index, u32 host_cmd) |
1553 | { | 1551 | { |
1554 | struct dsp_obj *pdo = | 1552 | struct hpi_hw_obj *phw = pao->priv; |
1555 | &(*(struct hpi_hw_obj *)pao->priv).ado[dsp_index]; | 1553 | struct dsp_obj *pdo = &phw->ado[dsp_index]; |
1556 | u32 timeout = TIMEOUT; | 1554 | u32 timeout = TIMEOUT; |
1557 | 1555 | ||
1558 | /* set command */ | 1556 | /* set command */ |
@@ -1577,7 +1575,7 @@ static short hpi6000_check_PCI2040_error_flag(struct hpi_adapter_obj *pao, | |||
1577 | { | 1575 | { |
1578 | u32 hPI_error; | 1576 | u32 hPI_error; |
1579 | 1577 | ||
1580 | struct hpi_hw_obj *phw = (struct hpi_hw_obj *)pao->priv; | 1578 | struct hpi_hw_obj *phw = pao->priv; |
1581 | 1579 | ||
1582 | /* read the error bits from the PCI2040 */ | 1580 | /* read the error bits from the PCI2040 */ |
1583 | hPI_error = ioread32(phw->dw2040_HPICSR + HPI_ERROR_REPORT); | 1581 | hPI_error = ioread32(phw->dw2040_HPICSR + HPI_ERROR_REPORT); |
@@ -1597,8 +1595,8 @@ static short hpi6000_check_PCI2040_error_flag(struct hpi_adapter_obj *pao, | |||
1597 | static short hpi6000_wait_dsp_ack(struct hpi_adapter_obj *pao, u16 dsp_index, | 1595 | static short hpi6000_wait_dsp_ack(struct hpi_adapter_obj *pao, u16 dsp_index, |
1598 | u32 ack_value) | 1596 | u32 ack_value) |
1599 | { | 1597 | { |
1600 | struct dsp_obj *pdo = | 1598 | struct hpi_hw_obj *phw = pao->priv; |
1601 | &(*(struct hpi_hw_obj *)pao->priv).ado[dsp_index]; | 1599 | struct dsp_obj *pdo = &phw->ado[dsp_index]; |
1602 | u32 ack = 0L; | 1600 | u32 ack = 0L; |
1603 | u32 timeout; | 1601 | u32 timeout; |
1604 | u32 hPIC = 0L; | 1602 | u32 hPIC = 0L; |
@@ -1640,7 +1638,7 @@ static short hpi6000_update_control_cache(struct hpi_adapter_obj *pao, | |||
1640 | struct hpi_message *phm) | 1638 | struct hpi_message *phm) |
1641 | { | 1639 | { |
1642 | const u16 dsp_index = 0; | 1640 | const u16 dsp_index = 0; |
1643 | struct hpi_hw_obj *phw = (struct hpi_hw_obj *)pao->priv; | 1641 | struct hpi_hw_obj *phw = pao->priv; |
1644 | struct dsp_obj *pdo = &phw->ado[dsp_index]; | 1642 | struct dsp_obj *pdo = &phw->ado[dsp_index]; |
1645 | u32 timeout; | 1643 | u32 timeout; |
1646 | u32 cache_dirty_flag; | 1644 | u32 cache_dirty_flag; |
@@ -1740,7 +1738,8 @@ static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm, | |||
1740 | { | 1738 | { |
1741 | u16 error = 0; | 1739 | u16 error = 0; |
1742 | u16 dsp_index = 0; | 1740 | u16 dsp_index = 0; |
1743 | u16 num_dsp = ((struct hpi_hw_obj *)pao->priv)->num_dsp; | 1741 | struct hpi_hw_obj *phw = pao->priv; |
1742 | u16 num_dsp = phw->num_dsp; | ||
1744 | 1743 | ||
1745 | if (num_dsp < 2) | 1744 | if (num_dsp < 2) |
1746 | dsp_index = 0; | 1745 | dsp_index = 0; |
diff --git a/sound/pci/asihpi/hpi6000.h b/sound/pci/asihpi/hpi6000.h index 4c7d507c0ecd..7e0deeff5e7c 100644 --- a/sound/pci/asihpi/hpi6000.h +++ b/sound/pci/asihpi/hpi6000.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /***************************************************************************** | 1 | /***************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
diff --git a/sound/pci/asihpi/hpi6205.c b/sound/pci/asihpi/hpi6205.c index e041a6ae1c5a..4f2873880b16 100644 --- a/sound/pci/asihpi/hpi6205.c +++ b/sound/pci/asihpi/hpi6205.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
@@ -45,18 +45,21 @@ | |||
45 | #define HPI6205_ERROR_MSG_RESP_TIMEOUT 1016 | 45 | #define HPI6205_ERROR_MSG_RESP_TIMEOUT 1016 |
46 | 46 | ||
47 | /* initialization/bootload errors */ | 47 | /* initialization/bootload errors */ |
48 | #define HPI6205_ERROR_6205_NO_IRQ 1002 | 48 | #define HPI6205_ERROR_6205_NO_IRQ 1002 |
49 | #define HPI6205_ERROR_6205_INIT_FAILED 1003 | 49 | #define HPI6205_ERROR_6205_INIT_FAILED 1003 |
50 | #define HPI6205_ERROR_6205_REG 1006 | 50 | #define HPI6205_ERROR_6205_REG 1006 |
51 | #define HPI6205_ERROR_6205_DSPPAGE 1007 | 51 | #define HPI6205_ERROR_6205_DSPPAGE 1007 |
52 | #define HPI6205_ERROR_C6713_HPIC 1009 | 52 | #define HPI6205_ERROR_C6713_HPIC 1009 |
53 | #define HPI6205_ERROR_C6713_HPIA 1010 | 53 | #define HPI6205_ERROR_C6713_HPIA 1010 |
54 | #define HPI6205_ERROR_C6713_PLL 1011 | 54 | #define HPI6205_ERROR_C6713_PLL 1011 |
55 | #define HPI6205_ERROR_DSP_INTMEM 1012 | 55 | #define HPI6205_ERROR_DSP_INTMEM 1012 |
56 | #define HPI6205_ERROR_DSP_EXTMEM 1013 | 56 | #define HPI6205_ERROR_DSP_EXTMEM 1013 |
57 | #define HPI6205_ERROR_DSP_PLD 1014 | 57 | #define HPI6205_ERROR_DSP_PLD 1014 |
58 | #define HPI6205_ERROR_6205_EEPROM 1017 | 58 | #define HPI6205_ERROR_6205_EEPROM 1017 |
59 | #define HPI6205_ERROR_DSP_EMIF 1018 | 59 | #define HPI6205_ERROR_DSP_EMIF1 1018 |
60 | #define HPI6205_ERROR_DSP_EMIF2 1019 | ||
61 | #define HPI6205_ERROR_DSP_EMIF3 1020 | ||
62 | #define HPI6205_ERROR_DSP_EMIF4 1021 | ||
60 | 63 | ||
61 | /*****************************************************************************/ | 64 | /*****************************************************************************/ |
62 | /* for C6205 PCI i/f */ | 65 | /* for C6205 PCI i/f */ |
@@ -488,7 +491,7 @@ static void subsys_create_adapter(struct hpi_message *phm, | |||
488 | return; | 491 | return; |
489 | } | 492 | } |
490 | 493 | ||
491 | phr->u.s.adapter_type = ao.adapter_type; | 494 | phr->u.s.adapter_type = ao.type; |
492 | phr->u.s.adapter_index = ao.index; | 495 | phr->u.s.adapter_index = ao.index; |
493 | phr->error = 0; | 496 | phr->error = 0; |
494 | } | 497 | } |
@@ -503,7 +506,7 @@ static void adapter_delete(struct hpi_adapter_obj *pao, | |||
503 | phr->error = HPI_ERROR_INVALID_OBJ_INDEX; | 506 | phr->error = HPI_ERROR_INVALID_OBJ_INDEX; |
504 | return; | 507 | return; |
505 | } | 508 | } |
506 | phw = (struct hpi_hw_obj *)pao->priv; | 509 | phw = pao->priv; |
507 | /* reset adapter h/w */ | 510 | /* reset adapter h/w */ |
508 | /* Reset C6713 #1 */ | 511 | /* Reset C6713 #1 */ |
509 | boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 0); | 512 | boot_loader_write_mem32(pao, 0, C6205_BAR0_TIMER1_CTL, 0); |
@@ -652,7 +655,7 @@ static u16 create_adapter_obj(struct hpi_adapter_obj *pao, | |||
652 | if (hr.error) | 655 | if (hr.error) |
653 | return hr.error; | 656 | return hr.error; |
654 | 657 | ||
655 | pao->adapter_type = hr.u.ax.info.adapter_type; | 658 | pao->type = hr.u.ax.info.adapter_type; |
656 | pao->index = hr.u.ax.info.adapter_index; | 659 | pao->index = hr.u.ax.info.adapter_index; |
657 | 660 | ||
658 | max_streams = | 661 | max_streams = |
@@ -665,8 +668,6 @@ static u16 create_adapter_obj(struct hpi_adapter_obj *pao, | |||
665 | hr.u.ax.info.serial_number); | 668 | hr.u.ax.info.serial_number); |
666 | } | 669 | } |
667 | 670 | ||
668 | pao->open = 0; /* upon creation the adapter is closed */ | ||
669 | |||
670 | if (phw->p_cache) | 671 | if (phw->p_cache) |
671 | phw->p_cache->adap_idx = pao->index; | 672 | phw->p_cache->adap_idx = pao->index; |
672 | 673 | ||
@@ -803,8 +804,8 @@ static void outstream_host_buffer_allocate(struct hpi_adapter_obj *pao, | |||
803 | obj_index]; | 804 | obj_index]; |
804 | status->samples_processed = 0; | 805 | status->samples_processed = 0; |
805 | status->stream_state = HPI_STATE_STOPPED; | 806 | status->stream_state = HPI_STATE_STOPPED; |
806 | status->dSP_index = 0; | 807 | status->dsp_index = 0; |
807 | status->host_index = status->dSP_index; | 808 | status->host_index = status->dsp_index; |
808 | status->size_in_bytes = phm->u.d.u.buffer.buffer_size; | 809 | status->size_in_bytes = phm->u.d.u.buffer.buffer_size; |
809 | status->auxiliary_data_available = 0; | 810 | status->auxiliary_data_available = 0; |
810 | 811 | ||
@@ -878,7 +879,7 @@ static void outstream_host_buffer_free(struct hpi_adapter_obj *pao, | |||
878 | static u32 outstream_get_space_available(struct hpi_hostbuffer_status *status) | 879 | static u32 outstream_get_space_available(struct hpi_hostbuffer_status *status) |
879 | { | 880 | { |
880 | return status->size_in_bytes - (status->host_index - | 881 | return status->size_in_bytes - (status->host_index - |
881 | status->dSP_index); | 882 | status->dsp_index); |
882 | } | 883 | } |
883 | 884 | ||
884 | static void outstream_write(struct hpi_adapter_obj *pao, | 885 | static void outstream_write(struct hpi_adapter_obj *pao, |
@@ -1080,8 +1081,8 @@ static void instream_host_buffer_allocate(struct hpi_adapter_obj *pao, | |||
1080 | obj_index]; | 1081 | obj_index]; |
1081 | status->samples_processed = 0; | 1082 | status->samples_processed = 0; |
1082 | status->stream_state = HPI_STATE_STOPPED; | 1083 | status->stream_state = HPI_STATE_STOPPED; |
1083 | status->dSP_index = 0; | 1084 | status->dsp_index = 0; |
1084 | status->host_index = status->dSP_index; | 1085 | status->host_index = status->dsp_index; |
1085 | status->size_in_bytes = phm->u.d.u.buffer.buffer_size; | 1086 | status->size_in_bytes = phm->u.d.u.buffer.buffer_size; |
1086 | status->auxiliary_data_available = 0; | 1087 | status->auxiliary_data_available = 0; |
1087 | 1088 | ||
@@ -1162,7 +1163,7 @@ static void instream_start(struct hpi_adapter_obj *pao, | |||
1162 | 1163 | ||
1163 | static u32 instream_get_bytes_available(struct hpi_hostbuffer_status *status) | 1164 | static u32 instream_get_bytes_available(struct hpi_hostbuffer_status *status) |
1164 | { | 1165 | { |
1165 | return status->dSP_index - status->host_index; | 1166 | return status->dsp_index - status->host_index; |
1166 | } | 1167 | } |
1167 | 1168 | ||
1168 | static void instream_read(struct hpi_adapter_obj *pao, | 1169 | static void instream_read(struct hpi_adapter_obj *pao, |
@@ -1614,7 +1615,7 @@ static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao, int dsp_index) | |||
1614 | boot_loader_write_mem32(pao, dsp_index, 0x01800008, setting); | 1615 | boot_loader_write_mem32(pao, dsp_index, 0x01800008, setting); |
1615 | if (setting != boot_loader_read_mem32(pao, dsp_index, | 1616 | if (setting != boot_loader_read_mem32(pao, dsp_index, |
1616 | 0x01800008)) | 1617 | 0x01800008)) |
1617 | return HPI6205_ERROR_DSP_EMIF; | 1618 | return HPI6205_ERROR_DSP_EMIF1; |
1618 | 1619 | ||
1619 | /* EMIF CE1 setup - 32 bit async. This is 6713 #1 HPI, */ | 1620 | /* EMIF CE1 setup - 32 bit async. This is 6713 #1 HPI, */ |
1620 | /* which occupies D15..0. 6713 starts at 27MHz, so need */ | 1621 | /* which occupies D15..0. 6713 starts at 27MHz, so need */ |
@@ -1627,7 +1628,7 @@ static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao, int dsp_index) | |||
1627 | boot_loader_write_mem32(pao, dsp_index, 0x01800004, setting); | 1628 | boot_loader_write_mem32(pao, dsp_index, 0x01800004, setting); |
1628 | if (setting != boot_loader_read_mem32(pao, dsp_index, | 1629 | if (setting != boot_loader_read_mem32(pao, dsp_index, |
1629 | 0x01800004)) | 1630 | 0x01800004)) |
1630 | return HPI6205_ERROR_DSP_EMIF; | 1631 | return HPI6205_ERROR_DSP_EMIF2; |
1631 | 1632 | ||
1632 | /* EMIF CE2 setup - 32 bit async. This is 6713 #2 HPI, */ | 1633 | /* EMIF CE2 setup - 32 bit async. This is 6713 #2 HPI, */ |
1633 | /* which occupies D15..0. 6713 starts at 27MHz, so need */ | 1634 | /* which occupies D15..0. 6713 starts at 27MHz, so need */ |
@@ -1639,7 +1640,7 @@ static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao, int dsp_index) | |||
1639 | boot_loader_write_mem32(pao, dsp_index, 0x01800010, setting); | 1640 | boot_loader_write_mem32(pao, dsp_index, 0x01800010, setting); |
1640 | if (setting != boot_loader_read_mem32(pao, dsp_index, | 1641 | if (setting != boot_loader_read_mem32(pao, dsp_index, |
1641 | 0x01800010)) | 1642 | 0x01800010)) |
1642 | return HPI6205_ERROR_DSP_EMIF; | 1643 | return HPI6205_ERROR_DSP_EMIF3; |
1643 | 1644 | ||
1644 | /* EMIF CE3 setup - 32 bit async. */ | 1645 | /* EMIF CE3 setup - 32 bit async. */ |
1645 | /* This is the PLD on the ASI5000 cards only */ | 1646 | /* This is the PLD on the ASI5000 cards only */ |
@@ -1650,7 +1651,7 @@ static u16 boot_loader_config_emif(struct hpi_adapter_obj *pao, int dsp_index) | |||
1650 | boot_loader_write_mem32(pao, dsp_index, 0x01800014, setting); | 1651 | boot_loader_write_mem32(pao, dsp_index, 0x01800014, setting); |
1651 | if (setting != boot_loader_read_mem32(pao, dsp_index, | 1652 | if (setting != boot_loader_read_mem32(pao, dsp_index, |
1652 | 0x01800014)) | 1653 | 0x01800014)) |
1653 | return HPI6205_ERROR_DSP_EMIF; | 1654 | return HPI6205_ERROR_DSP_EMIF4; |
1654 | 1655 | ||
1655 | /* set EMIF SDRAM control for 2Mx32 SDRAM (512x32x4 bank) */ | 1656 | /* set EMIF SDRAM control for 2Mx32 SDRAM (512x32x4 bank) */ |
1656 | /* need to use this else DSP code crashes? */ | 1657 | /* need to use this else DSP code crashes? */ |
diff --git a/sound/pci/asihpi/hpi_internal.h b/sound/pci/asihpi/hpi_internal.h index d497030c160f..4cc315daeda0 100644 --- a/sound/pci/asihpi/hpi_internal.h +++ b/sound/pci/asihpi/hpi_internal.h | |||
@@ -25,6 +25,7 @@ HPI internal definitions | |||
25 | #define _HPI_INTERNAL_H_ | 25 | #define _HPI_INTERNAL_H_ |
26 | 26 | ||
27 | #include "hpi.h" | 27 | #include "hpi.h" |
28 | |||
28 | /** maximum number of memory regions mapped to an adapter */ | 29 | /** maximum number of memory regions mapped to an adapter */ |
29 | #define HPI_MAX_ADAPTER_MEM_SPACES (2) | 30 | #define HPI_MAX_ADAPTER_MEM_SPACES (2) |
30 | 31 | ||
@@ -220,8 +221,6 @@ enum HPI_CONTROL_ATTRIBUTES { | |||
220 | 221 | ||
221 | HPI_COBRANET_SET = HPI_CTL_ATTR(COBRANET, 1), | 222 | HPI_COBRANET_SET = HPI_CTL_ATTR(COBRANET, 1), |
222 | HPI_COBRANET_GET = HPI_CTL_ATTR(COBRANET, 2), | 223 | HPI_COBRANET_GET = HPI_CTL_ATTR(COBRANET, 2), |
223 | /*HPI_COBRANET_SET_DATA = HPI_CTL_ATTR(COBRANET, 3), */ | ||
224 | /*HPI_COBRANET_GET_DATA = HPI_CTL_ATTR(COBRANET, 4), */ | ||
225 | HPI_COBRANET_GET_STATUS = HPI_CTL_ATTR(COBRANET, 5), | 224 | HPI_COBRANET_GET_STATUS = HPI_CTL_ATTR(COBRANET, 5), |
226 | HPI_COBRANET_SEND_PACKET = HPI_CTL_ATTR(COBRANET, 6), | 225 | HPI_COBRANET_SEND_PACKET = HPI_CTL_ATTR(COBRANET, 6), |
227 | HPI_COBRANET_GET_PACKET = HPI_CTL_ATTR(COBRANET, 7), | 226 | HPI_COBRANET_GET_PACKET = HPI_CTL_ATTR(COBRANET, 7), |
@@ -241,7 +240,9 @@ enum HPI_CONTROL_ATTRIBUTES { | |||
241 | HPI_PAD_PROGRAM_TYPE = HPI_CTL_ATTR(PAD, 5), | 240 | HPI_PAD_PROGRAM_TYPE = HPI_CTL_ATTR(PAD, 5), |
242 | HPI_PAD_PROGRAM_ID = HPI_CTL_ATTR(PAD, 6), | 241 | HPI_PAD_PROGRAM_ID = HPI_CTL_ATTR(PAD, 6), |
243 | HPI_PAD_TA_SUPPORT = HPI_CTL_ATTR(PAD, 7), | 242 | HPI_PAD_TA_SUPPORT = HPI_CTL_ATTR(PAD, 7), |
244 | HPI_PAD_TA_ACTIVE = HPI_CTL_ATTR(PAD, 8) | 243 | HPI_PAD_TA_ACTIVE = HPI_CTL_ATTR(PAD, 8), |
244 | |||
245 | HPI_UNIVERSAL_ENTITY = HPI_CTL_ATTR(UNIVERSAL, 1) | ||
245 | }; | 246 | }; |
246 | 247 | ||
247 | #define HPI_POLARITY_POSITIVE 0 | 248 | #define HPI_POLARITY_POSITIVE 0 |
@@ -393,14 +394,10 @@ enum HPI_FUNCTION_IDS { | |||
393 | HPI_SUBSYS_OPEN = HPI_FUNC_ID(SUBSYSTEM, 1), | 394 | HPI_SUBSYS_OPEN = HPI_FUNC_ID(SUBSYSTEM, 1), |
394 | HPI_SUBSYS_GET_VERSION = HPI_FUNC_ID(SUBSYSTEM, 2), | 395 | HPI_SUBSYS_GET_VERSION = HPI_FUNC_ID(SUBSYSTEM, 2), |
395 | HPI_SUBSYS_GET_INFO = HPI_FUNC_ID(SUBSYSTEM, 3), | 396 | HPI_SUBSYS_GET_INFO = HPI_FUNC_ID(SUBSYSTEM, 3), |
396 | /* HPI_SUBSYS_FIND_ADAPTERS = HPI_FUNC_ID(SUBSYSTEM, 4), */ | ||
397 | HPI_SUBSYS_CREATE_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 5), | 397 | HPI_SUBSYS_CREATE_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 5), |
398 | HPI_SUBSYS_CLOSE = HPI_FUNC_ID(SUBSYSTEM, 6), | 398 | HPI_SUBSYS_CLOSE = HPI_FUNC_ID(SUBSYSTEM, 6), |
399 | /* HPI_SUBSYS_DELETE_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 7), */ | ||
400 | HPI_SUBSYS_DRIVER_LOAD = HPI_FUNC_ID(SUBSYSTEM, 8), | 399 | HPI_SUBSYS_DRIVER_LOAD = HPI_FUNC_ID(SUBSYSTEM, 8), |
401 | HPI_SUBSYS_DRIVER_UNLOAD = HPI_FUNC_ID(SUBSYSTEM, 9), | 400 | HPI_SUBSYS_DRIVER_UNLOAD = HPI_FUNC_ID(SUBSYSTEM, 9), |
402 | /* HPI_SUBSYS_READ_PORT_8 = HPI_FUNC_ID(SUBSYSTEM, 10), */ | ||
403 | /* HPI_SUBSYS_WRITE_PORT_8 = HPI_FUNC_ID(SUBSYSTEM, 11), */ | ||
404 | HPI_SUBSYS_GET_NUM_ADAPTERS = HPI_FUNC_ID(SUBSYSTEM, 12), | 401 | HPI_SUBSYS_GET_NUM_ADAPTERS = HPI_FUNC_ID(SUBSYSTEM, 12), |
405 | HPI_SUBSYS_GET_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 13), | 402 | HPI_SUBSYS_GET_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 13), |
406 | HPI_SUBSYS_SET_NETWORK_INTERFACE = HPI_FUNC_ID(SUBSYSTEM, 14), | 403 | HPI_SUBSYS_SET_NETWORK_INTERFACE = HPI_FUNC_ID(SUBSYSTEM, 14), |
@@ -430,7 +427,10 @@ enum HPI_FUNCTION_IDS { | |||
430 | HPI_ADAPTER_IRQ_QUERY_AND_CLEAR = HPI_FUNC_ID(ADAPTER, 19), | 427 | HPI_ADAPTER_IRQ_QUERY_AND_CLEAR = HPI_FUNC_ID(ADAPTER, 19), |
431 | HPI_ADAPTER_IRQ_CALLBACK = HPI_FUNC_ID(ADAPTER, 20), | 428 | HPI_ADAPTER_IRQ_CALLBACK = HPI_FUNC_ID(ADAPTER, 20), |
432 | HPI_ADAPTER_DELETE = HPI_FUNC_ID(ADAPTER, 21), | 429 | HPI_ADAPTER_DELETE = HPI_FUNC_ID(ADAPTER, 21), |
433 | #define HPI_ADAPTER_FUNCTION_COUNT 21 | 430 | HPI_ADAPTER_READ_FLASH = HPI_FUNC_ID(ADAPTER, 22), |
431 | HPI_ADAPTER_END_FLASH = HPI_FUNC_ID(ADAPTER, 23), | ||
432 | HPI_ADAPTER_FILESTORE_DELETE_ALL = HPI_FUNC_ID(ADAPTER, 24), | ||
433 | #define HPI_ADAPTER_FUNCTION_COUNT 24 | ||
434 | 434 | ||
435 | HPI_OSTREAM_OPEN = HPI_FUNC_ID(OSTREAM, 1), | 435 | HPI_OSTREAM_OPEN = HPI_FUNC_ID(OSTREAM, 1), |
436 | HPI_OSTREAM_CLOSE = HPI_FUNC_ID(OSTREAM, 2), | 436 | HPI_OSTREAM_CLOSE = HPI_FUNC_ID(OSTREAM, 2), |
@@ -495,7 +495,9 @@ enum HPI_FUNCTION_IDS { | |||
495 | HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES = HPI_FUNC_ID(MIXER, 10), | 495 | HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES = HPI_FUNC_ID(MIXER, 10), |
496 | HPI_MIXER_STORE = HPI_FUNC_ID(MIXER, 11), | 496 | HPI_MIXER_STORE = HPI_FUNC_ID(MIXER, 11), |
497 | HPI_MIXER_GET_CACHE_INFO = HPI_FUNC_ID(MIXER, 12), | 497 | HPI_MIXER_GET_CACHE_INFO = HPI_FUNC_ID(MIXER, 12), |
498 | #define HPI_MIXER_FUNCTION_COUNT 12 | 498 | HPI_MIXER_GET_BLOCK_HANDLE = HPI_FUNC_ID(MIXER, 13), |
499 | HPI_MIXER_GET_PARAMETER_HANDLE = HPI_FUNC_ID(MIXER, 14), | ||
500 | #define HPI_MIXER_FUNCTION_COUNT 14 | ||
499 | 501 | ||
500 | HPI_CONTROL_GET_INFO = HPI_FUNC_ID(CONTROL, 1), | 502 | HPI_CONTROL_GET_INFO = HPI_FUNC_ID(CONTROL, 1), |
501 | HPI_CONTROL_GET_STATE = HPI_FUNC_ID(CONTROL, 2), | 503 | HPI_CONTROL_GET_STATE = HPI_FUNC_ID(CONTROL, 2), |
@@ -618,7 +620,7 @@ struct hpi_hostbuffer_status { | |||
618 | u32 auxiliary_data_available; | 620 | u32 auxiliary_data_available; |
619 | u32 stream_state; | 621 | u32 stream_state; |
620 | /* DSP index in to the host bus master buffer. */ | 622 | /* DSP index in to the host bus master buffer. */ |
621 | u32 dSP_index; | 623 | u32 dsp_index; |
622 | /* Host index in to the host bus master buffer. */ | 624 | /* Host index in to the host bus master buffer. */ |
623 | u32 host_index; | 625 | u32 host_index; |
624 | u32 size_in_bytes; | 626 | u32 size_in_bytes; |
@@ -661,13 +663,6 @@ union hpi_adapterx_msg { | |||
661 | u16 index; | 663 | u16 index; |
662 | } module_info; | 664 | } module_info; |
663 | struct { | 665 | struct { |
664 | u32 checksum; | ||
665 | u16 sequence; | ||
666 | u16 length; | ||
667 | u16 offset; /**< offset from start of msg to data */ | ||
668 | u16 unused; | ||
669 | } program_flash; | ||
670 | struct { | ||
671 | u16 index; | 666 | u16 index; |
672 | u16 what; | 667 | u16 what; |
673 | u16 property_index; | 668 | u16 property_index; |
@@ -678,25 +673,18 @@ union hpi_adapterx_msg { | |||
678 | u16 parameter2; | 673 | u16 parameter2; |
679 | } property_set; | 674 | } property_set; |
680 | struct { | 675 | struct { |
681 | u32 offset; | ||
682 | } query_flash; | ||
683 | struct { | ||
684 | u32 pad32; | 676 | u32 pad32; |
685 | u16 key1; | 677 | u16 key1; |
686 | u16 key2; | 678 | u16 key2; |
687 | } restart; | 679 | } restart; |
688 | struct { | 680 | struct { |
689 | u32 offset; | ||
690 | u32 length; | ||
691 | u32 key; | ||
692 | } start_flash; | ||
693 | struct { | ||
694 | u32 pad32; | 681 | u32 pad32; |
695 | u16 value; | 682 | u16 value; |
696 | } test_assert; | 683 | } test_assert; |
697 | struct { | 684 | struct { |
698 | u32 yes; | 685 | u32 yes; |
699 | } irq_query; | 686 | } irq_query; |
687 | u32 pad[3]; | ||
700 | }; | 688 | }; |
701 | 689 | ||
702 | struct hpi_adapter_res { | 690 | struct hpi_adapter_res { |
@@ -724,18 +712,10 @@ union hpi_adapterx_res { | |||
724 | u32 adapter_mode; | 712 | u32 adapter_mode; |
725 | } mode; | 713 | } mode; |
726 | struct { | 714 | struct { |
727 | u16 sequence; | ||
728 | } program_flash; | ||
729 | struct { | ||
730 | u16 parameter1; | 715 | u16 parameter1; |
731 | u16 parameter2; | 716 | u16 parameter2; |
732 | } property_get; | 717 | } property_get; |
733 | struct { | 718 | struct { |
734 | u32 checksum; | ||
735 | u32 length; | ||
736 | u32 version; | ||
737 | } query_flash; | ||
738 | struct { | ||
739 | u32 yes; | 719 | u32 yes; |
740 | } irq_query; | 720 | } irq_query; |
741 | }; | 721 | }; |
@@ -1150,74 +1130,9 @@ struct hpi_res_adapter_get_info { | |||
1150 | struct hpi_adapter_res p; | 1130 | struct hpi_adapter_res p; |
1151 | }; | 1131 | }; |
1152 | 1132 | ||
1153 | /* padding is so these are same size as v0 hpi_message */ | ||
1154 | struct hpi_msg_adapter_query_flash { | ||
1155 | struct hpi_message_header h; | ||
1156 | u32 offset; | ||
1157 | u8 pad_to_version0_size[sizeof(struct hpi_message) - /* V0 res */ | ||
1158 | sizeof(struct hpi_message_header) - 1 * sizeof(u32)]; | ||
1159 | }; | ||
1160 | |||
1161 | /* padding is so these are same size as v0 hpi_response */ | ||
1162 | struct hpi_res_adapter_query_flash { | ||
1163 | struct hpi_response_header h; | ||
1164 | u32 checksum; | ||
1165 | u32 length; | ||
1166 | u32 version; | ||
1167 | u8 pad_to_version0_size[sizeof(struct hpi_response) - /* V0 res */ | ||
1168 | sizeof(struct hpi_response_header) - 3 * sizeof(u32)]; | ||
1169 | }; | ||
1170 | |||
1171 | struct hpi_msg_adapter_start_flash { | ||
1172 | struct hpi_message_header h; | ||
1173 | u32 offset; | ||
1174 | u32 length; | ||
1175 | u32 key; | ||
1176 | u8 pad_to_version0_size[sizeof(struct hpi_message) - /* V0 res */ | ||
1177 | sizeof(struct hpi_message_header) - 3 * sizeof(u32)]; | ||
1178 | }; | ||
1179 | |||
1180 | struct hpi_res_adapter_start_flash { | ||
1181 | struct hpi_response_header h; | ||
1182 | u8 pad_to_version0_size[sizeof(struct hpi_response) - /* V0 res */ | ||
1183 | sizeof(struct hpi_response_header)]; | ||
1184 | }; | ||
1185 | |||
1186 | struct hpi_msg_adapter_program_flash_payload { | ||
1187 | u32 checksum; | ||
1188 | u16 sequence; | ||
1189 | u16 length; | ||
1190 | u16 offset; /**< offset from start of msg to data */ | ||
1191 | u16 unused; | ||
1192 | /* ensure sizeof(header + payload) == sizeof(hpi_message_V0) | ||
1193 | because old firmware expects data after message of this size */ | ||
1194 | u8 pad_to_version0_size[sizeof(struct hpi_message) - /* V0 message */ | ||
1195 | sizeof(struct hpi_message_header) - sizeof(u32) - | ||
1196 | 4 * sizeof(u16)]; | ||
1197 | }; | ||
1198 | |||
1199 | struct hpi_msg_adapter_program_flash { | ||
1200 | struct hpi_message_header h; | ||
1201 | struct hpi_msg_adapter_program_flash_payload p; | ||
1202 | u32 data[256]; | ||
1203 | }; | ||
1204 | |||
1205 | struct hpi_res_adapter_program_flash { | ||
1206 | struct hpi_response_header h; | ||
1207 | u16 sequence; | ||
1208 | u8 pad_to_version0_size[sizeof(struct hpi_response) - /* V0 res */ | ||
1209 | sizeof(struct hpi_response_header) - sizeof(u16)]; | ||
1210 | }; | ||
1211 | |||
1212 | struct hpi_msg_adapter_debug_read { | ||
1213 | struct hpi_message_header h; | ||
1214 | u32 dsp_address; | ||
1215 | u32 count_bytes; | ||
1216 | }; | ||
1217 | |||
1218 | struct hpi_res_adapter_debug_read { | 1133 | struct hpi_res_adapter_debug_read { |
1219 | struct hpi_response_header h; | 1134 | struct hpi_response_header h; |
1220 | u8 bytes[256]; | 1135 | u8 bytes[1024]; |
1221 | }; | 1136 | }; |
1222 | 1137 | ||
1223 | struct hpi_msg_cobranet_hmi { | 1138 | struct hpi_msg_cobranet_hmi { |
@@ -1461,7 +1376,7 @@ struct hpi_control_cache_pad { | |||
1461 | /* 2^N sized FIFO buffer (internal to HPI<->DSP interaction) */ | 1376 | /* 2^N sized FIFO buffer (internal to HPI<->DSP interaction) */ |
1462 | struct hpi_fifo_buffer { | 1377 | struct hpi_fifo_buffer { |
1463 | u32 size; | 1378 | u32 size; |
1464 | u32 dSP_index; | 1379 | u32 dsp_index; |
1465 | u32 host_index; | 1380 | u32 host_index; |
1466 | }; | 1381 | }; |
1467 | 1382 | ||
diff --git a/sound/pci/asihpi/hpi_version.h b/sound/pci/asihpi/hpi_version.h new file mode 100644 index 000000000000..e9146e53bd50 --- /dev/null +++ b/sound/pci/asihpi/hpi_version.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /** HPI Version Definitions | ||
2 | Development releases have odd minor version. | ||
3 | Production releases have even minor version. | ||
4 | |||
5 | \file hpi_version.h | ||
6 | */ | ||
7 | |||
8 | #ifndef _HPI_VERSION_H | ||
9 | #define _HPI_VERSION_H | ||
10 | |||
11 | /* Use single digits for versions less that 10 to avoid octal. */ | ||
12 | /* *** HPI_VER is the only edit required to update version *** */ | ||
13 | /** HPI version */ | ||
14 | #define HPI_VER HPI_VERSION_CONSTRUCTOR(4, 10, 1) | ||
15 | |||
16 | /** HPI version string in dotted decimal format */ | ||
17 | #define HPI_VER_STRING "4.10.01" | ||
18 | |||
19 | /** Library version as documented in hpi-api-versions.txt */ | ||
20 | #define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(10, 2, 0) | ||
21 | |||
22 | /** Construct hpi version number from major, minor, release numbers */ | ||
23 | #define HPI_VERSION_CONSTRUCTOR(maj, min, r) ((maj << 16) + (min << 8) + r) | ||
24 | |||
25 | /** Extract major version from hpi version number */ | ||
26 | #define HPI_VER_MAJOR(v) ((int)(v >> 16)) | ||
27 | /** Extract minor version from hpi version number */ | ||
28 | #define HPI_VER_MINOR(v) ((int)((v >> 8) & 0xFF)) | ||
29 | /** Extract release from hpi version number */ | ||
30 | #define HPI_VER_RELEASE(v) ((int)(v & 0xFF)) | ||
31 | |||
32 | #endif | ||
diff --git a/sound/pci/asihpi/hpicmn.c b/sound/pci/asihpi/hpicmn.c index bd47521b24ec..7ed5c26c3737 100644 --- a/sound/pci/asihpi/hpicmn.c +++ b/sound/pci/asihpi/hpicmn.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
@@ -68,7 +68,7 @@ u16 hpi_validate_response(struct hpi_message *phm, struct hpi_response *phr) | |||
68 | u16 hpi_add_adapter(struct hpi_adapter_obj *pao) | 68 | u16 hpi_add_adapter(struct hpi_adapter_obj *pao) |
69 | { | 69 | { |
70 | u16 retval = 0; | 70 | u16 retval = 0; |
71 | /*HPI_ASSERT(pao->wAdapterType); */ | 71 | /*HPI_ASSERT(pao->type); */ |
72 | 72 | ||
73 | hpios_alistlock_lock(&adapters); | 73 | hpios_alistlock_lock(&adapters); |
74 | 74 | ||
@@ -77,13 +77,13 @@ u16 hpi_add_adapter(struct hpi_adapter_obj *pao) | |||
77 | goto unlock; | 77 | goto unlock; |
78 | } | 78 | } |
79 | 79 | ||
80 | if (adapters.adapter[pao->index].adapter_type) { | 80 | if (adapters.adapter[pao->index].type) { |
81 | int a; | 81 | int a; |
82 | for (a = HPI_MAX_ADAPTERS - 1; a >= 0; a--) { | 82 | for (a = HPI_MAX_ADAPTERS - 1; a >= 0; a--) { |
83 | if (!adapters.adapter[a].adapter_type) { | 83 | if (!adapters.adapter[a].type) { |
84 | HPI_DEBUG_LOG(WARNING, | 84 | HPI_DEBUG_LOG(WARNING, |
85 | "ASI%X duplicate index %d moved to %d\n", | 85 | "ASI%X duplicate index %d moved to %d\n", |
86 | pao->adapter_type, pao->index, a); | 86 | pao->type, pao->index, a); |
87 | pao->index = a; | 87 | pao->index = a; |
88 | break; | 88 | break; |
89 | } | 89 | } |
@@ -104,13 +104,13 @@ unlock: | |||
104 | 104 | ||
105 | void hpi_delete_adapter(struct hpi_adapter_obj *pao) | 105 | void hpi_delete_adapter(struct hpi_adapter_obj *pao) |
106 | { | 106 | { |
107 | if (!pao->adapter_type) { | 107 | if (!pao->type) { |
108 | HPI_DEBUG_LOG(ERROR, "removing null adapter?\n"); | 108 | HPI_DEBUG_LOG(ERROR, "removing null adapter?\n"); |
109 | return; | 109 | return; |
110 | } | 110 | } |
111 | 111 | ||
112 | hpios_alistlock_lock(&adapters); | 112 | hpios_alistlock_lock(&adapters); |
113 | if (adapters.adapter[pao->index].adapter_type) | 113 | if (adapters.adapter[pao->index].type) |
114 | adapters.gw_num_adapters--; | 114 | adapters.gw_num_adapters--; |
115 | memset(&adapters.adapter[pao->index], 0, sizeof(adapters.adapter[0])); | 115 | memset(&adapters.adapter[pao->index], 0, sizeof(adapters.adapter[0])); |
116 | hpios_alistlock_unlock(&adapters); | 116 | hpios_alistlock_unlock(&adapters); |
@@ -132,7 +132,7 @@ struct hpi_adapter_obj *hpi_find_adapter(u16 adapter_index) | |||
132 | } | 132 | } |
133 | 133 | ||
134 | pao = &adapters.adapter[adapter_index]; | 134 | pao = &adapters.adapter[adapter_index]; |
135 | if (pao->adapter_type != 0) { | 135 | if (pao->type != 0) { |
136 | /* | 136 | /* |
137 | HPI_DEBUG_LOG(VERBOSE, "Found adapter index %d\n", | 137 | HPI_DEBUG_LOG(VERBOSE, "Found adapter index %d\n", |
138 | wAdapterIndex); | 138 | wAdapterIndex); |
@@ -165,7 +165,7 @@ static void subsys_get_adapter(struct hpi_message *phm, | |||
165 | 165 | ||
166 | /* find the nCount'th nonzero adapter in array */ | 166 | /* find the nCount'th nonzero adapter in array */ |
167 | for (index = 0; index < HPI_MAX_ADAPTERS; index++) { | 167 | for (index = 0; index < HPI_MAX_ADAPTERS; index++) { |
168 | if (adapters.adapter[index].adapter_type) { | 168 | if (adapters.adapter[index].type) { |
169 | if (!count) | 169 | if (!count) |
170 | break; | 170 | break; |
171 | count--; | 171 | count--; |
@@ -174,11 +174,11 @@ static void subsys_get_adapter(struct hpi_message *phm, | |||
174 | 174 | ||
175 | if (index < HPI_MAX_ADAPTERS) { | 175 | if (index < HPI_MAX_ADAPTERS) { |
176 | phr->u.s.adapter_index = adapters.adapter[index].index; | 176 | phr->u.s.adapter_index = adapters.adapter[index].index; |
177 | phr->u.s.adapter_type = adapters.adapter[index].adapter_type; | 177 | phr->u.s.adapter_type = adapters.adapter[index].type; |
178 | } else { | 178 | } else { |
179 | phr->u.s.adapter_index = 0; | 179 | phr->u.s.adapter_index = 0; |
180 | phr->u.s.adapter_type = 0; | 180 | phr->u.s.adapter_type = 0; |
181 | phr->error = HPI_ERROR_BAD_ADAPTER_NUMBER; | 181 | phr->error = HPI_ERROR_INVALID_OBJ_INDEX; |
182 | } | 182 | } |
183 | } | 183 | } |
184 | 184 | ||
@@ -324,6 +324,8 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache, | |||
324 | } | 324 | } |
325 | 325 | ||
326 | phr->error = 0; | 326 | phr->error = 0; |
327 | phr->specific_error = 0; | ||
328 | phr->version = 0; | ||
327 | 329 | ||
328 | /* set the default response size */ | 330 | /* set the default response size */ |
329 | response_size = | 331 | response_size = |
@@ -531,8 +533,12 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache, | |||
531 | found ? "Cached" : "Uncached", phm->adapter_index, | 533 | found ? "Cached" : "Uncached", phm->adapter_index, |
532 | pI->control_index, pI->control_type, phm->u.c.attribute); | 534 | pI->control_index, pI->control_type, phm->u.c.attribute); |
533 | 535 | ||
534 | if (found) | 536 | if (found) { |
535 | phr->size = (u16)response_size; | 537 | phr->size = (u16)response_size; |
538 | phr->type = HPI_TYPE_RESPONSE; | ||
539 | phr->object = phm->object; | ||
540 | phr->function = phm->function; | ||
541 | } | ||
536 | 542 | ||
537 | return found; | 543 | return found; |
538 | } | 544 | } |
@@ -631,7 +637,7 @@ struct hpi_control_cache *hpi_alloc_control_cache(const u32 control_count, | |||
631 | if (!p_cache) | 637 | if (!p_cache) |
632 | return NULL; | 638 | return NULL; |
633 | 639 | ||
634 | p_cache->p_info = kzalloc(sizeof(*p_cache->p_info) * control_count, | 640 | p_cache->p_info = kcalloc(control_count, sizeof(*p_cache->p_info), |
635 | GFP_KERNEL); | 641 | GFP_KERNEL); |
636 | if (!p_cache->p_info) { | 642 | if (!p_cache->p_info) { |
637 | kfree(p_cache); | 643 | kfree(p_cache); |
diff --git a/sound/pci/asihpi/hpicmn.h b/sound/pci/asihpi/hpicmn.h index d53cdf6e535f..e44121283047 100644 --- a/sound/pci/asihpi/hpicmn.h +++ b/sound/pci/asihpi/hpicmn.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /** | 1 | /** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
@@ -18,12 +18,15 @@ | |||
18 | 18 | ||
19 | */ | 19 | */ |
20 | 20 | ||
21 | struct hpi_adapter_obj; | ||
22 | |||
23 | /* a function that takes an adapter obj and returns an int */ | ||
24 | typedef int adapter_int_func(struct hpi_adapter_obj *pao); | ||
25 | |||
21 | struct hpi_adapter_obj { | 26 | struct hpi_adapter_obj { |
22 | struct hpi_pci pci; /* PCI info - bus#,dev#,address etc */ | 27 | struct hpi_pci pci; /* PCI info - bus#,dev#,address etc */ |
23 | u16 adapter_type; /* ASI6701 etc */ | 28 | u16 type; /* 0x6644 == ASI6644 etc */ |
24 | u16 index; /* */ | 29 | u16 index; |
25 | u16 open; /* =1 when adapter open */ | ||
26 | u16 mixer_open; | ||
27 | 30 | ||
28 | struct hpios_spinlock dsp_lock; | 31 | struct hpios_spinlock dsp_lock; |
29 | 32 | ||
diff --git a/sound/pci/asihpi/hpidebug.c b/sound/pci/asihpi/hpidebug.c index b52baf62791e..ac86a1f1d3bf 100644 --- a/sound/pci/asihpi/hpidebug.c +++ b/sound/pci/asihpi/hpidebug.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /************************************************************************ | 1 | /************************************************************************ |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
diff --git a/sound/pci/asihpi/hpidebug.h b/sound/pci/asihpi/hpidebug.h index 940f54c3c538..2c9af2329d36 100644 --- a/sound/pci/asihpi/hpidebug.h +++ b/sound/pci/asihpi/hpidebug.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /***************************************************************************** | 1 | /***************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
diff --git a/sound/pci/asihpi/hpidspcd.c b/sound/pci/asihpi/hpidspcd.c index 71d32c868c92..456a758f04f6 100644 --- a/sound/pci/asihpi/hpidspcd.c +++ b/sound/pci/asihpi/hpidspcd.c | |||
@@ -25,6 +25,7 @@ hotplug firmware loader from individual dsp code files | |||
25 | #define SOURCEFILE_NAME "hpidspcd.c" | 25 | #define SOURCEFILE_NAME "hpidspcd.c" |
26 | #include "hpidspcd.h" | 26 | #include "hpidspcd.h" |
27 | #include "hpidebug.h" | 27 | #include "hpidebug.h" |
28 | #include "hpi_version.h" | ||
28 | 29 | ||
29 | struct dsp_code_private { | 30 | struct dsp_code_private { |
30 | /** Firmware descriptor */ | 31 | /** Firmware descriptor */ |
@@ -32,9 +33,6 @@ struct dsp_code_private { | |||
32 | struct pci_dev *dev; | 33 | struct pci_dev *dev; |
33 | }; | 34 | }; |
34 | 35 | ||
35 | #define HPI_VER_DECIMAL ((int)(HPI_VER_MAJOR(HPI_VER) * 10000 + \ | ||
36 | HPI_VER_MINOR(HPI_VER) * 100 + HPI_VER_RELEASE(HPI_VER))) | ||
37 | |||
38 | /*-------------------------------------------------------------------*/ | 36 | /*-------------------------------------------------------------------*/ |
39 | short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code, | 37 | short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code, |
40 | u32 *os_error_code) | 38 | u32 *os_error_code) |
@@ -66,22 +64,25 @@ short hpi_dsp_code_open(u32 adapter, void *os_data, struct dsp_code *dsp_code, | |||
66 | if ((header.type != 0x45444F43) || /* "CODE" */ | 64 | if ((header.type != 0x45444F43) || /* "CODE" */ |
67 | (header.adapter != adapter) | 65 | (header.adapter != adapter) |
68 | || (header.size != firmware->size)) { | 66 | || (header.size != firmware->size)) { |
69 | dev_printk(KERN_ERR, &dev->dev, "Invalid firmware file\n"); | 67 | dev_printk(KERN_ERR, &dev->dev, |
68 | "Invalid firmware header size %d != file %zd\n", | ||
69 | header.size, firmware->size); | ||
70 | goto error2; | 70 | goto error2; |
71 | } | 71 | } |
72 | 72 | ||
73 | if ((header.version / 100 & ~1) != (HPI_VER_DECIMAL / 100 & ~1)) { | 73 | if ((header.version >> 9) != (HPI_VER >> 9)) { |
74 | /* Consider even and subsequent odd minor versions to be compatible */ | ||
74 | dev_printk(KERN_ERR, &dev->dev, | 75 | dev_printk(KERN_ERR, &dev->dev, |
75 | "Incompatible firmware version " | 76 | "Incompatible firmware version " |
76 | "DSP image %d != Driver %d\n", header.version, | 77 | "DSP image %X != Driver %X\n", header.version, |
77 | HPI_VER_DECIMAL); | 78 | HPI_VER); |
78 | goto error2; | 79 | goto error2; |
79 | } | 80 | } |
80 | 81 | ||
81 | if (header.version != HPI_VER_DECIMAL) { | 82 | if (header.version != HPI_VER) { |
82 | dev_printk(KERN_WARNING, &dev->dev, | 83 | dev_printk(KERN_INFO, &dev->dev, |
83 | "Firmware: release version mismatch DSP image %d != Driver %d\n", | 84 | "Firmware: release version mismatch DSP image %X != Driver %X\n", |
84 | header.version, HPI_VER_DECIMAL); | 85 | header.version, HPI_VER); |
85 | } | 86 | } |
86 | 87 | ||
87 | HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name); | 88 | HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name); |
@@ -108,11 +109,8 @@ error1: | |||
108 | /*-------------------------------------------------------------------*/ | 109 | /*-------------------------------------------------------------------*/ |
109 | void hpi_dsp_code_close(struct dsp_code *dsp_code) | 110 | void hpi_dsp_code_close(struct dsp_code *dsp_code) |
110 | { | 111 | { |
111 | if (dsp_code->pvt->firmware) { | 112 | HPI_DEBUG_LOG(DEBUG, "dsp code closed\n"); |
112 | HPI_DEBUG_LOG(DEBUG, "dsp code closed\n"); | 113 | release_firmware(dsp_code->pvt->firmware); |
113 | release_firmware(dsp_code->pvt->firmware); | ||
114 | dsp_code->pvt->firmware = NULL; | ||
115 | } | ||
116 | kfree(dsp_code->pvt); | 114 | kfree(dsp_code->pvt); |
117 | } | 115 | } |
118 | 116 | ||
diff --git a/sound/pci/asihpi/hpidspcd.h b/sound/pci/asihpi/hpidspcd.h index b22881122f19..659d19ca6d42 100644 --- a/sound/pci/asihpi/hpidspcd.h +++ b/sound/pci/asihpi/hpidspcd.h | |||
@@ -27,10 +27,6 @@ Functions for reading DSP code to load into DSP | |||
27 | 27 | ||
28 | #include "hpi_internal.h" | 28 | #include "hpi_internal.h" |
29 | 29 | ||
30 | /** Code header version is decimal encoded e.g. 4.06.10 is 40601 */ | ||
31 | #define HPI_VER_DECIMAL ((int)(HPI_VER_MAJOR(HPI_VER) * 10000 + \ | ||
32 | HPI_VER_MINOR(HPI_VER) * 100 + HPI_VER_RELEASE(HPI_VER))) | ||
33 | |||
34 | /** Header structure for dsp firmware file | 30 | /** Header structure for dsp firmware file |
35 | This structure must match that used in s2bin.c for generation of asidsp.bin | 31 | This structure must match that used in s2bin.c for generation of asidsp.bin |
36 | */ | 32 | */ |
diff --git a/sound/pci/asihpi/hpifunc.c b/sound/pci/asihpi/hpifunc.c index ebb568d695f1..510e56cffd31 100644 --- a/sound/pci/asihpi/hpifunc.c +++ b/sound/pci/asihpi/hpifunc.c | |||
@@ -2826,6 +2826,16 @@ u16 hpi_volume_auto_fade(u32 h_control, | |||
2826 | duration_ms, HPI_VOLUME_AUTOFADE_LOG); | 2826 | duration_ms, HPI_VOLUME_AUTOFADE_LOG); |
2827 | } | 2827 | } |
2828 | 2828 | ||
2829 | u16 hpi_volume_query_auto_fade_profile(const u32 h_volume, const u32 i, | ||
2830 | u16 *profile) | ||
2831 | { | ||
2832 | u16 e; | ||
2833 | u32 u; | ||
2834 | e = hpi_control_query(h_volume, HPI_VOLUME_AUTOFADE, i, 0, &u); | ||
2835 | *profile = (u16)u; | ||
2836 | return e; | ||
2837 | } | ||
2838 | |||
2829 | u16 hpi_vox_set_threshold(u32 h_control, short an_gain0_01dB) | 2839 | u16 hpi_vox_set_threshold(u32 h_control, short an_gain0_01dB) |
2830 | { | 2840 | { |
2831 | struct hpi_message hm; | 2841 | struct hpi_message hm; |
diff --git a/sound/pci/asihpi/hpimsginit.c b/sound/pci/asihpi/hpimsginit.c index 52400a6b5f15..032d563e3708 100644 --- a/sound/pci/asihpi/hpimsginit.c +++ b/sound/pci/asihpi/hpimsginit.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
diff --git a/sound/pci/asihpi/hpimsginit.h b/sound/pci/asihpi/hpimsginit.h index bfd330d78b58..5b48708c7d1e 100644 --- a/sound/pci/asihpi/hpimsginit.h +++ b/sound/pci/asihpi/hpimsginit.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
diff --git a/sound/pci/asihpi/hpimsgx.c b/sound/pci/asihpi/hpimsgx.c index 2e779421a618..d4790ddc225c 100644 --- a/sound/pci/asihpi/hpimsgx.c +++ b/sound/pci/asihpi/hpimsgx.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
@@ -22,6 +22,7 @@ Extended Message Function With Response Caching | |||
22 | *****************************************************************************/ | 22 | *****************************************************************************/ |
23 | #define SOURCEFILE_NAME "hpimsgx.c" | 23 | #define SOURCEFILE_NAME "hpimsgx.c" |
24 | #include "hpi_internal.h" | 24 | #include "hpi_internal.h" |
25 | #include "hpi_version.h" | ||
25 | #include "hpimsginit.h" | 26 | #include "hpimsginit.h" |
26 | #include "hpicmn.h" | 27 | #include "hpicmn.h" |
27 | #include "hpimsgx.h" | 28 | #include "hpimsgx.h" |
diff --git a/sound/pci/asihpi/hpimsgx.h b/sound/pci/asihpi/hpimsgx.h index fd49e7542a88..37f3efd95a70 100644 --- a/sound/pci/asihpi/hpimsgx.h +++ b/sound/pci/asihpi/hpimsgx.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c index f6b9517b4696..609156205562 100644 --- a/sound/pci/asihpi/hpioctl.c +++ b/sound/pci/asihpi/hpioctl.c | |||
@@ -21,6 +21,7 @@ Common Linux HPI ioctl and module probe/remove functions | |||
21 | #define SOURCEFILE_NAME "hpioctl.c" | 21 | #define SOURCEFILE_NAME "hpioctl.c" |
22 | 22 | ||
23 | #include "hpi_internal.h" | 23 | #include "hpi_internal.h" |
24 | #include "hpi_version.h" | ||
24 | #include "hpimsginit.h" | 25 | #include "hpimsginit.h" |
25 | #include "hpidebug.h" | 26 | #include "hpidebug.h" |
26 | #include "hpimsgx.h" | 27 | #include "hpimsgx.h" |
@@ -65,9 +66,7 @@ static struct hpi_adapter adapters[HPI_MAX_ADAPTERS]; | |||
65 | static void hpi_send_recv_f(struct hpi_message *phm, struct hpi_response *phr, | 66 | static void hpi_send_recv_f(struct hpi_message *phm, struct hpi_response *phr, |
66 | struct file *file) | 67 | struct file *file) |
67 | { | 68 | { |
68 | int adapter = phm->adapter_index; | 69 | if ((phm->adapter_index >= HPI_MAX_ADAPTERS) |
69 | |||
70 | if ((adapter >= HPI_MAX_ADAPTERS || adapter < 0) | ||
71 | && (phm->object != HPI_OBJ_SUBSYSTEM)) | 70 | && (phm->object != HPI_OBJ_SUBSYSTEM)) |
72 | phr->error = HPI_ERROR_INVALID_OBJ_INDEX; | 71 | phr->error = HPI_ERROR_INVALID_OBJ_INDEX; |
73 | else | 72 | else |
@@ -178,19 +177,14 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
178 | } else { | 177 | } else { |
179 | u16 __user *ptr = NULL; | 178 | u16 __user *ptr = NULL; |
180 | u32 size = 0; | 179 | u32 size = 0; |
181 | u32 adapter_present; | ||
182 | /* -1=no data 0=read from user mem, 1=write to user mem */ | 180 | /* -1=no data 0=read from user mem, 1=write to user mem */ |
183 | int wrflag = -1; | 181 | int wrflag = -1; |
184 | struct hpi_adapter *pa; | 182 | struct hpi_adapter *pa = NULL; |
185 | 183 | ||
186 | if (hm->h.adapter_index < HPI_MAX_ADAPTERS) { | 184 | if (hm->h.adapter_index < ARRAY_SIZE(adapters)) |
187 | pa = &adapters[hm->h.adapter_index]; | 185 | pa = &adapters[hm->h.adapter_index]; |
188 | adapter_present = pa->type; | ||
189 | } else { | ||
190 | adapter_present = 0; | ||
191 | } | ||
192 | 186 | ||
193 | if (!adapter_present) { | 187 | if (!pa || !pa->adapter || !pa->adapter->type) { |
194 | hpi_init_response(&hr->r0, hm->h.object, | 188 | hpi_init_response(&hr->r0, hm->h.object, |
195 | hm->h.function, HPI_ERROR_BAD_ADAPTER_NUMBER); | 189 | hm->h.function, HPI_ERROR_BAD_ADAPTER_NUMBER); |
196 | 190 | ||
@@ -317,6 +311,7 @@ int __devinit asihpi_adapter_probe(struct pci_dev *pci_dev, | |||
317 | const struct pci_device_id *pci_id) | 311 | const struct pci_device_id *pci_id) |
318 | { | 312 | { |
319 | int idx, nm; | 313 | int idx, nm; |
314 | int adapter_index; | ||
320 | unsigned int memlen; | 315 | unsigned int memlen; |
321 | struct hpi_message hm; | 316 | struct hpi_message hm; |
322 | struct hpi_response hr; | 317 | struct hpi_response hr; |
@@ -345,8 +340,6 @@ int __devinit asihpi_adapter_probe(struct pci_dev *pci_dev, | |||
345 | 340 | ||
346 | hm.adapter_index = HPI_ADAPTER_INDEX_INVALID; | 341 | hm.adapter_index = HPI_ADAPTER_INDEX_INVALID; |
347 | 342 | ||
348 | adapter.pci = pci_dev; | ||
349 | |||
350 | nm = HPI_MAX_ADAPTER_MEM_SPACES; | 343 | nm = HPI_MAX_ADAPTER_MEM_SPACES; |
351 | 344 | ||
352 | for (idx = 0; idx < nm; idx++) { | 345 | for (idx = 0; idx < nm; idx++) { |
@@ -355,18 +348,16 @@ int __devinit asihpi_adapter_probe(struct pci_dev *pci_dev, | |||
355 | 348 | ||
356 | if (pci_resource_flags(pci_dev, idx) & IORESOURCE_MEM) { | 349 | if (pci_resource_flags(pci_dev, idx) & IORESOURCE_MEM) { |
357 | memlen = pci_resource_len(pci_dev, idx); | 350 | memlen = pci_resource_len(pci_dev, idx); |
358 | adapter.ap_remapped_mem_base[idx] = | 351 | pci.ap_mem_base[idx] = |
359 | ioremap(pci_resource_start(pci_dev, idx), | 352 | ioremap(pci_resource_start(pci_dev, idx), |
360 | memlen); | 353 | memlen); |
361 | if (!adapter.ap_remapped_mem_base[idx]) { | 354 | if (!pci.ap_mem_base[idx]) { |
362 | HPI_DEBUG_LOG(ERROR, | 355 | HPI_DEBUG_LOG(ERROR, |
363 | "ioremap failed, aborting\n"); | 356 | "ioremap failed, aborting\n"); |
364 | /* unmap previously mapped pci mem space */ | 357 | /* unmap previously mapped pci mem space */ |
365 | goto err; | 358 | goto err; |
366 | } | 359 | } |
367 | } | 360 | } |
368 | |||
369 | pci.ap_mem_base[idx] = adapter.ap_remapped_mem_base[idx]; | ||
370 | } | 361 | } |
371 | 362 | ||
372 | pci.pci_dev = pci_dev; | 363 | pci.pci_dev = pci_dev; |
@@ -378,6 +369,9 @@ int __devinit asihpi_adapter_probe(struct pci_dev *pci_dev, | |||
378 | if (hr.error) | 369 | if (hr.error) |
379 | goto err; | 370 | goto err; |
380 | 371 | ||
372 | adapter_index = hr.u.s.adapter_index; | ||
373 | adapter.adapter = hpi_find_adapter(adapter_index); | ||
374 | |||
381 | if (prealloc_stream_buf) { | 375 | if (prealloc_stream_buf) { |
382 | adapter.p_buffer = vmalloc(prealloc_stream_buf); | 376 | adapter.p_buffer = vmalloc(prealloc_stream_buf); |
383 | if (!adapter.p_buffer) { | 377 | if (!adapter.p_buffer) { |
@@ -389,36 +383,32 @@ int __devinit asihpi_adapter_probe(struct pci_dev *pci_dev, | |||
389 | } | 383 | } |
390 | } | 384 | } |
391 | 385 | ||
392 | adapter.index = hr.u.s.adapter_index; | ||
393 | adapter.type = hr.u.s.adapter_type; | ||
394 | |||
395 | hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER, | 386 | hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER, |
396 | HPI_ADAPTER_OPEN); | 387 | HPI_ADAPTER_OPEN); |
397 | hm.adapter_index = adapter.index; | 388 | hm.adapter_index = adapter.adapter->index; |
398 | hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL); | 389 | hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL); |
399 | 390 | ||
400 | if (hr.error) | 391 | if (hr.error) |
401 | goto err; | 392 | goto err; |
402 | 393 | ||
403 | adapter.snd_card_asihpi = NULL; | ||
404 | /* WARNING can't init mutex in 'adapter' | 394 | /* WARNING can't init mutex in 'adapter' |
405 | * and then copy it to adapters[] ?!?! | 395 | * and then copy it to adapters[] ?!?! |
406 | */ | 396 | */ |
407 | adapters[adapter.index] = adapter; | 397 | adapters[adapter_index] = adapter; |
408 | mutex_init(&adapters[adapter.index].mutex); | 398 | mutex_init(&adapters[adapter_index].mutex); |
409 | pci_set_drvdata(pci_dev, &adapters[adapter.index]); | 399 | pci_set_drvdata(pci_dev, &adapters[adapter_index]); |
410 | 400 | ||
411 | dev_printk(KERN_INFO, &pci_dev->dev, | 401 | dev_printk(KERN_INFO, &pci_dev->dev, |
412 | "probe succeeded for ASI%04X HPI index %d\n", adapter.type, | 402 | "probe succeeded for ASI%04X HPI index %d\n", |
413 | adapter.index); | 403 | adapter.adapter->type, adapter_index); |
414 | 404 | ||
415 | return 0; | 405 | return 0; |
416 | 406 | ||
417 | err: | 407 | err: |
418 | for (idx = 0; idx < HPI_MAX_ADAPTER_MEM_SPACES; idx++) { | 408 | for (idx = 0; idx < HPI_MAX_ADAPTER_MEM_SPACES; idx++) { |
419 | if (adapter.ap_remapped_mem_base[idx]) { | 409 | if (pci.ap_mem_base[idx]) { |
420 | iounmap(adapter.ap_remapped_mem_base[idx]); | 410 | iounmap(pci.ap_mem_base[idx]); |
421 | adapter.ap_remapped_mem_base[idx] = NULL; | 411 | pci.ap_mem_base[idx] = NULL; |
422 | } | 412 | } |
423 | } | 413 | } |
424 | 414 | ||
@@ -437,19 +427,20 @@ void __devexit asihpi_adapter_remove(struct pci_dev *pci_dev) | |||
437 | struct hpi_message hm; | 427 | struct hpi_message hm; |
438 | struct hpi_response hr; | 428 | struct hpi_response hr; |
439 | struct hpi_adapter *pa; | 429 | struct hpi_adapter *pa; |
430 | struct hpi_pci pci; | ||
431 | |||
440 | pa = pci_get_drvdata(pci_dev); | 432 | pa = pci_get_drvdata(pci_dev); |
433 | pci = pa->adapter->pci; | ||
441 | 434 | ||
442 | hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER, | 435 | hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER, |
443 | HPI_ADAPTER_DELETE); | 436 | HPI_ADAPTER_DELETE); |
444 | hm.adapter_index = pa->index; | 437 | hm.adapter_index = pa->adapter->index; |
445 | hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL); | 438 | hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL); |
446 | 439 | ||
447 | /* unmap PCI memory space, mapped during device init. */ | 440 | /* unmap PCI memory space, mapped during device init. */ |
448 | for (idx = 0; idx < HPI_MAX_ADAPTER_MEM_SPACES; idx++) { | 441 | for (idx = 0; idx < HPI_MAX_ADAPTER_MEM_SPACES; idx++) { |
449 | if (pa->ap_remapped_mem_base[idx]) { | 442 | if (pci.ap_mem_base[idx]) |
450 | iounmap(pa->ap_remapped_mem_base[idx]); | 443 | iounmap(pci.ap_mem_base[idx]); |
451 | pa->ap_remapped_mem_base[idx] = NULL; | ||
452 | } | ||
453 | } | 444 | } |
454 | 445 | ||
455 | if (pa->p_buffer) | 446 | if (pa->p_buffer) |
@@ -461,7 +452,7 @@ void __devexit asihpi_adapter_remove(struct pci_dev *pci_dev) | |||
461 | "remove %04x:%04x,%04x:%04x,%04x," " HPI index %d.\n", | 452 | "remove %04x:%04x,%04x:%04x,%04x," " HPI index %d.\n", |
462 | pci_dev->vendor, pci_dev->device, | 453 | pci_dev->vendor, pci_dev->device, |
463 | pci_dev->subsystem_vendor, pci_dev->subsystem_device, | 454 | pci_dev->subsystem_vendor, pci_dev->subsystem_device, |
464 | pci_dev->devfn, pa->index); | 455 | pci_dev->devfn, pa->adapter->index); |
465 | 456 | ||
466 | memset(pa, 0, sizeof(*pa)); | 457 | memset(pa, 0, sizeof(*pa)); |
467 | } | 458 | } |
diff --git a/sound/pci/asihpi/hpioctl.h b/sound/pci/asihpi/hpioctl.h index 847f72f03fe1..2614aff672e2 100644 --- a/sound/pci/asihpi/hpioctl.h +++ b/sound/pci/asihpi/hpioctl.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
diff --git a/sound/pci/asihpi/hpios.c b/sound/pci/asihpi/hpios.c index ff2a19b544fa..2d7d1c2e1d0d 100644 --- a/sound/pci/asihpi/hpios.c +++ b/sound/pci/asihpi/hpios.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
diff --git a/sound/pci/asihpi/hpios.h b/sound/pci/asihpi/hpios.h index 2f605e34bad0..c5cef113c209 100644 --- a/sound/pci/asihpi/hpios.h +++ b/sound/pci/asihpi/hpios.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
@@ -149,20 +149,18 @@ static inline void cond_unlock(struct hpios_spinlock *l) | |||
149 | #define hpios_alistlock_lock(obj) spin_lock(&((obj)->list_lock.lock)) | 149 | #define hpios_alistlock_lock(obj) spin_lock(&((obj)->list_lock.lock)) |
150 | #define hpios_alistlock_unlock(obj) spin_unlock(&((obj)->list_lock.lock)) | 150 | #define hpios_alistlock_unlock(obj) spin_unlock(&((obj)->list_lock.lock)) |
151 | 151 | ||
152 | struct snd_card; | ||
153 | |||
154 | /** pci drvdata points to an instance of this struct */ | ||
152 | struct hpi_adapter { | 155 | struct hpi_adapter { |
156 | struct hpi_adapter_obj *adapter; | ||
157 | struct snd_card *snd_card; | ||
158 | |||
153 | /* mutex prevents contention for one card | 159 | /* mutex prevents contention for one card |
154 | between multiple user programs (via ioctl) */ | 160 | between multiple user programs (via ioctl) */ |
155 | struct mutex mutex; | 161 | struct mutex mutex; |
156 | u16 index; | ||
157 | u16 type; | ||
158 | |||
159 | /* ALSA card structure */ | ||
160 | void *snd_card_asihpi; | ||
161 | |||
162 | char *p_buffer; | 162 | char *p_buffer; |
163 | size_t buffer_size; | 163 | size_t buffer_size; |
164 | struct pci_dev *pci; | ||
165 | void __iomem *ap_remapped_mem_base[HPI_MAX_ADAPTER_MEM_SPACES]; | ||
166 | }; | 164 | }; |
167 | 165 | ||
168 | #endif | 166 | #endif |
diff --git a/sound/pci/asihpi/hpipcida.h b/sound/pci/asihpi/hpipcida.h index bb30868ce1a3..db570ddf64b3 100644 --- a/sound/pci/asihpi/hpipcida.h +++ b/sound/pci/asihpi/hpipcida.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 15e4e5ee3881..590682f115ef 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c | |||
@@ -43,7 +43,7 @@ static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ | |||
43 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ | 43 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
44 | static int ac97_clock = 48000; | 44 | static int ac97_clock = 48000; |
45 | static char *ac97_quirk; | 45 | static char *ac97_quirk; |
46 | static int spdif_aclink = 1; | 46 | static bool spdif_aclink = 1; |
47 | static int ac97_codec = -1; | 47 | static int ac97_codec = -1; |
48 | 48 | ||
49 | module_param(index, int, 0444); | 49 | module_param(index, int, 0444); |
@@ -60,7 +60,7 @@ module_param(spdif_aclink, bool, 0444); | |||
60 | MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link."); | 60 | MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link."); |
61 | 61 | ||
62 | /* just for backward compatibility */ | 62 | /* just for backward compatibility */ |
63 | static int enable; | 63 | static bool enable; |
64 | module_param(enable, bool, 0444); | 64 | module_param(enable, bool, 0444); |
65 | 65 | ||
66 | 66 | ||
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index 57bf8f4bc7a8..524d35f31232 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c | |||
@@ -51,7 +51,7 @@ module_param(ac97_clock, int, 0444); | |||
51 | MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz)."); | 51 | MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz)."); |
52 | 52 | ||
53 | /* just for backward compatibility */ | 53 | /* just for backward compatibility */ |
54 | static int enable; | 54 | static bool enable; |
55 | module_param(enable, bool, 0444); | 55 | module_param(enable, bool, 0444); |
56 | 56 | ||
57 | 57 | ||
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c index dc326be58c4b..762bb108c51c 100644 --- a/sound/pci/au88x0/au88x0.c +++ b/sound/pci/au88x0/au88x0.c | |||
@@ -26,7 +26,7 @@ | |||
26 | // module parameters (see "Module Parameters") | 26 | // module parameters (see "Module Parameters") |
27 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 27 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
28 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 28 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
29 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 29 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
30 | static int pcifix[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 255 }; | 30 | static int pcifix[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 255 }; |
31 | 31 | ||
32 | module_param_array(index, int, NULL, 0444); | 32 | module_param_array(index, int, NULL, 0444); |
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index 489150380eac..6933a27a5d76 100644 --- a/sound/pci/au88x0/au88x0_core.c +++ b/sound/pci/au88x0/au88x0_core.c | |||
@@ -805,7 +805,7 @@ static void vortex_fifo_setadbvalid(vortex_t * vortex, int fifo, int en) | |||
805 | } | 805 | } |
806 | 806 | ||
807 | static void | 807 | static void |
808 | vortex_fifo_setadbctrl(vortex_t * vortex, int fifo, int b, int priority, | 808 | vortex_fifo_setadbctrl(vortex_t * vortex, int fifo, int stereo, int priority, |
809 | int empty, int valid, int f) | 809 | int empty, int valid, int f) |
810 | { | 810 | { |
811 | int temp, lifeboat = 0; | 811 | int temp, lifeboat = 0; |
@@ -837,7 +837,7 @@ vortex_fifo_setadbctrl(vortex_t * vortex, int fifo, int b, int priority, | |||
837 | #else | 837 | #else |
838 | temp = (this_4 & 0x3f) << 0xc; | 838 | temp = (this_4 & 0x3f) << 0xc; |
839 | #endif | 839 | #endif |
840 | temp = (temp & 0xfffffffd) | ((b & 1) << 1); | 840 | temp = (temp & 0xfffffffd) | ((stereo & 1) << 1); |
841 | temp = (temp & 0xfffffff3) | ((priority & 3) << 2); | 841 | temp = (temp & 0xfffffff3) | ((priority & 3) << 2); |
842 | temp = (temp & 0xffffffef) | ((valid & 1) << 4); | 842 | temp = (temp & 0xffffffef) | ((valid & 1) << 4); |
843 | temp |= FIFO_U1; | 843 | temp |= FIFO_U1; |
@@ -1148,11 +1148,11 @@ vortex_adbdma_setbuffers(vortex_t * vortex, int adbdma, | |||
1148 | 1148 | ||
1149 | static void | 1149 | static void |
1150 | vortex_adbdma_setmode(vortex_t * vortex, int adbdma, int ie, int dir, | 1150 | vortex_adbdma_setmode(vortex_t * vortex, int adbdma, int ie, int dir, |
1151 | int fmt, int d, u32 offset) | 1151 | int fmt, int stereo, u32 offset) |
1152 | { | 1152 | { |
1153 | stream_t *dma = &vortex->dma_adb[adbdma]; | 1153 | stream_t *dma = &vortex->dma_adb[adbdma]; |
1154 | 1154 | ||
1155 | dma->dma_unknown = d; | 1155 | dma->dma_unknown = stereo; |
1156 | dma->dma_ctrl = | 1156 | dma->dma_ctrl = |
1157 | ((offset & OFFSET_MASK) | (dma->dma_ctrl & ~OFFSET_MASK)); | 1157 | ((offset & OFFSET_MASK) | (dma->dma_ctrl & ~OFFSET_MASK)); |
1158 | /* Enable PCMOUT interrupts. */ | 1158 | /* Enable PCMOUT interrupts. */ |
@@ -1336,7 +1336,6 @@ static void vortex_adbdma_pausefifo(vortex_t * vortex, int adbdma) | |||
1336 | dma->fifo_status = FIFO_PAUSE; | 1336 | dma->fifo_status = FIFO_PAUSE; |
1337 | } | 1337 | } |
1338 | 1338 | ||
1339 | #if 0 // Using pause instead | ||
1340 | static void vortex_adbdma_stopfifo(vortex_t * vortex, int adbdma) | 1339 | static void vortex_adbdma_stopfifo(vortex_t * vortex, int adbdma) |
1341 | { | 1340 | { |
1342 | stream_t *dma = &vortex->dma_adb[adbdma]; | 1341 | stream_t *dma = &vortex->dma_adb[adbdma]; |
@@ -1351,7 +1350,6 @@ static void vortex_adbdma_stopfifo(vortex_t * vortex, int adbdma) | |||
1351 | dma->fifo_enabled = 0; | 1350 | dma->fifo_enabled = 0; |
1352 | } | 1351 | } |
1353 | 1352 | ||
1354 | #endif | ||
1355 | /* WTDMA */ | 1353 | /* WTDMA */ |
1356 | 1354 | ||
1357 | #ifndef CHIP_AU8810 | 1355 | #ifndef CHIP_AU8810 |
diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c index c5f7ae46afef..0488633ea874 100644 --- a/sound/pci/au88x0/au88x0_pcm.c +++ b/sound/pci/au88x0/au88x0_pcm.c | |||
@@ -307,8 +307,8 @@ static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream) | |||
307 | fmt = vortex_alsafmt_aspfmt(runtime->format); | 307 | fmt = vortex_alsafmt_aspfmt(runtime->format); |
308 | spin_lock_irq(&chip->lock); | 308 | spin_lock_irq(&chip->lock); |
309 | if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { | 309 | if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { |
310 | vortex_adbdma_setmode(chip, dma, 1, dir, fmt, 0 /*? */ , | 310 | vortex_adbdma_setmode(chip, dma, 1, dir, fmt, |
311 | 0); | 311 | runtime->channels == 1 ? 0 : 1, 0); |
312 | vortex_adbdma_setstartbuffer(chip, dma, 0); | 312 | vortex_adbdma_setstartbuffer(chip, dma, 0); |
313 | if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_SPDIF) | 313 | if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_SPDIF) |
314 | vortex_adb_setsrc(chip, dma, runtime->rate, dir); | 314 | vortex_adb_setsrc(chip, dma, runtime->rate, dir); |
@@ -353,8 +353,7 @@ static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
353 | //printk(KERN_INFO "vortex: stop %d\n", dma); | 353 | //printk(KERN_INFO "vortex: stop %d\n", dma); |
354 | stream->fifo_enabled = 0; | 354 | stream->fifo_enabled = 0; |
355 | if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) | 355 | if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) |
356 | vortex_adbdma_pausefifo(chip, dma); | 356 | vortex_adbdma_stopfifo(chip, dma); |
357 | //vortex_adbdma_stopfifo(chip, dma); | ||
358 | #ifndef CHIP_AU8810 | 357 | #ifndef CHIP_AU8810 |
359 | else { | 358 | else { |
360 | printk(KERN_INFO "vortex: wt stop %d\n", dma); | 359 | printk(KERN_INFO "vortex: wt stop %d\n", dma); |
diff --git a/sound/pci/au88x0/au88x0_xtalk.c b/sound/pci/au88x0/au88x0_xtalk.c index b4151e208b71..b278e285fd40 100644 --- a/sound/pci/au88x0/au88x0_xtalk.c +++ b/sound/pci/au88x0/au88x0_xtalk.c | |||
@@ -48,43 +48,61 @@ static unsigned short const wXtalkNarrowLeftDelay = 0x7; | |||
48 | static unsigned short const wXtalkNarrowRightDelay = 0x7; | 48 | static unsigned short const wXtalkNarrowRightDelay = 0x7; |
49 | 49 | ||
50 | static xtalk_gains_t const asXtalkGainsDefault = { | 50 | static xtalk_gains_t const asXtalkGainsDefault = { |
51 | 0x4000, 0x4000, 4000, 0x4000, 4000, 0x4000, 4000, 0x4000, 4000, | 51 | 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, |
52 | 0x4000 | 52 | 0x4000, 0x4000, 0x4000, 0x4000, 0x4000 |
53 | }; | 53 | }; |
54 | 54 | ||
55 | static xtalk_gains_t const asXtalkGainsTest = { | 55 | static xtalk_gains_t const asXtalkGainsTest = { |
56 | 0x8000, 0x7FFF, 0, 0xFFFF, 0x0001, 0xC000, 0x4000, 0xFFFE, 0x0002, | 56 | 0x7fff, 0x8000, 0x0000, 0x0000, 0x0001, |
57 | 0 | 57 | 0xffff, 0x4000, 0xc000, 0x0002, 0xfffe |
58 | }; | 58 | }; |
59 | |||
59 | static xtalk_gains_t const asXtalkGains1Chan = { | 60 | static xtalk_gains_t const asXtalkGains1Chan = { |
60 | 0x7FFF, 0, 0, 0, 0x7FFF, 0, 0, 0, 0, 0 | 61 | 0x7FFF, 0, 0, 0, 0, |
62 | 0x7FFF, 0, 0, 0, 0, | ||
61 | }; | 63 | }; |
62 | 64 | ||
63 | // Input gain for 4 A3D slices. One possible input pair is left zero. | 65 | // Input gain for 4 A3D slices. One possible input pair is left zero. |
64 | static xtalk_gains_t const asXtalkGainsAllChan = { | 66 | static xtalk_gains_t const asXtalkGainsAllChan = { |
65 | 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, | 67 | 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0, |
66 | 0 | 68 | 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0 |
67 | //0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff | 69 | }; |
70 | |||
71 | static xtalk_gains_t const asXtalkGainsZeros = { | ||
72 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
68 | }; | 73 | }; |
69 | static xtalk_gains_t const asXtalkGainsZeros; | ||
70 | 74 | ||
71 | static xtalk_dline_t const alXtalkDlineZeros; | 75 | static xtalk_dline_t const alXtalkDlineZeros = { |
76 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
77 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
78 | }; | ||
72 | static xtalk_dline_t const alXtalkDlineTest = { | 79 | static xtalk_dline_t const alXtalkDlineTest = { |
73 | 0xFC18, 0x03E8FFFF, 0x186A0, 0x7960FFFE, 1, 0xFFFFFFFF, | 80 | 0x0000fc18, 0xfff03e8, 0x000186a0, 0xfffe7960, 1, 0xffffffff, 0, 0, |
74 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 81 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
82 | 0, 0, 0, 0, 0, 0, 0, 0 | ||
83 | }; | ||
84 | |||
85 | static xtalk_instate_t const asXtalkInStateZeros = { | ||
75 | 0, 0, 0, 0 | 86 | 0, 0, 0, 0 |
76 | }; | 87 | }; |
77 | 88 | ||
78 | static xtalk_instate_t const asXtalkInStateZeros; | 89 | static xtalk_instate_t const asXtalkInStateTest = { |
79 | static xtalk_instate_t const asXtalkInStateTest = | 90 | 0x0080, 0xff80, 0x0001, 0xffff |
80 | { 0xFF80, 0x0080, 0xFFFF, 0x0001 }; | 91 | }; |
81 | static xtalk_state_t const asXtalkOutStateZeros; | 92 | |
93 | static xtalk_state_t const asXtalkOutStateZeros = { | ||
94 | {0, 0, 0, 0}, | ||
95 | {0, 0, 0, 0}, | ||
96 | {0, 0, 0, 0}, | ||
97 | {0, 0, 0, 0}, | ||
98 | {0, 0, 0, 0} | ||
99 | }; | ||
82 | 100 | ||
83 | static short const sDiamondKLeftEq = 0x401d; | 101 | static short const sDiamondKLeftEq = 0x401d; |
84 | static short const sDiamondKRightEq = 0x401d; | 102 | static short const sDiamondKRightEq = 0x401d; |
85 | static short const sDiamondKLeftXt = 0xF90E; | 103 | static short const sDiamondKLeftXt = 0xF90E; |
86 | static short const sDiamondKRightXt = 0xF90E; | 104 | static short const sDiamondKRightXt = 0xF90E; |
87 | static short const sDiamondShiftLeftEq = 1; /* 0xF90E Is this a bug ??? */ | 105 | static short const sDiamondShiftLeftEq = 1; |
88 | static short const sDiamondShiftRightEq = 1; | 106 | static short const sDiamondShiftRightEq = 1; |
89 | static short const sDiamondShiftLeftXt = 0; | 107 | static short const sDiamondShiftLeftXt = 0; |
90 | static short const sDiamondShiftRightXt = 0; | 108 | static short const sDiamondShiftRightXt = 0; |
@@ -94,29 +112,29 @@ static unsigned short const wDiamondRightDelay = 0xb; | |||
94 | static xtalk_coefs_t const asXtalkWideCoefsLeftEq = { | 112 | static xtalk_coefs_t const asXtalkWideCoefsLeftEq = { |
95 | {0xEC4C, 0xDCE9, 0xFDC2, 0xFEEC, 0}, | 113 | {0xEC4C, 0xDCE9, 0xFDC2, 0xFEEC, 0}, |
96 | {0x5F60, 0xCBCB, 0xFC26, 0x0305, 0}, | 114 | {0x5F60, 0xCBCB, 0xFC26, 0x0305, 0}, |
97 | {0x340B, 0xf504, 0x6CE8, 0x0D23, 0x00E4}, | 115 | {0x340B, 0xe8f5, 0x236c, 0xe40d, 0}, |
98 | {0xD500, 0x8D76, 0xACC7, 0x5B05, 0x00FA}, | 116 | {0x76d5, 0xc78d, 0x05ac, 0xfa5b, 0}, |
99 | {0x7F04, 0xC0FA, 0x0263, 0xFDA2, 0} | 117 | {0x7F04, 0xC0FA, 0x0263, 0xFDA2, 0} |
100 | }; | 118 | }; |
101 | static xtalk_coefs_t const asXtalkWideCoefsRightEq = { | 119 | static xtalk_coefs_t const asXtalkWideCoefsRightEq = { |
102 | {0xEC4C, 0xDCE9, 0xFDC2, 0xFEEC, 0}, | 120 | {0xEC4C, 0xDCE9, 0xFDC2, 0xFEEC, 0}, |
103 | {0x5F60, 0xCBCB, 0xFC26, 0x0305, 0}, | 121 | {0x5F60, 0xCBCB, 0xFC26, 0x0305, 0}, |
104 | {0x340B, 0xF504, 0x6CE8, 0x0D23, 0x00E4}, | 122 | {0x340B, 0xe8f5, 0x236c, 0xe40d, 0}, |
105 | {0xD500, 0x8D76, 0xACC7, 0x5B05, 0x00FA}, | 123 | {0x76d5, 0xc78d, 0x05ac, 0xfa5b, 0}, |
106 | {0x7F04, 0xC0FA, 0x0263, 0xFDA2, 0} | 124 | {0x7F04, 0xC0FA, 0x0263, 0xFDA2, 0} |
107 | }; | 125 | }; |
108 | static xtalk_coefs_t const asXtalkWideCoefsLeftXt = { | 126 | static xtalk_coefs_t const asXtalkWideCoefsLeftXt = { |
109 | {0x86C3, 0x7B55, 0x89C3, 0x005B, 0x0047}, | 127 | {0x55c6, 0xc97b, 0x005b, 0x0047, 0}, |
110 | {0x6000, 0x206A, 0xC6CA, 0x40FF, 0}, | 128 | {0x6a60, 0xca20, 0xffc6, 0x0040, 0}, |
111 | {0x1100, 0x1164, 0xA1D7, 0x90FC, 0x0001}, | 129 | {0x6411, 0xd711, 0xfca1, 0x0190, 0}, |
112 | {0xDC00, 0x9E77, 0xB8C7, 0x0AFF, 0}, | 130 | {0x77dc, 0xc79e, 0xffb8, 0x000a, 0}, |
113 | {0, 0, 0, 0, 0} | 131 | {0, 0, 0, 0, 0} |
114 | }; | 132 | }; |
115 | static xtalk_coefs_t const asXtalkWideCoefsRightXt = { | 133 | static xtalk_coefs_t const asXtalkWideCoefsRightXt = { |
116 | {0x86C3, 0x7B55, 0x89C3, 0x005B, 0x0047}, | 134 | {0x55c6, 0xc97b, 0x005b, 0x0047, 0}, |
117 | {0x6000, 0x206A, 0xC6CA, 0x40FF, 0}, | 135 | {0x6a60, 0xca20, 0xffc6, 0x0040, 0}, |
118 | {0x1100, 0x1164, 0xA1D7, 0x90FC, 0x0001}, | 136 | {0x6411, 0xd711, 0xfca1, 0x0190, 0}, |
119 | {0xDC00, 0x9E77, 0xB8C7, 0x0AFF, 0}, | 137 | {0x77dc, 0xc79e, 0xffb8, 0x000a, 0}, |
120 | {0, 0, 0, 0, 0} | 138 | {0, 0, 0, 0, 0} |
121 | }; | 139 | }; |
122 | static xtalk_coefs_t const asXtalkNarrowCoefsLeftEq = { | 140 | static xtalk_coefs_t const asXtalkNarrowCoefsLeftEq = { |
@@ -151,7 +169,14 @@ static xtalk_coefs_t const asXtalkNarrowCoefsRightXt = { | |||
151 | {0, 0, 0, 0, 0} | 169 | {0, 0, 0, 0, 0} |
152 | }; | 170 | }; |
153 | 171 | ||
154 | static xtalk_coefs_t const asXtalkCoefsZeros; | 172 | static xtalk_coefs_t const asXtalkCoefsZeros = { |
173 | {0, 0, 0, 0, 0}, | ||
174 | {0, 0, 0, 0, 0}, | ||
175 | {0, 0, 0, 0, 0}, | ||
176 | {0, 0, 0, 0, 0}, | ||
177 | {0, 0, 0, 0, 0} | ||
178 | }; | ||
179 | |||
155 | static xtalk_coefs_t const asXtalkCoefsPipe = { | 180 | static xtalk_coefs_t const asXtalkCoefsPipe = { |
156 | {0, 0, 0x0FA0, 0, 0}, | 181 | {0, 0, 0x0FA0, 0, 0}, |
157 | {0, 0, 0x0FA0, 0, 0}, | 182 | {0, 0, 0x0FA0, 0, 0}, |
@@ -186,7 +211,7 @@ static xtalk_coefs_t const asXtalkCoefsDenTest = { | |||
186 | static xtalk_state_t const asXtalkOutStateTest = { | 211 | static xtalk_state_t const asXtalkOutStateTest = { |
187 | {0x7FFF, 0x0004, 0xFFFC, 0}, | 212 | {0x7FFF, 0x0004, 0xFFFC, 0}, |
188 | {0xFE00, 0x0008, 0xFFF8, 0x4000}, | 213 | {0xFE00, 0x0008, 0xFFF8, 0x4000}, |
189 | {0x200, 0x0010, 0xFFF0, 0xC000}, | 214 | {0x0200, 0x0010, 0xFFF0, 0xC000}, |
190 | {0x8000, 0x0020, 0xFFE0, 0}, | 215 | {0x8000, 0x0020, 0xFFE0, 0}, |
191 | {0, 0, 0, 0} | 216 | {0, 0, 0, 0} |
192 | }; | 217 | }; |
@@ -306,10 +331,10 @@ vortex_XtalkHw_SetLeftEQStates(vortex_t * vortex, | |||
306 | hwwrite(vortex->mmio, 0x2421C + i * 0x24, coefs[i][2]); | 331 | hwwrite(vortex->mmio, 0x2421C + i * 0x24, coefs[i][2]); |
307 | hwwrite(vortex->mmio, 0x24220 + i * 0x24, coefs[i][3]); | 332 | hwwrite(vortex->mmio, 0x24220 + i * 0x24, coefs[i][3]); |
308 | } | 333 | } |
309 | hwwrite(vortex->mmio, 0x244F8 + i * 0x24, arg_0[0]); | 334 | hwwrite(vortex->mmio, 0x244F8, arg_0[0]); |
310 | hwwrite(vortex->mmio, 0x244FC + i * 0x24, arg_0[1]); | 335 | hwwrite(vortex->mmio, 0x244FC, arg_0[1]); |
311 | hwwrite(vortex->mmio, 0x24500 + i * 0x24, arg_0[2]); | 336 | hwwrite(vortex->mmio, 0x24500, arg_0[2]); |
312 | hwwrite(vortex->mmio, 0x24504 + i * 0x24, arg_0[3]); | 337 | hwwrite(vortex->mmio, 0x24504, arg_0[3]); |
313 | } | 338 | } |
314 | 339 | ||
315 | static void | 340 | static void |
@@ -325,10 +350,10 @@ vortex_XtalkHw_SetRightEQStates(vortex_t * vortex, | |||
325 | hwwrite(vortex->mmio, 0x242D0 + i * 0x24, coefs[i][2]); | 350 | hwwrite(vortex->mmio, 0x242D0 + i * 0x24, coefs[i][2]); |
326 | hwwrite(vortex->mmio, 0x244D4 + i * 0x24, coefs[i][3]); | 351 | hwwrite(vortex->mmio, 0x244D4 + i * 0x24, coefs[i][3]); |
327 | } | 352 | } |
328 | hwwrite(vortex->mmio, 0x24508 + i * 0x24, arg_0[0]); | 353 | hwwrite(vortex->mmio, 0x24508, arg_0[0]); |
329 | hwwrite(vortex->mmio, 0x2450C + i * 0x24, arg_0[1]); | 354 | hwwrite(vortex->mmio, 0x2450C, arg_0[1]); |
330 | hwwrite(vortex->mmio, 0x24510 + i * 0x24, arg_0[2]); | 355 | hwwrite(vortex->mmio, 0x24510, arg_0[2]); |
331 | hwwrite(vortex->mmio, 0x24514 + i * 0x24, arg_0[3]); | 356 | hwwrite(vortex->mmio, 0x24514, arg_0[3]); |
332 | } | 357 | } |
333 | 358 | ||
334 | static void | 359 | static void |
@@ -344,10 +369,10 @@ vortex_XtalkHw_SetLeftXTStates(vortex_t * vortex, | |||
344 | hwwrite(vortex->mmio, 0x24384 + i * 0x24, coefs[i][2]); | 369 | hwwrite(vortex->mmio, 0x24384 + i * 0x24, coefs[i][2]); |
345 | hwwrite(vortex->mmio, 0x24388 + i * 0x24, coefs[i][3]); | 370 | hwwrite(vortex->mmio, 0x24388 + i * 0x24, coefs[i][3]); |
346 | } | 371 | } |
347 | hwwrite(vortex->mmio, 0x24518 + i * 0x24, arg_0[0]); | 372 | hwwrite(vortex->mmio, 0x24518, arg_0[0]); |
348 | hwwrite(vortex->mmio, 0x2451C + i * 0x24, arg_0[1]); | 373 | hwwrite(vortex->mmio, 0x2451C, arg_0[1]); |
349 | hwwrite(vortex->mmio, 0x24520 + i * 0x24, arg_0[2]); | 374 | hwwrite(vortex->mmio, 0x24520, arg_0[2]); |
350 | hwwrite(vortex->mmio, 0x24524 + i * 0x24, arg_0[3]); | 375 | hwwrite(vortex->mmio, 0x24524, arg_0[3]); |
351 | } | 376 | } |
352 | 377 | ||
353 | static void | 378 | static void |
@@ -363,10 +388,10 @@ vortex_XtalkHw_SetRightXTStates(vortex_t * vortex, | |||
363 | hwwrite(vortex->mmio, 0x24438 + i * 0x24, coefs[i][2]); | 388 | hwwrite(vortex->mmio, 0x24438 + i * 0x24, coefs[i][2]); |
364 | hwwrite(vortex->mmio, 0x2443C + i * 0x24, coefs[i][3]); | 389 | hwwrite(vortex->mmio, 0x2443C + i * 0x24, coefs[i][3]); |
365 | } | 390 | } |
366 | hwwrite(vortex->mmio, 0x24528 + i * 0x24, arg_0[0]); | 391 | hwwrite(vortex->mmio, 0x24528, arg_0[0]); |
367 | hwwrite(vortex->mmio, 0x2452C + i * 0x24, arg_0[1]); | 392 | hwwrite(vortex->mmio, 0x2452C, arg_0[1]); |
368 | hwwrite(vortex->mmio, 0x24530 + i * 0x24, arg_0[2]); | 393 | hwwrite(vortex->mmio, 0x24530, arg_0[2]); |
369 | hwwrite(vortex->mmio, 0x24534 + i * 0x24, arg_0[3]); | 394 | hwwrite(vortex->mmio, 0x24534, arg_0[3]); |
370 | } | 395 | } |
371 | 396 | ||
372 | #if 0 | 397 | #if 0 |
@@ -450,10 +475,10 @@ vortex_XtalkHw_GetLeftEQStates(vortex_t * vortex, xtalk_instate_t arg_0, | |||
450 | coefs[i][2] = hwread(vortex->mmio, 0x2421C + i * 0x24); | 475 | coefs[i][2] = hwread(vortex->mmio, 0x2421C + i * 0x24); |
451 | coefs[i][3] = hwread(vortex->mmio, 0x24220 + i * 0x24); | 476 | coefs[i][3] = hwread(vortex->mmio, 0x24220 + i * 0x24); |
452 | } | 477 | } |
453 | arg_0[0] = hwread(vortex->mmio, 0x244F8 + i * 0x24); | 478 | arg_0[0] = hwread(vortex->mmio, 0x244F8); |
454 | arg_0[1] = hwread(vortex->mmio, 0x244FC + i * 0x24); | 479 | arg_0[1] = hwread(vortex->mmio, 0x244FC); |
455 | arg_0[2] = hwread(vortex->mmio, 0x24500 + i * 0x24); | 480 | arg_0[2] = hwread(vortex->mmio, 0x24500); |
456 | arg_0[3] = hwread(vortex->mmio, 0x24504 + i * 0x24); | 481 | arg_0[3] = hwread(vortex->mmio, 0x24504); |
457 | } | 482 | } |
458 | 483 | ||
459 | static void | 484 | static void |
@@ -468,10 +493,10 @@ vortex_XtalkHw_GetRightEQStates(vortex_t * vortex, xtalk_instate_t arg_0, | |||
468 | coefs[i][2] = hwread(vortex->mmio, 0x242D0 + i * 0x24); | 493 | coefs[i][2] = hwread(vortex->mmio, 0x242D0 + i * 0x24); |
469 | coefs[i][3] = hwread(vortex->mmio, 0x242D4 + i * 0x24); | 494 | coefs[i][3] = hwread(vortex->mmio, 0x242D4 + i * 0x24); |
470 | } | 495 | } |
471 | arg_0[0] = hwread(vortex->mmio, 0x24508 + i * 0x24); | 496 | arg_0[0] = hwread(vortex->mmio, 0x24508); |
472 | arg_0[1] = hwread(vortex->mmio, 0x2450C + i * 0x24); | 497 | arg_0[1] = hwread(vortex->mmio, 0x2450C); |
473 | arg_0[2] = hwread(vortex->mmio, 0x24510 + i * 0x24); | 498 | arg_0[2] = hwread(vortex->mmio, 0x24510); |
474 | arg_0[3] = hwread(vortex->mmio, 0x24514 + i * 0x24); | 499 | arg_0[3] = hwread(vortex->mmio, 0x24514); |
475 | } | 500 | } |
476 | 501 | ||
477 | static void | 502 | static void |
@@ -486,10 +511,10 @@ vortex_XtalkHw_GetLeftXTStates(vortex_t * vortex, xtalk_instate_t arg_0, | |||
486 | coefs[i][2] = hwread(vortex->mmio, 0x24384 + i * 0x24); | 511 | coefs[i][2] = hwread(vortex->mmio, 0x24384 + i * 0x24); |
487 | coefs[i][3] = hwread(vortex->mmio, 0x24388 + i * 0x24); | 512 | coefs[i][3] = hwread(vortex->mmio, 0x24388 + i * 0x24); |
488 | } | 513 | } |
489 | arg_0[0] = hwread(vortex->mmio, 0x24518 + i * 0x24); | 514 | arg_0[0] = hwread(vortex->mmio, 0x24518); |
490 | arg_0[1] = hwread(vortex->mmio, 0x2451C + i * 0x24); | 515 | arg_0[1] = hwread(vortex->mmio, 0x2451C); |
491 | arg_0[2] = hwread(vortex->mmio, 0x24520 + i * 0x24); | 516 | arg_0[2] = hwread(vortex->mmio, 0x24520); |
492 | arg_0[3] = hwread(vortex->mmio, 0x24524 + i * 0x24); | 517 | arg_0[3] = hwread(vortex->mmio, 0x24524); |
493 | } | 518 | } |
494 | 519 | ||
495 | static void | 520 | static void |
@@ -504,10 +529,10 @@ vortex_XtalkHw_GetRightXTStates(vortex_t * vortex, xtalk_instate_t arg_0, | |||
504 | coefs[i][2] = hwread(vortex->mmio, 0x24438 + i * 0x24); | 529 | coefs[i][2] = hwread(vortex->mmio, 0x24438 + i * 0x24); |
505 | coefs[i][3] = hwread(vortex->mmio, 0x2443C + i * 0x24); | 530 | coefs[i][3] = hwread(vortex->mmio, 0x2443C + i * 0x24); |
506 | } | 531 | } |
507 | arg_0[0] = hwread(vortex->mmio, 0x24528 + i * 0x24); | 532 | arg_0[0] = hwread(vortex->mmio, 0x24528); |
508 | arg_0[1] = hwread(vortex->mmio, 0x2452C + i * 0x24); | 533 | arg_0[1] = hwread(vortex->mmio, 0x2452C); |
509 | arg_0[2] = hwread(vortex->mmio, 0x24530 + i * 0x24); | 534 | arg_0[2] = hwread(vortex->mmio, 0x24530); |
510 | arg_0[3] = hwread(vortex->mmio, 0x24534 + i * 0x24); | 535 | arg_0[3] = hwread(vortex->mmio, 0x24534); |
511 | } | 536 | } |
512 | 537 | ||
513 | #endif | 538 | #endif |
diff --git a/sound/pci/aw2/aw2-alsa.c b/sound/pci/aw2/aw2-alsa.c index 7a581151db0d..1c5231931462 100644 --- a/sound/pci/aw2/aw2-alsa.c +++ b/sound/pci/aw2/aw2-alsa.c | |||
@@ -153,7 +153,7 @@ static int snd_aw2_control_switch_capture_put(struct snd_kcontrol *kcontrol, | |||
153 | ********************************/ | 153 | ********************************/ |
154 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 154 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
155 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 155 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
156 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 156 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
157 | 157 | ||
158 | module_param_array(index, int, NULL, 0444); | 158 | module_param_array(index, int, NULL, 0444); |
159 | MODULE_PARM_DESC(index, "Index value for Audiowerk2 soundcard."); | 159 | MODULE_PARM_DESC(index, "Index value for Audiowerk2 soundcard."); |
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index bc1e6830b50d..95ffa6a9db6e 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c | |||
@@ -301,7 +301,7 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | |||
301 | module_param_array(id, charp, NULL, 0444); | 301 | module_param_array(id, charp, NULL, 0444); |
302 | MODULE_PARM_DESC(id, "ID string for AZF3328 soundcard."); | 302 | MODULE_PARM_DESC(id, "ID string for AZF3328 soundcard."); |
303 | 303 | ||
304 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 304 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
305 | module_param_array(enable, bool, NULL, 0444); | 305 | module_param_array(enable, bool, NULL, 0444); |
306 | MODULE_PARM_DESC(enable, "Enable AZF3328 soundcard."); | 306 | MODULE_PARM_DESC(enable, "Enable AZF3328 soundcard."); |
307 | 307 | ||
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c index c1c2d0c1c7f0..62d6163fc9d9 100644 --- a/sound/pci/bt87x.c +++ b/sound/pci/bt87x.c | |||
@@ -42,9 +42,9 @@ MODULE_SUPPORTED_DEVICE("{{Brooktree,Bt878}," | |||
42 | 42 | ||
43 | static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */ | 43 | static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */ |
44 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 44 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
45 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 45 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
46 | static int digital_rate[SNDRV_CARDS]; /* digital input rate */ | 46 | static int digital_rate[SNDRV_CARDS]; /* digital input rate */ |
47 | static int load_all; /* allow to load the non-whitelisted cards */ | 47 | static bool load_all; /* allow to load the non-whitelisted cards */ |
48 | 48 | ||
49 | module_param_array(index, int, NULL, 0444); | 49 | module_param_array(index, int, NULL, 0444); |
50 | MODULE_PARM_DESC(index, "Index value for Bt87x soundcard"); | 50 | MODULE_PARM_DESC(index, "Index value for Bt87x soundcard"); |
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index fe99fdeaf15f..08d6ebfe5a61 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c | |||
@@ -156,7 +156,7 @@ MODULE_SUPPORTED_DEVICE("{{Creative,SB CA0106 chip}}"); | |||
156 | // module parameters (see "Module Parameters") | 156 | // module parameters (see "Module Parameters") |
157 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 157 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
158 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 158 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
159 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 159 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
160 | static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */ | 160 | static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */ |
161 | 161 | ||
162 | module_param_array(index, int, NULL, 0444); | 162 | module_param_array(index, int, NULL, 0444); |
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 954c9934748a..19b06269adc2 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c | |||
@@ -54,10 +54,10 @@ MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8738}," | |||
54 | 54 | ||
55 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 55 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
56 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 56 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
57 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ | 57 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ |
58 | static long mpu_port[SNDRV_CARDS]; | 58 | static long mpu_port[SNDRV_CARDS]; |
59 | static long fm_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1}; | 59 | static long fm_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1}; |
60 | static int soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1}; | 60 | static bool soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1}; |
61 | #ifdef SUPPORT_JOYSTICK | 61 | #ifdef SUPPORT_JOYSTICK |
62 | static int joystick_port[SNDRV_CARDS]; | 62 | static int joystick_port[SNDRV_CARDS]; |
63 | #endif | 63 | #endif |
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index a6c6c5c53af9..a9f368f60df6 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c | |||
@@ -44,8 +44,8 @@ MODULE_SUPPORTED_DEVICE("{{Cirrus Logic,CS4281}}"); | |||
44 | 44 | ||
45 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 45 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
46 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 46 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
47 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ | 47 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ |
48 | static int dual_codec[SNDRV_CARDS]; /* dual codec */ | 48 | static bool dual_codec[SNDRV_CARDS]; /* dual codec */ |
49 | 49 | ||
50 | module_param_array(index, int, NULL, 0444); | 50 | module_param_array(index, int, NULL, 0444); |
51 | MODULE_PARM_DESC(index, "Index value for CS4281 soundcard."); | 51 | MODULE_PARM_DESC(index, "Index value for CS4281 soundcard."); |
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c index a4ecb40f8507..819d79d0586d 100644 --- a/sound/pci/cs46xx/cs46xx.c +++ b/sound/pci/cs46xx/cs46xx.c | |||
@@ -46,10 +46,10 @@ MODULE_SUPPORTED_DEVICE("{{Cirrus Logic,Sound Fusion (CS4280)}," | |||
46 | 46 | ||
47 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 47 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
48 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 48 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
49 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 49 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
50 | static int external_amp[SNDRV_CARDS]; | 50 | static bool external_amp[SNDRV_CARDS]; |
51 | static int thinkpad[SNDRV_CARDS]; | 51 | static bool thinkpad[SNDRV_CARDS]; |
52 | static int mmap_valid[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 52 | static bool mmap_valid[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
53 | 53 | ||
54 | module_param_array(index, int, NULL, 0444); | 54 | module_param_array(index, int, NULL, 0444); |
55 | MODULE_PARM_DESC(index, "Index value for the CS46xx soundcard."); | 55 | MODULE_PARM_DESC(index, "Index value for the CS46xx soundcard."); |
diff --git a/sound/pci/cs5530.c b/sound/pci/cs5530.c index 958f4949e973..c47cabff2bfa 100644 --- a/sound/pci/cs5530.c +++ b/sound/pci/cs5530.c | |||
@@ -50,7 +50,14 @@ MODULE_LICENSE("GPL"); | |||
50 | 50 | ||
51 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 51 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
52 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 52 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
53 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 53 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
54 | |||
55 | module_param_array(index, int, NULL, 0444); | ||
56 | MODULE_PARM_DESC(index, "Index value for CS5530 Audio driver."); | ||
57 | module_param_array(id, charp, NULL, 0444); | ||
58 | MODULE_PARM_DESC(id, "ID string for CS5530 Audio driver."); | ||
59 | module_param_array(enable, bool, NULL, 0444); | ||
60 | MODULE_PARM_DESC(enable, "Enable CS5530 Audio driver."); | ||
54 | 61 | ||
55 | struct snd_cs5530 { | 62 | struct snd_cs5530 { |
56 | struct snd_card *card; | 63 | struct snd_card *card; |
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c index b8959d2c804b..a2fb2173e980 100644 --- a/sound/pci/cs5535audio/cs5535audio.c +++ b/sound/pci/cs5535audio/cs5535audio.c | |||
@@ -57,7 +57,7 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { | |||
57 | 57 | ||
58 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 58 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
59 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 59 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
60 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 60 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
61 | 61 | ||
62 | module_param_array(index, int, NULL, 0444); | 62 | module_param_array(index, int, NULL, 0444); |
63 | MODULE_PARM_DESC(index, "Index value for " DRIVER_NAME); | 63 | MODULE_PARM_DESC(index, "Index value for " DRIVER_NAME); |
diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c index e083122ca55a..dbf94b189e75 100644 --- a/sound/pci/cs5535audio/cs5535audio_pcm.c +++ b/sound/pci/cs5535audio/cs5535audio_pcm.c | |||
@@ -148,7 +148,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au, | |||
148 | struct cs5535audio_dma_desc *desc = | 148 | struct cs5535audio_dma_desc *desc = |
149 | &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i]; | 149 | &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i]; |
150 | desc->addr = cpu_to_le32(addr); | 150 | desc->addr = cpu_to_le32(addr); |
151 | desc->size = cpu_to_le32(period_bytes); | 151 | desc->size = cpu_to_le16(period_bytes); |
152 | desc->ctlreserved = cpu_to_le16(PRD_EOP); | 152 | desc->ctlreserved = cpu_to_le16(PRD_EOP); |
153 | desc_addr += sizeof(struct cs5535audio_dma_desc); | 153 | desc_addr += sizeof(struct cs5535audio_dma_desc); |
154 | addr += period_bytes; | 154 | addr += period_bytes; |
diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c index e134b3a5780d..6e77e86307c2 100644 --- a/sound/pci/ctxfi/ctsrc.c +++ b/sound/pci/ctxfi/ctsrc.c | |||
@@ -437,7 +437,7 @@ get_src_rsc(struct src_mgr *mgr, const struct src_desc *desc, struct src **rsrc) | |||
437 | 437 | ||
438 | /* Allocate mem for master src resource */ | 438 | /* Allocate mem for master src resource */ |
439 | if (MEMRD == desc->mode) | 439 | if (MEMRD == desc->mode) |
440 | src = kzalloc(sizeof(*src)*desc->multi, GFP_KERNEL); | 440 | src = kcalloc(desc->multi, sizeof(*src), GFP_KERNEL); |
441 | else | 441 | else |
442 | src = kzalloc(sizeof(*src), GFP_KERNEL); | 442 | src = kzalloc(sizeof(*src), GFP_KERNEL); |
443 | 443 | ||
diff --git a/sound/pci/ctxfi/cttimer.c b/sound/pci/ctxfi/cttimer.c index 93b0aedc36d4..03fb909085af 100644 --- a/sound/pci/ctxfi/cttimer.c +++ b/sound/pci/ctxfi/cttimer.c | |||
@@ -15,8 +15,8 @@ | |||
15 | #include "cthardware.h" | 15 | #include "cthardware.h" |
16 | #include "cttimer.h" | 16 | #include "cttimer.h" |
17 | 17 | ||
18 | static int use_system_timer; | 18 | static bool use_system_timer; |
19 | MODULE_PARM_DESC(use_system_timer, "Foce to use system-timer"); | 19 | MODULE_PARM_DESC(use_system_timer, "Force to use system-timer"); |
20 | module_param(use_system_timer, bool, S_IRUGO); | 20 | module_param(use_system_timer, bool, S_IRUGO); |
21 | 21 | ||
22 | struct ct_timer_ops { | 22 | struct ct_timer_ops { |
diff --git a/sound/pci/ctxfi/xfi.c b/sound/pci/ctxfi/xfi.c index 33931ef5e129..15d95d2bacee 100644 --- a/sound/pci/ctxfi/xfi.c +++ b/sound/pci/ctxfi/xfi.c | |||
@@ -32,7 +32,7 @@ module_param(multiple, uint, S_IRUGO); | |||
32 | 32 | ||
33 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 33 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
34 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 34 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
35 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 35 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
36 | static unsigned int subsystem[SNDRV_CARDS]; | 36 | static unsigned int subsystem[SNDRV_CARDS]; |
37 | 37 | ||
38 | module_param_array(index, int, NULL, 0444); | 38 | module_param_array(index, int, NULL, 0444); |
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index 9fd694c61866..595c11f904bb 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c | |||
@@ -26,7 +26,7 @@ MODULE_DEVICE_TABLE(pci, snd_echo_ids); | |||
26 | 26 | ||
27 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 27 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
28 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 28 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
29 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 29 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
30 | 30 | ||
31 | module_param_array(index, int, NULL, 0444); | 31 | module_param_array(index, int, NULL, 0444); |
32 | MODULE_PARM_DESC(index, "Index value for " ECHOCARD_NAME " soundcard."); | 32 | MODULE_PARM_DESC(index, "Index value for " ECHOCARD_NAME " soundcard."); |
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c index eaa198e122c0..790c65d980c8 100644 --- a/sound/pci/emu10k1/emu10k1.c +++ b/sound/pci/emu10k1/emu10k1.c | |||
@@ -44,13 +44,13 @@ MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB Live!/PCI512/E-mu APS}," | |||
44 | 44 | ||
45 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 45 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
46 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 46 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
47 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 47 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
48 | static int extin[SNDRV_CARDS]; | 48 | static int extin[SNDRV_CARDS]; |
49 | static int extout[SNDRV_CARDS]; | 49 | static int extout[SNDRV_CARDS]; |
50 | static int seq_ports[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4}; | 50 | static int seq_ports[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4}; |
51 | static int max_synth_voices[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 64}; | 51 | static int max_synth_voices[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 64}; |
52 | static int max_buffer_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128}; | 52 | static int max_buffer_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128}; |
53 | static int enable_ir[SNDRV_CARDS]; | 53 | static bool enable_ir[SNDRV_CARDS]; |
54 | static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */ | 54 | static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */ |
55 | static uint delay_pcm_irq[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; | 55 | static uint delay_pcm_irq[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; |
56 | 56 | ||
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 6a3e5677f591..754924081d0a 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c | |||
@@ -1480,6 +1480,18 @@ static struct snd_emu_chip_details emu_chip_details[] = { | |||
1480 | .spdif_bug = 1, | 1480 | .spdif_bug = 1, |
1481 | .invert_shared_spdif = 1, /* digital/analog switch swapped */ | 1481 | .invert_shared_spdif = 1, /* digital/analog switch swapped */ |
1482 | .ac97_chip = 1} , | 1482 | .ac97_chip = 1} , |
1483 | /* 0x20051102 also has SB0350 written on it, treated as Audigy 2 ZS by | ||
1484 | Creative's Windows driver */ | ||
1485 | {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20051102, | ||
1486 | .driver = "Audigy2", .name = "SB Audigy 2 ZS [SB0350a]", | ||
1487 | .id = "Audigy2", | ||
1488 | .emu10k2_chip = 1, | ||
1489 | .ca0102_chip = 1, | ||
1490 | .ca0151_chip = 1, | ||
1491 | .spk71 = 1, | ||
1492 | .spdif_bug = 1, | ||
1493 | .invert_shared_spdif = 1, /* digital/analog switch swapped */ | ||
1494 | .ac97_chip = 1} , | ||
1483 | {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102, | 1495 | {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102, |
1484 | .driver = "Audigy2", .name = "SB Audigy 2 ZS [SB0350]", | 1496 | .driver = "Audigy2", .name = "SB Audigy 2 ZS [SB0350]", |
1485 | .id = "Audigy2", | 1497 | .id = "Audigy2", |
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index 2228be9f30e6..47a651cb6e84 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c | |||
@@ -50,7 +50,7 @@ MODULE_SUPPORTED_DEVICE("{{Dell Creative Labs,SB Live!}"); | |||
50 | // module parameters (see "Module Parameters") | 50 | // module parameters (see "Module Parameters") |
51 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 51 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
52 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 52 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
53 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 53 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
54 | 54 | ||
55 | module_param_array(index, int, NULL, 0444); | 55 | module_param_array(index, int, NULL, 0444); |
56 | MODULE_PARM_DESC(index, "Index value for the EMU10K1X soundcard."); | 56 | MODULE_PARM_DESC(index, "Index value for the EMU10K1X soundcard."); |
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index d085ad03efe8..47a245e84190 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c | |||
@@ -83,12 +83,12 @@ MODULE_SUPPORTED_DEVICE("{{Ensoniq,AudioPCI ES1371/73}," | |||
83 | 83 | ||
84 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 84 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
85 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 85 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
86 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ | 86 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ |
87 | #ifdef SUPPORT_JOYSTICK | 87 | #ifdef SUPPORT_JOYSTICK |
88 | #ifdef CHIP1371 | 88 | #ifdef CHIP1371 |
89 | static int joystick_port[SNDRV_CARDS]; | 89 | static int joystick_port[SNDRV_CARDS]; |
90 | #else | 90 | #else |
91 | static int joystick[SNDRV_CARDS]; | 91 | static bool joystick[SNDRV_CARDS]; |
92 | #endif | 92 | #endif |
93 | #endif | 93 | #endif |
94 | #ifdef CHIP1371 | 94 | #ifdef CHIP1371 |
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index 04cc21f5d014..53eb76b41108 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c | |||
@@ -79,7 +79,7 @@ MODULE_SUPPORTED_DEVICE("{{ESS,ES1938}," | |||
79 | 79 | ||
80 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 80 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
81 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 81 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
82 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 82 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
83 | 83 | ||
84 | module_param_array(index, int, NULL, 0444); | 84 | module_param_array(index, int, NULL, 0444); |
85 | MODULE_PARM_DESC(index, "Index value for ESS Solo-1 soundcard."); | 85 | MODULE_PARM_DESC(index, "Index value for ESS Solo-1 soundcard."); |
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 297a151bdba9..cb557c603a80 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c | |||
@@ -132,7 +132,7 @@ MODULE_SUPPORTED_DEVICE("{{ESS,Maestro 2e}," | |||
132 | 132 | ||
133 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */ | 133 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */ |
134 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 134 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
135 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 135 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
136 | static int total_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1024 }; | 136 | static int total_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1024 }; |
137 | static int pcm_substreams_p[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4 }; | 137 | static int pcm_substreams_p[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4 }; |
138 | static int pcm_substreams_c[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 }; | 138 | static int pcm_substreams_c[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 }; |
@@ -140,7 +140,7 @@ static int clock[SNDRV_CARDS]; | |||
140 | static int use_pm[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; | 140 | static int use_pm[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; |
141 | static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; | 141 | static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; |
142 | #ifdef SUPPORT_JOYSTICK | 142 | #ifdef SUPPORT_JOYSTICK |
143 | static int joystick[SNDRV_CARDS]; | 143 | static bool joystick[SNDRV_CARDS]; |
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | module_param_array(index, int, NULL, 0444); | 146 | module_param_array(index, int, NULL, 0444); |
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index ec05ef5a5abf..9597ef1eccca 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -48,7 +48,7 @@ MODULE_SUPPORTED_DEVICE("{{ForteMedia,FM801}," | |||
48 | 48 | ||
49 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 49 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
50 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 50 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
51 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 51 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
52 | /* | 52 | /* |
53 | * Enable TEA575x tuner | 53 | * Enable TEA575x tuner |
54 | * 1 = MediaForte 256-PCS | 54 | * 1 = MediaForte 256-PCS |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index e44b107fdc75..4562e9de6a1a 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -4046,9 +4046,9 @@ int snd_hda_check_board_codec_sid_config(struct hda_codec *codec, | |||
4046 | 4046 | ||
4047 | /* Search for codec ID */ | 4047 | /* Search for codec ID */ |
4048 | for (q = tbl; q->subvendor; q++) { | 4048 | for (q = tbl; q->subvendor; q++) { |
4049 | unsigned long vendorid = (q->subdevice) | (q->subvendor << 16); | 4049 | unsigned int mask = 0xffff0000 | q->subdevice_mask; |
4050 | 4050 | unsigned int id = (q->subdevice | (q->subvendor << 16)) & mask; | |
4051 | if (vendorid == codec->subsystem_id) | 4051 | if ((codec->subsystem_id & mask) == id) |
4052 | break; | 4052 | break; |
4053 | } | 4053 | } |
4054 | 4054 | ||
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index 7ae7578bdcc0..c1da422e085a 100644 --- a/sound/pci/hda/hda_eld.c +++ b/sound/pci/hda/hda_eld.c | |||
@@ -347,18 +347,28 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld, | |||
347 | 347 | ||
348 | for (i = 0; i < size; i++) { | 348 | for (i = 0; i < size; i++) { |
349 | unsigned int val = hdmi_get_eld_data(codec, nid, i); | 349 | unsigned int val = hdmi_get_eld_data(codec, nid, i); |
350 | /* | ||
351 | * Graphics driver might be writing to ELD buffer right now. | ||
352 | * Just abort. The caller will repoll after a while. | ||
353 | */ | ||
350 | if (!(val & AC_ELDD_ELD_VALID)) { | 354 | if (!(val & AC_ELDD_ELD_VALID)) { |
351 | if (!i) { | ||
352 | snd_printd(KERN_INFO | ||
353 | "HDMI: invalid ELD data\n"); | ||
354 | ret = -EINVAL; | ||
355 | goto error; | ||
356 | } | ||
357 | snd_printd(KERN_INFO | 355 | snd_printd(KERN_INFO |
358 | "HDMI: invalid ELD data byte %d\n", i); | 356 | "HDMI: invalid ELD data byte %d\n", i); |
359 | val = 0; | 357 | ret = -EINVAL; |
360 | } else | 358 | goto error; |
361 | val &= AC_ELDD_ELD_DATA; | 359 | } |
360 | val &= AC_ELDD_ELD_DATA; | ||
361 | /* | ||
362 | * The first byte cannot be zero. This can happen on some DVI | ||
363 | * connections. Some Intel chips may also need some 250ms delay | ||
364 | * to return non-zero ELD data, even when the graphics driver | ||
365 | * correctly writes ELD content before setting ELD_valid bit. | ||
366 | */ | ||
367 | if (!val && !i) { | ||
368 | snd_printdd(KERN_INFO "HDMI: 0 ELD data\n"); | ||
369 | ret = -EINVAL; | ||
370 | goto error; | ||
371 | } | ||
362 | buf[i] = val; | 372 | buf[i] = val; |
363 | } | 373 | } |
364 | 374 | ||
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 096507d2ca9a..06fe2c546ee4 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -58,13 +58,13 @@ | |||
58 | 58 | ||
59 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 59 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
60 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 60 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
61 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 61 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
62 | static char *model[SNDRV_CARDS]; | 62 | static char *model[SNDRV_CARDS]; |
63 | static int position_fix[SNDRV_CARDS]; | 63 | static int position_fix[SNDRV_CARDS]; |
64 | static int bdl_pos_adj[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1}; | 64 | static int bdl_pos_adj[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1}; |
65 | static int probe_mask[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1}; | 65 | static int probe_mask[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1}; |
66 | static int probe_only[SNDRV_CARDS]; | 66 | static int probe_only[SNDRV_CARDS]; |
67 | static int single_cmd; | 67 | static bool single_cmd; |
68 | static int enable_msi = -1; | 68 | static int enable_msi = -1; |
69 | #ifdef CONFIG_SND_HDA_PATCH_LOADER | 69 | #ifdef CONFIG_SND_HDA_PATCH_LOADER |
70 | static char *patch[SNDRV_CARDS]; | 70 | static char *patch[SNDRV_CARDS]; |
@@ -116,12 +116,12 @@ MODULE_PARM_DESC(power_save, "Automatic power-saving timeout " | |||
116 | * this may give more power-saving, but will take longer time to | 116 | * this may give more power-saving, but will take longer time to |
117 | * wake up. | 117 | * wake up. |
118 | */ | 118 | */ |
119 | static int power_save_controller = 1; | 119 | static bool power_save_controller = 1; |
120 | module_param(power_save_controller, bool, 0644); | 120 | module_param(power_save_controller, bool, 0644); |
121 | MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode."); | 121 | MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode."); |
122 | #endif | 122 | #endif |
123 | 123 | ||
124 | static int align_buffer_size = 1; | 124 | static bool align_buffer_size = 1; |
125 | module_param(align_buffer_size, bool, 0644); | 125 | module_param(align_buffer_size, bool, 0644); |
126 | MODULE_PARM_DESC(align_buffer_size, | 126 | MODULE_PARM_DESC(align_buffer_size, |
127 | "Force buffer and period sizes to be multiple of 128 bytes."); | 127 | "Force buffer and period sizes to be multiple of 128 bytes."); |
@@ -2508,7 +2508,6 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = { | |||
2508 | SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), | 2508 | SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), |
2509 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), | 2509 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), |
2510 | SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), | 2510 | SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), |
2511 | SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB), | ||
2512 | SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB), | 2511 | SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB), |
2513 | SND_PCI_QUIRK(0x1458, 0xa022, "ga-ma770-ud3", POS_FIX_LPIB), | 2512 | SND_PCI_QUIRK(0x1458, 0xa022, "ga-ma770-ud3", POS_FIX_LPIB), |
2514 | SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB), | 2513 | SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB), |
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 2fbab8e29576..70a7abda7e22 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
@@ -58,6 +58,8 @@ struct cs_spec { | |||
58 | unsigned int gpio_mask; | 58 | unsigned int gpio_mask; |
59 | unsigned int gpio_dir; | 59 | unsigned int gpio_dir; |
60 | unsigned int gpio_data; | 60 | unsigned int gpio_data; |
61 | unsigned int gpio_eapd_hp; /* EAPD GPIO bit for headphones */ | ||
62 | unsigned int gpio_eapd_speaker; /* EAPD GPIO bit for speakers */ | ||
61 | 63 | ||
62 | struct hda_pcm pcm_rec[2]; /* PCM information */ | 64 | struct hda_pcm pcm_rec[2]; /* PCM information */ |
63 | 65 | ||
@@ -76,6 +78,7 @@ enum { | |||
76 | CS420X_MBP53, | 78 | CS420X_MBP53, |
77 | CS420X_MBP55, | 79 | CS420X_MBP55, |
78 | CS420X_IMAC27, | 80 | CS420X_IMAC27, |
81 | CS420X_APPLE, | ||
79 | CS420X_AUTO, | 82 | CS420X_AUTO, |
80 | CS420X_MODELS | 83 | CS420X_MODELS |
81 | }; | 84 | }; |
@@ -928,10 +931,9 @@ static void cs_automute(struct hda_codec *codec) | |||
928 | spdif_present ? 0 : PIN_OUT); | 931 | spdif_present ? 0 : PIN_OUT); |
929 | } | 932 | } |
930 | } | 933 | } |
931 | if (spec->board_config == CS420X_MBP53 || | 934 | if (spec->gpio_eapd_hp) { |
932 | spec->board_config == CS420X_MBP55 || | 935 | unsigned int gpio = hp_present ? |
933 | spec->board_config == CS420X_IMAC27) { | 936 | spec->gpio_eapd_hp : spec->gpio_eapd_speaker; |
934 | unsigned int gpio = hp_present ? 0x02 : 0x08; | ||
935 | snd_hda_codec_write(codec, 0x01, 0, | 937 | snd_hda_codec_write(codec, 0x01, 0, |
936 | AC_VERB_SET_GPIO_DATA, gpio); | 938 | AC_VERB_SET_GPIO_DATA, gpio); |
937 | } | 939 | } |
@@ -1276,6 +1278,7 @@ static const char * const cs420x_models[CS420X_MODELS] = { | |||
1276 | [CS420X_MBP53] = "mbp53", | 1278 | [CS420X_MBP53] = "mbp53", |
1277 | [CS420X_MBP55] = "mbp55", | 1279 | [CS420X_MBP55] = "mbp55", |
1278 | [CS420X_IMAC27] = "imac27", | 1280 | [CS420X_IMAC27] = "imac27", |
1281 | [CS420X_APPLE] = "apple", | ||
1279 | [CS420X_AUTO] = "auto", | 1282 | [CS420X_AUTO] = "auto", |
1280 | }; | 1283 | }; |
1281 | 1284 | ||
@@ -1285,7 +1288,13 @@ static const struct snd_pci_quirk cs420x_cfg_tbl[] = { | |||
1285 | SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55), | 1288 | SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55), |
1286 | SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55), | 1289 | SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55), |
1287 | SND_PCI_QUIRK(0x10de, 0xcb89, "MacBookPro 7,1", CS420X_MBP55), | 1290 | SND_PCI_QUIRK(0x10de, 0xcb89, "MacBookPro 7,1", CS420X_MBP55), |
1288 | SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27), | 1291 | /* this conflicts with too many other models */ |
1292 | /*SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),*/ | ||
1293 | {} /* terminator */ | ||
1294 | }; | ||
1295 | |||
1296 | static const struct snd_pci_quirk cs420x_codec_cfg_tbl[] = { | ||
1297 | SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS420X_APPLE), | ||
1289 | {} /* terminator */ | 1298 | {} /* terminator */ |
1290 | }; | 1299 | }; |
1291 | 1300 | ||
@@ -1367,6 +1376,10 @@ static int patch_cs420x(struct hda_codec *codec) | |||
1367 | spec->board_config = | 1376 | spec->board_config = |
1368 | snd_hda_check_board_config(codec, CS420X_MODELS, | 1377 | snd_hda_check_board_config(codec, CS420X_MODELS, |
1369 | cs420x_models, cs420x_cfg_tbl); | 1378 | cs420x_models, cs420x_cfg_tbl); |
1379 | if (spec->board_config < 0) | ||
1380 | spec->board_config = | ||
1381 | snd_hda_check_board_codec_sid_config(codec, | ||
1382 | CS420X_MODELS, NULL, cs420x_codec_cfg_tbl); | ||
1370 | if (spec->board_config >= 0) | 1383 | if (spec->board_config >= 0) |
1371 | fix_pincfg(codec, spec->board_config, cs_pincfgs); | 1384 | fix_pincfg(codec, spec->board_config, cs_pincfgs); |
1372 | 1385 | ||
@@ -1374,10 +1387,11 @@ static int patch_cs420x(struct hda_codec *codec) | |||
1374 | case CS420X_IMAC27: | 1387 | case CS420X_IMAC27: |
1375 | case CS420X_MBP53: | 1388 | case CS420X_MBP53: |
1376 | case CS420X_MBP55: | 1389 | case CS420X_MBP55: |
1377 | /* GPIO1 = headphones */ | 1390 | case CS420X_APPLE: |
1378 | /* GPIO3 = speakers */ | 1391 | spec->gpio_eapd_hp = 2; /* GPIO1 = headphones */ |
1379 | spec->gpio_mask = 0x0a; | 1392 | spec->gpio_eapd_speaker = 8; /* GPIO3 = speakers */ |
1380 | spec->gpio_dir = 0x0a; | 1393 | spec->gpio_mask = spec->gpio_dir = |
1394 | spec->gpio_eapd_hp | spec->gpio_eapd_speaker; | ||
1381 | break; | 1395 | break; |
1382 | } | 1396 | } |
1383 | 1397 | ||
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 9850c5b481ea..c505fd5d338c 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -69,6 +69,7 @@ struct hdmi_spec_per_pin { | |||
69 | struct hda_codec *codec; | 69 | struct hda_codec *codec; |
70 | struct hdmi_eld sink_eld; | 70 | struct hdmi_eld sink_eld; |
71 | struct delayed_work work; | 71 | struct delayed_work work; |
72 | int repoll_count; | ||
72 | }; | 73 | }; |
73 | 74 | ||
74 | struct hdmi_spec { | 75 | struct hdmi_spec { |
@@ -748,7 +749,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, int pin_idx, | |||
748 | * Unsolicited events | 749 | * Unsolicited events |
749 | */ | 750 | */ |
750 | 751 | ||
751 | static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry); | 752 | static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll); |
752 | 753 | ||
753 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | 754 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) |
754 | { | 755 | { |
@@ -766,7 +767,7 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | |||
766 | if (pin_idx < 0) | 767 | if (pin_idx < 0) |
767 | return; | 768 | return; |
768 | 769 | ||
769 | hdmi_present_sense(&spec->pins[pin_idx], true); | 770 | hdmi_present_sense(&spec->pins[pin_idx], 1); |
770 | } | 771 | } |
771 | 772 | ||
772 | static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) | 773 | static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) |
@@ -960,7 +961,7 @@ static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx) | |||
960 | return 0; | 961 | return 0; |
961 | } | 962 | } |
962 | 963 | ||
963 | static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry) | 964 | static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll) |
964 | { | 965 | { |
965 | struct hda_codec *codec = per_pin->codec; | 966 | struct hda_codec *codec = per_pin->codec; |
966 | struct hdmi_eld *eld = &per_pin->sink_eld; | 967 | struct hdmi_eld *eld = &per_pin->sink_eld; |
@@ -989,7 +990,7 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry) | |||
989 | if (eld_valid) { | 990 | if (eld_valid) { |
990 | if (!snd_hdmi_get_eld(eld, codec, pin_nid)) | 991 | if (!snd_hdmi_get_eld(eld, codec, pin_nid)) |
991 | snd_hdmi_show_eld(eld); | 992 | snd_hdmi_show_eld(eld); |
992 | else if (retry) { | 993 | else if (repoll) { |
993 | queue_delayed_work(codec->bus->workq, | 994 | queue_delayed_work(codec->bus->workq, |
994 | &per_pin->work, | 995 | &per_pin->work, |
995 | msecs_to_jiffies(300)); | 996 | msecs_to_jiffies(300)); |
@@ -1004,7 +1005,10 @@ static void hdmi_repoll_eld(struct work_struct *work) | |||
1004 | struct hdmi_spec_per_pin *per_pin = | 1005 | struct hdmi_spec_per_pin *per_pin = |
1005 | container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work); | 1006 | container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work); |
1006 | 1007 | ||
1007 | hdmi_present_sense(per_pin, false); | 1008 | if (per_pin->repoll_count++ > 6) |
1009 | per_pin->repoll_count = 0; | ||
1010 | |||
1011 | hdmi_present_sense(per_pin, per_pin->repoll_count); | ||
1008 | } | 1012 | } |
1009 | 1013 | ||
1010 | static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) | 1014 | static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) |
@@ -1235,7 +1239,7 @@ static int generic_hdmi_build_jack(struct hda_codec *codec, int pin_idx) | |||
1235 | if (err < 0) | 1239 | if (err < 0) |
1236 | return err; | 1240 | return err; |
1237 | 1241 | ||
1238 | hdmi_present_sense(per_pin, false); | 1242 | hdmi_present_sense(per_pin, 0); |
1239 | return 0; | 1243 | return 0; |
1240 | } | 1244 | } |
1241 | 1245 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 336d14eb72af..cbde019d3d52 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -277,6 +277,12 @@ static bool alc_dyn_adc_pcm_resetup(struct hda_codec *codec, int cur) | |||
277 | return false; | 277 | return false; |
278 | } | 278 | } |
279 | 279 | ||
280 | static inline hda_nid_t get_capsrc(struct alc_spec *spec, int idx) | ||
281 | { | ||
282 | return spec->capsrc_nids ? | ||
283 | spec->capsrc_nids[idx] : spec->adc_nids[idx]; | ||
284 | } | ||
285 | |||
280 | /* select the given imux item; either unmute exclusively or select the route */ | 286 | /* select the given imux item; either unmute exclusively or select the route */ |
281 | static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx, | 287 | static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx, |
282 | unsigned int idx, bool force) | 288 | unsigned int idx, bool force) |
@@ -303,8 +309,7 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx, | |||
303 | adc_idx = spec->dyn_adc_idx[idx]; | 309 | adc_idx = spec->dyn_adc_idx[idx]; |
304 | } | 310 | } |
305 | 311 | ||
306 | nid = spec->capsrc_nids ? | 312 | nid = get_capsrc(spec, adc_idx); |
307 | spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx]; | ||
308 | 313 | ||
309 | /* no selection? */ | 314 | /* no selection? */ |
310 | num_conns = snd_hda_get_conn_list(codec, nid, NULL); | 315 | num_conns = snd_hda_get_conn_list(codec, nid, NULL); |
@@ -1054,8 +1059,19 @@ static bool alc_rebuild_imux_for_auto_mic(struct hda_codec *codec) | |||
1054 | spec->imux_pins[2] = spec->dock_mic_pin; | 1059 | spec->imux_pins[2] = spec->dock_mic_pin; |
1055 | for (i = 0; i < 3; i++) { | 1060 | for (i = 0; i < 3; i++) { |
1056 | strcpy(imux->items[i].label, texts[i]); | 1061 | strcpy(imux->items[i].label, texts[i]); |
1057 | if (spec->imux_pins[i]) | 1062 | if (spec->imux_pins[i]) { |
1063 | hda_nid_t pin = spec->imux_pins[i]; | ||
1064 | int c; | ||
1065 | for (c = 0; c < spec->num_adc_nids; c++) { | ||
1066 | hda_nid_t cap = get_capsrc(spec, c); | ||
1067 | int idx = get_connection_index(codec, cap, pin); | ||
1068 | if (idx >= 0) { | ||
1069 | imux->items[i].index = idx; | ||
1070 | break; | ||
1071 | } | ||
1072 | } | ||
1058 | imux->num_items = i + 1; | 1073 | imux->num_items = i + 1; |
1074 | } | ||
1059 | } | 1075 | } |
1060 | spec->num_mux_defs = 1; | 1076 | spec->num_mux_defs = 1; |
1061 | spec->input_mux = imux; | 1077 | spec->input_mux = imux; |
@@ -1957,10 +1973,8 @@ static int alc_build_controls(struct hda_codec *codec) | |||
1957 | if (!kctl) | 1973 | if (!kctl) |
1958 | kctl = snd_hda_find_mixer_ctl(codec, "Input Source"); | 1974 | kctl = snd_hda_find_mixer_ctl(codec, "Input Source"); |
1959 | for (i = 0; kctl && i < kctl->count; i++) { | 1975 | for (i = 0; kctl && i < kctl->count; i++) { |
1960 | const hda_nid_t *nids = spec->capsrc_nids; | 1976 | err = snd_hda_add_nid(codec, kctl, i, |
1961 | if (!nids) | 1977 | get_capsrc(spec, i)); |
1962 | nids = spec->adc_nids; | ||
1963 | err = snd_hda_add_nid(codec, kctl, i, nids[i]); | ||
1964 | if (err < 0) | 1978 | if (err < 0) |
1965 | return err; | 1979 | return err; |
1966 | } | 1980 | } |
@@ -2747,8 +2761,7 @@ static int alc_auto_create_input_ctls(struct hda_codec *codec) | |||
2747 | } | 2761 | } |
2748 | 2762 | ||
2749 | for (c = 0; c < num_adcs; c++) { | 2763 | for (c = 0; c < num_adcs; c++) { |
2750 | hda_nid_t cap = spec->capsrc_nids ? | 2764 | hda_nid_t cap = get_capsrc(spec, c); |
2751 | spec->capsrc_nids[c] : spec->adc_nids[c]; | ||
2752 | idx = get_connection_index(codec, cap, pin); | 2765 | idx = get_connection_index(codec, cap, pin); |
2753 | if (idx >= 0) { | 2766 | if (idx >= 0) { |
2754 | spec->imux_pins[imux->num_items] = pin; | 2767 | spec->imux_pins[imux->num_items] = pin; |
@@ -3694,8 +3707,7 @@ static int init_capsrc_for_pin(struct hda_codec *codec, hda_nid_t pin) | |||
3694 | if (!pin) | 3707 | if (!pin) |
3695 | return 0; | 3708 | return 0; |
3696 | for (i = 0; i < spec->num_adc_nids; i++) { | 3709 | for (i = 0; i < spec->num_adc_nids; i++) { |
3697 | hda_nid_t cap = spec->capsrc_nids ? | 3710 | hda_nid_t cap = get_capsrc(spec, i); |
3698 | spec->capsrc_nids[i] : spec->adc_nids[i]; | ||
3699 | int idx; | 3711 | int idx; |
3700 | 3712 | ||
3701 | idx = get_connection_index(codec, cap, pin); | 3713 | idx = get_connection_index(codec, cap, pin); |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 470f6f286e81..d8d2f9dccd9b 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -1641,6 +1641,8 @@ static const struct snd_pci_quirk stac92hd73xx_codec_id_cfg_tbl[] = { | |||
1641 | "Alienware M17x", STAC_ALIENWARE_M17X), | 1641 | "Alienware M17x", STAC_ALIENWARE_M17X), |
1642 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a, | 1642 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a, |
1643 | "Alienware M17x", STAC_ALIENWARE_M17X), | 1643 | "Alienware M17x", STAC_ALIENWARE_M17X), |
1644 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0490, | ||
1645 | "Alienware M17x", STAC_ALIENWARE_M17X), | ||
1644 | {} /* terminator */ | 1646 | {} /* terminator */ |
1645 | }; | 1647 | }; |
1646 | 1648 | ||
@@ -4439,7 +4441,9 @@ static int stac92xx_init(struct hda_codec *codec) | |||
4439 | int pinctl, def_conf; | 4441 | int pinctl, def_conf; |
4440 | 4442 | ||
4441 | /* power on when no jack detection is available */ | 4443 | /* power on when no jack detection is available */ |
4442 | if (!spec->hp_detect) { | 4444 | /* or when the VREF is used for controlling LED */ |
4445 | if (!spec->hp_detect || | ||
4446 | (spec->gpio_led > 8 && spec->gpio_led == nid)) { | ||
4443 | stac_toggle_power_map(codec, nid, 1); | 4447 | stac_toggle_power_map(codec, nid, 1); |
4444 | continue; | 4448 | continue; |
4445 | } | 4449 | } |
@@ -5053,20 +5057,6 @@ static int stac92xx_pre_resume(struct hda_codec *codec) | |||
5053 | return 0; | 5057 | return 0; |
5054 | } | 5058 | } |
5055 | 5059 | ||
5056 | static int stac92xx_post_suspend(struct hda_codec *codec) | ||
5057 | { | ||
5058 | struct sigmatel_spec *spec = codec->spec; | ||
5059 | if (spec->gpio_led > 8) { | ||
5060 | /* with vref-out pin used for mute led control | ||
5061 | * codec AFG is prevented from D3 state, but on | ||
5062 | * system suspend it can (and should) be used | ||
5063 | */ | ||
5064 | snd_hda_codec_read(codec, codec->afg, 0, | ||
5065 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); | ||
5066 | } | ||
5067 | return 0; | ||
5068 | } | ||
5069 | |||
5070 | static void stac92xx_set_power_state(struct hda_codec *codec, hda_nid_t fg, | 5060 | static void stac92xx_set_power_state(struct hda_codec *codec, hda_nid_t fg, |
5071 | unsigned int power_state) | 5061 | unsigned int power_state) |
5072 | { | 5062 | { |
@@ -5666,8 +5656,6 @@ again: | |||
5666 | } else { | 5656 | } else { |
5667 | codec->patch_ops.set_power_state = | 5657 | codec->patch_ops.set_power_state = |
5668 | stac92xx_set_power_state; | 5658 | stac92xx_set_power_state; |
5669 | codec->patch_ops.post_suspend = | ||
5670 | stac92xx_post_suspend; | ||
5671 | } | 5659 | } |
5672 | codec->patch_ops.pre_resume = stac92xx_pre_resume; | 5660 | codec->patch_ops.pre_resume = stac92xx_pre_resume; |
5673 | codec->patch_ops.check_power_status = | 5661 | codec->patch_ops.check_power_status = |
@@ -5981,8 +5969,6 @@ again: | |||
5981 | } else { | 5969 | } else { |
5982 | codec->patch_ops.set_power_state = | 5970 | codec->patch_ops.set_power_state = |
5983 | stac92xx_set_power_state; | 5971 | stac92xx_set_power_state; |
5984 | codec->patch_ops.post_suspend = | ||
5985 | stac92xx_post_suspend; | ||
5986 | } | 5972 | } |
5987 | codec->patch_ops.pre_resume = stac92xx_pre_resume; | 5973 | codec->patch_ops.pre_resume = stac92xx_pre_resume; |
5988 | codec->patch_ops.check_power_status = | 5974 | codec->patch_ops.check_power_status = |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 431c0d417eeb..b5137629f8e9 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -208,6 +208,7 @@ struct via_spec { | |||
208 | /* work to check hp jack state */ | 208 | /* work to check hp jack state */ |
209 | struct hda_codec *codec; | 209 | struct hda_codec *codec; |
210 | struct delayed_work vt1708_hp_work; | 210 | struct delayed_work vt1708_hp_work; |
211 | int hp_work_active; | ||
211 | int vt1708_jack_detect; | 212 | int vt1708_jack_detect; |
212 | int vt1708_hp_present; | 213 | int vt1708_hp_present; |
213 | 214 | ||
@@ -305,27 +306,35 @@ enum { | |||
305 | static void analog_low_current_mode(struct hda_codec *codec); | 306 | static void analog_low_current_mode(struct hda_codec *codec); |
306 | static bool is_aa_path_mute(struct hda_codec *codec); | 307 | static bool is_aa_path_mute(struct hda_codec *codec); |
307 | 308 | ||
308 | static void vt1708_start_hp_work(struct via_spec *spec) | 309 | #define hp_detect_with_aa(codec) \ |
310 | (snd_hda_get_bool_hint(codec, "analog_loopback_hp_detect") == 1 && \ | ||
311 | !is_aa_path_mute(codec)) | ||
312 | |||
313 | static void vt1708_stop_hp_work(struct via_spec *spec) | ||
309 | { | 314 | { |
310 | if (spec->codec_type != VT1708 || spec->autocfg.hp_pins[0] == 0) | 315 | if (spec->codec_type != VT1708 || spec->autocfg.hp_pins[0] == 0) |
311 | return; | 316 | return; |
312 | snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, | 317 | if (spec->hp_work_active) { |
313 | !spec->vt1708_jack_detect); | 318 | snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, 1); |
314 | if (!delayed_work_pending(&spec->vt1708_hp_work)) | 319 | cancel_delayed_work_sync(&spec->vt1708_hp_work); |
315 | schedule_delayed_work(&spec->vt1708_hp_work, | 320 | spec->hp_work_active = 0; |
316 | msecs_to_jiffies(100)); | 321 | } |
317 | } | 322 | } |
318 | 323 | ||
319 | static void vt1708_stop_hp_work(struct via_spec *spec) | 324 | static void vt1708_update_hp_work(struct via_spec *spec) |
320 | { | 325 | { |
321 | if (spec->codec_type != VT1708 || spec->autocfg.hp_pins[0] == 0) | 326 | if (spec->codec_type != VT1708 || spec->autocfg.hp_pins[0] == 0) |
322 | return; | 327 | return; |
323 | if (snd_hda_get_bool_hint(spec->codec, "analog_loopback_hp_detect") == 1 | 328 | if (spec->vt1708_jack_detect && |
324 | && !is_aa_path_mute(spec->codec)) | 329 | (spec->active_streams || hp_detect_with_aa(spec->codec))) { |
325 | return; | 330 | if (!spec->hp_work_active) { |
326 | snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, | 331 | snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, 0); |
327 | !spec->vt1708_jack_detect); | 332 | schedule_delayed_work(&spec->vt1708_hp_work, |
328 | cancel_delayed_work_sync(&spec->vt1708_hp_work); | 333 | msecs_to_jiffies(100)); |
334 | spec->hp_work_active = 1; | ||
335 | } | ||
336 | } else if (!hp_detect_with_aa(spec->codec)) | ||
337 | vt1708_stop_hp_work(spec); | ||
329 | } | 338 | } |
330 | 339 | ||
331 | static void set_widgets_power_state(struct hda_codec *codec) | 340 | static void set_widgets_power_state(struct hda_codec *codec) |
@@ -343,12 +352,7 @@ static int analog_input_switch_put(struct snd_kcontrol *kcontrol, | |||
343 | 352 | ||
344 | set_widgets_power_state(codec); | 353 | set_widgets_power_state(codec); |
345 | analog_low_current_mode(snd_kcontrol_chip(kcontrol)); | 354 | analog_low_current_mode(snd_kcontrol_chip(kcontrol)); |
346 | if (snd_hda_get_bool_hint(codec, "analog_loopback_hp_detect") == 1) { | 355 | vt1708_update_hp_work(codec->spec); |
347 | if (is_aa_path_mute(codec)) | ||
348 | vt1708_start_hp_work(codec->spec); | ||
349 | else | ||
350 | vt1708_stop_hp_work(codec->spec); | ||
351 | } | ||
352 | return change; | 356 | return change; |
353 | } | 357 | } |
354 | 358 | ||
@@ -1154,7 +1158,7 @@ static int via_playback_multi_pcm_prepare(struct hda_pcm_stream *hinfo, | |||
1154 | spec->cur_dac_stream_tag = stream_tag; | 1158 | spec->cur_dac_stream_tag = stream_tag; |
1155 | spec->cur_dac_format = format; | 1159 | spec->cur_dac_format = format; |
1156 | mutex_unlock(&spec->config_mutex); | 1160 | mutex_unlock(&spec->config_mutex); |
1157 | vt1708_start_hp_work(spec); | 1161 | vt1708_update_hp_work(spec); |
1158 | return 0; | 1162 | return 0; |
1159 | } | 1163 | } |
1160 | 1164 | ||
@@ -1174,7 +1178,7 @@ static int via_playback_hp_pcm_prepare(struct hda_pcm_stream *hinfo, | |||
1174 | spec->cur_hp_stream_tag = stream_tag; | 1178 | spec->cur_hp_stream_tag = stream_tag; |
1175 | spec->cur_hp_format = format; | 1179 | spec->cur_hp_format = format; |
1176 | mutex_unlock(&spec->config_mutex); | 1180 | mutex_unlock(&spec->config_mutex); |
1177 | vt1708_start_hp_work(spec); | 1181 | vt1708_update_hp_work(spec); |
1178 | return 0; | 1182 | return 0; |
1179 | } | 1183 | } |
1180 | 1184 | ||
@@ -1188,7 +1192,7 @@ static int via_playback_multi_pcm_cleanup(struct hda_pcm_stream *hinfo, | |||
1188 | snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); | 1192 | snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); |
1189 | spec->active_streams &= ~STREAM_MULTI_OUT; | 1193 | spec->active_streams &= ~STREAM_MULTI_OUT; |
1190 | mutex_unlock(&spec->config_mutex); | 1194 | mutex_unlock(&spec->config_mutex); |
1191 | vt1708_stop_hp_work(spec); | 1195 | vt1708_update_hp_work(spec); |
1192 | return 0; | 1196 | return 0; |
1193 | } | 1197 | } |
1194 | 1198 | ||
@@ -1203,7 +1207,7 @@ static int via_playback_hp_pcm_cleanup(struct hda_pcm_stream *hinfo, | |||
1203 | snd_hda_codec_setup_stream(codec, spec->hp_dac_nid, 0, 0, 0); | 1207 | snd_hda_codec_setup_stream(codec, spec->hp_dac_nid, 0, 0, 0); |
1204 | spec->active_streams &= ~STREAM_INDEP_HP; | 1208 | spec->active_streams &= ~STREAM_INDEP_HP; |
1205 | mutex_unlock(&spec->config_mutex); | 1209 | mutex_unlock(&spec->config_mutex); |
1206 | vt1708_stop_hp_work(spec); | 1210 | vt1708_update_hp_work(spec); |
1207 | return 0; | 1211 | return 0; |
1208 | } | 1212 | } |
1209 | 1213 | ||
@@ -1645,7 +1649,8 @@ static void via_hp_automute(struct hda_codec *codec) | |||
1645 | int nums; | 1649 | int nums; |
1646 | struct via_spec *spec = codec->spec; | 1650 | struct via_spec *spec = codec->spec; |
1647 | 1651 | ||
1648 | if (!spec->hp_independent_mode && spec->autocfg.hp_pins[0]) | 1652 | if (!spec->hp_independent_mode && spec->autocfg.hp_pins[0] && |
1653 | (spec->codec_type != VT1708 || spec->vt1708_jack_detect)) | ||
1649 | present = snd_hda_jack_detect(codec, spec->autocfg.hp_pins[0]); | 1654 | present = snd_hda_jack_detect(codec, spec->autocfg.hp_pins[0]); |
1650 | 1655 | ||
1651 | if (spec->smart51_enabled) | 1656 | if (spec->smart51_enabled) |
@@ -2612,8 +2617,6 @@ static int vt1708_jack_detect_get(struct snd_kcontrol *kcontrol, | |||
2612 | 2617 | ||
2613 | if (spec->codec_type != VT1708) | 2618 | if (spec->codec_type != VT1708) |
2614 | return 0; | 2619 | return 0; |
2615 | spec->vt1708_jack_detect = | ||
2616 | !((snd_hda_codec_read(codec, 0x1, 0, 0xf84, 0) >> 8) & 0x1); | ||
2617 | ucontrol->value.integer.value[0] = spec->vt1708_jack_detect; | 2620 | ucontrol->value.integer.value[0] = spec->vt1708_jack_detect; |
2618 | return 0; | 2621 | return 0; |
2619 | } | 2622 | } |
@@ -2623,18 +2626,22 @@ static int vt1708_jack_detect_put(struct snd_kcontrol *kcontrol, | |||
2623 | { | 2626 | { |
2624 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 2627 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
2625 | struct via_spec *spec = codec->spec; | 2628 | struct via_spec *spec = codec->spec; |
2626 | int change; | 2629 | int val; |
2627 | 2630 | ||
2628 | if (spec->codec_type != VT1708) | 2631 | if (spec->codec_type != VT1708) |
2629 | return 0; | 2632 | return 0; |
2630 | spec->vt1708_jack_detect = ucontrol->value.integer.value[0]; | 2633 | val = !!ucontrol->value.integer.value[0]; |
2631 | change = (0x1 & (snd_hda_codec_read(codec, 0x1, 0, 0xf84, 0) >> 8)) | 2634 | if (spec->vt1708_jack_detect == val) |
2632 | == !spec->vt1708_jack_detect; | 2635 | return 0; |
2633 | if (spec->vt1708_jack_detect) { | 2636 | spec->vt1708_jack_detect = val; |
2637 | if (spec->vt1708_jack_detect && | ||
2638 | snd_hda_get_bool_hint(codec, "analog_loopback_hp_detect") != 1) { | ||
2634 | mute_aa_path(codec, 1); | 2639 | mute_aa_path(codec, 1); |
2635 | notify_aa_path_ctls(codec); | 2640 | notify_aa_path_ctls(codec); |
2636 | } | 2641 | } |
2637 | return change; | 2642 | via_hp_automute(codec); |
2643 | vt1708_update_hp_work(spec); | ||
2644 | return 1; | ||
2638 | } | 2645 | } |
2639 | 2646 | ||
2640 | static const struct snd_kcontrol_new vt1708_jack_detect_ctl = { | 2647 | static const struct snd_kcontrol_new vt1708_jack_detect_ctl = { |
@@ -2771,6 +2778,7 @@ static int via_init(struct hda_codec *codec) | |||
2771 | via_auto_init_unsol_event(codec); | 2778 | via_auto_init_unsol_event(codec); |
2772 | 2779 | ||
2773 | via_hp_automute(codec); | 2780 | via_hp_automute(codec); |
2781 | vt1708_update_hp_work(spec); | ||
2774 | 2782 | ||
2775 | return 0; | 2783 | return 0; |
2776 | } | 2784 | } |
@@ -2787,7 +2795,9 @@ static void vt1708_update_hp_jack_state(struct work_struct *work) | |||
2787 | spec->vt1708_hp_present ^= 1; | 2795 | spec->vt1708_hp_present ^= 1; |
2788 | via_hp_automute(spec->codec); | 2796 | via_hp_automute(spec->codec); |
2789 | } | 2797 | } |
2790 | vt1708_start_hp_work(spec); | 2798 | if (spec->vt1708_jack_detect) |
2799 | schedule_delayed_work(&spec->vt1708_hp_work, | ||
2800 | msecs_to_jiffies(100)); | ||
2791 | } | 2801 | } |
2792 | 2802 | ||
2793 | static int get_mux_nids(struct hda_codec *codec) | 2803 | static int get_mux_nids(struct hda_codec *codec) |
diff --git a/sound/pci/ice1712/amp.c b/sound/pci/ice1712/amp.c index e328cfb7620c..e525da2673be 100644 --- a/sound/pci/ice1712/amp.c +++ b/sound/pci/ice1712/amp.c | |||
@@ -68,8 +68,11 @@ static int __devinit snd_vt1724_amp_init(struct snd_ice1712 *ice) | |||
68 | 68 | ||
69 | static int __devinit snd_vt1724_amp_add_controls(struct snd_ice1712 *ice) | 69 | static int __devinit snd_vt1724_amp_add_controls(struct snd_ice1712 *ice) |
70 | { | 70 | { |
71 | /* we use pins 39 and 41 of the VT1616 for left and right read outputs */ | 71 | if (ice->ac97) |
72 | snd_ac97_write_cache(ice->ac97, 0x5a, snd_ac97_read(ice->ac97, 0x5a) & ~0x8000); | 72 | /* we use pins 39 and 41 of the VT1616 for left and right |
73 | read outputs */ | ||
74 | snd_ac97_write_cache(ice->ac97, 0x5a, | ||
75 | snd_ac97_read(ice->ac97, 0x5a) & ~0x8000); | ||
73 | return 0; | 76 | return 0; |
74 | } | 77 | } |
75 | 78 | ||
diff --git a/sound/pci/ice1712/envy24ht.h b/sound/pci/ice1712/envy24ht.h index a0c5e009bb4a..4ca33a800bc8 100644 --- a/sound/pci/ice1712/envy24ht.h +++ b/sound/pci/ice1712/envy24ht.h | |||
@@ -66,6 +66,7 @@ enum { | |||
66 | #define VT1724_CFG_CLOCK384 0x40 /* 16.9344Mhz, 44.1kHz*384 */ | 66 | #define VT1724_CFG_CLOCK384 0x40 /* 16.9344Mhz, 44.1kHz*384 */ |
67 | #define VT1724_CFG_MPU401 0x20 /* MPU401 UARTs */ | 67 | #define VT1724_CFG_MPU401 0x20 /* MPU401 UARTs */ |
68 | #define VT1724_CFG_ADC_MASK 0x0c /* one, two or one and S/PDIF, stereo ADCs */ | 68 | #define VT1724_CFG_ADC_MASK 0x0c /* one, two or one and S/PDIF, stereo ADCs */ |
69 | #define VT1724_CFG_ADC_NONE 0x0c /* no ADCs */ | ||
69 | #define VT1724_CFG_DAC_MASK 0x03 /* one, two, three, four stereo DACs */ | 70 | #define VT1724_CFG_DAC_MASK 0x03 /* one, two, three, four stereo DACs */ |
70 | 71 | ||
71 | #define VT1724_REG_AC97_CFG 0x05 /* byte */ | 72 | #define VT1724_REG_AC97_CFG 0x05 /* byte */ |
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 44446f2222d9..132a86e09d07 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c | |||
@@ -84,9 +84,9 @@ MODULE_SUPPORTED_DEVICE("{" | |||
84 | 84 | ||
85 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 85 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
86 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 86 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
87 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */ | 87 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */ |
88 | static char *model[SNDRV_CARDS]; | 88 | static char *model[SNDRV_CARDS]; |
89 | static int omni[SNDRV_CARDS]; /* Delta44 & 66 Omni I/O support */ | 89 | static bool omni[SNDRV_CARDS]; /* Delta44 & 66 Omni I/O support */ |
90 | static int cs8427_timeout[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 500}; /* CS8427 S/PDIF transceiver reset timeout value in msec */ | 90 | static int cs8427_timeout[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 500}; /* CS8427 S/PDIF transceiver reset timeout value in msec */ |
91 | static int dxr_enable[SNDRV_CARDS]; /* DXR enable for DMX6FIRE */ | 91 | static int dxr_enable[SNDRV_CARDS]; /* DXR enable for DMX6FIRE */ |
92 | 92 | ||
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 4353e76bf0a6..92362973764d 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c | |||
@@ -80,7 +80,7 @@ MODULE_SUPPORTED_DEVICE("{" | |||
80 | 80 | ||
81 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 81 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
82 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 82 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
83 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 83 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
84 | static char *model[SNDRV_CARDS]; | 84 | static char *model[SNDRV_CARDS]; |
85 | 85 | ||
86 | module_param_array(index, int, NULL, 0444); | 86 | module_param_array(index, int, NULL, 0444); |
@@ -1117,14 +1117,21 @@ static struct snd_pcm_ops snd_vt1724_capture_pro_ops = { | |||
1117 | static int __devinit snd_vt1724_pcm_profi(struct snd_ice1712 *ice, int device) | 1117 | static int __devinit snd_vt1724_pcm_profi(struct snd_ice1712 *ice, int device) |
1118 | { | 1118 | { |
1119 | struct snd_pcm *pcm; | 1119 | struct snd_pcm *pcm; |
1120 | int err; | 1120 | int capt, err; |
1121 | 1121 | ||
1122 | err = snd_pcm_new(ice->card, "ICE1724", device, 1, 1, &pcm); | 1122 | if ((ice->eeprom.data[ICE_EEP2_SYSCONF] & VT1724_CFG_ADC_MASK) == |
1123 | VT1724_CFG_ADC_NONE) | ||
1124 | capt = 0; | ||
1125 | else | ||
1126 | capt = 1; | ||
1127 | err = snd_pcm_new(ice->card, "ICE1724", device, 1, capt, &pcm); | ||
1123 | if (err < 0) | 1128 | if (err < 0) |
1124 | return err; | 1129 | return err; |
1125 | 1130 | ||
1126 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_vt1724_playback_pro_ops); | 1131 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_vt1724_playback_pro_ops); |
1127 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_vt1724_capture_pro_ops); | 1132 | if (capt) |
1133 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, | ||
1134 | &snd_vt1724_capture_pro_ops); | ||
1128 | 1135 | ||
1129 | pcm->private_data = ice; | 1136 | pcm->private_data = ice; |
1130 | pcm->info_flags = 0; | 1137 | pcm->info_flags = 0; |
@@ -1825,7 +1832,12 @@ static int snd_vt1724_pro_internal_clock_info(struct snd_kcontrol *kcontrol, | |||
1825 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1832 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
1826 | uinfo->count = 1; | 1833 | uinfo->count = 1; |
1827 | 1834 | ||
1828 | uinfo->value.enumerated.items = hw_rates_count + ice->ext_clock_count; | 1835 | /* internal clocks */ |
1836 | uinfo->value.enumerated.items = hw_rates_count; | ||
1837 | /* external clocks */ | ||
1838 | if (ice->force_rdma1 || | ||
1839 | (ice->eeprom.data[ICE_EEP2_SPDIF] & VT1724_CFG_SPDIF_IN)) | ||
1840 | uinfo->value.enumerated.items += ice->ext_clock_count; | ||
1829 | /* upper limit - keep at top */ | 1841 | /* upper limit - keep at top */ |
1830 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) | 1842 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) |
1831 | uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; | 1843 | uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; |
@@ -2173,6 +2185,40 @@ static struct snd_kcontrol_new snd_vt1724_mixer_pro_peak __devinitdata = { | |||
2173 | 2185 | ||
2174 | static struct snd_ice1712_card_info no_matched __devinitdata; | 2186 | static struct snd_ice1712_card_info no_matched __devinitdata; |
2175 | 2187 | ||
2188 | |||
2189 | /* | ||
2190 | ooAoo cards with no controls | ||
2191 | */ | ||
2192 | static unsigned char ooaoo_sq210_eeprom[] __devinitdata = { | ||
2193 | [ICE_EEP2_SYSCONF] = 0x4c, /* 49MHz crystal, no mpu401, no ADC, | ||
2194 | 1xDACs */ | ||
2195 | [ICE_EEP2_ACLINK] = 0x80, /* I2S */ | ||
2196 | [ICE_EEP2_I2S] = 0x78, /* no volume, 96k, 24bit, 192k */ | ||
2197 | [ICE_EEP2_SPDIF] = 0xc1, /* out-en, out-int, out-ext */ | ||
2198 | [ICE_EEP2_GPIO_DIR] = 0x00, /* no GPIOs are used */ | ||
2199 | [ICE_EEP2_GPIO_DIR1] = 0x00, | ||
2200 | [ICE_EEP2_GPIO_DIR2] = 0x00, | ||
2201 | [ICE_EEP2_GPIO_MASK] = 0xff, | ||
2202 | [ICE_EEP2_GPIO_MASK1] = 0xff, | ||
2203 | [ICE_EEP2_GPIO_MASK2] = 0xff, | ||
2204 | |||
2205 | [ICE_EEP2_GPIO_STATE] = 0x00, /* inputs */ | ||
2206 | [ICE_EEP2_GPIO_STATE1] = 0x00, /* all 1, but GPIO_CPLD_RW | ||
2207 | and GPIO15 always zero */ | ||
2208 | [ICE_EEP2_GPIO_STATE2] = 0x00, /* inputs */ | ||
2209 | }; | ||
2210 | |||
2211 | |||
2212 | struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] __devinitdata = { | ||
2213 | { | ||
2214 | .name = "ooAoo SQ210a", | ||
2215 | .model = "sq210a", | ||
2216 | .eeprom_size = sizeof(ooaoo_sq210_eeprom), | ||
2217 | .eeprom_data = ooaoo_sq210_eeprom, | ||
2218 | }, | ||
2219 | { } /* terminator */ | ||
2220 | }; | ||
2221 | |||
2176 | static struct snd_ice1712_card_info *card_tables[] __devinitdata = { | 2222 | static struct snd_ice1712_card_info *card_tables[] __devinitdata = { |
2177 | snd_vt1724_revo_cards, | 2223 | snd_vt1724_revo_cards, |
2178 | snd_vt1724_amp_cards, | 2224 | snd_vt1724_amp_cards, |
@@ -2187,6 +2233,7 @@ static struct snd_ice1712_card_info *card_tables[] __devinitdata = { | |||
2187 | snd_vt1724_wtm_cards, | 2233 | snd_vt1724_wtm_cards, |
2188 | snd_vt1724_se_cards, | 2234 | snd_vt1724_se_cards, |
2189 | snd_vt1724_qtet_cards, | 2235 | snd_vt1724_qtet_cards, |
2236 | snd_vt1724_ooaoo_cards, | ||
2190 | NULL, | 2237 | NULL, |
2191 | }; | 2238 | }; |
2192 | 2239 | ||
@@ -2270,7 +2317,7 @@ static int __devinit snd_vt1724_read_eeprom(struct snd_ice1712 *ice, | |||
2270 | } | 2317 | } |
2271 | } | 2318 | } |
2272 | for (tbl = card_tables; *tbl; tbl++) { | 2319 | for (tbl = card_tables; *tbl; tbl++) { |
2273 | for (c = *tbl; c->subvendor; c++) { | 2320 | for (c = *tbl; c->name; c++) { |
2274 | if (modelname && c->model && | 2321 | if (modelname && c->model && |
2275 | !strcmp(modelname, c->model)) { | 2322 | !strcmp(modelname, c->model)) { |
2276 | printk(KERN_INFO "ice1724: Using board model %s\n", | 2323 | printk(KERN_INFO "ice1724: Using board model %s\n", |
@@ -2579,8 +2626,10 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci, | |||
2579 | ice->ext_clock_count = 0; | 2626 | ice->ext_clock_count = 0; |
2580 | 2627 | ||
2581 | for (tbl = card_tables; *tbl; tbl++) { | 2628 | for (tbl = card_tables; *tbl; tbl++) { |
2582 | for (c = *tbl; c->subvendor; c++) { | 2629 | for (c = *tbl; c->name; c++) { |
2583 | if (c->subvendor == ice->eeprom.subvendor) { | 2630 | if ((model[dev] && c->model && |
2631 | !strcmp(model[dev], c->model)) || | ||
2632 | (c->subvendor == ice->eeprom.subvendor)) { | ||
2584 | strcpy(card->shortname, c->name); | 2633 | strcpy(card->shortname, c->name); |
2585 | if (c->driver) /* specific driver? */ | 2634 | if (c->driver) /* specific driver? */ |
2586 | strcpy(card->driver, c->driver); | 2635 | strcpy(card->driver, c->driver); |
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 11718b49b2e2..40b181bab930 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
@@ -79,9 +79,9 @@ static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ | |||
79 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ | 79 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
80 | static int ac97_clock; | 80 | static int ac97_clock; |
81 | static char *ac97_quirk; | 81 | static char *ac97_quirk; |
82 | static int buggy_semaphore; | 82 | static bool buggy_semaphore; |
83 | static int buggy_irq = -1; /* auto-check */ | 83 | static int buggy_irq = -1; /* auto-check */ |
84 | static int xbox; | 84 | static bool xbox; |
85 | static int spdif_aclink = -1; | 85 | static int spdif_aclink = -1; |
86 | static int inside_vm = -1; | 86 | static int inside_vm = -1; |
87 | 87 | ||
@@ -105,7 +105,7 @@ module_param(inside_vm, bool, 0444); | |||
105 | MODULE_PARM_DESC(inside_vm, "KVM/Parallels optimization."); | 105 | MODULE_PARM_DESC(inside_vm, "KVM/Parallels optimization."); |
106 | 106 | ||
107 | /* just for backward compatibility */ | 107 | /* just for backward compatibility */ |
108 | static int enable; | 108 | static bool enable; |
109 | module_param(enable, bool, 0444); | 109 | module_param(enable, bool, 0444); |
110 | static int joystick; | 110 | static int joystick; |
111 | module_param(joystick, int, 0444); | 111 | module_param(joystick, int, 0444); |
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index 0f7041ec7ddc..d689913a61be 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c | |||
@@ -68,7 +68,7 @@ module_param(ac97_clock, int, 0444); | |||
68 | MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect)."); | 68 | MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect)."); |
69 | 69 | ||
70 | /* just for backward compatibility */ | 70 | /* just for backward compatibility */ |
71 | static int enable; | 71 | static bool enable; |
72 | module_param(enable, bool, 0444); | 72 | module_param(enable, bool, 0444); |
73 | 73 | ||
74 | /* | 74 | /* |
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index 841864b6b371..8fea45ab5882 100644 --- a/sound/pci/korg1212/korg1212.c +++ b/sound/pci/korg1212/korg1212.c | |||
@@ -408,7 +408,7 @@ MODULE_FIRMWARE("korg/k1212.dsp"); | |||
408 | 408 | ||
409 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 409 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
410 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 410 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
411 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 411 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
412 | 412 | ||
413 | module_param_array(index, int, NULL, 0444); | 413 | module_param_array(index, int, NULL, 0444); |
414 | MODULE_PARM_DESC(index, "Index value for Korg 1212 soundcard."); | 414 | MODULE_PARM_DESC(index, "Index value for Korg 1212 soundcard."); |
diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c index 924168ef1ed6..375982736858 100644 --- a/sound/pci/lola/lola.c +++ b/sound/pci/lola/lola.c | |||
@@ -35,7 +35,7 @@ | |||
35 | /* Standard options */ | 35 | /* Standard options */ |
36 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 36 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
37 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 37 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
38 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 38 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
39 | 39 | ||
40 | module_param_array(index, int, NULL, 0444); | 40 | module_param_array(index, int, NULL, 0444); |
41 | MODULE_PARM_DESC(index, "Index value for Digigram Lola driver."); | 41 | MODULE_PARM_DESC(index, "Index value for Digigram Lola driver."); |
diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c index 04ae84b2a107..d94c0c292bd0 100644 --- a/sound/pci/lx6464es/lx6464es.c +++ b/sound/pci/lx6464es/lx6464es.c | |||
@@ -42,7 +42,7 @@ MODULE_SUPPORTED_DEVICE("{digigram lx6464es{}}"); | |||
42 | 42 | ||
43 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 43 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
44 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 44 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
45 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 45 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
46 | 46 | ||
47 | module_param_array(index, int, NULL, 0444); | 47 | module_param_array(index, int, NULL, 0444); |
48 | MODULE_PARM_DESC(index, "Index value for Digigram LX6464ES interface."); | 48 | MODULE_PARM_DESC(index, "Index value for Digigram LX6464ES interface."); |
diff --git a/sound/pci/lx6464es/lx_core.c b/sound/pci/lx6464es/lx_core.c index 5c8717e29eeb..8c3e7fcefd99 100644 --- a/sound/pci/lx6464es/lx_core.c +++ b/sound/pci/lx6464es/lx_core.c | |||
@@ -78,10 +78,15 @@ unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port) | |||
78 | return ioread32(address); | 78 | return ioread32(address); |
79 | } | 79 | } |
80 | 80 | ||
81 | void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, u32 len) | 81 | static void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, |
82 | u32 len) | ||
82 | { | 83 | { |
83 | void __iomem *address = lx_dsp_register(chip, port); | 84 | u32 __iomem *address = lx_dsp_register(chip, port); |
84 | memcpy_fromio(data, address, len*sizeof(u32)); | 85 | int i; |
86 | |||
87 | /* we cannot use memcpy_fromio */ | ||
88 | for (i = 0; i != len; ++i) | ||
89 | data[i] = ioread32(address + i); | ||
85 | } | 90 | } |
86 | 91 | ||
87 | 92 | ||
@@ -91,11 +96,15 @@ void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data) | |||
91 | iowrite32(data, address); | 96 | iowrite32(data, address); |
92 | } | 97 | } |
93 | 98 | ||
94 | void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, const u32 *data, | 99 | static void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, |
95 | u32 len) | 100 | const u32 *data, u32 len) |
96 | { | 101 | { |
97 | void __iomem *address = lx_dsp_register(chip, port); | 102 | u32 __iomem *address = lx_dsp_register(chip, port); |
98 | memcpy_toio(address, data, len*sizeof(u32)); | 103 | int i; |
104 | |||
105 | /* we cannot use memcpy_to */ | ||
106 | for (i = 0; i != len; ++i) | ||
107 | iowrite32(data[i], address + i); | ||
99 | } | 108 | } |
100 | 109 | ||
101 | 110 | ||
diff --git a/sound/pci/lx6464es/lx_core.h b/sound/pci/lx6464es/lx_core.h index 1dd562980b6c..4d7ff797a646 100644 --- a/sound/pci/lx6464es/lx_core.h +++ b/sound/pci/lx6464es/lx_core.h | |||
@@ -72,10 +72,7 @@ enum { | |||
72 | }; | 72 | }; |
73 | 73 | ||
74 | unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port); | 74 | unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port); |
75 | void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, u32 len); | ||
76 | void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data); | 75 | void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data); |
77 | void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, const u32 *data, | ||
78 | u32 len); | ||
79 | 76 | ||
80 | /* plx register access */ | 77 | /* plx register access */ |
81 | enum { | 78 | enum { |
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index 863c8bdaecd6..78229b0dad2b 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c | |||
@@ -64,8 +64,8 @@ MODULE_FIRMWARE("ess/maestro3_assp_minisrc.fw"); | |||
64 | 64 | ||
65 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 65 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
66 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 66 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
67 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* all enabled */ | 67 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* all enabled */ |
68 | static int external_amp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 68 | static bool external_amp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
69 | static int amp_gpio[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; | 69 | static int amp_gpio[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; |
70 | 70 | ||
71 | module_param_array(index, int, NULL, 0444); | 71 | module_param_array(index, int, NULL, 0444); |
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index a0bd1d99793f..487837c01c9f 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c | |||
@@ -49,7 +49,7 @@ MODULE_SUPPORTED_DEVICE("{{Digigram," CARD_NAME "}}"); | |||
49 | 49 | ||
50 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 50 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
51 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 51 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
52 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 52 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
53 | 53 | ||
54 | module_param_array(index, int, NULL, 0444); | 54 | module_param_array(index, int, NULL, 0444); |
55 | MODULE_PARM_DESC(index, "Index value for Digigram " CARD_NAME " soundcard."); | 55 | MODULE_PARM_DESC(index, "Index value for Digigram " CARD_NAME " soundcard."); |
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index c6c45d979f7a..ade2c64bd606 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c | |||
@@ -57,12 +57,12 @@ static int index = SNDRV_DEFAULT_IDX1; /* Index */ | |||
57 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ | 57 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
58 | static int playback_bufsize = 16; | 58 | static int playback_bufsize = 16; |
59 | static int capture_bufsize = 16; | 59 | static int capture_bufsize = 16; |
60 | static int force_ac97; /* disabled as default */ | 60 | static bool force_ac97; /* disabled as default */ |
61 | static int buffer_top; /* not specified */ | 61 | static int buffer_top; /* not specified */ |
62 | static int use_cache; /* disabled */ | 62 | static bool use_cache; /* disabled */ |
63 | static int vaio_hack; /* disabled */ | 63 | static bool vaio_hack; /* disabled */ |
64 | static int reset_workaround; | 64 | static bool reset_workaround; |
65 | static int reset_workaround_2; | 65 | static bool reset_workaround_2; |
66 | 66 | ||
67 | module_param(index, int, 0444); | 67 | module_param(index, int, 0444); |
68 | MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); | 68 | MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); |
@@ -86,7 +86,7 @@ module_param(reset_workaround_2, bool, 0444); | |||
86 | MODULE_PARM_DESC(reset_workaround_2, "Enable extended AC97 RESET workaround for some other laptops."); | 86 | MODULE_PARM_DESC(reset_workaround_2, "Enable extended AC97 RESET workaround for some other laptops."); |
87 | 87 | ||
88 | /* just for backward compatibility */ | 88 | /* just for backward compatibility */ |
89 | static int enable; | 89 | static bool enable; |
90 | module_param(enable, bool, 0444); | 90 | module_param(enable, bool, 0444); |
91 | 91 | ||
92 | 92 | ||
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c index 5f3a13d4369d..eab663eef117 100644 --- a/sound/pci/oxygen/oxygen.c +++ b/sound/pci/oxygen/oxygen.c | |||
@@ -74,7 +74,7 @@ MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8786}" | |||
74 | 74 | ||
75 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 75 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
76 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 76 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
77 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 77 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
78 | 78 | ||
79 | module_param_array(index, int, NULL, 0444); | 79 | module_param_array(index, int, NULL, 0444); |
80 | MODULE_PARM_DESC(index, "card index"); | 80 | MODULE_PARM_DESC(index, "card index"); |
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c index 4149a0cb8b73..3fdee4950174 100644 --- a/sound/pci/oxygen/virtuoso.c +++ b/sound/pci/oxygen/virtuoso.c | |||
@@ -32,7 +32,7 @@ MODULE_SUPPORTED_DEVICE("{{Asus,AV66},{Asus,AV100},{Asus,AV200}}"); | |||
32 | 32 | ||
33 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 33 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
34 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 34 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
35 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 35 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
36 | 36 | ||
37 | module_param_array(index, int, NULL, 0444); | 37 | module_param_array(index, int, NULL, 0444); |
38 | MODULE_PARM_DESC(index, "card index"); | 38 | MODULE_PARM_DESC(index, "card index"); |
diff --git a/sound/pci/oxygen/xonar_cs43xx.c b/sound/pci/oxygen/xonar_cs43xx.c index 252719101c42..c8febf4b9bd6 100644 --- a/sound/pci/oxygen/xonar_cs43xx.c +++ b/sound/pci/oxygen/xonar_cs43xx.c | |||
@@ -418,6 +418,7 @@ static const struct oxygen_model model_xonar_d1 = { | |||
418 | .device_config = PLAYBACK_0_TO_I2S | | 418 | .device_config = PLAYBACK_0_TO_I2S | |
419 | PLAYBACK_1_TO_SPDIF | | 419 | PLAYBACK_1_TO_SPDIF | |
420 | CAPTURE_0_FROM_I2S_2 | | 420 | CAPTURE_0_FROM_I2S_2 | |
421 | CAPTURE_1_FROM_SPDIF | | ||
421 | AC97_FMIC_SWITCH, | 422 | AC97_FMIC_SWITCH, |
422 | .dac_channels_pcm = 8, | 423 | .dac_channels_pcm = 8, |
423 | .dac_channels_mixer = 8, | 424 | .dac_channels_mixer = 8, |
diff --git a/sound/pci/oxygen/xonar_dg.c b/sound/pci/oxygen/xonar_dg.c index bc6eb58be380..793bdf03d7e0 100644 --- a/sound/pci/oxygen/xonar_dg.c +++ b/sound/pci/oxygen/xonar_dg.c | |||
@@ -597,7 +597,8 @@ struct oxygen_model model_xonar_dg = { | |||
597 | .model_data_size = sizeof(struct dg), | 597 | .model_data_size = sizeof(struct dg), |
598 | .device_config = PLAYBACK_0_TO_I2S | | 598 | .device_config = PLAYBACK_0_TO_I2S | |
599 | PLAYBACK_1_TO_SPDIF | | 599 | PLAYBACK_1_TO_SPDIF | |
600 | CAPTURE_0_FROM_I2S_2, | 600 | CAPTURE_0_FROM_I2S_2 | |
601 | CAPTURE_1_FROM_SPDIF, | ||
601 | .dac_channels_pcm = 6, | 602 | .dac_channels_pcm = 6, |
602 | .dac_channels_mixer = 0, | 603 | .dac_channels_mixer = 0, |
603 | .function_flags = OXYGEN_FUNCTION_SPI, | 604 | .function_flags = OXYGEN_FUNCTION_SPI, |
diff --git a/sound/pci/oxygen/xonar_wm87x6.c b/sound/pci/oxygen/xonar_wm87x6.c index 42d1ab136217..478303e6c2b0 100644 --- a/sound/pci/oxygen/xonar_wm87x6.c +++ b/sound/pci/oxygen/xonar_wm87x6.c | |||
@@ -1274,7 +1274,8 @@ static const struct oxygen_model model_xonar_ds = { | |||
1274 | .model_data_size = sizeof(struct xonar_wm87x6), | 1274 | .model_data_size = sizeof(struct xonar_wm87x6), |
1275 | .device_config = PLAYBACK_0_TO_I2S | | 1275 | .device_config = PLAYBACK_0_TO_I2S | |
1276 | PLAYBACK_1_TO_SPDIF | | 1276 | PLAYBACK_1_TO_SPDIF | |
1277 | CAPTURE_0_FROM_I2S_1, | 1277 | CAPTURE_0_FROM_I2S_1 | |
1278 | CAPTURE_1_FROM_SPDIF, | ||
1278 | .dac_channels_pcm = 8, | 1279 | .dac_channels_pcm = 8, |
1279 | .dac_channels_mixer = 8, | 1280 | .dac_channels_mixer = 8, |
1280 | .dac_volume_min = 255 - 2*60, | 1281 | .dac_volume_min = 255 - 2*60, |
@@ -1306,7 +1307,8 @@ static const struct oxygen_model model_xonar_hdav_slim = { | |||
1306 | .model_data_size = sizeof(struct xonar_wm87x6), | 1307 | .model_data_size = sizeof(struct xonar_wm87x6), |
1307 | .device_config = PLAYBACK_0_TO_I2S | | 1308 | .device_config = PLAYBACK_0_TO_I2S | |
1308 | PLAYBACK_1_TO_SPDIF | | 1309 | PLAYBACK_1_TO_SPDIF | |
1309 | CAPTURE_0_FROM_I2S_1, | 1310 | CAPTURE_0_FROM_I2S_1 | |
1311 | CAPTURE_1_FROM_SPDIF, | ||
1310 | .dac_channels_pcm = 8, | 1312 | .dac_channels_pcm = 8, |
1311 | .dac_channels_mixer = 2, | 1313 | .dac_channels_mixer = 2, |
1312 | .dac_volume_min = 255 - 2*60, | 1314 | .dac_volume_min = 255 - 2*60, |
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index 56a52659742d..fd1809ab73b4 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c | |||
@@ -52,8 +52,8 @@ MODULE_SUPPORTED_DEVICE("{{Digigram," DRIVER_NAME "}}"); | |||
52 | 52 | ||
53 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 53 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
54 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 54 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
55 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */ | 55 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */ |
56 | static int mono[SNDRV_CARDS]; /* capture mono only */ | 56 | static bool mono[SNDRV_CARDS]; /* capture mono only */ |
57 | 57 | ||
58 | module_param_array(index, int, NULL, 0444); | 58 | module_param_array(index, int, NULL, 0444); |
59 | MODULE_PARM_DESC(index, "Index value for Digigram " DRIVER_NAME " soundcard"); | 59 | MODULE_PARM_DESC(index, "Index value for Digigram " DRIVER_NAME " soundcard"); |
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index dcbedd33a629..0481d94aac9b 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c | |||
@@ -122,7 +122,7 @@ MODULE_FIRMWARE("riptide.hex"); | |||
122 | 122 | ||
123 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 123 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
124 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 124 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
125 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; | 125 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; |
126 | 126 | ||
127 | #ifdef SUPPORT_JOYSTICK | 127 | #ifdef SUPPORT_JOYSTICK |
128 | static int joystick_port[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS - 1)] = 0x200 }; | 128 | static int joystick_port[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS - 1)] = 0x200 }; |
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c index 21bcb47fab50..b4819d5e41db 100644 --- a/sound/pci/rme32.c +++ b/sound/pci/rme32.c | |||
@@ -89,8 +89,8 @@ | |||
89 | 89 | ||
90 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 90 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
91 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 91 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
92 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 92 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
93 | static int fullduplex[SNDRV_CARDS]; // = {[0 ... (SNDRV_CARDS - 1)] = 1}; | 93 | static bool fullduplex[SNDRV_CARDS]; // = {[0 ... (SNDRV_CARDS - 1)] = 1}; |
94 | 94 | ||
95 | module_param_array(index, int, NULL, 0444); | 95 | module_param_array(index, int, NULL, 0444); |
96 | MODULE_PARM_DESC(index, "Index value for RME Digi32 soundcard."); | 96 | MODULE_PARM_DESC(index, "Index value for RME Digi32 soundcard."); |
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c index 4585c9729fea..ba894158e76c 100644 --- a/sound/pci/rme96.c +++ b/sound/pci/rme96.c | |||
@@ -53,7 +53,7 @@ MODULE_SUPPORTED_DEVICE("{{RME,Digi96}," | |||
53 | 53 | ||
54 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 54 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
55 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 55 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
56 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 56 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
57 | 57 | ||
58 | module_param_array(index, int, NULL, 0444); | 58 | module_param_array(index, int, NULL, 0444); |
59 | MODULE_PARM_DESC(index, "Index value for RME Digi96 soundcard."); | 59 | MODULE_PARM_DESC(index, "Index value for RME Digi96 soundcard."); |
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index f2a3758dac52..b68cdec03b9e 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
@@ -45,7 +45,7 @@ | |||
45 | 45 | ||
46 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 46 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
47 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 47 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
48 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 48 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
49 | 49 | ||
50 | module_param_array(index, int, NULL, 0444); | 50 | module_param_array(index, int, NULL, 0444); |
51 | MODULE_PARM_DESC(index, "Index value for RME Hammerfall DSP interface."); | 51 | MODULE_PARM_DESC(index, "Index value for RME Hammerfall DSP interface."); |
@@ -2640,8 +2640,7 @@ static int snd_hdsp_info_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd | |||
2640 | uinfo->value.enumerated.items = 3; | 2640 | uinfo->value.enumerated.items = 3; |
2641 | break; | 2641 | break; |
2642 | default: | 2642 | default: |
2643 | uinfo->value.enumerated.items = 0; | 2643 | return -EINVAL; |
2644 | break; | ||
2645 | } | 2644 | } |
2646 | 2645 | ||
2647 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) | 2646 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) |
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index e760adad9523..cc9f6c83d661 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
@@ -61,7 +61,7 @@ | |||
61 | 61 | ||
62 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 62 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
63 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 63 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
64 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */ | 64 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */ |
65 | 65 | ||
66 | module_param_array(index, int, NULL, 0444); | 66 | module_param_array(index, int, NULL, 0444); |
67 | MODULE_PARM_DESC(index, "Index value for RME HDSPM interface."); | 67 | MODULE_PARM_DESC(index, "Index value for RME HDSPM interface."); |
@@ -941,6 +941,8 @@ struct hdspm { | |||
941 | 941 | ||
942 | cycles_t last_interrupt; | 942 | cycles_t last_interrupt; |
943 | 943 | ||
944 | unsigned int serial; | ||
945 | |||
944 | struct hdspm_peak_rms peak_rms; | 946 | struct hdspm_peak_rms peak_rms; |
945 | }; | 947 | }; |
946 | 948 | ||
@@ -4694,7 +4696,7 @@ snd_hdspm_proc_read_madi(struct snd_info_entry * entry, | |||
4694 | 4696 | ||
4695 | snd_iprintf(buffer, "HW Serial: 0x%06x%06x\n", | 4697 | snd_iprintf(buffer, "HW Serial: 0x%06x%06x\n", |
4696 | (hdspm_read(hdspm, HDSPM_midiStatusIn1)>>8) & 0xFFFFFF, | 4698 | (hdspm_read(hdspm, HDSPM_midiStatusIn1)>>8) & 0xFFFFFF, |
4697 | (hdspm_read(hdspm, HDSPM_midiStatusIn0)>>8) & 0xFFFFFF); | 4699 | hdspm->serial); |
4698 | 4700 | ||
4699 | snd_iprintf(buffer, "IRQ: %d Registers bus: 0x%lx VM: 0x%lx\n", | 4701 | snd_iprintf(buffer, "IRQ: %d Registers bus: 0x%lx VM: 0x%lx\n", |
4700 | hdspm->irq, hdspm->port, (unsigned long)hdspm->iobase); | 4702 | hdspm->irq, hdspm->port, (unsigned long)hdspm->iobase); |
@@ -6266,8 +6268,7 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, | |||
6266 | hdspm_version.card_type = hdspm->io_type; | 6268 | hdspm_version.card_type = hdspm->io_type; |
6267 | strncpy(hdspm_version.cardname, hdspm->card_name, | 6269 | strncpy(hdspm_version.cardname, hdspm->card_name, |
6268 | sizeof(hdspm_version.cardname)); | 6270 | sizeof(hdspm_version.cardname)); |
6269 | hdspm_version.serial = (hdspm_read(hdspm, | 6271 | hdspm_version.serial = hdspm->serial; |
6270 | HDSPM_midiStatusIn0)>>8) & 0xFFFFFF; | ||
6271 | hdspm_version.firmware_rev = hdspm->firmware_rev; | 6272 | hdspm_version.firmware_rev = hdspm->firmware_rev; |
6272 | hdspm_version.addons = 0; | 6273 | hdspm_version.addons = 0; |
6273 | if (hdspm->tco) | 6274 | if (hdspm->tco) |
@@ -6518,7 +6519,7 @@ static int __devinit snd_hdspm_create(struct snd_card *card, | |||
6518 | hdspm->io_type = AES32; | 6519 | hdspm->io_type = AES32; |
6519 | hdspm->card_name = "RME AES32"; | 6520 | hdspm->card_name = "RME AES32"; |
6520 | hdspm->midiPorts = 2; | 6521 | hdspm->midiPorts = 2; |
6521 | } else if ((hdspm->firmware_rev == 0xd5) || | 6522 | } else if ((hdspm->firmware_rev == 0xd2) || |
6522 | ((hdspm->firmware_rev >= 0xc8) && | 6523 | ((hdspm->firmware_rev >= 0xc8) && |
6523 | (hdspm->firmware_rev <= 0xcf))) { | 6524 | (hdspm->firmware_rev <= 0xcf))) { |
6524 | hdspm->io_type = MADI; | 6525 | hdspm->io_type = MADI; |
@@ -6782,6 +6783,25 @@ static int __devinit snd_hdspm_create(struct snd_card *card, | |||
6782 | tasklet_init(&hdspm->midi_tasklet, | 6783 | tasklet_init(&hdspm->midi_tasklet, |
6783 | hdspm_midi_tasklet, (unsigned long) hdspm); | 6784 | hdspm_midi_tasklet, (unsigned long) hdspm); |
6784 | 6785 | ||
6786 | |||
6787 | if (hdspm->io_type != MADIface) { | ||
6788 | hdspm->serial = (hdspm_read(hdspm, | ||
6789 | HDSPM_midiStatusIn0)>>8) & 0xFFFFFF; | ||
6790 | /* id contains either a user-provided value or the default | ||
6791 | * NULL. If it's the default, we're safe to | ||
6792 | * fill card->id with the serial number. | ||
6793 | * | ||
6794 | * If the serial number is 0xFFFFFF, then we're dealing with | ||
6795 | * an old PCI revision that comes without a sane number. In | ||
6796 | * this case, we don't set card->id to avoid collisions | ||
6797 | * when running with multiple cards. | ||
6798 | */ | ||
6799 | if (NULL == id[hdspm->dev] && hdspm->serial != 0xFFFFFF) { | ||
6800 | sprintf(card->id, "HDSPMx%06x", hdspm->serial); | ||
6801 | snd_card_set_id(card, card->id); | ||
6802 | } | ||
6803 | } | ||
6804 | |||
6785 | snd_printdd("create alsa devices.\n"); | 6805 | snd_printdd("create alsa devices.\n"); |
6786 | err = snd_hdspm_create_alsa_devices(card, hdspm); | 6806 | err = snd_hdspm_create_alsa_devices(card, hdspm); |
6787 | if (err < 0) | 6807 | if (err < 0) |
@@ -6868,10 +6888,10 @@ static int __devinit snd_hdspm_probe(struct pci_dev *pci, | |||
6868 | if (hdspm->io_type != MADIface) { | 6888 | if (hdspm->io_type != MADIface) { |
6869 | sprintf(card->shortname, "%s_%x", | 6889 | sprintf(card->shortname, "%s_%x", |
6870 | hdspm->card_name, | 6890 | hdspm->card_name, |
6871 | (hdspm_read(hdspm, HDSPM_midiStatusIn0)>>8) & 0xFFFFFF); | 6891 | hdspm->serial); |
6872 | sprintf(card->longname, "%s S/N 0x%x at 0x%lx, irq %d", | 6892 | sprintf(card->longname, "%s S/N 0x%x at 0x%lx, irq %d", |
6873 | hdspm->card_name, | 6893 | hdspm->card_name, |
6874 | (hdspm_read(hdspm, HDSPM_midiStatusIn0)>>8) & 0xFFFFFF, | 6894 | hdspm->serial, |
6875 | hdspm->port, hdspm->irq); | 6895 | hdspm->port, hdspm->irq); |
6876 | } else { | 6896 | } else { |
6877 | sprintf(card->shortname, "%s", hdspm->card_name); | 6897 | sprintf(card->shortname, "%s", hdspm->card_name); |
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c index 732c5e837437..b737d1619cc7 100644 --- a/sound/pci/rme9652/rme9652.c +++ b/sound/pci/rme9652/rme9652.c | |||
@@ -38,8 +38,8 @@ | |||
38 | 38 | ||
39 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 39 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
40 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 40 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
41 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 41 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
42 | static int precise_ptr[SNDRV_CARDS]; /* Enable precise pointer */ | 42 | static bool precise_ptr[SNDRV_CARDS]; /* Enable precise pointer */ |
43 | 43 | ||
44 | module_param_array(index, int, NULL, 0444); | 44 | module_param_array(index, int, NULL, 0444); |
45 | MODULE_PARM_DESC(index, "Index value for RME Digi9652 (Hammerfall) soundcard."); | 45 | MODULE_PARM_DESC(index, "Index value for RME Digi9652 (Hammerfall) soundcard."); |
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c index a391e622a192..ff500a87f769 100644 --- a/sound/pci/sis7019.c +++ b/sound/pci/sis7019.c | |||
@@ -40,7 +40,8 @@ MODULE_SUPPORTED_DEVICE("{{SiS,SiS7019 Audio Accelerator}}"); | |||
40 | 40 | ||
41 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ | 41 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
42 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ | 42 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
43 | static int enable = 1; | 43 | static bool enable = 1; |
44 | static int codecs = 1; | ||
44 | 45 | ||
45 | module_param(index, int, 0444); | 46 | module_param(index, int, 0444); |
46 | MODULE_PARM_DESC(index, "Index value for SiS7019 Audio Accelerator."); | 47 | MODULE_PARM_DESC(index, "Index value for SiS7019 Audio Accelerator."); |
@@ -48,6 +49,8 @@ module_param(id, charp, 0444); | |||
48 | MODULE_PARM_DESC(id, "ID string for SiS7019 Audio Accelerator."); | 49 | MODULE_PARM_DESC(id, "ID string for SiS7019 Audio Accelerator."); |
49 | module_param(enable, bool, 0444); | 50 | module_param(enable, bool, 0444); |
50 | MODULE_PARM_DESC(enable, "Enable SiS7019 Audio Accelerator."); | 51 | MODULE_PARM_DESC(enable, "Enable SiS7019 Audio Accelerator."); |
52 | module_param(codecs, int, 0444); | ||
53 | MODULE_PARM_DESC(codecs, "Set bit to indicate that codec number is expected to be present (default 1)"); | ||
51 | 54 | ||
52 | static DEFINE_PCI_DEVICE_TABLE(snd_sis7019_ids) = { | 55 | static DEFINE_PCI_DEVICE_TABLE(snd_sis7019_ids) = { |
53 | { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x7019) }, | 56 | { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x7019) }, |
@@ -140,6 +143,9 @@ struct sis7019 { | |||
140 | dma_addr_t silence_dma_addr; | 143 | dma_addr_t silence_dma_addr; |
141 | }; | 144 | }; |
142 | 145 | ||
146 | /* These values are also used by the module param 'codecs' to indicate | ||
147 | * which codecs should be present. | ||
148 | */ | ||
143 | #define SIS_PRIMARY_CODEC_PRESENT 0x0001 | 149 | #define SIS_PRIMARY_CODEC_PRESENT 0x0001 |
144 | #define SIS_SECONDARY_CODEC_PRESENT 0x0002 | 150 | #define SIS_SECONDARY_CODEC_PRESENT 0x0002 |
145 | #define SIS_TERTIARY_CODEC_PRESENT 0x0004 | 151 | #define SIS_TERTIARY_CODEC_PRESENT 0x0004 |
@@ -977,7 +983,7 @@ timeout: | |||
977 | mutex_unlock(&sis->ac97_mutex); | 983 | mutex_unlock(&sis->ac97_mutex); |
978 | 984 | ||
979 | if (!count) { | 985 | if (!count) { |
980 | printk(KERN_ERR "sis7019: ac97 codec %d timeout cmd 0x%08x\n", | 986 | dev_err(&sis->pci->dev, "ac97 codec %d timeout cmd 0x%08x\n", |
981 | codec, cmd); | 987 | codec, cmd); |
982 | } | 988 | } |
983 | 989 | ||
@@ -1078,6 +1084,7 @@ static int sis_chip_init(struct sis7019 *sis) | |||
1078 | { | 1084 | { |
1079 | unsigned long io = sis->ioport; | 1085 | unsigned long io = sis->ioport; |
1080 | void __iomem *ioaddr = sis->ioaddr; | 1086 | void __iomem *ioaddr = sis->ioaddr; |
1087 | unsigned long timeout; | ||
1081 | u16 status; | 1088 | u16 status; |
1082 | int count; | 1089 | int count; |
1083 | int i; | 1090 | int i; |
@@ -1104,21 +1111,45 @@ static int sis_chip_init(struct sis7019 *sis) | |||
1104 | while ((inw(io + SIS_AC97_STATUS) & SIS_AC97_STATUS_BUSY) && --count) | 1111 | while ((inw(io + SIS_AC97_STATUS) & SIS_AC97_STATUS_BUSY) && --count) |
1105 | udelay(1); | 1112 | udelay(1); |
1106 | 1113 | ||
1114 | /* Command complete, we can let go of the semaphore now. | ||
1115 | */ | ||
1116 | outl(SIS_AC97_SEMA_RELEASE, io + SIS_AC97_SEMA); | ||
1117 | if (!count) | ||
1118 | return -EIO; | ||
1119 | |||
1107 | /* Now that we've finished the reset, find out what's attached. | 1120 | /* Now that we've finished the reset, find out what's attached. |
1121 | * There are some codec/board combinations that take an extremely | ||
1122 | * long time to come up. 350+ ms has been observed in the field, | ||
1123 | * so we'll give them up to 500ms. | ||
1108 | */ | 1124 | */ |
1109 | status = inl(io + SIS_AC97_STATUS); | 1125 | sis->codecs_present = 0; |
1110 | if (status & SIS_AC97_STATUS_CODEC_READY) | 1126 | timeout = msecs_to_jiffies(500) + jiffies; |
1111 | sis->codecs_present |= SIS_PRIMARY_CODEC_PRESENT; | 1127 | while (time_before_eq(jiffies, timeout)) { |
1112 | if (status & SIS_AC97_STATUS_CODEC2_READY) | 1128 | status = inl(io + SIS_AC97_STATUS); |
1113 | sis->codecs_present |= SIS_SECONDARY_CODEC_PRESENT; | 1129 | if (status & SIS_AC97_STATUS_CODEC_READY) |
1114 | if (status & SIS_AC97_STATUS_CODEC3_READY) | 1130 | sis->codecs_present |= SIS_PRIMARY_CODEC_PRESENT; |
1115 | sis->codecs_present |= SIS_TERTIARY_CODEC_PRESENT; | 1131 | if (status & SIS_AC97_STATUS_CODEC2_READY) |
1116 | 1132 | sis->codecs_present |= SIS_SECONDARY_CODEC_PRESENT; | |
1117 | /* All done, let go of the semaphore, and check for errors | 1133 | if (status & SIS_AC97_STATUS_CODEC3_READY) |
1134 | sis->codecs_present |= SIS_TERTIARY_CODEC_PRESENT; | ||
1135 | |||
1136 | if (sis->codecs_present == codecs) | ||
1137 | break; | ||
1138 | |||
1139 | msleep(1); | ||
1140 | } | ||
1141 | |||
1142 | /* All done, check for errors. | ||
1118 | */ | 1143 | */ |
1119 | outl(SIS_AC97_SEMA_RELEASE, io + SIS_AC97_SEMA); | 1144 | if (!sis->codecs_present) { |
1120 | if (!sis->codecs_present || !count) | 1145 | dev_err(&sis->pci->dev, "could not find any codecs\n"); |
1121 | return -EIO; | 1146 | return -EIO; |
1147 | } | ||
1148 | |||
1149 | if (sis->codecs_present != codecs) { | ||
1150 | dev_warn(&sis->pci->dev, "missing codecs, found %0x, expected %0x\n", | ||
1151 | sis->codecs_present, codecs); | ||
1152 | } | ||
1122 | 1153 | ||
1123 | /* Let the hardware know that the audio driver is alive, | 1154 | /* Let the hardware know that the audio driver is alive, |
1124 | * and enable PCM slots on the AC-link for L/R playback (3 & 4) and | 1155 | * and enable PCM slots on the AC-link for L/R playback (3 & 4) and |
@@ -1225,18 +1256,18 @@ static int sis_resume(struct pci_dev *pci) | |||
1225 | pci_restore_state(pci); | 1256 | pci_restore_state(pci); |
1226 | 1257 | ||
1227 | if (pci_enable_device(pci) < 0) { | 1258 | if (pci_enable_device(pci) < 0) { |
1228 | printk(KERN_ERR "sis7019: unable to re-enable device\n"); | 1259 | dev_err(&pci->dev, "unable to re-enable device\n"); |
1229 | goto error; | 1260 | goto error; |
1230 | } | 1261 | } |
1231 | 1262 | ||
1232 | if (sis_chip_init(sis)) { | 1263 | if (sis_chip_init(sis)) { |
1233 | printk(KERN_ERR "sis7019: unable to re-init controller\n"); | 1264 | dev_err(&pci->dev, "unable to re-init controller\n"); |
1234 | goto error; | 1265 | goto error; |
1235 | } | 1266 | } |
1236 | 1267 | ||
1237 | if (request_irq(pci->irq, sis_interrupt, IRQF_SHARED, | 1268 | if (request_irq(pci->irq, sis_interrupt, IRQF_SHARED, |
1238 | KBUILD_MODNAME, sis)) { | 1269 | KBUILD_MODNAME, sis)) { |
1239 | printk(KERN_ERR "sis7019: unable to regain IRQ %d\n", pci->irq); | 1270 | dev_err(&pci->dev, "unable to regain IRQ %d\n", pci->irq); |
1240 | goto error; | 1271 | goto error; |
1241 | } | 1272 | } |
1242 | 1273 | ||
@@ -1304,8 +1335,7 @@ static int __devinit sis_chip_create(struct snd_card *card, | |||
1304 | goto error_out; | 1335 | goto error_out; |
1305 | 1336 | ||
1306 | if (pci_set_dma_mask(pci, DMA_BIT_MASK(30)) < 0) { | 1337 | if (pci_set_dma_mask(pci, DMA_BIT_MASK(30)) < 0) { |
1307 | printk(KERN_ERR "sis7019: architecture does not support " | 1338 | dev_err(&pci->dev, "architecture does not support 30-bit PCI busmaster DMA"); |
1308 | "30-bit PCI busmaster DMA"); | ||
1309 | goto error_out_enabled; | 1339 | goto error_out_enabled; |
1310 | } | 1340 | } |
1311 | 1341 | ||
@@ -1319,20 +1349,20 @@ static int __devinit sis_chip_create(struct snd_card *card, | |||
1319 | 1349 | ||
1320 | rc = pci_request_regions(pci, "SiS7019"); | 1350 | rc = pci_request_regions(pci, "SiS7019"); |
1321 | if (rc) { | 1351 | if (rc) { |
1322 | printk(KERN_ERR "sis7019: unable request regions\n"); | 1352 | dev_err(&pci->dev, "unable request regions\n"); |
1323 | goto error_out_enabled; | 1353 | goto error_out_enabled; |
1324 | } | 1354 | } |
1325 | 1355 | ||
1326 | rc = -EIO; | 1356 | rc = -EIO; |
1327 | sis->ioaddr = ioremap_nocache(pci_resource_start(pci, 1), 0x4000); | 1357 | sis->ioaddr = ioremap_nocache(pci_resource_start(pci, 1), 0x4000); |
1328 | if (!sis->ioaddr) { | 1358 | if (!sis->ioaddr) { |
1329 | printk(KERN_ERR "sis7019: unable to remap MMIO, aborting\n"); | 1359 | dev_err(&pci->dev, "unable to remap MMIO, aborting\n"); |
1330 | goto error_out_cleanup; | 1360 | goto error_out_cleanup; |
1331 | } | 1361 | } |
1332 | 1362 | ||
1333 | rc = sis_alloc_suspend(sis); | 1363 | rc = sis_alloc_suspend(sis); |
1334 | if (rc < 0) { | 1364 | if (rc < 0) { |
1335 | printk(KERN_ERR "sis7019: unable to allocate state storage\n"); | 1365 | dev_err(&pci->dev, "unable to allocate state storage\n"); |
1336 | goto error_out_cleanup; | 1366 | goto error_out_cleanup; |
1337 | } | 1367 | } |
1338 | 1368 | ||
@@ -1340,9 +1370,9 @@ static int __devinit sis_chip_create(struct snd_card *card, | |||
1340 | if (rc) | 1370 | if (rc) |
1341 | goto error_out_cleanup; | 1371 | goto error_out_cleanup; |
1342 | 1372 | ||
1343 | if (request_irq(pci->irq, sis_interrupt, IRQF_SHARED, | 1373 | if (request_irq(pci->irq, sis_interrupt, IRQF_SHARED, KBUILD_MODNAME, |
1344 | KBUILD_MODNAME, sis)) { | 1374 | sis)) { |
1345 | printk(KERN_ERR "unable to allocate irq %d\n", sis->irq); | 1375 | dev_err(&pci->dev, "unable to allocate irq %d\n", sis->irq); |
1346 | goto error_out_cleanup; | 1376 | goto error_out_cleanup; |
1347 | } | 1377 | } |
1348 | 1378 | ||
@@ -1390,6 +1420,17 @@ static int __devinit snd_sis7019_probe(struct pci_dev *pci, | |||
1390 | if (!enable) | 1420 | if (!enable) |
1391 | goto error_out; | 1421 | goto error_out; |
1392 | 1422 | ||
1423 | /* The user can specify which codecs should be present so that we | ||
1424 | * can wait for them to show up if they are slow to recover from | ||
1425 | * the AC97 cold reset. We default to a single codec, the primary. | ||
1426 | * | ||
1427 | * We assume that SIS_PRIMARY_*_PRESENT matches bits 0-2. | ||
1428 | */ | ||
1429 | codecs &= SIS_PRIMARY_CODEC_PRESENT | SIS_SECONDARY_CODEC_PRESENT | | ||
1430 | SIS_TERTIARY_CODEC_PRESENT; | ||
1431 | if (!codecs) | ||
1432 | codecs = SIS_PRIMARY_CODEC_PRESENT; | ||
1433 | |||
1393 | rc = snd_card_create(index, id, THIS_MODULE, sizeof(*sis), &card); | 1434 | rc = snd_card_create(index, id, THIS_MODULE, sizeof(*sis), &card); |
1394 | if (rc < 0) | 1435 | if (rc < 0) |
1395 | goto error_out; | 1436 | goto error_out; |
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c index 31b6ad3ab1dc..54cc802050f7 100644 --- a/sound/pci/sonicvibes.c +++ b/sound/pci/sonicvibes.c | |||
@@ -52,9 +52,9 @@ MODULE_SUPPORTED_DEVICE("{{S3,SonicVibes PCI}}"); | |||
52 | 52 | ||
53 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 53 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
54 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 54 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
55 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 55 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
56 | static int reverb[SNDRV_CARDS]; | 56 | static bool reverb[SNDRV_CARDS]; |
57 | static int mge[SNDRV_CARDS]; | 57 | static bool mge[SNDRV_CARDS]; |
58 | static unsigned int dmaio = 0x7a00; /* DDMA i/o address */ | 58 | static unsigned int dmaio = 0x7a00; /* DDMA i/o address */ |
59 | 59 | ||
60 | module_param_array(index, int, NULL, 0444); | 60 | module_param_array(index, int, NULL, 0444); |
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c index deb04b924122..5f1def7f45e5 100644 --- a/sound/pci/trident/trident.c +++ b/sound/pci/trident/trident.c | |||
@@ -47,7 +47,7 @@ MODULE_SUPPORTED_DEVICE("{{Trident,4DWave DX}," | |||
47 | 47 | ||
48 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 48 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
49 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 49 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
50 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 50 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
51 | static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 32}; | 51 | static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 32}; |
52 | static int wavetable_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8192}; | 52 | static int wavetable_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8192}; |
53 | 53 | ||
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index ae98d56d05bd..75630408c6db 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c | |||
@@ -80,7 +80,7 @@ static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ | |||
80 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ | 80 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
81 | static long mpu_port; | 81 | static long mpu_port; |
82 | #ifdef SUPPORT_JOYSTICK | 82 | #ifdef SUPPORT_JOYSTICK |
83 | static int joystick; | 83 | static bool joystick; |
84 | #endif | 84 | #endif |
85 | static int ac97_clock = 48000; | 85 | static int ac97_clock = 48000; |
86 | static char *ac97_quirk; | 86 | static char *ac97_quirk; |
@@ -110,7 +110,7 @@ module_param(nodelay, int, 0444); | |||
110 | MODULE_PARM_DESC(nodelay, "Disable 500ms init delay"); | 110 | MODULE_PARM_DESC(nodelay, "Disable 500ms init delay"); |
111 | 111 | ||
112 | /* just for backward compatibility */ | 112 | /* just for backward compatibility */ |
113 | static int enable; | 113 | static bool enable; |
114 | module_param(enable, bool, 0444); | 114 | module_param(enable, bool, 0444); |
115 | 115 | ||
116 | 116 | ||
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 80a9c2bf3301..5efcbcac506a 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c | |||
@@ -66,7 +66,7 @@ module_param(ac97_clock, int, 0444); | |||
66 | MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz)."); | 66 | MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz)."); |
67 | 67 | ||
68 | /* just for backward compatibility */ | 68 | /* just for backward compatibility */ |
69 | static int enable; | 69 | static bool enable; |
70 | module_param(enable, bool, 0444); | 70 | module_param(enable, bool, 0444); |
71 | 71 | ||
72 | 72 | ||
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c index 6765822fb3b7..6a534bfe1274 100644 --- a/sound/pci/vx222/vx222.c +++ b/sound/pci/vx222/vx222.c | |||
@@ -37,8 +37,8 @@ MODULE_SUPPORTED_DEVICE("{{Digigram," CARD_NAME "}}"); | |||
37 | 37 | ||
38 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 38 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
39 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 39 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
40 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 40 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
41 | static int mic[SNDRV_CARDS]; /* microphone */ | 41 | static bool mic[SNDRV_CARDS]; /* microphone */ |
42 | static int ibl[SNDRV_CARDS]; /* microphone */ | 42 | static int ibl[SNDRV_CARDS]; /* microphone */ |
43 | 43 | ||
44 | module_param_array(index, int, NULL, 0444); | 44 | module_param_array(index, int, NULL, 0444); |
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c index e97ddcac0d37..e57b89e8aa89 100644 --- a/sound/pci/ymfpci/ymfpci.c +++ b/sound/pci/ymfpci/ymfpci.c | |||
@@ -41,13 +41,13 @@ MODULE_SUPPORTED_DEVICE("{{Yamaha,YMF724}," | |||
41 | 41 | ||
42 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 42 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
43 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 43 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
44 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 44 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
45 | static long fm_port[SNDRV_CARDS]; | 45 | static long fm_port[SNDRV_CARDS]; |
46 | static long mpu_port[SNDRV_CARDS]; | 46 | static long mpu_port[SNDRV_CARDS]; |
47 | #ifdef SUPPORT_JOYSTICK | 47 | #ifdef SUPPORT_JOYSTICK |
48 | static long joystick_port[SNDRV_CARDS]; | 48 | static long joystick_port[SNDRV_CARDS]; |
49 | #endif | 49 | #endif |
50 | static int rear_switch[SNDRV_CARDS]; | 50 | static bool rear_switch[SNDRV_CARDS]; |
51 | 51 | ||
52 | module_param_array(index, int, NULL, 0444); | 52 | module_param_array(index, int, NULL, 0444); |
53 | MODULE_PARM_DESC(index, "Index value for the Yamaha DS-1 PCI soundcard."); | 53 | MODULE_PARM_DESC(index, "Index value for the Yamaha DS-1 PCI soundcard."); |
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index 6af41d2d8fc5..830839a874b6 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c | |||
@@ -39,7 +39,7 @@ MODULE_SUPPORTED_DEVICE("{{Sound Core," CARD_NAME "}}"); | |||
39 | 39 | ||
40 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 40 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
41 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 41 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
42 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ | 42 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ |
43 | 43 | ||
44 | module_param_array(index, int, NULL, 0444); | 44 | module_param_array(index, int, NULL, 0444); |
45 | MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); | 45 | MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); |
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 9e361c9d5bf3..512f0b472375 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c | |||
@@ -39,7 +39,7 @@ MODULE_SUPPORTED_DEVICE("{{Digigram,VXPocket},{Digigram,VXPocket440}}"); | |||
39 | 39 | ||
40 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 40 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
41 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 41 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
42 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ | 42 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ |
43 | static int ibl[SNDRV_CARDS]; | 43 | static int ibl[SNDRV_CARDS]; |
44 | 44 | ||
45 | module_param_array(index, int, NULL, 0444); | 45 | module_param_array(index, int, NULL, 0444); |
diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c index 65645693c485..5a4e263b5b0f 100644 --- a/sound/ppc/powermac.c +++ b/sound/ppc/powermac.c | |||
@@ -36,7 +36,7 @@ MODULE_LICENSE("GPL"); | |||
36 | 36 | ||
37 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ | 37 | static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ |
38 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ | 38 | static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ |
39 | static int enable_beep = 1; | 39 | static bool enable_beep = 1; |
40 | 40 | ||
41 | module_param(index, int, 0444); | 41 | module_param(index, int, 0444); |
42 | MODULE_PARM_DESC(index, "Index value for " CHIP_NAME " soundchip."); | 42 | MODULE_PARM_DESC(index, "Index value for " CHIP_NAME " soundchip."); |
diff --git a/sound/sh/aica.c b/sound/sh/aica.c index 1120ca49edd0..391a38ca58bc 100644 --- a/sound/sh/aica.c +++ b/sound/sh/aica.c | |||
@@ -55,7 +55,7 @@ MODULE_FIRMWARE("aica_firmware.bin"); | |||
55 | #define CARD_NAME "AICA" | 55 | #define CARD_NAME "AICA" |
56 | static int index = -1; | 56 | static int index = -1; |
57 | static char *id; | 57 | static char *id; |
58 | static int enable = 1; | 58 | static bool enable = 1; |
59 | module_param(index, int, 0444); | 59 | module_param(index, int, 0444); |
60 | MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); | 60 | MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); |
61 | module_param(id, charp, 0444); | 61 | module_param(id, charp, 0444); |
diff --git a/sound/sh/sh_dac_audio.c b/sound/sh/sh_dac_audio.c index 56bcb46abf0d..b11f82b5718f 100644 --- a/sound/sh/sh_dac_audio.c +++ b/sound/sh/sh_dac_audio.c | |||
@@ -441,15 +441,4 @@ static struct platform_driver driver = { | |||
441 | }, | 441 | }, |
442 | }; | 442 | }; |
443 | 443 | ||
444 | static int __init sh_dac_init(void) | 444 | module_platform_driver(driver); |
445 | { | ||
446 | return platform_driver_register(&driver); | ||
447 | } | ||
448 | |||
449 | static void __exit sh_dac_exit(void) | ||
450 | { | ||
451 | platform_driver_unregister(&driver); | ||
452 | } | ||
453 | |||
454 | module_init(sh_dac_init); | ||
455 | module_exit(sh_dac_exit); | ||
diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c index f036776380b5..b63b3a86d3f4 100644 --- a/sound/sparc/amd7930.c +++ b/sound/sparc/amd7930.c | |||
@@ -50,7 +50,7 @@ | |||
50 | 50 | ||
51 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 51 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
52 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 52 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
53 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 53 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
54 | 54 | ||
55 | module_param_array(index, int, NULL, 0444); | 55 | module_param_array(index, int, NULL, 0444); |
56 | MODULE_PARM_DESC(index, "Index value for Sun AMD7930 soundcard."); | 56 | MODULE_PARM_DESC(index, "Index value for Sun AMD7930 soundcard."); |
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index 0e618f82808c..f2eabd3f22fd 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c | |||
@@ -40,7 +40,7 @@ | |||
40 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 40 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
41 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 41 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
42 | /* Enable this card */ | 42 | /* Enable this card */ |
43 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 43 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
44 | 44 | ||
45 | module_param_array(index, int, NULL, 0444); | 45 | module_param_array(index, int, NULL, 0444); |
46 | MODULE_PARM_DESC(index, "Index value for Sun CS4231 soundcard."); | 46 | MODULE_PARM_DESC(index, "Index value for Sun CS4231 soundcard."); |
@@ -2118,15 +2118,4 @@ static struct platform_driver cs4231_driver = { | |||
2118 | .remove = __devexit_p(cs4231_remove), | 2118 | .remove = __devexit_p(cs4231_remove), |
2119 | }; | 2119 | }; |
2120 | 2120 | ||
2121 | static int __init cs4231_init(void) | 2121 | module_platform_driver(cs4231_driver); |
2122 | { | ||
2123 | return platform_driver_register(&cs4231_driver); | ||
2124 | } | ||
2125 | |||
2126 | static void __exit cs4231_exit(void) | ||
2127 | { | ||
2128 | platform_driver_unregister(&cs4231_driver); | ||
2129 | } | ||
2130 | |||
2131 | module_init(cs4231_init); | ||
2132 | module_exit(cs4231_exit); | ||
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index 4a4f1d740330..a6b0deb77746 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c | |||
@@ -80,7 +80,7 @@ MODULE_SUPPORTED_DEVICE("{{Sun,DBRI}}"); | |||
80 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 80 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
81 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 81 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
82 | /* Enable this card */ | 82 | /* Enable this card */ |
83 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 83 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
84 | 84 | ||
85 | module_param_array(index, int, NULL, 0444); | 85 | module_param_array(index, int, NULL, 0444); |
86 | MODULE_PARM_DESC(index, "Index value for Sun DBRI soundcard."); | 86 | MODULE_PARM_DESC(index, "Index value for Sun DBRI soundcard."); |
@@ -2697,16 +2697,4 @@ static struct platform_driver dbri_sbus_driver = { | |||
2697 | .remove = __devexit_p(dbri_remove), | 2697 | .remove = __devexit_p(dbri_remove), |
2698 | }; | 2698 | }; |
2699 | 2699 | ||
2700 | /* Probe for the dbri chip and then attach the driver. */ | 2700 | module_platform_driver(dbri_sbus_driver); |
2701 | static int __init dbri_init(void) | ||
2702 | { | ||
2703 | return platform_driver_register(&dbri_sbus_driver); | ||
2704 | } | ||
2705 | |||
2706 | static void __exit dbri_exit(void) | ||
2707 | { | ||
2708 | platform_driver_unregister(&dbri_sbus_driver); | ||
2709 | } | ||
2710 | |||
2711 | module_init(dbri_init); | ||
2712 | module_exit(dbri_exit); | ||
diff --git a/sound/usb/6fire/chip.c b/sound/usb/6fire/chip.c index c7dca7b0b9fe..a43f1952169a 100644 --- a/sound/usb/6fire/chip.c +++ b/sound/usb/6fire/chip.c | |||
@@ -35,7 +35,7 @@ MODULE_SUPPORTED_DEVICE("{{TerraTec, DMX 6Fire USB}}"); | |||
35 | 35 | ||
36 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ | 36 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ |
37 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */ | 37 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */ |
38 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable card */ | 38 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable card */ |
39 | static struct sfire_chip *chips[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; | 39 | static struct sfire_chip *chips[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; |
40 | static struct usb_device *devices[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; | 40 | static struct usb_device *devices[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; |
41 | 41 | ||
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c index 3eb605bd9503..7cf67e44d85b 100644 --- a/sound/usb/caiaq/device.c +++ b/sound/usb/caiaq/device.c | |||
@@ -55,7 +55,7 @@ MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," | |||
55 | 55 | ||
56 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ | 56 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ |
57 | static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ | 57 | static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ |
58 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 58 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
59 | static int snd_card_used[SNDRV_CARDS]; | 59 | static int snd_card_used[SNDRV_CARDS]; |
60 | 60 | ||
61 | module_param_array(index, int, NULL, 0444); | 61 | module_param_array(index, int, NULL, 0444); |
diff --git a/sound/usb/card.c b/sound/usb/card.c index 0f6dc0d457bf..4a7be7b98331 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c | |||
@@ -78,14 +78,14 @@ MODULE_SUPPORTED_DEVICE("{{Generic,USB Audio}}"); | |||
78 | 78 | ||
79 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 79 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
80 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 80 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
81 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */ | 81 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card */ |
82 | /* Vendor/product IDs for this card */ | 82 | /* Vendor/product IDs for this card */ |
83 | static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; | 83 | static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; |
84 | static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; | 84 | static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; |
85 | static int nrpacks = 8; /* max. number of packets per urb */ | 85 | static int nrpacks = 8; /* max. number of packets per urb */ |
86 | static int async_unlink = 1; | 86 | static bool async_unlink = 1; |
87 | static int device_setup[SNDRV_CARDS]; /* device parameter for this card */ | 87 | static int device_setup[SNDRV_CARDS]; /* device parameter for this card */ |
88 | static int ignore_ctl_error; | 88 | static bool ignore_ctl_error; |
89 | 89 | ||
90 | module_param_array(index, int, NULL, 0444); | 90 | module_param_array(index, int, NULL, 0444); |
91 | MODULE_PARM_DESC(index, "Index value for the USB audio adapter."); | 91 | MODULE_PARM_DESC(index, "Index value for the USB audio adapter."); |
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 81c6edecd862..08dcce53720b 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include <linux/gfp.h> | 18 | #include <linux/gfp.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/ratelimit.h> | ||
20 | #include <linux/usb.h> | 21 | #include <linux/usb.h> |
21 | #include <linux/usb/audio.h> | 22 | #include <linux/usb/audio.h> |
22 | 23 | ||
@@ -458,8 +459,8 @@ static int retire_capture_urb(struct snd_usb_substream *subs, | |||
458 | 459 | ||
459 | for (i = 0; i < urb->number_of_packets; i++) { | 460 | for (i = 0; i < urb->number_of_packets; i++) { |
460 | cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset; | 461 | cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset; |
461 | if (urb->iso_frame_desc[i].status) { | 462 | if (urb->iso_frame_desc[i].status && printk_ratelimit()) { |
462 | snd_printd(KERN_ERR "frame %d active: %d\n", i, urb->iso_frame_desc[i].status); | 463 | snd_printdd("frame %d active: %d\n", i, urb->iso_frame_desc[i].status); |
463 | // continue; | 464 | // continue; |
464 | } | 465 | } |
465 | bytes = urb->iso_frame_desc[i].actual_length; | 466 | bytes = urb->iso_frame_desc[i].actual_length; |
diff --git a/sound/usb/format.c b/sound/usb/format.c index 89421d176570..e09aba19375c 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c | |||
@@ -209,6 +209,8 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof | |||
209 | return 0; | 209 | return 0; |
210 | } | 210 | } |
211 | 211 | ||
212 | #define MAX_UAC2_NR_RATES 1024 | ||
213 | |||
212 | /* | 214 | /* |
213 | * Helper function to walk the array of sample rate triplets reported by | 215 | * Helper function to walk the array of sample rate triplets reported by |
214 | * the device. The problem is that we need to parse whole array first to | 216 | * the device. The problem is that we need to parse whole array first to |
@@ -226,7 +228,7 @@ static int parse_uac2_sample_rate_range(struct audioformat *fp, int nr_triplets, | |||
226 | int min = combine_quad(&data[2 + 12 * i]); | 228 | int min = combine_quad(&data[2 + 12 * i]); |
227 | int max = combine_quad(&data[6 + 12 * i]); | 229 | int max = combine_quad(&data[6 + 12 * i]); |
228 | int res = combine_quad(&data[10 + 12 * i]); | 230 | int res = combine_quad(&data[10 + 12 * i]); |
229 | int rate; | 231 | unsigned int rate; |
230 | 232 | ||
231 | if ((max < 0) || (min < 0) || (res < 0) || (max < min)) | 233 | if ((max < 0) || (min < 0) || (res < 0) || (max < min)) |
232 | continue; | 234 | continue; |
@@ -253,6 +255,10 @@ static int parse_uac2_sample_rate_range(struct audioformat *fp, int nr_triplets, | |||
253 | fp->rates |= snd_pcm_rate_to_rate_bit(rate); | 255 | fp->rates |= snd_pcm_rate_to_rate_bit(rate); |
254 | 256 | ||
255 | nr_rates++; | 257 | nr_rates++; |
258 | if (nr_rates >= MAX_UAC2_NR_RATES) { | ||
259 | snd_printk(KERN_ERR "invalid uac2 rates\n"); | ||
260 | break; | ||
261 | } | ||
256 | 262 | ||
257 | /* avoid endless loop */ | 263 | /* avoid endless loop */ |
258 | if (res == 0) | 264 | if (res == 0) |
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c index c0609c210303..e42805862ce5 100644 --- a/sound/usb/misc/ua101.c +++ b/sound/usb/misc/ua101.c | |||
@@ -52,7 +52,7 @@ MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}"); | |||
52 | 52 | ||
53 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 53 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
54 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 54 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
55 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 55 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
56 | static unsigned int queue_length = 21; | 56 | static unsigned int queue_length = 21; |
57 | 57 | ||
58 | module_param_array(index, int, NULL, 0444); | 58 | module_param_array(index, int, NULL, 0444); |
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index b61945f3af9e..8edc5035fc8f 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h | |||
@@ -269,6 +269,32 @@ YAMAHA_DEVICE(0x105a, NULL), | |||
269 | YAMAHA_DEVICE(0x105b, NULL), | 269 | YAMAHA_DEVICE(0x105b, NULL), |
270 | YAMAHA_DEVICE(0x105c, NULL), | 270 | YAMAHA_DEVICE(0x105c, NULL), |
271 | YAMAHA_DEVICE(0x105d, NULL), | 271 | YAMAHA_DEVICE(0x105d, NULL), |
272 | { | ||
273 | USB_DEVICE(0x0499, 0x1503), | ||
274 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { | ||
275 | /* .vendor_name = "Yamaha", */ | ||
276 | /* .product_name = "MOX6/MOX8", */ | ||
277 | .ifnum = QUIRK_ANY_INTERFACE, | ||
278 | .type = QUIRK_COMPOSITE, | ||
279 | .data = (const struct snd_usb_audio_quirk[]) { | ||
280 | { | ||
281 | .ifnum = 1, | ||
282 | .type = QUIRK_AUDIO_STANDARD_INTERFACE | ||
283 | }, | ||
284 | { | ||
285 | .ifnum = 2, | ||
286 | .type = QUIRK_AUDIO_STANDARD_INTERFACE | ||
287 | }, | ||
288 | { | ||
289 | .ifnum = 3, | ||
290 | .type = QUIRK_MIDI_YAMAHA | ||
291 | }, | ||
292 | { | ||
293 | .ifnum = -1 | ||
294 | } | ||
295 | } | ||
296 | } | ||
297 | }, | ||
272 | YAMAHA_DEVICE(0x2000, "DGP-7"), | 298 | YAMAHA_DEVICE(0x2000, "DGP-7"), |
273 | YAMAHA_DEVICE(0x2001, "DGP-5"), | 299 | YAMAHA_DEVICE(0x2001, "DGP-5"), |
274 | YAMAHA_DEVICE(0x2002, NULL), | 300 | YAMAHA_DEVICE(0x2002, NULL), |
@@ -1633,6 +1659,37 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
1633 | } | 1659 | } |
1634 | }, | 1660 | }, |
1635 | { | 1661 | { |
1662 | /* Roland GAIA SH-01 */ | ||
1663 | USB_DEVICE(0x0582, 0x0111), | ||
1664 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | ||
1665 | .vendor_name = "Roland", | ||
1666 | .product_name = "GAIA", | ||
1667 | .ifnum = QUIRK_ANY_INTERFACE, | ||
1668 | .type = QUIRK_COMPOSITE, | ||
1669 | .data = (const struct snd_usb_audio_quirk[]) { | ||
1670 | { | ||
1671 | .ifnum = 0, | ||
1672 | .type = QUIRK_AUDIO_STANDARD_INTERFACE | ||
1673 | }, | ||
1674 | { | ||
1675 | .ifnum = 1, | ||
1676 | .type = QUIRK_AUDIO_STANDARD_INTERFACE | ||
1677 | }, | ||
1678 | { | ||
1679 | .ifnum = 2, | ||
1680 | .type = QUIRK_MIDI_FIXED_ENDPOINT, | ||
1681 | .data = &(const struct snd_usb_midi_endpoint_info) { | ||
1682 | .out_cables = 0x0003, | ||
1683 | .in_cables = 0x0003 | ||
1684 | } | ||
1685 | }, | ||
1686 | { | ||
1687 | .ifnum = -1 | ||
1688 | } | ||
1689 | } | ||
1690 | } | ||
1691 | }, | ||
1692 | { | ||
1636 | USB_DEVICE(0x0582, 0x0113), | 1693 | USB_DEVICE(0x0582, 0x0113), |
1637 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { | 1694 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
1638 | /* .vendor_name = "BOSS", */ | 1695 | /* .vendor_name = "BOSS", */ |
@@ -2305,6 +2362,16 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2305 | } | 2362 | } |
2306 | }, | 2363 | }, |
2307 | 2364 | ||
2365 | { | ||
2366 | USB_DEVICE_VENDOR_SPEC(0x0944, 0x0201), | ||
2367 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { | ||
2368 | .vendor_name = "KORG, Inc.", | ||
2369 | /* .product_name = "ToneLab ST", */ | ||
2370 | .ifnum = 3, | ||
2371 | .type = QUIRK_MIDI_STANDARD_INTERFACE, | ||
2372 | } | ||
2373 | }, | ||
2374 | |||
2308 | /* AKAI devices */ | 2375 | /* AKAI devices */ |
2309 | { | 2376 | { |
2310 | USB_DEVICE(0x09e8, 0x0062), | 2377 | USB_DEVICE(0x09e8, 0x0062), |
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index 726c1a7b89b8..86f76a9aefae 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c | |||
@@ -37,7 +37,7 @@ MODULE_LICENSE("GPL"); | |||
37 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ | 37 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ |
38 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ | 38 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ |
39 | /* Enable this card */ | 39 | /* Enable this card */ |
40 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 40 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
41 | 41 | ||
42 | module_param_array(index, int, NULL, 0444); | 42 | module_param_array(index, int, NULL, 0444); |
43 | MODULE_PARM_DESC(index, "Index value for "NAME_ALLCAPS"."); | 43 | MODULE_PARM_DESC(index, "Index value for "NAME_ALLCAPS"."); |
diff --git a/sound/usb/usx2y/usb_stream.c b/sound/usb/usx2y/usb_stream.c index c400ade3ff08..1e7a47a86605 100644 --- a/sound/usb/usx2y/usb_stream.c +++ b/sound/usb/usx2y/usb_stream.c | |||
@@ -674,7 +674,7 @@ dotry: | |||
674 | inurb->transfer_buffer_length = | 674 | inurb->transfer_buffer_length = |
675 | inurb->number_of_packets * | 675 | inurb->number_of_packets * |
676 | inurb->iso_frame_desc[0].length; | 676 | inurb->iso_frame_desc[0].length; |
677 | preempt_disable(); | 677 | |
678 | if (u == 0) { | 678 | if (u == 0) { |
679 | int now; | 679 | int now; |
680 | struct usb_device *dev = inurb->dev; | 680 | struct usb_device *dev = inurb->dev; |
@@ -686,19 +686,17 @@ dotry: | |||
686 | } | 686 | } |
687 | err = usb_submit_urb(inurb, GFP_ATOMIC); | 687 | err = usb_submit_urb(inurb, GFP_ATOMIC); |
688 | if (err < 0) { | 688 | if (err < 0) { |
689 | preempt_enable(); | ||
690 | snd_printk(KERN_ERR"usb_submit_urb(sk->inurb[%i])" | 689 | snd_printk(KERN_ERR"usb_submit_urb(sk->inurb[%i])" |
691 | " returned %i\n", u, err); | 690 | " returned %i\n", u, err); |
692 | return err; | 691 | return err; |
693 | } | 692 | } |
694 | err = usb_submit_urb(outurb, GFP_ATOMIC); | 693 | err = usb_submit_urb(outurb, GFP_ATOMIC); |
695 | if (err < 0) { | 694 | if (err < 0) { |
696 | preempt_enable(); | ||
697 | snd_printk(KERN_ERR"usb_submit_urb(sk->outurb[%i])" | 695 | snd_printk(KERN_ERR"usb_submit_urb(sk->outurb[%i])" |
698 | " returned %i\n", u, err); | 696 | " returned %i\n", u, err); |
699 | return err; | 697 | return err; |
700 | } | 698 | } |
701 | preempt_enable(); | 699 | |
702 | if (inurb->start_frame != outurb->start_frame) { | 700 | if (inurb->start_frame != outurb->start_frame) { |
703 | snd_printd(KERN_DEBUG | 701 | snd_printd(KERN_DEBUG |
704 | "u[%i] start_frames differ in:%u out:%u\n", | 702 | "u[%i] start_frames differ in:%u out:%u\n", |
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index cbd37f2c76d0..1d694586d637 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c | |||
@@ -154,7 +154,7 @@ MODULE_SUPPORTED_DEVICE("{{TASCAM(0x1604), "NAME_ALLCAPS"(0x8001)(0x8005)(0x8007 | |||
154 | 154 | ||
155 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ | 155 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ |
156 | static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ | 156 | static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ |
157 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ | 157 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ |
158 | 158 | ||
159 | module_param_array(index, int, NULL, 0444); | 159 | module_param_array(index, int, NULL, 0444); |
160 | MODULE_PARM_DESC(index, "Index value for "NAME_ALLCAPS"."); | 160 | MODULE_PARM_DESC(index, "Index value for "NAME_ALLCAPS"."); |