aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-03-08 17:43:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-08 17:43:33 -0500
commiteca968305c2a5fbc3445c22b8e8e809196d28893 (patch)
treee52541142a59d00789731f0b50d8dca1f9fcb557
parentd381f45c890a3fb136afb0dc1cbe025e066cb981 (diff)
parent69a4cfdd444d1fe5c24d29b3a063964ac165d2cd (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "All are boring small fixes in various parts: - A few possible NULL-dereference or zero-division Oops fixes - Fix vmaster slave volume notification - Add codec ID for ALC233 - Various fixes in several ASoC WM codecs - ASoC tegra i2c fix Sorry if you wanted a thrilling adventure with huge sharks :)" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: ice1712: Initialize card->private_data properly ALSA: hda - Add support of new codec ALC233 ALSA: hda/ca0132 - Avoid division by zero in dspxfr_one_seg() ALSA: hda - check NULL pointer when creating SPDIF PCM switch ALSA: hda - check NULL pointer when creating SPDIF controls ASoC: wm5102: Apply a SYSCLK patch for later revs ALSA: vmaster: Fix slave change notification ASoC: tegra: fix I2S bit count mask ALSA: seq: seq_oss_event: missing range checks ASoC: wm8350: Use jiffies rather than msecs in schedule_delayed_work() ASoC: wm5110: Correct OUT2/3 volume and switch names ASoC: wm5102: Correct OUT2 volume and switch names ASoC: wm8960: Fix ADC power bits ASoC: wm8960: Correct register 0 and 1 defaults
-rw-r--r--sound/core/seq/oss/seq_oss_event.c14
-rw-r--r--sound/core/vmaster.c5
-rw-r--r--sound/pci/hda/hda_codec.c11
-rw-r--r--sound/pci/hda/patch_ca0132.c8
-rw-r--r--sound/pci/hda/patch_realtek.c2
-rw-r--r--sound/pci/ice1712/ice1712.c2
-rw-r--r--sound/soc/codecs/wm5102.c15
-rw-r--r--sound/soc/codecs/wm5110.c16
-rw-r--r--sound/soc/codecs/wm8350.c4
-rw-r--r--sound/soc/codecs/wm8960.c8
-rw-r--r--sound/soc/tegra/tegra20_i2s.h2
-rw-r--r--sound/soc/tegra/tegra30_i2s.h2
12 files changed, 64 insertions, 25 deletions
diff --git a/sound/core/seq/oss/seq_oss_event.c b/sound/core/seq/oss/seq_oss_event.c
index 066f5f3e3f4c..c3908862bc8b 100644
--- a/sound/core/seq/oss/seq_oss_event.c
+++ b/sound/core/seq/oss/seq_oss_event.c
@@ -285,7 +285,12 @@ local_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev
285static int 285static int
286note_on_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev) 286note_on_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev)
287{ 287{
288 struct seq_oss_synthinfo *info = &dp->synths[dev]; 288 struct seq_oss_synthinfo *info;
289
290 if (!snd_seq_oss_synth_is_valid(dp, dev))
291 return -ENXIO;
292
293 info = &dp->synths[dev];
289 switch (info->arg.event_passing) { 294 switch (info->arg.event_passing) {
290 case SNDRV_SEQ_OSS_PROCESS_EVENTS: 295 case SNDRV_SEQ_OSS_PROCESS_EVENTS:
291 if (! info->ch || ch < 0 || ch >= info->nr_voices) { 296 if (! info->ch || ch < 0 || ch >= info->nr_voices) {
@@ -340,7 +345,12 @@ note_on_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, st
340static int 345static int
341note_off_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev) 346note_off_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev)
342{ 347{
343 struct seq_oss_synthinfo *info = &dp->synths[dev]; 348 struct seq_oss_synthinfo *info;
349
350 if (!snd_seq_oss_synth_is_valid(dp, dev))
351 return -ENXIO;
352
353 info = &dp->synths[dev];
344 switch (info->arg.event_passing) { 354 switch (info->arg.event_passing) {
345 case SNDRV_SEQ_OSS_PROCESS_EVENTS: 355 case SNDRV_SEQ_OSS_PROCESS_EVENTS:
346 if (! info->ch || ch < 0 || ch >= info->nr_voices) { 356 if (! info->ch || ch < 0 || ch >= info->nr_voices) {
diff --git a/sound/core/vmaster.c b/sound/core/vmaster.c
index 857586135d18..0097f3619faa 100644
--- a/sound/core/vmaster.c
+++ b/sound/core/vmaster.c
@@ -213,7 +213,10 @@ static int slave_put(struct snd_kcontrol *kcontrol,
213 } 213 }
214 if (!changed) 214 if (!changed)
215 return 0; 215 return 0;
216 return slave_put_val(slave, ucontrol); 216 err = slave_put_val(slave, ucontrol);
217 if (err < 0)
218 return err;
219 return 1;
217} 220}
218 221
219static int slave_tlv_cmd(struct snd_kcontrol *kcontrol, 222static int slave_tlv_cmd(struct snd_kcontrol *kcontrol,
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 04b57383e8cb..97c68dd24ef5 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -3334,6 +3334,8 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec,
3334 return -EBUSY; 3334 return -EBUSY;
3335 } 3335 }
3336 spdif = snd_array_new(&codec->spdif_out); 3336 spdif = snd_array_new(&codec->spdif_out);
3337 if (!spdif)
3338 return -ENOMEM;
3337 for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) { 3339 for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) {
3338 kctl = snd_ctl_new1(dig_mix, codec); 3340 kctl = snd_ctl_new1(dig_mix, codec);
3339 if (!kctl) 3341 if (!kctl)
@@ -3431,11 +3433,16 @@ static struct snd_kcontrol_new spdif_share_sw = {
3431int snd_hda_create_spdif_share_sw(struct hda_codec *codec, 3433int snd_hda_create_spdif_share_sw(struct hda_codec *codec,
3432 struct hda_multi_out *mout) 3434 struct hda_multi_out *mout)
3433{ 3435{
3436 struct snd_kcontrol *kctl;
3437
3434 if (!mout->dig_out_nid) 3438 if (!mout->dig_out_nid)
3435 return 0; 3439 return 0;
3440
3441 kctl = snd_ctl_new1(&spdif_share_sw, mout);
3442 if (!kctl)
3443 return -ENOMEM;
3436 /* ATTENTION: here mout is passed as private_data, instead of codec */ 3444 /* ATTENTION: here mout is passed as private_data, instead of codec */
3437 return snd_hda_ctl_add(codec, mout->dig_out_nid, 3445 return snd_hda_ctl_add(codec, mout->dig_out_nid, kctl);
3438 snd_ctl_new1(&spdif_share_sw, mout));
3439} 3446}
3440EXPORT_SYMBOL_HDA(snd_hda_create_spdif_share_sw); 3447EXPORT_SYMBOL_HDA(snd_hda_create_spdif_share_sw);
3441 3448
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index db02c1e96b08..eefc4563b2f9 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -2298,6 +2298,11 @@ static int dspxfr_one_seg(struct hda_codec *codec,
2298 hda_frame_size_words = ((sample_rate_div == 0) ? 0 : 2298 hda_frame_size_words = ((sample_rate_div == 0) ? 0 :
2299 (num_chans * sample_rate_mul / sample_rate_div)); 2299 (num_chans * sample_rate_mul / sample_rate_div));
2300 2300
2301 if (hda_frame_size_words == 0) {
2302 snd_printdd(KERN_ERR "frmsz zero\n");
2303 return -EINVAL;
2304 }
2305
2301 buffer_size_words = min(buffer_size_words, 2306 buffer_size_words = min(buffer_size_words,
2302 (unsigned int)(UC_RANGE(chip_addx, 1) ? 2307 (unsigned int)(UC_RANGE(chip_addx, 1) ?
2303 65536 : 32768)); 2308 65536 : 32768));
@@ -2308,8 +2313,7 @@ static int dspxfr_one_seg(struct hda_codec *codec,
2308 chip_addx, hda_frame_size_words, num_chans, 2313 chip_addx, hda_frame_size_words, num_chans,
2309 sample_rate_mul, sample_rate_div, buffer_size_words); 2314 sample_rate_mul, sample_rate_div, buffer_size_words);
2310 2315
2311 if ((buffer_addx == NULL) || (hda_frame_size_words == 0) || 2316 if (buffer_size_words < hda_frame_size_words) {
2312 (buffer_size_words < hda_frame_size_words)) {
2313 snd_printdd(KERN_ERR "dspxfr_one_seg:failed\n"); 2317 snd_printdd(KERN_ERR "dspxfr_one_seg:failed\n");
2314 return -EINVAL; 2318 return -EINVAL;
2315 } 2319 }
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 2d4237bc0d8e..563c24df4d6f 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3163,6 +3163,7 @@ static int patch_alc269(struct hda_codec *codec)
3163 case 0x10ec0290: 3163 case 0x10ec0290:
3164 spec->codec_variant = ALC269_TYPE_ALC280; 3164 spec->codec_variant = ALC269_TYPE_ALC280;
3165 break; 3165 break;
3166 case 0x10ec0233:
3166 case 0x10ec0282: 3167 case 0x10ec0282:
3167 case 0x10ec0283: 3168 case 0x10ec0283:
3168 spec->codec_variant = ALC269_TYPE_ALC282; 3169 spec->codec_variant = ALC269_TYPE_ALC282;
@@ -3862,6 +3863,7 @@ static int patch_alc680(struct hda_codec *codec)
3862 */ 3863 */
3863static const struct hda_codec_preset snd_hda_preset_realtek[] = { 3864static const struct hda_codec_preset snd_hda_preset_realtek[] = {
3864 { .id = 0x10ec0221, .name = "ALC221", .patch = patch_alc269 }, 3865 { .id = 0x10ec0221, .name = "ALC221", .patch = patch_alc269 },
3866 { .id = 0x10ec0233, .name = "ALC233", .patch = patch_alc269 },
3865 { .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 }, 3867 { .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 },
3866 { .id = 0x10ec0262, .name = "ALC262", .patch = patch_alc262 }, 3868 { .id = 0x10ec0262, .name = "ALC262", .patch = patch_alc262 },
3867 { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 }, 3869 { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 },
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 2ffdc35d5ffd..806407a3973e 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2594,6 +2594,8 @@ static int snd_ice1712_create(struct snd_card *card,
2594 snd_ice1712_proc_init(ice); 2594 snd_ice1712_proc_init(ice);
2595 synchronize_irq(pci->irq); 2595 synchronize_irq(pci->irq);
2596 2596
2597 card->private_data = ice;
2598
2597 err = pci_request_regions(pci, "ICE1712"); 2599 err = pci_request_regions(pci, "ICE1712");
2598 if (err < 0) { 2600 if (err < 0) {
2599 kfree(ice); 2601 kfree(ice);
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index b8d461db369f..b82bbf584146 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -573,6 +573,13 @@ static const struct reg_default wm5102_sysclk_reva_patch[] = {
573 { 0x025e, 0x0112 }, 573 { 0x025e, 0x0112 },
574}; 574};
575 575
576static const struct reg_default wm5102_sysclk_revb_patch[] = {
577 { 0x3081, 0x08FE },
578 { 0x3083, 0x00ED },
579 { 0x30C1, 0x08FE },
580 { 0x30C3, 0x00ED },
581};