Commit 91ef3d9f authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge tag 'asoc-fix-v5.8-rc2' of...

Merge tag 'asoc-fix-v5.8-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.8

This is a collection of mostly small fixes, mostly fixing fallout from
some of the DPCM changes that went in last time around which shook out
some issues on i.MX and Qualcomm platforms.  The addition of a managed
version of snd_soc_register_dai() is to fix resource leaks.

There's also a few new device IDs for x86 systems.
parents d50313a5 f141a422
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -161,4 +161,15 @@ int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream,

#define SND_DMAENGINE_PCM_DRV_NAME "snd_dmaengine_pcm"

struct dmaengine_pcm {
	struct dma_chan *chan[SNDRV_PCM_STREAM_LAST + 1];
	const struct snd_dmaengine_pcm_config *config;
	struct snd_soc_component component;
	unsigned int flags;
};

static inline struct dmaengine_pcm *soc_component_to_pcm(struct snd_soc_component *p)
{
	return container_of(p, struct dmaengine_pcm, component);
}
#endif
+6 −0
Original line number Diff line number Diff line
@@ -444,6 +444,8 @@ int devm_snd_soc_register_component(struct device *dev,
			 const struct snd_soc_component_driver *component_driver,
			 struct snd_soc_dai_driver *dai_drv, int num_dai);
void snd_soc_unregister_component(struct device *dev);
struct snd_soc_component *snd_soc_lookup_component_nolocked(struct device *dev,
							    const char *driver_name);
struct snd_soc_component *snd_soc_lookup_component(struct device *dev,
						   const char *driver_name);

@@ -1361,6 +1363,10 @@ void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component,
					 struct snd_soc_dai_driver *dai_drv,
					 bool legacy_dai_naming);
struct snd_soc_dai *devm_snd_soc_register_dai(struct device *dev,
					      struct snd_soc_component *component,
					      struct snd_soc_dai_driver *dai_drv,
					      bool legacy_dai_naming);
void snd_soc_unregister_dai(struct snd_soc_dai *dai);

struct snd_soc_dai *snd_soc_find_dai(
+1 −3
Original line number Diff line number Diff line
@@ -208,8 +208,8 @@ static const struct config_entry config_table[] = {
	},
#endif

#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE)
/* Cometlake-LP */
#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE_LP)
	{
		.flags = FLAG_SOF,
		.device = 0x02c8,
@@ -240,9 +240,7 @@ static const struct config_entry config_table[] = {
		.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
		.device = 0x02c8,
	},
#endif
/* Cometlake-H */
#if IS_ENABLED(CONFIG_SND_SOC_SOF_COMETLAKE_H)
	{
		.flags = FLAG_SOF,
		.device = 0x06c8,
+23 −7
Original line number Diff line number Diff line
@@ -342,25 +342,41 @@ static int acp3x_dma_close(struct snd_soc_component *component,
{
	struct snd_soc_pcm_runtime *prtd;
	struct i2s_dev_data *adata;
	struct i2s_stream_instance *ins;

	prtd = substream->private_data;
	component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
	adata = dev_get_drvdata(component->dev);
	ins = substream->runtime->private_data;
	if (!ins)
		return -EINVAL;


	/* Disable ACP irq, when the current stream is being closed and
	 * another stream is also not active.
	 */
	if (!adata->play_stream && !adata->capture_stream &&
		!adata->i2ssp_play_stream && !adata->i2ssp_capture_stream)
		rv_writel(0, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
		switch (ins->i2s_instance) {
		case I2S_BT_INSTANCE:
			adata->play_stream = NULL;
			break;
		case I2S_SP_INSTANCE:
		default:
			adata->i2ssp_play_stream = NULL;
		}
	} else {
		switch (ins->i2s_instance) {
		case I2S_BT_INSTANCE:
			adata->capture_stream = NULL;
			break;
		case I2S_SP_INSTANCE:
		default:
			adata->i2ssp_capture_stream = NULL;
		}
	}

	/* Disable ACP irq, when the current stream is being closed and
	 * another stream is also not active.
	 */
	if (!adata->play_stream && !adata->capture_stream &&
		!adata->i2ssp_play_stream && !adata->i2ssp_capture_stream)
		rv_writel(0, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
	return 0;
}

+10 −6
Original line number Diff line number Diff line
@@ -441,13 +441,13 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component)
	ret = snd_hda_codec_set_name(hcodec, hcodec->preset->name);
	if (ret < 0) {
		dev_err(&hdev->dev, "name failed %s\n", hcodec->preset->name);
		goto error;
		goto error_pm;
	}

	ret = snd_hdac_regmap_init(&hcodec->core);
	if (ret < 0) {
		dev_err(&hdev->dev, "regmap init failed\n");
		goto error;
		goto error_pm;
	}

	patch = (hda_codec_patch_t)hcodec->preset->driver_data;
@@ -455,7 +455,7 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component)
		ret = patch(hcodec);
		if (ret < 0) {
			dev_err(&hdev->dev, "patch failed %d\n", ret);
			goto error;
			goto error_regmap;
		}
	} else {
		dev_dbg(&hdev->dev, "no patch file found\n");
@@ -467,7 +467,7 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component)
	ret = snd_hda_codec_parse_pcms(hcodec);
	if (ret < 0) {
		dev_err(&hdev->dev, "unable to map pcms to dai %d\n", ret);
		goto error;
		goto error_regmap;
	}

	/* HDMI controls need to be created in machine drivers */
@@ -476,7 +476,7 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component)
		if (ret < 0) {
			dev_err(&hdev->dev, "unable to create controls %d\n",
				ret);
			goto error;
			goto error_regmap;
		}
	}

@@ -496,7 +496,9 @@ static int hdac_hda_codec_probe(struct snd_soc_component *component)

	return 0;

error:
error_regmap:
	snd_hdac_regmap_exit(hdev);
error_pm:
	pm_runtime_put(&hdev->dev);
error_no_pm:
	snd_hdac_ext_bus_link_put(hdev->bus, hlink);
@@ -518,6 +520,8 @@ static void hdac_hda_codec_remove(struct snd_soc_component *component)

	pm_runtime_disable(&hdev->dev);
	snd_hdac_ext_bus_link_put(hdev->bus, hlink);

	snd_hdac_regmap_exit(hdev);
}

static const struct snd_soc_dapm_route hdac_hda_dapm_routes[] = {
Loading