Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eca96830 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents d381f45c 69a4cfdd
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -285,7 +285,12 @@ local_event(struct seq_oss_devinfo *dp, union evrec *q, struct snd_seq_event *ev
static int
note_on_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev)
{
	struct seq_oss_synthinfo *info = &dp->synths[dev];
	struct seq_oss_synthinfo *info;

	if (!snd_seq_oss_synth_is_valid(dp, dev))
		return -ENXIO;

	info = &dp->synths[dev];
	switch (info->arg.event_passing) {
	case SNDRV_SEQ_OSS_PROCESS_EVENTS:
		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
static int
note_off_event(struct seq_oss_devinfo *dp, int dev, int ch, int note, int vel, struct snd_seq_event *ev)
{
	struct seq_oss_synthinfo *info = &dp->synths[dev];
	struct seq_oss_synthinfo *info;

	if (!snd_seq_oss_synth_is_valid(dp, dev))
		return -ENXIO;

	info = &dp->synths[dev];
	switch (info->arg.event_passing) {
	case SNDRV_SEQ_OSS_PROCESS_EVENTS:
		if (! info->ch || ch < 0 || ch >= info->nr_voices) {
+4 −1
Original line number Diff line number Diff line
@@ -213,7 +213,10 @@ static int slave_put(struct snd_kcontrol *kcontrol,
	}
	if (!changed)
		return 0;
	return slave_put_val(slave, ucontrol);
	err = slave_put_val(slave, ucontrol);
	if (err < 0)
		return err;
	return 1;
}

static int slave_tlv_cmd(struct snd_kcontrol *kcontrol,
+9 −2
Original line number Diff line number Diff line
@@ -3334,6 +3334,8 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec,
		return -EBUSY;
	}
	spdif = snd_array_new(&codec->spdif_out);
	if (!spdif)
		return -ENOMEM;
	for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) {
		kctl = snd_ctl_new1(dig_mix, codec);
		if (!kctl)
@@ -3431,11 +3433,16 @@ static struct snd_kcontrol_new spdif_share_sw = {
int snd_hda_create_spdif_share_sw(struct hda_codec *codec,
				  struct hda_multi_out *mout)
{
	struct snd_kcontrol *kctl;

	if (!mout->dig_out_nid)
		return 0;

	kctl = snd_ctl_new1(&spdif_share_sw, mout);
	if (!kctl)
		return -ENOMEM;
	/* ATTENTION: here mout is passed as private_data, instead of codec */
	return snd_hda_ctl_add(codec, mout->dig_out_nid,
			      snd_ctl_new1(&spdif_share_sw, mout));
	return snd_hda_ctl_add(codec, mout->dig_out_nid, kctl);
}
EXPORT_SYMBOL_HDA(snd_hda_create_spdif_share_sw);

+6 −2
Original line number Diff line number Diff line
@@ -2298,6 +2298,11 @@ static int dspxfr_one_seg(struct hda_codec *codec,
	hda_frame_size_words = ((sample_rate_div == 0) ? 0 :
			(num_chans * sample_rate_mul / sample_rate_div));

	if (hda_frame_size_words == 0) {
		snd_printdd(KERN_ERR "frmsz zero\n");
		return -EINVAL;
	}

	buffer_size_words = min(buffer_size_words,
				(unsigned int)(UC_RANGE(chip_addx, 1) ?
				65536 : 32768));
@@ -2308,8 +2313,7 @@ static int dspxfr_one_seg(struct hda_codec *codec,
		   chip_addx, hda_frame_size_words, num_chans,
		   sample_rate_mul, sample_rate_div, buffer_size_words);

	if ((buffer_addx == NULL) || (hda_frame_size_words == 0) ||
	    (buffer_size_words < hda_frame_size_words)) {
	if (buffer_size_words < hda_frame_size_words) {
		snd_printdd(KERN_ERR "dspxfr_one_seg:failed\n");
		return -EINVAL;
	}
+2 −0
Original line number Diff line number Diff line
@@ -3163,6 +3163,7 @@ static int patch_alc269(struct hda_codec *codec)
	case 0x10ec0290:
		spec->codec_variant = ALC269_TYPE_ALC280;
		break;
	case 0x10ec0233:
	case 0x10ec0282:
	case 0x10ec0283:
		spec->codec_variant = ALC269_TYPE_ALC282;
@@ -3862,6 +3863,7 @@ static int patch_alc680(struct hda_codec *codec)
 */
static const struct hda_codec_preset snd_hda_preset_realtek[] = {
	{ .id = 0x10ec0221, .name = "ALC221", .patch = patch_alc269 },
	{ .id = 0x10ec0233, .name = "ALC233", .patch = patch_alc269 },
	{ .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 },
	{ .id = 0x10ec0262, .name = "ALC262", .patch = patch_alc262 },
	{ .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 },
Loading