diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-08-07 04:55:03 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-08-07 04:55:03 -0400 |
commit | 4fb8af10d0fd09372d52966b76922b9e82bbc950 (patch) | |
tree | d240e4d40357583e3f3eb228dccf20122a5b31ed /sound | |
parent | f44f82e8a20b98558486eb14497b2f71c78fa325 (diff) | |
parent | 64a99d2a8c3ed5c4e39f3ae1cc682aa8fd3977fc (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/seq/oss/seq_oss_synth.c | 3 | ||||
-rw-r--r-- | sound/i2c/other/tea575x-tuner.c | 2 | ||||
-rw-r--r-- | sound/sh/aica.c | 2 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_dma.c | 7 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 74 | ||||
-rw-r--r-- | sound/soc/pxa/poodle.c | 8 | ||||
-rw-r--r-- | sound/soc/pxa/tosa.c | 1 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 1 |
8 files changed, 77 insertions, 21 deletions
diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c index 558dadbf45f1..e024e4588b82 100644 --- a/sound/core/seq/oss/seq_oss_synth.c +++ b/sound/core/seq/oss/seq_oss_synth.c | |||
@@ -604,6 +604,9 @@ snd_seq_oss_synth_make_info(struct seq_oss_devinfo *dp, int dev, struct synth_in | |||
604 | { | 604 | { |
605 | struct seq_oss_synth *rec; | 605 | struct seq_oss_synth *rec; |
606 | 606 | ||
607 | if (dev < 0 || dev >= dp->max_synthdev) | ||
608 | return -ENXIO; | ||
609 | |||
607 | if (dp->synths[dev].is_midi) { | 610 | if (dp->synths[dev].is_midi) { |
608 | struct midi_info minf; | 611 | struct midi_info minf; |
609 | snd_seq_oss_midi_make_info(dp, dp->synths[dev].midi_mapped, &minf); | 612 | snd_seq_oss_midi_make_info(dp, dp->synths[dev].midi_mapped, &minf); |
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c index 87e3aefeddc3..83e90057270e 100644 --- a/sound/i2c/other/tea575x-tuner.c +++ b/sound/i2c/other/tea575x-tuner.c | |||
@@ -189,9 +189,7 @@ void snd_tea575x_init(struct snd_tea575x *tea) | |||
189 | } | 189 | } |
190 | 190 | ||
191 | memset(&tea->vd, 0, sizeof(tea->vd)); | 191 | memset(&tea->vd, 0, sizeof(tea->vd)); |
192 | tea->vd.owner = tea->card->module; | ||
193 | strcpy(tea->vd.name, tea->tea5759 ? "TEA5759 radio" : "TEA5757 radio"); | 192 | strcpy(tea->vd.name, tea->tea5759 ? "TEA5759 radio" : "TEA5757 radio"); |
194 | tea->vd.type = VID_TYPE_TUNER; | ||
195 | tea->vd.release = snd_tea575x_release; | 193 | tea->vd.release = snd_tea575x_release; |
196 | video_set_drvdata(&tea->vd, tea); | 194 | video_set_drvdata(&tea->vd, tea); |
197 | tea->vd.fops = &tea->fops; | 195 | tea->vd.fops = &tea->fops; |
diff --git a/sound/sh/aica.c b/sound/sh/aica.c index 9ca113326143..54df8baf916f 100644 --- a/sound/sh/aica.c +++ b/sound/sh/aica.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #include <sound/info.h> | 42 | #include <sound/info.h> |
43 | #include <asm/io.h> | 43 | #include <asm/io.h> |
44 | #include <asm/dma.h> | 44 | #include <asm/dma.h> |
45 | #include <asm/dreamcast/sysasic.h> | 45 | #include <mach/sysasic.h> |
46 | #include "aica.h" | 46 | #include "aica.h" |
47 | 47 | ||
48 | MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>"); | 48 | MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>"); |
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index da2bc5902864..7ceea2bba1f5 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c | |||
@@ -132,12 +132,17 @@ struct fsl_dma_private { | |||
132 | * Since each link descriptor has a 32-bit byte count field, we set | 132 | * Since each link descriptor has a 32-bit byte count field, we set |
133 | * period_bytes_max to the largest 32-bit number. We also have no maximum | 133 | * period_bytes_max to the largest 32-bit number. We also have no maximum |
134 | * number of periods. | 134 | * number of periods. |
135 | * | ||
136 | * Note that we specify SNDRV_PCM_INFO_JOINT_DUPLEX here, but only because a | ||
137 | * limitation in the SSI driver requires the sample rates for playback and | ||
138 | * capture to be the same. | ||
135 | */ | 139 | */ |
136 | static const struct snd_pcm_hardware fsl_dma_hardware = { | 140 | static const struct snd_pcm_hardware fsl_dma_hardware = { |
137 | 141 | ||
138 | .info = SNDRV_PCM_INFO_INTERLEAVED | | 142 | .info = SNDRV_PCM_INFO_INTERLEAVED | |
139 | SNDRV_PCM_INFO_MMAP | | 143 | SNDRV_PCM_INFO_MMAP | |
140 | SNDRV_PCM_INFO_MMAP_VALID, | 144 | SNDRV_PCM_INFO_MMAP_VALID | |
145 | SNDRV_PCM_INFO_JOINT_DUPLEX, | ||
141 | .formats = FSLDMA_PCM_FORMATS, | 146 | .formats = FSLDMA_PCM_FORMATS, |
142 | .rates = FSLDMA_PCM_RATES, | 147 | .rates = FSLDMA_PCM_RATES, |
143 | .rate_min = 5512, | 148 | .rate_min = 5512, |
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 71bff33f5528..157a7895ffa1 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -67,6 +67,8 @@ | |||
67 | * @ssi: pointer to the SSI's registers | 67 | * @ssi: pointer to the SSI's registers |
68 | * @ssi_phys: physical address of the SSI registers | 68 | * @ssi_phys: physical address of the SSI registers |
69 | * @irq: IRQ of this SSI | 69 | * @irq: IRQ of this SSI |
70 | * @first_stream: pointer to the stream that was opened first | ||
71 | * @second_stream: pointer to second stream | ||
70 | * @dev: struct device pointer | 72 | * @dev: struct device pointer |
71 | * @playback: the number of playback streams opened | 73 | * @playback: the number of playback streams opened |
72 | * @capture: the number of capture streams opened | 74 | * @capture: the number of capture streams opened |
@@ -79,6 +81,8 @@ struct fsl_ssi_private { | |||
79 | struct ccsr_ssi __iomem *ssi; | 81 | struct ccsr_ssi __iomem *ssi; |
80 | dma_addr_t ssi_phys; | 82 | dma_addr_t ssi_phys; |
81 | unsigned int irq; | 83 | unsigned int irq; |
84 | struct snd_pcm_substream *first_stream; | ||
85 | struct snd_pcm_substream *second_stream; | ||
82 | struct device *dev; | 86 | struct device *dev; |
83 | unsigned int playback; | 87 | unsigned int playback; |
84 | unsigned int capture; | 88 | unsigned int capture; |
@@ -342,6 +346,49 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream) | |||
342 | */ | 346 | */ |
343 | } | 347 | } |
344 | 348 | ||
349 | if (!ssi_private->first_stream) | ||
350 | ssi_private->first_stream = substream; | ||
351 | else { | ||
352 | /* This is the second stream open, so we need to impose sample | ||
353 | * rate and maybe sample size constraints. Note that this can | ||
354 | * cause a race condition if the second stream is opened before | ||
355 | * the first stream is fully initialized. | ||
356 | * | ||
357 | * We provide some protection by checking to make sure the first | ||
358 | * stream is initialized, but it's not perfect. ALSA sometimes | ||
359 | * re-initializes the driver with a different sample rate or | ||
360 | * size. If the second stream is opened before the first stream | ||
361 | * has received its final parameters, then the second stream may | ||
362 | * be constrained to the wrong sample rate or size. | ||
363 | * | ||
364 | * FIXME: This code does not handle opening and closing streams | ||
365 | * repeatedly. If you open two streams and then close the first | ||
366 | * one, you may not be able to open another stream until you | ||
367 | * close the second one as well. | ||
368 | */ | ||
369 | struct snd_pcm_runtime *first_runtime = | ||
370 | ssi_private->first_stream->runtime; | ||
371 | |||
372 | if (!first_runtime->rate || !first_runtime->sample_bits) { | ||
373 | dev_err(substream->pcm->card->dev, | ||
374 | "set sample rate and size in %s stream first\n", | ||
375 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK | ||
376 | ? "capture" : "playback"); | ||
377 | return -EAGAIN; | ||
378 | } | ||
379 | |||
380 | snd_pcm_hw_constraint_minmax(substream->runtime, | ||
381 | SNDRV_PCM_HW_PARAM_RATE, | ||
382 | first_runtime->rate, first_runtime->rate); | ||
383 | |||
384 | snd_pcm_hw_constraint_minmax(substream->runtime, | ||
385 | SNDRV_PCM_HW_PARAM_SAMPLE_BITS, | ||
386 | first_runtime->sample_bits, | ||
387 | first_runtime->sample_bits); | ||
388 | |||
389 | ssi_private->second_stream = substream; | ||
390 | } | ||
391 | |||
345 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | 392 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) |
346 | ssi_private->playback++; | 393 | ssi_private->playback++; |
347 | 394 | ||
@@ -371,18 +418,16 @@ static int fsl_ssi_prepare(struct snd_pcm_substream *substream) | |||
371 | struct fsl_ssi_private *ssi_private = rtd->dai->cpu_dai->private_data; | 418 | struct fsl_ssi_private *ssi_private = rtd->dai->cpu_dai->private_data; |
372 | 419 | ||
373 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; | 420 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; |
374 | u32 wl; | ||
375 | 421 | ||
376 | wl = CCSR_SSI_SxCCR_WL(snd_pcm_format_width(runtime->format)); | 422 | if (substream == ssi_private->first_stream) { |
423 | u32 wl; | ||
377 | 424 | ||
378 | clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN); | 425 | /* The SSI should always be disabled at this points (SSIEN=0) */ |
426 | wl = CCSR_SSI_SxCCR_WL(snd_pcm_format_width(runtime->format)); | ||
379 | 427 | ||
380 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | 428 | /* In synchronous mode, the SSI uses STCCR for capture */ |
381 | clrsetbits_be32(&ssi->stccr, CCSR_SSI_SxCCR_WL_MASK, wl); | 429 | clrsetbits_be32(&ssi->stccr, CCSR_SSI_SxCCR_WL_MASK, wl); |
382 | else | 430 | } |
383 | clrsetbits_be32(&ssi->srccr, CCSR_SSI_SxCCR_WL_MASK, wl); | ||
384 | |||
385 | setbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN); | ||
386 | 431 | ||
387 | return 0; | 432 | return 0; |
388 | } | 433 | } |
@@ -407,9 +452,13 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd) | |||
407 | case SNDRV_PCM_TRIGGER_RESUME: | 452 | case SNDRV_PCM_TRIGGER_RESUME: |
408 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 453 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
409 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 454 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
410 | setbits32(&ssi->scr, CCSR_SSI_SCR_TE); | 455 | clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN); |
456 | setbits32(&ssi->scr, | ||
457 | CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_TE); | ||
411 | } else { | 458 | } else { |
412 | setbits32(&ssi->scr, CCSR_SSI_SCR_RE); | 459 | clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN); |
460 | setbits32(&ssi->scr, | ||
461 | CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE); | ||
413 | 462 | ||
414 | /* | 463 | /* |
415 | * I think we need this delay to allow time for the SSI | 464 | * I think we need this delay to allow time for the SSI |
@@ -452,6 +501,11 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream) | |||
452 | if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) | 501 | if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) |
453 | ssi_private->capture--; | 502 | ssi_private->capture--; |
454 | 503 | ||
504 | if (ssi_private->first_stream == substream) | ||
505 | ssi_private->first_stream = ssi_private->second_stream; | ||
506 | |||
507 | ssi_private->second_stream = NULL; | ||
508 | |||
455 | /* | 509 | /* |
456 | * If this is the last active substream, disable the SSI and release | 510 | * If this is the last active substream, disable the SSI and release |
457 | * the IRQ. | 511 | * the IRQ. |
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c index 65a4e9a8c39e..d968cf71b569 100644 --- a/sound/soc/pxa/poodle.c +++ b/sound/soc/pxa/poodle.c | |||
@@ -85,17 +85,13 @@ static int poodle_startup(struct snd_pcm_substream *substream) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | /* we need to unmute the HP at shutdown as the mute burns power on poodle */ | 87 | /* we need to unmute the HP at shutdown as the mute burns power on poodle */ |
88 | static int poodle_shutdown(struct snd_pcm_substream *substream) | 88 | static void poodle_shutdown(struct snd_pcm_substream *substream) |
89 | { | 89 | { |
90 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
91 | struct snd_soc_codec *codec = rtd->socdev->codec; | ||
92 | |||
93 | /* set = unmute headphone */ | 90 | /* set = unmute headphone */ |
94 | locomo_gpio_write(&poodle_locomo_device.dev, | 91 | locomo_gpio_write(&poodle_locomo_device.dev, |
95 | POODLE_LOCOMO_GPIO_MUTE_L, 1); | 92 | POODLE_LOCOMO_GPIO_MUTE_L, 1); |
96 | locomo_gpio_write(&poodle_locomo_device.dev, | 93 | locomo_gpio_write(&poodle_locomo_device.dev, |
97 | POODLE_LOCOMO_GPIO_MUTE_R, 1); | 94 | POODLE_LOCOMO_GPIO_MUTE_R, 1); |
98 | return 0; | ||
99 | } | 95 | } |
100 | 96 | ||
101 | static int poodle_hw_params(struct snd_pcm_substream *substream, | 97 | static int poodle_hw_params(struct snd_pcm_substream *substream, |
@@ -232,7 +228,7 @@ static const struct soc_enum poodle_enum[] = { | |||
232 | SOC_ENUM_SINGLE_EXT(2, spk_function), | 228 | SOC_ENUM_SINGLE_EXT(2, spk_function), |
233 | }; | 229 | }; |
234 | 230 | ||
235 | static const snd_kcontrol_new_t wm8731_poodle_controls[] = { | 231 | static const struct snd_kcontrol_new wm8731_poodle_controls[] = { |
236 | SOC_ENUM_EXT("Jack Function", poodle_enum[0], poodle_get_jack, | 232 | SOC_ENUM_EXT("Jack Function", poodle_enum[0], poodle_get_jack, |
237 | poodle_set_jack), | 233 | poodle_set_jack), |
238 | SOC_ENUM_EXT("Speaker Function", poodle_enum[1], poodle_get_spk, | 234 | SOC_ENUM_EXT("Speaker Function", poodle_enum[1], poodle_get_spk, |
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c index fe6cca9c9e76..22971a0f040e 100644 --- a/sound/soc/pxa/tosa.c +++ b/sound/soc/pxa/tosa.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <asm/arch/pxa-regs.h> | 33 | #include <asm/arch/pxa-regs.h> |
34 | #include <asm/arch/hardware.h> | 34 | #include <asm/arch/hardware.h> |
35 | #include <asm/arch/audio.h> | 35 | #include <asm/arch/audio.h> |
36 | #include <asm/arch/tosa.h> | ||
37 | 36 | ||
38 | #include "../codecs/wm9712.h" | 37 | #include "../codecs/wm9712.h" |
39 | #include "pxa2xx-pcm.h" | 38 | #include "pxa2xx-pcm.h" |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 820347c9ae4b..f9d100bc8479 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -470,6 +470,7 @@ int dapm_reg_event(struct snd_soc_dapm_widget *w, | |||
470 | 470 | ||
471 | return 0; | 471 | return 0; |
472 | } | 472 | } |
473 | EXPORT_SYMBOL_GPL(dapm_reg_event); | ||
473 | 474 | ||
474 | /* | 475 | /* |
475 | * Scan each dapm widget for complete audio path. | 476 | * Scan each dapm widget for complete audio path. |