Commit 4aafdf68 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sound fixes from Takashi Iwai:
 "A collection of small fixes gathered since the previous update.

  ALSA core:
   - Regression fix for OSS PCM emulation

  ASoC:
   - Trivial fixes in reg bit mask ops, DAPM, DPCM and topology
   - Lots of fixes for Intel-based devices
   - Minor fixes for AMD, STM32, Qualcomm, Realtek

  Others:
   - Fixes for the bugs in mixer handling in HD-audio and ice1724
     drivers that were caught by the recent kctl validator
   - New quirks for HD-audio and USB-audio

  Also this contains a fix for EDD firmware fix, which slipped from
  anyone's hands"

* tag 'sound-fix-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (35 commits)
  ALSA: hda: Add driver blacklist
  ALSA: usb-audio: Add mixer workaround for TRX40 and co
  ALSA: hda/realtek - Add quirk for MSI GL63
  ALSA: ice1724: Fix invalid access for enumerated ctl items
  ALSA: hda: Fix potential access overflow in beep helper
  ASoC: cs4270: pull reset GPIO low then high
  ALSA: hda/realtek - Add HP new mute led supported for ALC236
  ALSA: hda/realtek - Add supported new mute Led for HP
  ASoC: rt5645: Add platform-data for Medion E1239T
  ASoC: Intel: bytcr_rt5640: Add quirk for MPMAN MPWIN895CL tablet
  ASoC: stm32: sai: Add missing cleanup
  ALSA: usb-audio: Add registration quirk for Kingston HyperX Cloud Alpha S
  ASoC: Intel: atom: Fix uninitialized variable compiler warning
  ASoC: Intel: atom: Check drv->lock is locked in sst_fill_and_send_cmd_unlocked
  ASoC: Intel: atom: Take the drv->lock mutex before calling sst_send_slot_map()
  ASoC: SOF: Turn "firmware boot complete" message into a dbg message
  ALSA: usb-audio: Add Pioneer DJ DJM-250MK2 quirk
  ALSA: pcm: oss: Fix regression by buffer overflow fix (again)
  ALSA: pcm: oss: Fix regression by buffer overflow fix
  edd: Use scnprintf() for avoiding potential buffer overflow
  ...
parents 93f3321f ddd5609f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ required:
examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    i2c@0 {
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

+3 −3
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ edd_show_legacy_max_cylinder(struct edd_device *edev, char *buf)
	if (!info || !buf)
		return -EINVAL;

	p += snprintf(p, left, "%u\n", info->legacy_max_cylinder);
	p += scnprintf(p, left, "%u\n", info->legacy_max_cylinder);
	return (p - buf);
}

@@ -356,7 +356,7 @@ edd_show_legacy_max_head(struct edd_device *edev, char *buf)
	if (!info || !buf)
		return -EINVAL;

	p += snprintf(p, left, "%u\n", info->legacy_max_head);
	p += scnprintf(p, left, "%u\n", info->legacy_max_head);
	return (p - buf);
}

@@ -371,7 +371,7 @@ edd_show_legacy_sectors_per_track(struct edd_device *edev, char *buf)
	if (!info || !buf)
		return -EINVAL;

	p += snprintf(p, left, "%u\n", info->legacy_sectors_per_track);
	p += scnprintf(p, left, "%u\n", info->legacy_sectors_per_track);
	return (p - buf);
}

+1 −1
Original line number Diff line number Diff line
@@ -351,7 +351,7 @@ struct snd_soc_dai {

	/* bit field */
	unsigned int probed:1;
	unsigned int started:1;
	unsigned int started[SNDRV_PCM_STREAM_LAST + 1];
};

static inline struct snd_soc_pcm_stream *
+12 −10
Original line number Diff line number Diff line
@@ -197,7 +197,8 @@ int snd_pcm_plugin_free(struct snd_pcm_plugin *plugin)
}

static snd_pcm_sframes_t calc_dst_frames(struct snd_pcm_substream *plug,
					 snd_pcm_sframes_t frames)
					 snd_pcm_sframes_t frames,
					 bool check_size)
{
	struct snd_pcm_plugin *plugin, *plugin_next;

@@ -209,7 +210,7 @@ static snd_pcm_sframes_t calc_dst_frames(struct snd_pcm_substream *plug,
			if (frames < 0)
				return frames;
		}
		if (frames > plugin->buf_frames)
		if (check_size && frames > plugin->buf_frames)
			frames = plugin->buf_frames;
		plugin = plugin_next;
	}
@@ -217,13 +218,14 @@ static snd_pcm_sframes_t calc_dst_frames(struct snd_pcm_substream *plug,
}

static snd_pcm_sframes_t calc_src_frames(struct snd_pcm_substream *plug,
					 snd_pcm_sframes_t frames)
					 snd_pcm_sframes_t frames,
					 bool check_size)
{
	struct snd_pcm_plugin *plugin, *plugin_prev;

	plugin = snd_pcm_plug_last(plug);
	while (plugin && frames > 0) {
		if (frames > plugin->buf_frames)
		if (check_size && frames > plugin->buf_frames)
			frames = plugin->buf_frames;
		plugin_prev = plugin->prev;
		if (plugin->src_frames) {
@@ -242,9 +244,9 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p
		return -ENXIO;
	switch (snd_pcm_plug_stream(plug)) {
	case SNDRV_PCM_STREAM_PLAYBACK:
		return calc_src_frames(plug, drv_frames);
		return calc_src_frames(plug, drv_frames, false);
	case SNDRV_PCM_STREAM_CAPTURE:
		return calc_dst_frames(plug, drv_frames);
		return calc_dst_frames(plug, drv_frames, false);
	default:
		snd_BUG();
		return -EINVAL;
@@ -257,9 +259,9 @@ snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pc
		return -ENXIO;
	switch (snd_pcm_plug_stream(plug)) {
	case SNDRV_PCM_STREAM_PLAYBACK:
		return calc_dst_frames(plug, clt_frames);
		return calc_dst_frames(plug, clt_frames, false);
	case SNDRV_PCM_STREAM_CAPTURE:
		return calc_src_frames(plug, clt_frames);
		return calc_src_frames(plug, clt_frames, false);
	default:
		snd_BUG();
		return -EINVAL;
@@ -622,7 +624,7 @@ snd_pcm_sframes_t snd_pcm_plug_write_transfer(struct snd_pcm_substream *plug, st
		src_channels = dst_channels;
		plugin = next;
	}
	return snd_pcm_plug_client_size(plug, frames);
	return calc_src_frames(plug, frames, true);
}

snd_pcm_sframes_t snd_pcm_plug_read_transfer(struct snd_pcm_substream *plug, struct snd_pcm_plugin_channel *dst_channels_final, snd_pcm_uframes_t size)
@@ -632,7 +634,7 @@ snd_pcm_sframes_t snd_pcm_plug_read_transfer(struct snd_pcm_substream *plug, str
	snd_pcm_sframes_t frames = size;
	int err;

	frames = snd_pcm_plug_slave_size(plug, frames);
	frames = calc_src_frames(plug, frames, true);
	if (frames < 0)
		return frames;

+5 −1
Original line number Diff line number Diff line
@@ -290,8 +290,12 @@ int snd_hda_mixer_amp_switch_get_beep(struct snd_kcontrol *kcontrol,
{
	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
	struct hda_beep *beep = codec->beep;
	int chs = get_amp_channels(kcontrol);

	if (beep && (!beep->enabled || !ctl_has_mute(kcontrol))) {
		ucontrol->value.integer.value[0] =
		if (chs & 1)
			ucontrol->value.integer.value[0] = beep->enabled;
		if (chs & 2)
			ucontrol->value.integer.value[1] = beep->enabled;
		return 0;
	}
Loading