diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 11:32:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 11:32:05 -0400 |
commit | 33081adf8b89d5a716d7e1c60171768d39795b39 (patch) | |
tree | 275de58bbbb5f7ddffcdc087844cfc7fbe4315be /sound/core | |
parent | c55960499f810357a29659b32d6ea594abee9237 (diff) | |
parent | 506ecbca71d07fa327dd986be1682e90885678ee (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (365 commits)
ALSA: hda - Disable sticky PCM stream assignment for AD codecs
ALSA: usb - Creative USB X-Fi volume knob support
ALSA: ca0106: Use card specific dac id for mute controls.
ALSA: ca0106: Allow different sound cards to use different SPI channel mappings.
ALSA: ca0106: Create a nice spot for mapping channels to dacs.
ALSA: ca0106: Move enabling of front dac out of hardcoded setup sequence.
ALSA: ca0106: Pull out dac powering routine into separate function.
ALSA: ca0106 - add Sound Blaster 5.1vx info.
ASoC: tlv320dac33: Use usleep_range for delays
ALSA: usb-audio: add Novation Launchpad support
ALSA: hda - Add workarounds for CT-IBG controllers
ALSA: hda - Fix wrong TLV mute bit for STAC/IDT codecs
ASoC: tpa6130a2: Error handling for broken chip
ASoC: max98088: Staticise m98088_eq_band
ASoC: soc-core: Fix codec->name memory leak
ALSA: hda - Apply ideapad quirk to Acer laptops with Cxt5066
ALSA: hda - Add some workarounds for Creative IBG
ALSA: hda - Fix wrong SPDIF NID assignment for CA0110
ALSA: hda - Fix codec rename rules for ALC662-compatible codecs
ALSA: hda - Add alc_init_jacks() call to other codecs
...
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/init.c | 9 | ||||
-rw-r--r-- | sound/core/oss/mixer_oss.c | 34 | ||||
-rw-r--r-- | sound/core/pcm.c | 3 | ||||
-rw-r--r-- | sound/core/pcm_lib.c | 14 | ||||
-rw-r--r-- | sound/core/pcm_native.c | 4 |
5 files changed, 39 insertions, 25 deletions
diff --git a/sound/core/init.c b/sound/core/init.c index f7c3df8b521b..57b792e2439a 100644 --- a/sound/core/init.c +++ b/sound/core/init.c | |||
@@ -604,11 +604,16 @@ card_id_store_attr(struct device *dev, struct device_attribute *attr, | |||
604 | return -EEXIST; | 604 | return -EEXIST; |
605 | } | 605 | } |
606 | for (idx = 0; idx < snd_ecards_limit; idx++) { | 606 | for (idx = 0; idx < snd_ecards_limit; idx++) { |
607 | if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1)) | 607 | if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1)) { |
608 | goto __exist; | 608 | if (card == snd_cards[idx]) |
609 | goto __ok; | ||
610 | else | ||
611 | goto __exist; | ||
612 | } | ||
609 | } | 613 | } |
610 | strcpy(card->id, buf1); | 614 | strcpy(card->id, buf1); |
611 | snd_info_card_id_change(card); | 615 | snd_info_card_id_change(card); |
616 | __ok: | ||
612 | mutex_unlock(&snd_card_mutex); | 617 | mutex_unlock(&snd_card_mutex); |
613 | 618 | ||
614 | return count; | 619 | return count; |
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index f50ebf20df96..822dd56993ca 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c | |||
@@ -77,7 +77,7 @@ static int snd_mixer_oss_release(struct inode *inode, struct file *file) | |||
77 | struct snd_mixer_oss_file *fmixer; | 77 | struct snd_mixer_oss_file *fmixer; |
78 | 78 | ||
79 | if (file->private_data) { | 79 | if (file->private_data) { |
80 | fmixer = (struct snd_mixer_oss_file *) file->private_data; | 80 | fmixer = file->private_data; |
81 | module_put(fmixer->card->module); | 81 | module_put(fmixer->card->module); |
82 | snd_card_file_remove(fmixer->card, file); | 82 | snd_card_file_remove(fmixer->card, file); |
83 | kfree(fmixer); | 83 | kfree(fmixer); |
@@ -368,7 +368,7 @@ static int snd_mixer_oss_ioctl1(struct snd_mixer_oss_file *fmixer, unsigned int | |||
368 | 368 | ||
369 | static long snd_mixer_oss_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 369 | static long snd_mixer_oss_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
370 | { | 370 | { |
371 | return snd_mixer_oss_ioctl1((struct snd_mixer_oss_file *) file->private_data, cmd, arg); | 371 | return snd_mixer_oss_ioctl1(file->private_data, cmd, arg); |
372 | } | 372 | } |
373 | 373 | ||
374 | int snd_mixer_oss_ioctl_card(struct snd_card *card, unsigned int cmd, unsigned long arg) | 374 | int snd_mixer_oss_ioctl_card(struct snd_card *card, unsigned int cmd, unsigned long arg) |
@@ -582,7 +582,7 @@ static int snd_mixer_oss_get_volume1(struct snd_mixer_oss_file *fmixer, | |||
582 | struct snd_mixer_oss_slot *pslot, | 582 | struct snd_mixer_oss_slot *pslot, |
583 | int *left, int *right) | 583 | int *left, int *right) |
584 | { | 584 | { |
585 | struct slot *slot = (struct slot *)pslot->private_data; | 585 | struct slot *slot = pslot->private_data; |
586 | 586 | ||
587 | *left = *right = 100; | 587 | *left = *right = 100; |
588 | if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) { | 588 | if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) { |
@@ -618,8 +618,10 @@ static void snd_mixer_oss_put_volume1_vol(struct snd_mixer_oss_file *fmixer, | |||
618 | if (numid == ID_UNKNOWN) | 618 | if (numid == ID_UNKNOWN) |
619 | return; | 619 | return; |
620 | down_read(&card->controls_rwsem); | 620 | down_read(&card->controls_rwsem); |
621 | if ((kctl = snd_ctl_find_numid(card, numid)) == NULL) | 621 | if ((kctl = snd_ctl_find_numid(card, numid)) == NULL) { |
622 | up_read(&card->controls_rwsem); | ||
622 | return; | 623 | return; |
624 | } | ||
623 | uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL); | 625 | uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL); |
624 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); | 626 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
625 | if (uinfo == NULL || uctl == NULL) | 627 | if (uinfo == NULL || uctl == NULL) |
@@ -658,7 +660,7 @@ static void snd_mixer_oss_put_volume1_sw(struct snd_mixer_oss_file *fmixer, | |||
658 | return; | 660 | return; |
659 | down_read(&card->controls_rwsem); | 661 | down_read(&card->controls_rwsem); |
660 | if ((kctl = snd_ctl_find_numid(card, numid)) == NULL) { | 662 | if ((kctl = snd_ctl_find_numid(card, numid)) == NULL) { |
661 | up_read(&fmixer->card->controls_rwsem); | 663 | up_read(&card->controls_rwsem); |
662 | return; | 664 | return; |
663 | } | 665 | } |
664 | uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL); | 666 | uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL); |
@@ -691,7 +693,7 @@ static int snd_mixer_oss_put_volume1(struct snd_mixer_oss_file *fmixer, | |||
691 | struct snd_mixer_oss_slot *pslot, | 693 | struct snd_mixer_oss_slot *pslot, |
692 | int left, int right) | 694 | int left, int right) |
693 | { | 695 | { |
694 | struct slot *slot = (struct slot *)pslot->private_data; | 696 | struct slot *slot = pslot->private_data; |
695 | 697 | ||
696 | if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) { | 698 | if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) { |
697 | snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right); | 699 | snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right); |
@@ -740,7 +742,7 @@ static int snd_mixer_oss_get_recsrc1_sw(struct snd_mixer_oss_file *fmixer, | |||
740 | struct snd_mixer_oss_slot *pslot, | 742 | struct snd_mixer_oss_slot *pslot, |
741 | int *active) | 743 | int *active) |
742 | { | 744 | { |
743 | struct slot *slot = (struct slot *)pslot->private_data; | 745 | struct slot *slot = pslot->private_data; |
744 | int left, right; | 746 | int left, right; |
745 | 747 | ||
746 | left = right = 1; | 748 | left = right = 1; |
@@ -753,7 +755,7 @@ static int snd_mixer_oss_get_recsrc1_route(struct snd_mixer_oss_file *fmixer, | |||
753 | struct snd_mixer_oss_slot *pslot, | 755 | struct snd_mixer_oss_slot *pslot, |
754 | int *active) | 756 | int *active) |
755 | { | 757 | { |
756 | struct slot *slot = (struct slot *)pslot->private_data; | 758 | struct slot *slot = pslot->private_data; |
757 | int left, right; | 759 | int left, right; |
758 | 760 | ||
759 | left = right = 1; | 761 | left = right = 1; |
@@ -766,7 +768,7 @@ static int snd_mixer_oss_put_recsrc1_sw(struct snd_mixer_oss_file *fmixer, | |||
766 | struct snd_mixer_oss_slot *pslot, | 768 | struct snd_mixer_oss_slot *pslot, |
767 | int active) | 769 | int active) |
768 | { | 770 | { |
769 | struct slot *slot = (struct slot *)pslot->private_data; | 771 | struct slot *slot = pslot->private_data; |
770 | 772 | ||
771 | snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], active, active, 0); | 773 | snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], active, active, 0); |
772 | return 0; | 774 | return 0; |
@@ -776,7 +778,7 @@ static int snd_mixer_oss_put_recsrc1_route(struct snd_mixer_oss_file *fmixer, | |||
776 | struct snd_mixer_oss_slot *pslot, | 778 | struct snd_mixer_oss_slot *pslot, |
777 | int active) | 779 | int active) |
778 | { | 780 | { |
779 | struct slot *slot = (struct slot *)pslot->private_data; | 781 | struct slot *slot = pslot->private_data; |
780 | 782 | ||
781 | snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], active, active, 1); | 783 | snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], active, active, 1); |
782 | return 0; | 784 | return 0; |
@@ -797,7 +799,7 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned | |||
797 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); | 799 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
798 | if (uinfo == NULL || uctl == NULL) { | 800 | if (uinfo == NULL || uctl == NULL) { |
799 | err = -ENOMEM; | 801 | err = -ENOMEM; |
800 | goto __unlock; | 802 | goto __free_only; |
801 | } | 803 | } |
802 | down_read(&card->controls_rwsem); | 804 | down_read(&card->controls_rwsem); |
803 | kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0); | 805 | kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0); |
@@ -813,7 +815,7 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned | |||
813 | if (!(mixer->mask_recsrc & (1 << idx))) | 815 | if (!(mixer->mask_recsrc & (1 << idx))) |
814 | continue; | 816 | continue; |
815 | pslot = &mixer->slots[idx]; | 817 | pslot = &mixer->slots[idx]; |
816 | slot = (struct slot *)pslot->private_data; | 818 | slot = pslot->private_data; |
817 | if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE) | 819 | if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE) |
818 | continue; | 820 | continue; |
819 | if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE)) | 821 | if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE)) |
@@ -826,6 +828,7 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned | |||
826 | err = 0; | 828 | err = 0; |
827 | __unlock: | 829 | __unlock: |
828 | up_read(&card->controls_rwsem); | 830 | up_read(&card->controls_rwsem); |
831 | __free_only: | ||
829 | kfree(uctl); | 832 | kfree(uctl); |
830 | kfree(uinfo); | 833 | kfree(uinfo); |
831 | return err; | 834 | return err; |
@@ -847,7 +850,7 @@ static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned | |||
847 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); | 850 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); |
848 | if (uinfo == NULL || uctl == NULL) { | 851 | if (uinfo == NULL || uctl == NULL) { |
849 | err = -ENOMEM; | 852 | err = -ENOMEM; |
850 | goto __unlock; | 853 | goto __free_only; |
851 | } | 854 | } |
852 | down_read(&card->controls_rwsem); | 855 | down_read(&card->controls_rwsem); |
853 | kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0); | 856 | kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0); |
@@ -861,7 +864,7 @@ static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned | |||
861 | if (!(mixer->mask_recsrc & (1 << idx))) | 864 | if (!(mixer->mask_recsrc & (1 << idx))) |
862 | continue; | 865 | continue; |
863 | pslot = &mixer->slots[idx]; | 866 | pslot = &mixer->slots[idx]; |
864 | slot = (struct slot *)pslot->private_data; | 867 | slot = pslot->private_data; |
865 | if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE) | 868 | if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE) |
866 | continue; | 869 | continue; |
867 | if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE)) | 870 | if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE)) |
@@ -880,6 +883,7 @@ static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned | |||
880 | err = 0; | 883 | err = 0; |
881 | __unlock: | 884 | __unlock: |
882 | up_read(&card->controls_rwsem); | 885 | up_read(&card->controls_rwsem); |
886 | __free_only: | ||
883 | kfree(uctl); | 887 | kfree(uctl); |
884 | kfree(uinfo); | 888 | kfree(uinfo); |
885 | return err; | 889 | return err; |
@@ -925,7 +929,7 @@ static int snd_mixer_oss_build_test(struct snd_mixer_oss *mixer, struct slot *sl | |||
925 | 929 | ||
926 | static void snd_mixer_oss_slot_free(struct snd_mixer_oss_slot *chn) | 930 | static void snd_mixer_oss_slot_free(struct snd_mixer_oss_slot *chn) |
927 | { | 931 | { |
928 | struct slot *p = (struct slot *)chn->private_data; | 932 | struct slot *p = chn->private_data; |
929 | if (p) { | 933 | if (p) { |
930 | if (p->allocated && p->assigned) { | 934 | if (p->allocated && p->assigned) { |
931 | kfree(p->assigned->name); | 935 | kfree(p->assigned->name); |
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index ac242a377aea..6b4b1287b314 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c | |||
@@ -364,8 +364,7 @@ static void snd_pcm_stream_proc_info_read(struct snd_info_entry *entry, | |||
364 | static void snd_pcm_substream_proc_info_read(struct snd_info_entry *entry, | 364 | static void snd_pcm_substream_proc_info_read(struct snd_info_entry *entry, |
365 | struct snd_info_buffer *buffer) | 365 | struct snd_info_buffer *buffer) |
366 | { | 366 | { |
367 | snd_pcm_proc_info_read((struct snd_pcm_substream *)entry->private_data, | 367 | snd_pcm_proc_info_read(entry->private_data, buffer); |
368 | buffer); | ||
369 | } | 368 | } |
370 | 369 | ||
371 | static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry, | 370 | static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry, |
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index e23e0e7ab26f..a1707cca9c66 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -334,11 +334,15 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, | |||
334 | /* delta = "expected next hw_ptr" for in_interrupt != 0 */ | 334 | /* delta = "expected next hw_ptr" for in_interrupt != 0 */ |
335 | delta = runtime->hw_ptr_interrupt + runtime->period_size; | 335 | delta = runtime->hw_ptr_interrupt + runtime->period_size; |
336 | if (delta > new_hw_ptr) { | 336 | if (delta > new_hw_ptr) { |
337 | hw_base += runtime->buffer_size; | 337 | /* check for double acknowledged interrupts */ |
338 | if (hw_base >= runtime->boundary) | 338 | hdelta = jiffies - runtime->hw_ptr_jiffies; |
339 | hw_base = 0; | 339 | if (hdelta > runtime->hw_ptr_buffer_jiffies/2) { |
340 | new_hw_ptr = hw_base + pos; | 340 | hw_base += runtime->buffer_size; |
341 | goto __delta; | 341 | if (hw_base >= runtime->boundary) |
342 | hw_base = 0; | ||
343 | new_hw_ptr = hw_base + pos; | ||
344 | goto __delta; | ||
345 | } | ||
342 | } | 346 | } |
343 | } | 347 | } |
344 | /* new_hw_ptr might be lower than old_hw_ptr in case when */ | 348 | /* new_hw_ptr might be lower than old_hw_ptr in case when */ |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index d4eb2ef80784..8bc7cb3db330 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -142,7 +142,7 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream, | |||
142 | 142 | ||
143 | #ifdef RULES_DEBUG | 143 | #ifdef RULES_DEBUG |
144 | #define HW_PARAM(v) [SNDRV_PCM_HW_PARAM_##v] = #v | 144 | #define HW_PARAM(v) [SNDRV_PCM_HW_PARAM_##v] = #v |
145 | char *snd_pcm_hw_param_names[] = { | 145 | static const char * const snd_pcm_hw_param_names[] = { |
146 | HW_PARAM(ACCESS), | 146 | HW_PARAM(ACCESS), |
147 | HW_PARAM(FORMAT), | 147 | HW_PARAM(FORMAT), |
148 | HW_PARAM(SUBFORMAT), | 148 | HW_PARAM(SUBFORMAT), |
@@ -864,6 +864,8 @@ static void snd_pcm_post_start(struct snd_pcm_substream *substream, int state) | |||
864 | struct snd_pcm_runtime *runtime = substream->runtime; | 864 | struct snd_pcm_runtime *runtime = substream->runtime; |
865 | snd_pcm_trigger_tstamp(substream); | 865 | snd_pcm_trigger_tstamp(substream); |
866 | runtime->hw_ptr_jiffies = jiffies; | 866 | runtime->hw_ptr_jiffies = jiffies; |
867 | runtime->hw_ptr_buffer_jiffies = (runtime->buffer_size * HZ) / | ||
868 | runtime->rate; | ||
867 | runtime->status->state = state; | 869 | runtime->status->state = state; |
868 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && | 870 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && |
869 | runtime->silence_size > 0) | 871 | runtime->silence_size > 0) |