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

Commit 70e0db2f authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branch 'asoc/topic/dma' into asoc-next

parents 48ce3ec1 90130d2e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream)
 * @slave_id: Slave requester id for the DMA channel.
 * @filter_data: Custom DMA channel filter data, this will usually be used when
 * requesting the DMA channel.
 * @chan_name: Custom channel name to use when requesting DMA channel.
 * @fifo_size: FIFO size of the DAI controller in bytes
 */
struct snd_dmaengine_dai_dma_data {
	dma_addr_t addr;
@@ -68,6 +70,8 @@ struct snd_dmaengine_dai_dma_data {
	u32 maxburst;
	unsigned int slave_id;
	void *filter_data;
	const char *chan_name;
	unsigned int fifo_size;
};

void snd_dmaengine_pcm_set_config_from_dai_data(
@@ -96,6 +100,10 @@ void snd_dmaengine_pcm_set_config_from_dai_data(
 * playback.
 */
#define SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX BIT(3)
/*
 * The PCM streams have custom channel names specified.
 */
#define SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME BIT(4)

/**
 * struct snd_dmaengine_pcm_config - Configuration data for dmaengine based PCM
+7 −0
Original line number Diff line number Diff line
@@ -279,6 +279,13 @@ static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai,
		dai->capture_dma_data = data;
}

static inline void snd_soc_dai_init_dma_data(struct snd_soc_dai *dai,
					     void *playback, void *capture)
{
	dai->playback_dma_data = playback;
	dai->capture_dma_data = capture;
}

static inline void snd_soc_dai_set_drvdata(struct snd_soc_dai *dai,
		void *data)
{
+13 −0
Original line number Diff line number Diff line
@@ -57,9 +57,22 @@ static bool ep93xx_pcm_dma_filter(struct dma_chan *chan, void *filter_param)
	return false;
}

static struct dma_chan *ep93xx_compat_request_channel(
	struct snd_soc_pcm_runtime *rtd,
	struct snd_pcm_substream *substream)
{
	struct snd_dmaengine_dai_dma_data *dma_data;

	dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);

	return snd_dmaengine_pcm_request_channel(ep93xx_pcm_dma_filter,
						 dma_data);
}

static const struct snd_dmaengine_pcm_config ep93xx_dmaengine_pcm_config = {
	.pcm_hardware = &ep93xx_pcm_hardware,
	.compat_filter_fn = ep93xx_pcm_dma_filter,
	.compat_request_channel = ep93xx_compat_request_channel,
	.prealloc_buffer_size = 131072,
};

+1 −3
Original line number Diff line number Diff line
@@ -25,12 +25,10 @@

static bool filter(struct dma_chan *chan, void *param)
{
	struct snd_dmaengine_dai_dma_data *dma_data = param;

	if (!imx_dma_is_general_purpose(chan))
		return false;

	chan->private = dma_data->filter_data;
	chan->private = param;

	return true;
}
+2 −7
Original line number Diff line number Diff line
@@ -702,13 +702,6 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
	}
	writel(mod, i2s->addr + I2SMOD);

	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
		snd_soc_dai_set_dma_data(dai, substream,
			(void *)&i2s->dma_playback);
	else
		snd_soc_dai_set_dma_data(dai, substream,
			(void *)&i2s->dma_capture);

	i2s->frmclk = params_rate(params);

	return 0;
@@ -970,6 +963,8 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
	}
	clk_prepare_enable(i2s->clk);

	snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, &i2s->dma_capture);

	if (other) {
		other->addr = i2s->addr;
		other->clk = i2s->clk;
Loading