diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-08-18 09:17:52 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-08-18 09:17:52 -0400 |
commit | e7cfbea9cb7a02ea29fdae5d39c9e3d09102c4d5 (patch) | |
tree | 37c20ec03e70dc7b5df1d02f16b6ac38d8ed1364 /sound | |
parent | 7ac03db84baa204d7d280401ed65842541ed1078 (diff) | |
parent | 56385a12d9bb9e173751f74b6c430742018cafc0 (diff) |
Merge branch 'fix/misc' into topic/misc
Diffstat (limited to 'sound')
28 files changed, 215 insertions, 64 deletions
diff --git a/sound/aoa/soundbus/core.c b/sound/aoa/soundbus/core.c index 99ca7120e269..7487eb76e034 100644 --- a/sound/aoa/soundbus/core.c +++ b/sound/aoa/soundbus/core.c | |||
@@ -59,7 +59,7 @@ static int soundbus_probe(struct device *dev) | |||
59 | static int soundbus_uevent(struct device *dev, struct kobj_uevent_env *env) | 59 | static int soundbus_uevent(struct device *dev, struct kobj_uevent_env *env) |
60 | { | 60 | { |
61 | struct soundbus_dev * soundbus_dev; | 61 | struct soundbus_dev * soundbus_dev; |
62 | struct of_device * of; | 62 | struct platform_device * of; |
63 | const char *compat; | 63 | const char *compat; |
64 | int retval = 0; | 64 | int retval = 0; |
65 | int cplen, seen = 0; | 65 | int cplen, seen = 0; |
diff --git a/sound/aoa/soundbus/soundbus.h b/sound/aoa/soundbus/soundbus.h index a0f223c13f66..adecbf36f4f6 100644 --- a/sound/aoa/soundbus/soundbus.h +++ b/sound/aoa/soundbus/soundbus.h | |||
@@ -141,7 +141,7 @@ struct soundbus_dev { | |||
141 | struct list_head onbuslist; | 141 | struct list_head onbuslist; |
142 | 142 | ||
143 | /* the of device it represents */ | 143 | /* the of device it represents */ |
144 | struct of_device ofdev; | 144 | struct platform_device ofdev; |
145 | 145 | ||
146 | /* what modules go by */ | 146 | /* what modules go by */ |
147 | char modalias[32]; | 147 | char modalias[32]; |
diff --git a/sound/aoa/soundbus/sysfs.c b/sound/aoa/soundbus/sysfs.c index 6496e754f00a..e0980b5c2cd8 100644 --- a/sound/aoa/soundbus/sysfs.c +++ b/sound/aoa/soundbus/sysfs.c | |||
@@ -16,7 +16,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, | |||
16 | char *buf) | 16 | char *buf) |
17 | { | 17 | { |
18 | struct soundbus_dev *sdev = to_soundbus_device(dev); | 18 | struct soundbus_dev *sdev = to_soundbus_device(dev); |
19 | struct of_device *of = &sdev->ofdev; | 19 | struct platform_device *of = &sdev->ofdev; |
20 | int length; | 20 | int length; |
21 | 21 | ||
22 | if (*sdev->modalias) { | 22 | if (*sdev->modalias) { |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index a3b2a6479246..134fc6c2e08d 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -978,6 +978,10 @@ static int snd_pcm_do_pause(struct snd_pcm_substream *substream, int push) | |||
978 | { | 978 | { |
979 | if (substream->runtime->trigger_master != substream) | 979 | if (substream->runtime->trigger_master != substream) |
980 | return 0; | 980 | return 0; |
981 | /* some drivers might use hw_ptr to recover from the pause - | ||
982 | update the hw_ptr now */ | ||
983 | if (push) | ||
984 | snd_pcm_update_hw_ptr(substream); | ||
981 | /* The jiffies check in snd_pcm_update_hw_ptr*() is done by | 985 | /* The jiffies check in snd_pcm_update_hw_ptr*() is done by |
982 | * a delta betwen the current jiffies, this gives a large enough | 986 | * a delta betwen the current jiffies, this gives a large enough |
983 | * delta, effectively to skip the check once. | 987 | * delta, effectively to skip the check once. |
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c index 4203782d7cb7..aff8387c45cf 100644 --- a/sound/pci/emu10k1/emu10k1.c +++ b/sound/pci/emu10k1/emu10k1.c | |||
@@ -52,6 +52,7 @@ 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 int 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 | 56 | ||
56 | module_param_array(index, int, NULL, 0444); | 57 | module_param_array(index, int, NULL, 0444); |
57 | MODULE_PARM_DESC(index, "Index value for the EMU10K1 soundcard."); | 58 | MODULE_PARM_DESC(index, "Index value for the EMU10K1 soundcard."); |
@@ -73,6 +74,8 @@ module_param_array(enable_ir, bool, NULL, 0444); | |||
73 | MODULE_PARM_DESC(enable_ir, "Enable IR."); | 74 | MODULE_PARM_DESC(enable_ir, "Enable IR."); |
74 | module_param_array(subsystem, uint, NULL, 0444); | 75 | module_param_array(subsystem, uint, NULL, 0444); |
75 | MODULE_PARM_DESC(subsystem, "Force card subsystem model."); | 76 | MODULE_PARM_DESC(subsystem, "Force card subsystem model."); |
77 | module_param_array(delay_pcm_irq, uint, NULL, 0444); | ||
78 | MODULE_PARM_DESC(delay_pcm_irq, "Delay PCM interrupt by specified number of samples (default 0)."); | ||
76 | /* | 79 | /* |
77 | * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400 | 80 | * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400 |
78 | */ | 81 | */ |
@@ -127,6 +130,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci, | |||
127 | &emu)) < 0) | 130 | &emu)) < 0) |
128 | goto error; | 131 | goto error; |
129 | card->private_data = emu; | 132 | card->private_data = emu; |
133 | emu->delay_pcm_irq = delay_pcm_irq[dev] & 0x1f; | ||
130 | if ((err = snd_emu10k1_pcm(emu, 0, NULL)) < 0) | 134 | if ((err = snd_emu10k1_pcm(emu, 0, NULL)) < 0) |
131 | goto error; | 135 | goto error; |
132 | if ((err = snd_emu10k1_pcm_mic(emu, 1, NULL)) < 0) | 136 | if ((err = snd_emu10k1_pcm_mic(emu, 1, NULL)) < 0) |
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c index 55b83ef73c63..622bace148e3 100644 --- a/sound/pci/emu10k1/emupcm.c +++ b/sound/pci/emu10k1/emupcm.c | |||
@@ -332,7 +332,7 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu, | |||
332 | evoice->epcm->ccca_start_addr = start_addr + ccis; | 332 | evoice->epcm->ccca_start_addr = start_addr + ccis; |
333 | if (extra) { | 333 | if (extra) { |
334 | start_addr += ccis; | 334 | start_addr += ccis; |
335 | end_addr += ccis; | 335 | end_addr += ccis + emu->delay_pcm_irq; |
336 | } | 336 | } |
337 | if (stereo && !extra) { | 337 | if (stereo && !extra) { |
338 | snd_emu10k1_ptr_write(emu, CPF, voice, CPF_STEREO_MASK); | 338 | snd_emu10k1_ptr_write(emu, CPF, voice, CPF_STEREO_MASK); |
@@ -360,7 +360,9 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu, | |||
360 | /* Assumption that PT is already 0 so no harm overwriting */ | 360 | /* Assumption that PT is already 0 so no harm overwriting */ |
361 | snd_emu10k1_ptr_write(emu, PTRX, voice, (send_amount[0] << 8) | send_amount[1]); | 361 | snd_emu10k1_ptr_write(emu, PTRX, voice, (send_amount[0] << 8) | send_amount[1]); |
362 | snd_emu10k1_ptr_write(emu, DSL, voice, end_addr | (send_amount[3] << 24)); | 362 | snd_emu10k1_ptr_write(emu, DSL, voice, end_addr | (send_amount[3] << 24)); |
363 | snd_emu10k1_ptr_write(emu, PSST, voice, start_addr | (send_amount[2] << 24)); | 363 | snd_emu10k1_ptr_write(emu, PSST, voice, |
364 | (start_addr + (extra ? emu->delay_pcm_irq : 0)) | | ||
365 | (send_amount[2] << 24)); | ||
364 | if (emu->card_capabilities->emu_model) | 366 | if (emu->card_capabilities->emu_model) |
365 | pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */ | 367 | pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */ |
366 | else | 368 | else |
@@ -732,6 +734,23 @@ static void snd_emu10k1_playback_stop_voice(struct snd_emu10k1 *emu, struct snd_ | |||
732 | snd_emu10k1_ptr_write(emu, IP, voice, 0); | 734 | snd_emu10k1_ptr_write(emu, IP, voice, 0); |
733 | } | 735 | } |
734 | 736 | ||
737 | static inline void snd_emu10k1_playback_mangle_extra(struct snd_emu10k1 *emu, | ||
738 | struct snd_emu10k1_pcm *epcm, | ||
739 | struct snd_pcm_substream *substream, | ||
740 | struct snd_pcm_runtime *runtime) | ||
741 | { | ||
742 | unsigned int ptr, period_pos; | ||
743 | |||
744 | /* try to sychronize the current position for the interrupt | ||
745 | source voice */ | ||
746 | period_pos = runtime->status->hw_ptr - runtime->hw_ptr_interrupt; | ||
747 | period_pos %= runtime->period_size; | ||
748 | ptr = snd_emu10k1_ptr_read(emu, CCCA, epcm->extra->number); | ||
749 | ptr &= ~0x00ffffff; | ||
750 | ptr |= epcm->ccca_start_addr + period_pos; | ||
751 | snd_emu10k1_ptr_write(emu, CCCA, epcm->extra->number, ptr); | ||
752 | } | ||
753 | |||
735 | static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream, | 754 | static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream, |
736 | int cmd) | 755 | int cmd) |
737 | { | 756 | { |
@@ -753,6 +772,8 @@ static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream, | |||
753 | /* follow thru */ | 772 | /* follow thru */ |
754 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 773 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
755 | case SNDRV_PCM_TRIGGER_RESUME: | 774 | case SNDRV_PCM_TRIGGER_RESUME: |
775 | if (cmd == SNDRV_PCM_TRIGGER_PAUSE_RELEASE) | ||
776 | snd_emu10k1_playback_mangle_extra(emu, epcm, substream, runtime); | ||
756 | mix = &emu->pcm_mixer[substream->number]; | 777 | mix = &emu->pcm_mixer[substream->number]; |
757 | snd_emu10k1_playback_prepare_voice(emu, epcm->voices[0], 1, 0, mix); | 778 | snd_emu10k1_playback_prepare_voice(emu, epcm->voices[0], 1, 0, mix); |
758 | snd_emu10k1_playback_prepare_voice(emu, epcm->voices[1], 0, 0, mix); | 779 | snd_emu10k1_playback_prepare_voice(emu, epcm->voices[1], 0, 0, mix); |
@@ -869,8 +890,9 @@ static snd_pcm_uframes_t snd_emu10k1_playback_pointer(struct snd_pcm_substream * | |||
869 | #endif | 890 | #endif |
870 | /* | 891 | /* |
871 | printk(KERN_DEBUG | 892 | printk(KERN_DEBUG |
872 | "ptr = 0x%x, buffer_size = 0x%x, period_size = 0x%x\n", | 893 | "ptr = 0x%lx, buffer_size = 0x%lx, period_size = 0x%lx\n", |
873 | ptr, runtime->buffer_size, runtime->period_size); | 894 | (long)ptr, (long)runtime->buffer_size, |
895 | (long)runtime->period_size); | ||
874 | */ | 896 | */ |
875 | return ptr; | 897 | return ptr; |
876 | } | 898 | } |
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c index ffb1ddb8dc28..957a311514c8 100644 --- a/sound/pci/emu10k1/memory.c +++ b/sound/pci/emu10k1/memory.c | |||
@@ -310,8 +310,10 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst | |||
310 | if (snd_BUG_ON(!hdr)) | 310 | if (snd_BUG_ON(!hdr)) |
311 | return NULL; | 311 | return NULL; |
312 | 312 | ||
313 | idx = runtime->period_size >= runtime->buffer_size ? | ||
314 | (emu->delay_pcm_irq * 2) : 0; | ||
313 | mutex_lock(&hdr->block_mutex); | 315 | mutex_lock(&hdr->block_mutex); |
314 | blk = search_empty(emu, runtime->dma_bytes); | 316 | blk = search_empty(emu, runtime->dma_bytes + idx); |
315 | if (blk == NULL) { | 317 | if (blk == NULL) { |
316 | mutex_unlock(&hdr->block_mutex); | 318 | mutex_unlock(&hdr->block_mutex); |
317 | return NULL; | 319 | return NULL; |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 720a81d711e3..dd8fb86c842b 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1261,12 +1261,17 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, | |||
1261 | } | 1261 | } |
1262 | EXPORT_SYMBOL_HDA(snd_hda_codec_setup_stream); | 1262 | EXPORT_SYMBOL_HDA(snd_hda_codec_setup_stream); |
1263 | 1263 | ||
1264 | static void really_cleanup_stream(struct hda_codec *codec, | ||
1265 | struct hda_cvt_setup *q); | ||
1266 | |||
1264 | /** | 1267 | /** |
1265 | * snd_hda_codec_cleanup_stream - clean up the codec for closing | 1268 | * __snd_hda_codec_cleanup_stream - clean up the codec for closing |
1266 | * @codec: the CODEC to clean up | 1269 | * @codec: the CODEC to clean up |
1267 | * @nid: the NID to clean up | 1270 | * @nid: the NID to clean up |
1271 | * @do_now: really clean up the stream instead of clearing the active flag | ||
1268 | */ | 1272 | */ |
1269 | void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) | 1273 | void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid, |
1274 | int do_now) | ||
1270 | { | 1275 | { |
1271 | struct hda_cvt_setup *p; | 1276 | struct hda_cvt_setup *p; |
1272 | 1277 | ||
@@ -1274,14 +1279,19 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) | |||
1274 | return; | 1279 | return; |
1275 | 1280 | ||
1276 | snd_printdd("hda_codec_cleanup_stream: NID=0x%x\n", nid); | 1281 | snd_printdd("hda_codec_cleanup_stream: NID=0x%x\n", nid); |
1277 | /* here we just clear the active flag; actual clean-ups will be done | ||
1278 | * in purify_inactive_streams() | ||
1279 | */ | ||
1280 | p = get_hda_cvt_setup(codec, nid); | 1282 | p = get_hda_cvt_setup(codec, nid); |
1281 | if (p) | 1283 | if (p) { |
1282 | p->active = 0; | 1284 | /* here we just clear the active flag when do_now isn't set; |
1285 | * actual clean-ups will be done later in | ||
1286 | * purify_inactive_streams() called from snd_hda_codec_prpapre() | ||
1287 | */ | ||
1288 | if (do_now) | ||
1289 | really_cleanup_stream(codec, p); | ||
1290 | else | ||
1291 | p->active = 0; | ||
1292 | } | ||
1283 | } | 1293 | } |
1284 | EXPORT_SYMBOL_HDA(snd_hda_codec_cleanup_stream); | 1294 | EXPORT_SYMBOL_HDA(__snd_hda_codec_cleanup_stream); |
1285 | 1295 | ||
1286 | static void really_cleanup_stream(struct hda_codec *codec, | 1296 | static void really_cleanup_stream(struct hda_codec *codec, |
1287 | struct hda_cvt_setup *q) | 1297 | struct hda_cvt_setup *q) |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 3f7a479881e5..4303353feda9 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -963,7 +963,10 @@ void snd_hda_codec_cleanup(struct hda_codec *codec, | |||
963 | void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, | 963 | void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, |
964 | u32 stream_tag, | 964 | u32 stream_tag, |
965 | int channel_id, int format); | 965 | int channel_id, int format); |
966 | void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid); | 966 | void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid, |
967 | int do_now); | ||
968 | #define snd_hda_codec_cleanup_stream(codec, nid) \ | ||
969 | __snd_hda_codec_cleanup_stream(codec, nid, 0) | ||
967 | unsigned int snd_hda_calc_stream_format(unsigned int rate, | 970 | unsigned int snd_hda_calc_stream_format(unsigned int rate, |
968 | unsigned int channels, | 971 | unsigned int channels, |
969 | unsigned int format, | 972 | unsigned int format, |
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index d8da18a9e98b..803b298f7411 100644 --- a/sound/pci/hda/hda_eld.c +++ b/sound/pci/hda/hda_eld.c | |||
@@ -596,4 +596,53 @@ void snd_hda_eld_proc_free(struct hda_codec *codec, struct hdmi_eld *eld) | |||
596 | } | 596 | } |
597 | EXPORT_SYMBOL_HDA(snd_hda_eld_proc_free); | 597 | EXPORT_SYMBOL_HDA(snd_hda_eld_proc_free); |
598 | 598 | ||
599 | /* update PCM info based on ELD */ | ||
600 | void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm, | ||
601 | struct hda_pcm_stream *codec_pars) | ||
602 | { | ||
603 | int i; | ||
604 | |||
605 | pcm->rates = 0; | ||
606 | pcm->formats = 0; | ||
607 | pcm->maxbps = 0; | ||
608 | pcm->channels_min = -1; | ||
609 | pcm->channels_max = 0; | ||
610 | for (i = 0; i < eld->sad_count; i++) { | ||
611 | struct cea_sad *a = &eld->sad[i]; | ||
612 | pcm->rates |= a->rates; | ||
613 | if (a->channels < pcm->channels_min) | ||
614 | pcm->channels_min = a->channels; | ||
615 | if (a->channels > pcm->channels_max) | ||
616 | pcm->channels_max = a->channels; | ||
617 | if (a->format == AUDIO_CODING_TYPE_LPCM) { | ||
618 | if (a->sample_bits & AC_SUPPCM_BITS_16) { | ||
619 | pcm->formats |= SNDRV_PCM_FMTBIT_S16_LE; | ||
620 | if (pcm->maxbps < 16) | ||
621 | pcm->maxbps = 16; | ||
622 | } | ||
623 | if (a->sample_bits & AC_SUPPCM_BITS_20) { | ||
624 | pcm->formats |= SNDRV_PCM_FMTBIT_S32_LE; | ||
625 | if (pcm->maxbps < 20) | ||
626 | pcm->maxbps = 20; | ||
627 | } | ||
628 | if (a->sample_bits & AC_SUPPCM_BITS_24) { | ||
629 | pcm->formats |= SNDRV_PCM_FMTBIT_S32_LE; | ||
630 | if (pcm->maxbps < 24) | ||
631 | pcm->maxbps = 24; | ||
632 | } | ||
633 | } | ||
634 | } | ||
635 | |||
636 | if (!codec_pars) | ||
637 | return; | ||
638 | |||
639 | /* restrict the parameters by the values the codec provides */ | ||
640 | pcm->rates &= codec_pars->rates; | ||
641 | pcm->formats &= codec_pars->formats; | ||
642 | pcm->channels_min = max(pcm->channels_min, codec_pars->channels_min); | ||
643 | pcm->channels_max = min(pcm->channels_max, codec_pars->channels_max); | ||
644 | pcm->maxbps = min(pcm->maxbps, codec_pars->maxbps); | ||
645 | } | ||
646 | EXPORT_SYMBOL_HDA(hdmi_eld_update_pcm_info); | ||
647 | |||
599 | #endif /* CONFIG_PROC_FS */ | 648 | #endif /* CONFIG_PROC_FS */ |
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 7a97f126f6f7..28ab4aead48f 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -604,6 +604,8 @@ struct hdmi_eld { | |||
604 | int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid); | 604 | int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid); |
605 | int snd_hdmi_get_eld(struct hdmi_eld *, struct hda_codec *, hda_nid_t); | 605 | int snd_hdmi_get_eld(struct hdmi_eld *, struct hda_codec *, hda_nid_t); |
606 | void snd_hdmi_show_eld(struct hdmi_eld *eld); | 606 | void snd_hdmi_show_eld(struct hdmi_eld *eld); |
607 | void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm, | ||
608 | struct hda_pcm_stream *codec_pars); | ||
607 | 609 | ||
608 | #ifdef CONFIG_PROC_FS | 610 | #ifdef CONFIG_PROC_FS |
609 | int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld, | 611 | int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld, |
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 350ee8ac4153..4ef5efaaaef1 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
@@ -656,7 +656,7 @@ static int change_cur_input(struct hda_codec *codec, unsigned int idx, | |||
656 | return 0; | 656 | return 0; |
657 | if (spec->cur_adc && spec->cur_adc != spec->adc_nid[idx]) { | 657 | if (spec->cur_adc && spec->cur_adc != spec->adc_nid[idx]) { |
658 | /* stream is running, let's swap the current ADC */ | 658 | /* stream is running, let's swap the current ADC */ |
659 | snd_hda_codec_cleanup_stream(codec, spec->cur_adc); | 659 | __snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1); |
660 | spec->cur_adc = spec->adc_nid[idx]; | 660 | spec->cur_adc = spec->adc_nid[idx]; |
661 | snd_hda_codec_setup_stream(codec, spec->cur_adc, | 661 | snd_hda_codec_setup_stream(codec, spec->cur_adc, |
662 | spec->cur_adc_stream_tag, 0, | 662 | spec->cur_adc_stream_tag, 0, |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index f7e234e5ee96..31b5d9eeba68 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -1733,7 +1733,7 @@ static void cxt5051_portc_automic(struct hda_codec *codec) | |||
1733 | new_adc = spec->adc_nids[spec->cur_adc_idx]; | 1733 | new_adc = spec->adc_nids[spec->cur_adc_idx]; |
1734 | if (spec->cur_adc && spec->cur_adc != new_adc) { | 1734 | if (spec->cur_adc && spec->cur_adc != new_adc) { |
1735 | /* stream is running, let's swap the current ADC */ | 1735 | /* stream is running, let's swap the current ADC */ |
1736 | snd_hda_codec_cleanup_stream(codec, spec->cur_adc); | 1736 | __snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1); |
1737 | spec->cur_adc = new_adc; | 1737 | spec->cur_adc = new_adc; |
1738 | snd_hda_codec_setup_stream(codec, new_adc, | 1738 | snd_hda_codec_setup_stream(codec, new_adc, |
1739 | spec->cur_adc_stream_tag, 0, | 1739 | spec->cur_adc_stream_tag, 0, |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 522e0748ee99..2bc0f07cf33f 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -46,6 +46,7 @@ struct hdmi_spec { | |||
46 | * export one pcm per pipe | 46 | * export one pcm per pipe |
47 | */ | 47 | */ |
48 | struct hda_pcm pcm_rec[MAX_HDMI_CVTS]; | 48 | struct hda_pcm pcm_rec[MAX_HDMI_CVTS]; |
49 | struct hda_pcm_stream codec_pcm_pars[MAX_HDMI_CVTS]; | ||
49 | 50 | ||
50 | /* | 51 | /* |
51 | * nvhdmi specific | 52 | * nvhdmi specific |
@@ -766,6 +767,47 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid, | |||
766 | } | 767 | } |
767 | 768 | ||
768 | /* | 769 | /* |
770 | * HDA PCM callbacks | ||
771 | */ | ||
772 | static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, | ||
773 | struct hda_codec *codec, | ||
774 | struct snd_pcm_substream *substream) | ||
775 | { | ||
776 | struct hdmi_spec *spec = codec->spec; | ||
777 | struct hdmi_eld *eld; | ||
778 | struct hda_pcm_stream *codec_pars; | ||
779 | unsigned int idx; | ||
780 | |||
781 | for (idx = 0; idx < spec->num_cvts; idx++) | ||
782 | if (hinfo->nid == spec->cvt[idx]) | ||
783 | break; | ||
784 | if (snd_BUG_ON(idx >= spec->num_cvts) || | ||
785 | snd_BUG_ON(idx >= spec->num_pins)) | ||
786 | return -EINVAL; | ||
787 | |||
788 | /* save the PCM info the codec provides */ | ||
789 | codec_pars = &spec->codec_pcm_pars[idx]; | ||
790 | if (!codec_pars->rates) | ||
791 | *codec_pars = *hinfo; | ||
792 | |||
793 | eld = &spec->sink_eld[idx]; | ||
794 | if (eld->sad_count > 0) { | ||
795 | hdmi_eld_update_pcm_info(eld, hinfo, codec_pars); | ||
796 | if (hinfo->channels_min > hinfo->channels_max || | ||
797 | !hinfo->rates || !hinfo->formats) | ||
798 | return -ENODEV; | ||
799 | } else { | ||
800 | /* fallback to the codec default */ | ||
801 | hinfo->channels_min = codec_pars->channels_min; | ||
802 | hinfo->channels_max = codec_pars->channels_max; | ||
803 | hinfo->rates = codec_pars->rates; | ||
804 | hinfo->formats = codec_pars->formats; | ||
805 | hinfo->maxbps = codec_pars->maxbps; | ||
806 | } | ||
807 | return 0; | ||
808 | } | ||
809 | |||
810 | /* | ||
769 | * HDA/HDMI auto parsing | 811 | * HDA/HDMI auto parsing |
770 | */ | 812 | */ |
771 | 813 | ||
diff --git a/sound/pci/hda/patch_intelhdmi.c b/sound/pci/hda/patch_intelhdmi.c index 5972d5e7d01f..d382d3c81c0f 100644 --- a/sound/pci/hda/patch_intelhdmi.c +++ b/sound/pci/hda/patch_intelhdmi.c | |||
@@ -80,6 +80,7 @@ static struct hda_pcm_stream intel_hdmi_pcm_playback = { | |||
80 | .substreams = 1, | 80 | .substreams = 1, |
81 | .channels_min = 2, | 81 | .channels_min = 2, |
82 | .ops = { | 82 | .ops = { |
83 | .open = hdmi_pcm_open, | ||
83 | .prepare = intel_hdmi_playback_pcm_prepare, | 84 | .prepare = intel_hdmi_playback_pcm_prepare, |
84 | .cleanup = intel_hdmi_playback_pcm_cleanup, | 85 | .cleanup = intel_hdmi_playback_pcm_cleanup, |
85 | }, | 86 | }, |
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c index 77e2b4028b9f..f636870dc718 100644 --- a/sound/pci/hda/patch_nvhdmi.c +++ b/sound/pci/hda/patch_nvhdmi.c | |||
@@ -347,10 +347,8 @@ static int nvhdmi_dig_playback_pcm_prepare_2ch(struct hda_pcm_stream *hinfo, | |||
347 | static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_89 = { | 347 | static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_89 = { |
348 | .substreams = 1, | 348 | .substreams = 1, |
349 | .channels_min = 2, | 349 | .channels_min = 2, |
350 | .rates = SUPPORTED_RATES, | ||
351 | .maxbps = SUPPORTED_MAXBPS, | ||
352 | .formats = SUPPORTED_FORMATS, | ||
353 | .ops = { | 350 | .ops = { |
351 | .open = hdmi_pcm_open, | ||
354 | .prepare = nvhdmi_dig_playback_pcm_prepare_8ch_89, | 352 | .prepare = nvhdmi_dig_playback_pcm_prepare_8ch_89, |
355 | .cleanup = nvhdmi_playback_pcm_cleanup, | 353 | .cleanup = nvhdmi_playback_pcm_cleanup, |
356 | }, | 354 | }, |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 55d6e5b6bb7d..2cd1ae809e46 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1037,7 +1037,7 @@ static void alc_dual_mic_adc_auto_switch(struct hda_codec *codec) | |||
1037 | new_adc = spec->adc_nids[spec->cur_adc_idx]; | 1037 | new_adc = spec->adc_nids[spec->cur_adc_idx]; |
1038 | if (spec->cur_adc && spec->cur_adc != new_adc) { | 1038 | if (spec->cur_adc && spec->cur_adc != new_adc) { |
1039 | /* stream is running, let's swap the current ADC */ | 1039 | /* stream is running, let's swap the current ADC */ |
1040 | snd_hda_codec_cleanup_stream(codec, spec->cur_adc); | 1040 | __snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1); |
1041 | spec->cur_adc = new_adc; | 1041 | spec->cur_adc = new_adc; |
1042 | snd_hda_codec_setup_stream(codec, new_adc, | 1042 | snd_hda_codec_setup_stream(codec, new_adc, |
1043 | spec->cur_adc_stream_tag, 0, | 1043 | spec->cur_adc_stream_tag, 0, |
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index f64fb7d988cb..ad5202efd7a9 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c | |||
@@ -1224,15 +1224,14 @@ static int try_to_load_firmware(struct cmdif *cif, struct snd_riptide *chip) | |||
1224 | firmware.firmware.ASIC, firmware.firmware.CODEC, | 1224 | firmware.firmware.ASIC, firmware.firmware.CODEC, |
1225 | firmware.firmware.AUXDSP, firmware.firmware.PROG); | 1225 | firmware.firmware.AUXDSP, firmware.firmware.PROG); |
1226 | 1226 | ||
1227 | if (!chip) | ||
1228 | return 1; | ||
1229 | |||
1227 | for (i = 0; i < FIRMWARE_VERSIONS; i++) { | 1230 | for (i = 0; i < FIRMWARE_VERSIONS; i++) { |
1228 | if (!memcmp(&firmware_versions[i], &firmware, sizeof(firmware))) | 1231 | if (!memcmp(&firmware_versions[i], &firmware, sizeof(firmware))) |
1229 | break; | 1232 | return 1; /* OK */ |
1230 | } | ||
1231 | if (i >= FIRMWARE_VERSIONS) | ||
1232 | return 0; /* no match */ | ||
1233 | 1233 | ||
1234 | if (!chip) | 1234 | } |
1235 | return 1; /* OK */ | ||
1236 | 1235 | ||
1237 | snd_printdd("Writing Firmware\n"); | 1236 | snd_printdd("Writing Firmware\n"); |
1238 | if (!chip->fw_entry) { | 1237 | if (!chip->fw_entry) { |
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index a87046a96f2a..522249d5c2b4 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -95,6 +95,7 @@ struct wm8994_priv { | |||
95 | 95 | ||
96 | struct wm8994_micdet micdet[2]; | 96 | struct wm8994_micdet micdet[2]; |
97 | 97 | ||
98 | int revision; | ||
98 | struct wm8994_pdata *pdata; | 99 | struct wm8994_pdata *pdata; |
99 | }; | 100 | }; |
100 | 101 | ||
@@ -3070,6 +3071,8 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai, | |||
3070 | static int wm8994_set_bias_level(struct snd_soc_codec *codec, | 3071 | static int wm8994_set_bias_level(struct snd_soc_codec *codec, |
3071 | enum snd_soc_bias_level level) | 3072 | enum snd_soc_bias_level level) |
3072 | { | 3073 | { |
3074 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
3075 | |||
3073 | switch (level) { | 3076 | switch (level) { |
3074 | case SND_SOC_BIAS_ON: | 3077 | case SND_SOC_BIAS_ON: |
3075 | break; | 3078 | break; |
@@ -3082,11 +3085,16 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec, | |||
3082 | 3085 | ||
3083 | case SND_SOC_BIAS_STANDBY: | 3086 | case SND_SOC_BIAS_STANDBY: |
3084 | if (codec->bias_level == SND_SOC_BIAS_OFF) { | 3087 | if (codec->bias_level == SND_SOC_BIAS_OFF) { |
3085 | /* Tweak DC servo configuration for improved | 3088 | /* Tweak DC servo and DSP configuration for |
3086 | * performance. */ | 3089 | * improved performance. */ |
3087 | snd_soc_write(codec, 0x102, 0x3); | 3090 | if (wm8994->revision < 4) { |
3088 | snd_soc_write(codec, 0x56, 0x3); | 3091 | /* Tweak DC servo and DSP configuration for |
3089 | snd_soc_write(codec, 0x102, 0); | 3092 | * improved performance. */ |
3093 | snd_soc_write(codec, 0x102, 0x3); | ||
3094 | snd_soc_write(codec, 0x56, 0x3); | ||
3095 | snd_soc_write(codec, 0x817, 0); | ||
3096 | snd_soc_write(codec, 0x102, 0); | ||
3097 | } | ||
3090 | 3098 | ||
3091 | /* Discharge LINEOUT1 & 2 */ | 3099 | /* Discharge LINEOUT1 & 2 */ |
3092 | snd_soc_update_bits(codec, WM8994_ANTIPOP_1, | 3100 | snd_soc_update_bits(codec, WM8994_ANTIPOP_1, |
@@ -3919,7 +3927,6 @@ static int wm8994_codec_probe(struct platform_device *pdev) | |||
3919 | struct wm8994_priv *wm8994; | 3927 | struct wm8994_priv *wm8994; |
3920 | struct snd_soc_codec *codec; | 3928 | struct snd_soc_codec *codec; |
3921 | int i; | 3929 | int i; |
3922 | u16 rev; | ||
3923 | 3930 | ||
3924 | if (wm8994_codec) { | 3931 | if (wm8994_codec) { |
3925 | dev_err(&pdev->dev, "Another WM8994 is registered\n"); | 3932 | dev_err(&pdev->dev, "Another WM8994 is registered\n"); |
@@ -3973,8 +3980,8 @@ static int wm8994_codec_probe(struct platform_device *pdev) | |||
3973 | wm8994->reg_cache[i] = 0; | 3980 | wm8994->reg_cache[i] = 0; |
3974 | 3981 | ||
3975 | /* Set revision-specific configuration */ | 3982 | /* Set revision-specific configuration */ |
3976 | rev = snd_soc_read(codec, WM8994_CHIP_REVISION); | 3983 | wm8994->revision = snd_soc_read(codec, WM8994_CHIP_REVISION); |
3977 | switch (rev) { | 3984 | switch (wm8994->revision) { |
3978 | case 2: | 3985 | case 2: |
3979 | case 3: | 3986 | case 3: |
3980 | wm8994->hubs.dcs_codes = -5; | 3987 | wm8994->hubs.dcs_codes = -5; |
diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index 1d4e7164e80a..3dcd1469f283 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c | |||
@@ -369,7 +369,7 @@ struct snd_soc_platform mpc5200_audio_dma_platform = { | |||
369 | }; | 369 | }; |
370 | EXPORT_SYMBOL_GPL(mpc5200_audio_dma_platform); | 370 | EXPORT_SYMBOL_GPL(mpc5200_audio_dma_platform); |
371 | 371 | ||
372 | int mpc5200_audio_dma_create(struct of_device *op) | 372 | int mpc5200_audio_dma_create(struct platform_device *op) |
373 | { | 373 | { |
374 | phys_addr_t fifo; | 374 | phys_addr_t fifo; |
375 | struct psc_dma *psc_dma; | 375 | struct psc_dma *psc_dma; |
@@ -488,7 +488,7 @@ out_unmap: | |||
488 | } | 488 | } |
489 | EXPORT_SYMBOL_GPL(mpc5200_audio_dma_create); | 489 | EXPORT_SYMBOL_GPL(mpc5200_audio_dma_create); |
490 | 490 | ||
491 | int mpc5200_audio_dma_destroy(struct of_device *op) | 491 | int mpc5200_audio_dma_destroy(struct platform_device *op) |
492 | { | 492 | { |
493 | struct psc_dma *psc_dma = dev_get_drvdata(&op->dev); | 493 | struct psc_dma *psc_dma = dev_get_drvdata(&op->dev); |
494 | 494 | ||
diff --git a/sound/soc/fsl/mpc5200_dma.h b/sound/soc/fsl/mpc5200_dma.h index e1ec6d91ea38..ca99586f2ad9 100644 --- a/sound/soc/fsl/mpc5200_dma.h +++ b/sound/soc/fsl/mpc5200_dma.h | |||
@@ -81,8 +81,8 @@ to_psc_dma_stream(struct snd_pcm_substream *substream, struct psc_dma *psc_dma) | |||
81 | return &psc_dma->playback; | 81 | return &psc_dma->playback; |
82 | } | 82 | } |
83 | 83 | ||
84 | int mpc5200_audio_dma_create(struct of_device *op); | 84 | int mpc5200_audio_dma_create(struct platform_device *op); |
85 | int mpc5200_audio_dma_destroy(struct of_device *op); | 85 | int mpc5200_audio_dma_destroy(struct platform_device *op); |
86 | 86 | ||
87 | extern struct snd_soc_platform mpc5200_audio_dma_platform; | 87 | extern struct snd_soc_platform mpc5200_audio_dma_platform; |
88 | 88 | ||
diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c index e7f5d50ed084..a9560235daee 100644 --- a/sound/soc/fsl/mpc5200_psc_ac97.c +++ b/sound/soc/fsl/mpc5200_psc_ac97.c | |||
@@ -277,7 +277,7 @@ EXPORT_SYMBOL_GPL(psc_ac97_dai); | |||
277 | * - Probe/remove operations | 277 | * - Probe/remove operations |
278 | * - OF device match table | 278 | * - OF device match table |
279 | */ | 279 | */ |
280 | static int __devinit psc_ac97_of_probe(struct of_device *op, | 280 | static int __devinit psc_ac97_of_probe(struct platform_device *op, |
281 | const struct of_device_id *match) | 281 | const struct of_device_id *match) |
282 | { | 282 | { |
283 | int rc, i; | 283 | int rc, i; |
@@ -317,7 +317,7 @@ static int __devinit psc_ac97_of_probe(struct of_device *op, | |||
317 | return 0; | 317 | return 0; |
318 | } | 318 | } |
319 | 319 | ||
320 | static int __devexit psc_ac97_of_remove(struct of_device *op) | 320 | static int __devexit psc_ac97_of_remove(struct platform_device *op) |
321 | { | 321 | { |
322 | return mpc5200_audio_dma_destroy(op); | 322 | return mpc5200_audio_dma_destroy(op); |
323 | } | 323 | } |
diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c index 676841cbae98..534f04cb15d7 100644 --- a/sound/soc/fsl/mpc5200_psc_i2s.c +++ b/sound/soc/fsl/mpc5200_psc_i2s.c | |||
@@ -152,7 +152,7 @@ EXPORT_SYMBOL_GPL(psc_i2s_dai); | |||
152 | * - Probe/remove operations | 152 | * - Probe/remove operations |
153 | * - OF device match table | 153 | * - OF device match table |
154 | */ | 154 | */ |
155 | static int __devinit psc_i2s_of_probe(struct of_device *op, | 155 | static int __devinit psc_i2s_of_probe(struct platform_device *op, |
156 | const struct of_device_id *match) | 156 | const struct of_device_id *match) |
157 | { | 157 | { |
158 | int rc; | 158 | int rc; |
@@ -205,7 +205,7 @@ static int __devinit psc_i2s_of_probe(struct of_device *op, | |||
205 | 205 | ||
206 | } | 206 | } |
207 | 207 | ||
208 | static int __devexit psc_i2s_of_remove(struct of_device *op) | 208 | static int __devexit psc_i2s_of_remove(struct platform_device *op) |
209 | { | 209 | { |
210 | return mpc5200_audio_dma_destroy(op); | 210 | return mpc5200_audio_dma_destroy(op); |
211 | } | 211 | } |
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c index 3a501062c244..3b13b8d65262 100644 --- a/sound/soc/fsl/mpc8610_hpcd.c +++ b/sound/soc/fsl/mpc8610_hpcd.c | |||
@@ -200,7 +200,7 @@ static struct snd_soc_ops mpc8610_hpcd_ops = { | |||
200 | * SSI devices. We also probably aren't compatible with the generic Elo DMA | 200 | * SSI devices. We also probably aren't compatible with the generic Elo DMA |
201 | * device driver. | 201 | * device driver. |
202 | */ | 202 | */ |
203 | static int mpc8610_hpcd_probe(struct of_device *ofdev, | 203 | static int mpc8610_hpcd_probe(struct platform_device *ofdev, |
204 | const struct of_device_id *match) | 204 | const struct of_device_id *match) |
205 | { | 205 | { |
206 | struct device_node *np = ofdev->dev.of_node; | 206 | struct device_node *np = ofdev->dev.of_node; |
@@ -534,7 +534,7 @@ error: | |||
534 | * | 534 | * |
535 | * This function is called when the OF device is removed. | 535 | * This function is called when the OF device is removed. |
536 | */ | 536 | */ |
537 | static int mpc8610_hpcd_remove(struct of_device *ofdev) | 537 | static int mpc8610_hpcd_remove(struct platform_device *ofdev) |
538 | { | 538 | { |
539 | struct platform_device *sound_device = dev_get_drvdata(&ofdev->dev); | 539 | struct platform_device *sound_device = dev_get_drvdata(&ofdev->dev); |
540 | struct mpc8610_hpcd_data *machine_data = | 540 | struct mpc8610_hpcd_data *machine_data = |
diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c index 9eb1a4e0363b..f8bcfc30f800 100644 --- a/sound/sparc/amd7930.c +++ b/sound/sparc/amd7930.c | |||
@@ -336,7 +336,7 @@ struct snd_amd7930 { | |||
336 | int pgain; | 336 | int pgain; |
337 | int mgain; | 337 | int mgain; |
338 | 338 | ||
339 | struct of_device *op; | 339 | struct platform_device *op; |
340 | unsigned int irq; | 340 | unsigned int irq; |
341 | struct snd_amd7930 *next; | 341 | struct snd_amd7930 *next; |
342 | }; | 342 | }; |
@@ -906,7 +906,7 @@ static int __devinit snd_amd7930_mixer(struct snd_amd7930 *amd) | |||
906 | 906 | ||
907 | static int snd_amd7930_free(struct snd_amd7930 *amd) | 907 | static int snd_amd7930_free(struct snd_amd7930 *amd) |
908 | { | 908 | { |
909 | struct of_device *op = amd->op; | 909 | struct platform_device *op = amd->op; |
910 | 910 | ||
911 | amd7930_idle(amd); | 911 | amd7930_idle(amd); |
912 | 912 | ||
@@ -934,7 +934,7 @@ static struct snd_device_ops snd_amd7930_dev_ops = { | |||
934 | }; | 934 | }; |
935 | 935 | ||
936 | static int __devinit snd_amd7930_create(struct snd_card *card, | 936 | static int __devinit snd_amd7930_create(struct snd_card *card, |
937 | struct of_device *op, | 937 | struct platform_device *op, |
938 | int irq, int dev, | 938 | int irq, int dev, |
939 | struct snd_amd7930 **ramd) | 939 | struct snd_amd7930 **ramd) |
940 | { | 940 | { |
@@ -1002,7 +1002,7 @@ static int __devinit snd_amd7930_create(struct snd_card *card, | |||
1002 | return 0; | 1002 | return 0; |
1003 | } | 1003 | } |
1004 | 1004 | ||
1005 | static int __devinit amd7930_sbus_probe(struct of_device *op, const struct of_device_id *match) | 1005 | static int __devinit amd7930_sbus_probe(struct platform_device *op, const struct of_device_id *match) |
1006 | { | 1006 | { |
1007 | struct resource *rp = &op->resource[0]; | 1007 | struct resource *rp = &op->resource[0]; |
1008 | static int dev_num; | 1008 | static int dev_num; |
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index 68570ee2c9bb..c276086c3b57 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c | |||
@@ -111,7 +111,7 @@ struct snd_cs4231 { | |||
111 | struct mutex mce_mutex; /* mutex for mce register */ | 111 | struct mutex mce_mutex; /* mutex for mce register */ |
112 | struct mutex open_mutex; /* mutex for ALSA open/close */ | 112 | struct mutex open_mutex; /* mutex for ALSA open/close */ |
113 | 113 | ||
114 | struct of_device *op; | 114 | struct platform_device *op; |
115 | unsigned int irq[2]; | 115 | unsigned int irq[2]; |
116 | unsigned int regs_size; | 116 | unsigned int regs_size; |
117 | struct snd_cs4231 *next; | 117 | struct snd_cs4231 *next; |
@@ -1771,7 +1771,7 @@ static unsigned int sbus_dma_addr(struct cs4231_dma_control *dma_cont) | |||
1771 | 1771 | ||
1772 | static int snd_cs4231_sbus_free(struct snd_cs4231 *chip) | 1772 | static int snd_cs4231_sbus_free(struct snd_cs4231 *chip) |
1773 | { | 1773 | { |
1774 | struct of_device *op = chip->op; | 1774 | struct platform_device *op = chip->op; |
1775 | 1775 | ||
1776 | if (chip->irq[0]) | 1776 | if (chip->irq[0]) |
1777 | free_irq(chip->irq[0], chip); | 1777 | free_irq(chip->irq[0], chip); |
@@ -1794,7 +1794,7 @@ static struct snd_device_ops snd_cs4231_sbus_dev_ops = { | |||
1794 | }; | 1794 | }; |
1795 | 1795 | ||
1796 | static int __devinit snd_cs4231_sbus_create(struct snd_card *card, | 1796 | static int __devinit snd_cs4231_sbus_create(struct snd_card *card, |
1797 | struct of_device *op, | 1797 | struct platform_device *op, |
1798 | int dev) | 1798 | int dev) |
1799 | { | 1799 | { |
1800 | struct snd_cs4231 *chip = card->private_data; | 1800 | struct snd_cs4231 *chip = card->private_data; |
@@ -1856,7 +1856,7 @@ static int __devinit snd_cs4231_sbus_create(struct snd_card *card, | |||
1856 | return 0; | 1856 | return 0; |
1857 | } | 1857 | } |
1858 | 1858 | ||
1859 | static int __devinit cs4231_sbus_probe(struct of_device *op, const struct of_device_id *match) | 1859 | static int __devinit cs4231_sbus_probe(struct platform_device *op, const struct of_device_id *match) |
1860 | { | 1860 | { |
1861 | struct resource *rp = &op->resource[0]; | 1861 | struct resource *rp = &op->resource[0]; |
1862 | struct snd_card *card; | 1862 | struct snd_card *card; |
@@ -1931,7 +1931,7 @@ static unsigned int _ebus_dma_addr(struct cs4231_dma_control *dma_cont) | |||
1931 | 1931 | ||
1932 | static int snd_cs4231_ebus_free(struct snd_cs4231 *chip) | 1932 | static int snd_cs4231_ebus_free(struct snd_cs4231 *chip) |
1933 | { | 1933 | { |
1934 | struct of_device *op = chip->op; | 1934 | struct platform_device *op = chip->op; |
1935 | 1935 | ||
1936 | if (chip->c_dma.ebus_info.regs) { | 1936 | if (chip->c_dma.ebus_info.regs) { |
1937 | ebus_dma_unregister(&chip->c_dma.ebus_info); | 1937 | ebus_dma_unregister(&chip->c_dma.ebus_info); |
@@ -1960,7 +1960,7 @@ static struct snd_device_ops snd_cs4231_ebus_dev_ops = { | |||
1960 | }; | 1960 | }; |
1961 | 1961 | ||
1962 | static int __devinit snd_cs4231_ebus_create(struct snd_card *card, | 1962 | static int __devinit snd_cs4231_ebus_create(struct snd_card *card, |
1963 | struct of_device *op, | 1963 | struct platform_device *op, |
1964 | int dev) | 1964 | int dev) |
1965 | { | 1965 | { |
1966 | struct snd_cs4231 *chip = card->private_data; | 1966 | struct snd_cs4231 *chip = card->private_data; |
@@ -2048,7 +2048,7 @@ static int __devinit snd_cs4231_ebus_create(struct snd_card *card, | |||
2048 | return 0; | 2048 | return 0; |
2049 | } | 2049 | } |
2050 | 2050 | ||
2051 | static int __devinit cs4231_ebus_probe(struct of_device *op, const struct of_device_id *match) | 2051 | static int __devinit cs4231_ebus_probe(struct platform_device *op, const struct of_device_id *match) |
2052 | { | 2052 | { |
2053 | struct snd_card *card; | 2053 | struct snd_card *card; |
2054 | int err; | 2054 | int err; |
@@ -2072,7 +2072,7 @@ static int __devinit cs4231_ebus_probe(struct of_device *op, const struct of_dev | |||
2072 | } | 2072 | } |
2073 | #endif | 2073 | #endif |
2074 | 2074 | ||
2075 | static int __devinit cs4231_probe(struct of_device *op, const struct of_device_id *match) | 2075 | static int __devinit cs4231_probe(struct platform_device *op, const struct of_device_id *match) |
2076 | { | 2076 | { |
2077 | #ifdef EBUS_SUPPORT | 2077 | #ifdef EBUS_SUPPORT |
2078 | if (!strcmp(op->dev.of_node->parent->name, "ebus")) | 2078 | if (!strcmp(op->dev.of_node->parent->name, "ebus")) |
@@ -2086,7 +2086,7 @@ static int __devinit cs4231_probe(struct of_device *op, const struct of_device_i | |||
2086 | return -ENODEV; | 2086 | return -ENODEV; |
2087 | } | 2087 | } |
2088 | 2088 | ||
2089 | static int __devexit cs4231_remove(struct of_device *op) | 2089 | static int __devexit cs4231_remove(struct platform_device *op) |
2090 | { | 2090 | { |
2091 | struct snd_cs4231 *chip = dev_get_drvdata(&op->dev); | 2091 | struct snd_cs4231 *chip = dev_get_drvdata(&op->dev); |
2092 | 2092 | ||
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index c421901c48d0..39cd5d69d051 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c | |||
@@ -299,7 +299,7 @@ struct dbri_streaminfo { | |||
299 | /* This structure holds the information for both chips (DBRI & CS4215) */ | 299 | /* This structure holds the information for both chips (DBRI & CS4215) */ |
300 | struct snd_dbri { | 300 | struct snd_dbri { |
301 | int regs_size, irq; /* Needed for unload */ | 301 | int regs_size, irq; /* Needed for unload */ |
302 | struct of_device *op; /* OF device info */ | 302 | struct platform_device *op; /* OF device info */ |
303 | spinlock_t lock; | 303 | spinlock_t lock; |
304 | 304 | ||
305 | struct dbri_dma *dma; /* Pointer to our DMA block */ | 305 | struct dbri_dma *dma; /* Pointer to our DMA block */ |
@@ -2523,7 +2523,7 @@ static void __devinit snd_dbri_proc(struct snd_card *card) | |||
2523 | static void snd_dbri_free(struct snd_dbri *dbri); | 2523 | static void snd_dbri_free(struct snd_dbri *dbri); |
2524 | 2524 | ||
2525 | static int __devinit snd_dbri_create(struct snd_card *card, | 2525 | static int __devinit snd_dbri_create(struct snd_card *card, |
2526 | struct of_device *op, | 2526 | struct platform_device *op, |
2527 | int irq, int dev) | 2527 | int irq, int dev) |
2528 | { | 2528 | { |
2529 | struct snd_dbri *dbri = card->private_data; | 2529 | struct snd_dbri *dbri = card->private_data; |
@@ -2592,7 +2592,7 @@ static void snd_dbri_free(struct snd_dbri *dbri) | |||
2592 | (void *)dbri->dma, dbri->dma_dvma); | 2592 | (void *)dbri->dma, dbri->dma_dvma); |
2593 | } | 2593 | } |
2594 | 2594 | ||
2595 | static int __devinit dbri_probe(struct of_device *op, const struct of_device_id *match) | 2595 | static int __devinit dbri_probe(struct platform_device *op, const struct of_device_id *match) |
2596 | { | 2596 | { |
2597 | struct snd_dbri *dbri; | 2597 | struct snd_dbri *dbri; |
2598 | struct resource *rp; | 2598 | struct resource *rp; |
@@ -2662,7 +2662,7 @@ _err: | |||
2662 | return err; | 2662 | return err; |
2663 | } | 2663 | } |
2664 | 2664 | ||
2665 | static int __devexit dbri_remove(struct of_device *op) | 2665 | static int __devexit dbri_remove(struct platform_device *op) |
2666 | { | 2666 | { |
2667 | struct snd_card *card = dev_get_drvdata(&op->dev); | 2667 | struct snd_card *card = dev_get_drvdata(&op->dev); |
2668 | 2668 | ||
diff --git a/sound/usb/format.c b/sound/usb/format.c index 4387f54d73db..3a1375459c06 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c | |||
@@ -392,6 +392,10 @@ static int parse_audio_format_i(struct snd_usb_audio *chip, | |||
392 | /* fp->channels is already set in this case */ | 392 | /* fp->channels is already set in this case */ |
393 | ret = parse_audio_format_rates_v2(chip, fp); | 393 | ret = parse_audio_format_rates_v2(chip, fp); |
394 | break; | 394 | break; |
395 | default: | ||
396 | snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n", | ||
397 | chip->dev->devnum, fp->iface, fp->altsetting, protocol); | ||
398 | return -EINVAL; | ||
395 | } | 399 | } |
396 | 400 | ||
397 | if (fp->channels < 1) { | 401 | if (fp->channels < 1) { |
@@ -452,6 +456,10 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip, | |||
452 | ret = parse_audio_format_rates_v2(chip, fp); | 456 | ret = parse_audio_format_rates_v2(chip, fp); |
453 | break; | 457 | break; |
454 | } | 458 | } |
459 | default: | ||
460 | snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n", | ||
461 | chip->dev->devnum, fp->iface, fp->altsetting, protocol); | ||
462 | return -EINVAL; | ||
455 | } | 463 | } |
456 | 464 | ||
457 | return ret; | 465 | return ret; |