ASoC: ep93xx: Setup dma data in DAI probe

This allows us to access the DAI DMA data when we create the PCM. We'll use
this when converting ep39xx to generic DMA engine PCM driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Lars-Peter Clausen 2013-04-20 19:29:04 +02:00 committed by Mark Brown
parent 701c73aa89
commit 785d81e29b
2 changed files with 8 additions and 20 deletions

View File

@ -314,22 +314,15 @@ static int ep93xx_ac97_trigger(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static int ep93xx_ac97_startup(struct snd_pcm_substream *substream, static int ep93xx_ac97_dai_probe(struct snd_soc_dai *dai)
struct snd_soc_dai *dai)
{ {
struct ep93xx_dma_data *dma_data; dai->playback_dma_data = &ep93xx_ac97_pcm_out;
dai->capture_dma_data = &ep93xx_ac97_pcm_in;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
dma_data = &ep93xx_ac97_pcm_out;
else
dma_data = &ep93xx_ac97_pcm_in;
snd_soc_dai_set_dma_data(dai, substream, dma_data);
return 0; return 0;
} }
static const struct snd_soc_dai_ops ep93xx_ac97_dai_ops = { static const struct snd_soc_dai_ops ep93xx_ac97_dai_ops = {
.startup = ep93xx_ac97_startup,
.trigger = ep93xx_ac97_trigger, .trigger = ep93xx_ac97_trigger,
}; };
@ -337,6 +330,7 @@ static struct snd_soc_dai_driver ep93xx_ac97_dai = {
.name = "ep93xx-ac97", .name = "ep93xx-ac97",
.id = 0, .id = 0,
.ac97_control = 1, .ac97_control = 1,
.probe = ep93xx_ac97_dai_probe,
.playback = { .playback = {
.stream_name = "AC97 Playback", .stream_name = "AC97 Playback",
.channels_min = 2, .channels_min = 2,

View File

@ -60,7 +60,6 @@ struct ep93xx_i2s_info {
struct clk *mclk; struct clk *mclk;
struct clk *sclk; struct clk *sclk;
struct clk *lrclk; struct clk *lrclk;
struct ep93xx_dma_data *dma_data;
void __iomem *regs; void __iomem *regs;
}; };
@ -139,15 +138,11 @@ static void ep93xx_i2s_disable(struct ep93xx_i2s_info *info, int stream)
} }
} }
static int ep93xx_i2s_startup(struct snd_pcm_substream *substream, static int ep93xx_i2s_dai_probe(struct snd_soc_dai *dai)
struct snd_soc_dai *dai)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; dai->playback_dma_data = &ep93xx_i2s_dma_data[SNDRV_PCM_STREAM_PLAYBACK];
struct ep93xx_i2s_info *info = snd_soc_dai_get_drvdata(dai); dai->capture_dma_data = &ep93xx_i2s_dma_data[SNDRV_PCM_STREAM_CAPTURE];
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
snd_soc_dai_set_dma_data(cpu_dai, substream,
&info->dma_data[substream->stream]);
return 0; return 0;
} }
@ -338,7 +333,6 @@ static int ep93xx_i2s_resume(struct snd_soc_dai *dai)
#endif #endif
static const struct snd_soc_dai_ops ep93xx_i2s_dai_ops = { static const struct snd_soc_dai_ops ep93xx_i2s_dai_ops = {
.startup = ep93xx_i2s_startup,
.shutdown = ep93xx_i2s_shutdown, .shutdown = ep93xx_i2s_shutdown,
.hw_params = ep93xx_i2s_hw_params, .hw_params = ep93xx_i2s_hw_params,
.set_sysclk = ep93xx_i2s_set_sysclk, .set_sysclk = ep93xx_i2s_set_sysclk,
@ -349,6 +343,7 @@ static const struct snd_soc_dai_ops ep93xx_i2s_dai_ops = {
static struct snd_soc_dai_driver ep93xx_i2s_dai = { static struct snd_soc_dai_driver ep93xx_i2s_dai = {
.symmetric_rates= 1, .symmetric_rates= 1,
.probe = ep93xx_i2s_dai_probe,
.suspend = ep93xx_i2s_suspend, .suspend = ep93xx_i2s_suspend,
.resume = ep93xx_i2s_resume, .resume = ep93xx_i2s_resume,
.playback = { .playback = {
@ -407,7 +402,6 @@ static int ep93xx_i2s_probe(struct platform_device *pdev)
} }
dev_set_drvdata(&pdev->dev, info); dev_set_drvdata(&pdev->dev, info);
info->dma_data = ep93xx_i2s_dma_data;
err = snd_soc_register_component(&pdev->dev, &ep93xx_i2s_component, err = snd_soc_register_component(&pdev->dev, &ep93xx_i2s_component,
&ep93xx_i2s_dai, 1); &ep93xx_i2s_dai, 1);