aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/cirrus/ep93xx-ac97.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/cirrus/ep93xx-ac97.c')
-rw-r--r--sound/soc/cirrus/ep93xx-ac97.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c
index 1738d28fb04f..7798fbd5e81d 100644
--- a/sound/soc/cirrus/ep93xx-ac97.c
+++ b/sound/soc/cirrus/ep93xx-ac97.c
@@ -23,7 +23,6 @@
23#include <sound/soc.h> 23#include <sound/soc.h>
24 24
25#include <linux/platform_data/dma-ep93xx.h> 25#include <linux/platform_data/dma-ep93xx.h>
26#include "ep93xx-pcm.h"
27 26
28/* 27/*
29 * Per channel (1-4) registers. 28 * Per channel (1-4) registers.
@@ -101,14 +100,16 @@ struct ep93xx_ac97_info {
101/* currently ALSA only supports a single AC97 device */ 100/* currently ALSA only supports a single AC97 device */
102static struct ep93xx_ac97_info *ep93xx_ac97_info; 101static struct ep93xx_ac97_info *ep93xx_ac97_info;
103 102
104static struct ep93xx_pcm_dma_params ep93xx_ac97_pcm_out = { 103static struct ep93xx_dma_data ep93xx_ac97_pcm_out = {
105 .name = "ac97-pcm-out", 104 .name = "ac97-pcm-out",
106 .dma_port = EP93XX_DMA_AAC1, 105 .dma_port = EP93XX_DMA_AAC1,
106 .direction = DMA_MEM_TO_DEV,
107}; 107};
108 108
109static struct ep93xx_pcm_dma_params ep93xx_ac97_pcm_in = { 109static struct ep93xx_dma_data ep93xx_ac97_pcm_in = {
110 .name = "ac97-pcm-in", 110 .name = "ac97-pcm-in",
111 .dma_port = EP93XX_DMA_AAC1, 111 .dma_port = EP93XX_DMA_AAC1,
112 .direction = DMA_DEV_TO_MEM,
112}; 113};
113 114
114static inline unsigned ep93xx_ac97_read_reg(struct ep93xx_ac97_info *info, 115static inline unsigned ep93xx_ac97_read_reg(struct ep93xx_ac97_info *info,
@@ -316,7 +317,7 @@ static int ep93xx_ac97_trigger(struct snd_pcm_substream *substream,
316static int ep93xx_ac97_startup(struct snd_pcm_substream *substream, 317static int ep93xx_ac97_startup(struct snd_pcm_substream *substream,
317 struct snd_soc_dai *dai) 318 struct snd_soc_dai *dai)
318{ 319{
319 struct ep93xx_pcm_dma_params *dma_data; 320 struct ep93xx_dma_data *dma_data;
320 321
321 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 322 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
322 dma_data = &ep93xx_ac97_pcm_out; 323 dma_data = &ep93xx_ac97_pcm_out;
@@ -353,6 +354,10 @@ static struct snd_soc_dai_driver ep93xx_ac97_dai = {
353 .ops = &ep93xx_ac97_dai_ops, 354 .ops = &ep93xx_ac97_dai_ops,
354}; 355};
355 356
357static const struct snd_soc_component_driver ep93xx_ac97_component = {
358 .name = "ep93xx-ac97",
359};
360
356static int ep93xx_ac97_probe(struct platform_device *pdev) 361static int ep93xx_ac97_probe(struct platform_device *pdev)
357{ 362{
358 struct ep93xx_ac97_info *info; 363 struct ep93xx_ac97_info *info;
@@ -390,7 +395,8 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
390 ep93xx_ac97_info = info; 395 ep93xx_ac97_info = info;
391 platform_set_drvdata(pdev, info); 396 platform_set_drvdata(pdev, info);
392 397
393 ret = snd_soc_register_dai(&pdev->dev, &ep93xx_ac97_dai); 398 ret = snd_soc_register_component(&pdev->dev, &ep93xx_ac97_component,
399 &ep93xx_ac97_dai, 1);
394 if (ret) 400 if (ret)
395 goto fail; 401 goto fail;
396 402
@@ -407,7 +413,7 @@ static int ep93xx_ac97_remove(struct platform_device *pdev)
407{ 413{
408 struct ep93xx_ac97_info *info = platform_get_drvdata(pdev); 414 struct ep93xx_ac97_info *info = platform_get_drvdata(pdev);
409 415
410 snd_soc_unregister_dai(&pdev->dev); 416 snd_soc_unregister_component(&pdev->dev);
411 417
412 /* disable the AC97 controller */ 418 /* disable the AC97 controller */
413 ep93xx_ac97_write_reg(info, AC97GCR, 0); 419 ep93xx_ac97_write_reg(info, AC97GCR, 0);