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

Commit 7445c995 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'fix/asoc' into for-linus

parents 1172234c 5f712b2b
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -219,7 +219,6 @@ struct snd_soc_dai {
	struct snd_soc_codec *codec;
	unsigned int active;
	unsigned char pop_wait:1;
	void *dma_data;

	/* DAI private data */
	void *private_data;
@@ -230,4 +229,21 @@ struct snd_soc_dai {
	struct list_head list;
};

static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai,
					     const struct snd_pcm_substream *ss)
{
	return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
		dai->playback.dma_data : dai->capture.dma_data;
}

static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai,
					    const struct snd_pcm_substream *ss,
					    void *data)
{
	if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
		dai->playback.dma_data = data;
	else
		dai->capture.dma_data = data;
}

#endif
+1 −0
Original line number Diff line number Diff line
@@ -375,6 +375,7 @@ struct snd_soc_pcm_stream {
	unsigned int channels_min;	/* min channels */
	unsigned int channels_max;	/* max channels */
	unsigned int active:1;		/* stream is in use */
	void *dma_data;			/* used by platform code */
};

/* SoC audio ops */
+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ static int atmel_pcm_hw_params(struct snd_pcm_substream *substream,
	snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
	runtime->dma_bytes = params_buffer_bytes(params);

	prtd->params = rtd->dai->cpu_dai->dma_data;
	prtd->params = snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream);
	prtd->params->dma_intr_handler = atmel_pcm_dma_irq;

	prtd->dma_buffer = runtime->dma_addr;
+3 −3
Original line number Diff line number Diff line
@@ -363,12 +363,12 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
	ssc_p->dma_params[dir] = dma_params;

	/*
	 * The cpu_dai->dma_data field is only used to communicate the
	 * appropriate DMA parameters to the pcm driver hw_params()
	 * The snd_soc_pcm_stream->dma_data field is only used to communicate
	 * the appropriate DMA parameters to the pcm driver hw_params()
	 * function.  It should not be used for other purposes
	 * as it is common to all substreams.
	 */
	rtd->dai->cpu_dai->dma_data = dma_params;
	snd_soc_dai_set_dma_data(rtd->dai->cpu_dai, substream, dma_params);

	channels = params_channels(params);

+9 −6
Original line number Diff line number Diff line
@@ -80,9 +80,11 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
static int ac97_soc_probe(struct platform_device *pdev)
{
	struct snd_soc_device *socdev = platform_get_drvdata(pdev);
	struct snd_soc_card *card = socdev->card;
	struct snd_soc_codec *codec;
	struct snd_ac97_bus *ac97_bus;
	struct snd_ac97_template ac97_template;
	int i;
	int ret = 0;

	printk(KERN_INFO "AC97 SoC Audio Codec %s\n", AC97_VERSION);
@@ -102,12 +104,6 @@ static int ac97_soc_probe(struct platform_device *pdev)
	INIT_LIST_HEAD(&codec->dapm_widgets);
	INIT_LIST_HEAD(&codec->dapm_paths);

	ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
	if (ret < 0) {
		printk(KERN_ERR "ASoC: failed to init gen ac97 glue\n");
		goto err;
	}

	/* register pcms */
	ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
	if (ret < 0)
@@ -123,6 +119,13 @@ static int ac97_soc_probe(struct platform_device *pdev)
	if (ret < 0)
		goto bus_err;

	for (i = 0; i < card->num_links; i++) {
		if (card->dai_link[i].codec_dai->ac97_control) {
			snd_ac97_dev_add_pdata(codec->ac97,
				card->dai_link[i].cpu_dai->ac97_pdata);
		}
	}

	return 0;

bus_err:
Loading