Commit e0154bd4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sound fixes from Takashi Iwai:
 "Here are last-minute fixes gathered before merge window close; a few
  fixes are for the core while the rest majority are driver fixes.

   - PCM locking annotation fixes and the possible self-lock fix

   - ASoC DPCM regression fixes with multi-CPU DAI

   - A fix for inconsistent resume from system-PM on USB-audio

   - Improved runtime-PM handling with multiple USB interfaces

   - Quirks for HD-audio and USB-audio

   - Hardened firmware handling in max98390 codec

   - A couple of fixes for meson"

* tag 'sound-fix-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits)
  ASoC: rt5645: Add platform-data for Asus T101HA
  ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT10-A tablet
  ASoC: SOF: nocodec: conditionally set dpcm_capture/dpcm_playback flags
  ASoC: Intel: boards: replace capture_only by dpcm_capture
  ASoC: core: only convert non DPCM link to DPCM link
  ASoC: soc-pcm: dpcm: fix playback/capture checks
  ASoC: meson: add missing free_irq() in error path
  ALSA: pcm: disallow linking stream to itself
  ALSA: usb-audio: Manage auto-pm of all bundled interfaces
  ALSA: hda/realtek - add a pintbl quirk for several Lenovo machines
  ALSA: pcm: fix snd_pcm_link() lockdep splat
  ALSA: usb-audio: Use the new macro for HP Dock rename quirks
  ALSA: usb-audio: Add vendor, product and profile name for HP Thunderbolt Dock
  ALSA: emu10k1: delete an unnecessary condition
  dt-bindings: ASoc: Fix tdm-slot documentation spelling error
  ASoC: meson: fix memory leak of links if allocation of ldata fails
  ALSA: usb-audio: Fix inconsistent card PM state after resume
  ASoC: max98390: Fix potential crash during param fw loading
  ASoC: max98390: Fix incorrect printf qualifier
  ASoC: fsl-asoc-card: Defer probe when fail to find codec device
  ...
parents d4e181f2 a4f55d92
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@ For instance:
	dai-tdm-slot-tx-mask = <0 1>;
	dai-tdm-slot-rx-mask = <1 0>;

And for each spcified driver, there could be one .of_xlate_tdm_slot_mask()
to specify a explicit mapping of the channels and the slots. If it's absent
And for each specified driver, there could be one .of_xlate_tdm_slot_mask()
to specify an explicit mapping of the channels and the slots. If it's absent
the default snd_soc_of_xlate_tdm_slot_mask() will be used to generating the
tx and rx masks.

+18 −2
Original line number Diff line number Diff line
@@ -138,6 +138,16 @@ void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream)
}
EXPORT_SYMBOL_GPL(snd_pcm_stream_lock_irq);

static void snd_pcm_stream_lock_nested(struct snd_pcm_substream *substream)
{
	struct snd_pcm_group *group = &substream->self_group;

	if (substream->pcm->nonatomic)
		mutex_lock_nested(&group->mutex, SINGLE_DEPTH_NESTING);
	else
		spin_lock_nested(&group->lock, SINGLE_DEPTH_NESTING);
}

/**
 * snd_pcm_stream_unlock_irq - Unlock the PCM stream
 * @substream: PCM substream
@@ -2166,6 +2176,12 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
	}
	pcm_file = f.file->private_data;
	substream1 = pcm_file->substream;

	if (substream == substream1) {
		res = -EINVAL;
		goto _badf;
	}

	group = kzalloc(sizeof(*group), GFP_KERNEL);
	if (!group) {
		res = -ENOMEM;
@@ -2194,7 +2210,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
	snd_pcm_stream_unlock_irq(substream);

	snd_pcm_group_lock_irq(target_group, nonatomic);
	snd_pcm_stream_lock(substream1);
	snd_pcm_stream_lock_nested(substream1);
	snd_pcm_group_assign(substream1, target_group);
	refcount_inc(&target_group->refs);
	snd_pcm_stream_unlock(substream1);
@@ -2210,7 +2226,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)

static void relink_to_local(struct snd_pcm_substream *substream)
{
	snd_pcm_stream_lock(substream);
	snd_pcm_stream_lock_nested(substream);
	snd_pcm_group_assign(substream, &substream->self_group);
	snd_pcm_stream_unlock(substream);
}
+1 −1
Original line number Diff line number Diff line
@@ -1040,7 +1040,7 @@ static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry,
		if (sscanf(line, "%x %x %x", &reg, &channel_id, &val) != 3)
			continue;

		if (reg < 0x49 && val <= 0xffffffff && channel_id <= 2)
		if (reg < 0x49 && channel_id <= 2)
			snd_emu10k1x_ptr_write(emu, reg, channel_id, val);
	}
}
+6 −0
Original line number Diff line number Diff line
@@ -8161,6 +8161,12 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
		ALC225_STANDARD_PINS,
		{0x12, 0xb7a60130},
		{0x17, 0x90170110}),
	SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
		{0x14, 0x01014010},
		{0x17, 0x90170120},
		{0x18, 0x02a11030},
		{0x19, 0x02a1103f},
		{0x21, 0x0221101f}),
	{}
};

+21 −5
Original line number Diff line number Diff line
@@ -754,6 +754,7 @@ static struct snd_soc_dai_driver max98390_dai[] = {
static int max98390_dsm_init(struct snd_soc_component *component)
{
	int ret;
	int param_size, param_start_addr;
	char filename[128];
	const char *vendor, *product;
	struct max98390_priv *max98390 =
@@ -778,16 +779,31 @@ static int max98390_dsm_init(struct snd_soc_component *component)
	}

	dev_dbg(component->dev,
		"max98390: param fw size %ld\n",
		"max98390: param fw size %zd\n",
		fw->size);
	if (fw->size < MAX98390_DSM_PARAM_MIN_SIZE) {
		dev_err(component->dev,
			"param fw is invalid.\n");
		goto err_alloc;
	}
	dsm_param = (char *)fw->data;
	param_start_addr = (dsm_param[0] & 0xff) | (dsm_param[1] & 0xff) << 8;
	param_size = (dsm_param[2] & 0xff) | (dsm_param[3] & 0xff) << 8;
	if (param_size > MAX98390_DSM_PARAM_MAX_SIZE ||
		param_start_addr < DSM_STBASS_HPF_B0_BYTE0 ||
		fw->size < param_size + MAX98390_DSM_PAYLOAD_OFFSET) {
		dev_err(component->dev,
			"param fw is invalid.\n");
		goto err_alloc;
	}
	regmap_write(max98390->regmap, MAX98390_R203A_AMP_EN, 0x80);
	dsm_param += MAX98390_DSM_PAYLOAD_OFFSET;
	regmap_bulk_write(max98390->regmap, DSM_EQ_BQ1_B0_BYTE0,
		dsm_param,
		fw->size - MAX98390_DSM_PAYLOAD_OFFSET);
	release_firmware(fw);
	regmap_bulk_write(max98390->regmap, param_start_addr,
		dsm_param, param_size);
	regmap_write(max98390->regmap, MAX98390_R23E1_DSP_GLOBAL_EN, 0x01);

err_alloc:
	release_firmware(fw);
err:
	return ret;
}
Loading