diff options
Diffstat (limited to 'sound/soc/au1x/db1200.c')
-rw-r--r-- | sound/soc/au1x/db1200.c | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/sound/soc/au1x/db1200.c b/sound/soc/au1x/db1200.c index cdf7be1b9b91..b62fcd33e586 100644 --- a/sound/soc/au1x/db1200.c +++ b/sound/soc/au1x/db1200.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <asm/mach-au1x00/au1xxx_dbdma.h> | 19 | #include <asm/mach-au1x00/au1xxx_dbdma.h> |
20 | #include <asm/mach-db1x00/bcsr.h> | 20 | #include <asm/mach-db1x00/bcsr.h> |
21 | 21 | ||
22 | #include "../codecs/ac97.h" | ||
23 | #include "../codecs/wm8731.h" | 22 | #include "../codecs/wm8731.h" |
24 | #include "psc.h" | 23 | #include "psc.h" |
25 | 24 | ||
@@ -28,20 +27,16 @@ | |||
28 | static struct snd_soc_dai_link db1200_ac97_dai = { | 27 | static struct snd_soc_dai_link db1200_ac97_dai = { |
29 | .name = "AC97", | 28 | .name = "AC97", |
30 | .stream_name = "AC97 HiFi", | 29 | .stream_name = "AC97 HiFi", |
31 | .cpu_dai = &au1xpsc_ac97_dai, | 30 | .codec_dai_name = "ac97-hifi", |
32 | .codec_dai = &ac97_dai, | 31 | .cpu_dai_name = "au1xpsc_ac97.1", |
32 | .platform_name = "au1xpsc-pcm.1", | ||
33 | .codec_name = "ac97-codec.1", | ||
33 | }; | 34 | }; |
34 | 35 | ||
35 | static struct snd_soc_card db1200_ac97_machine = { | 36 | static struct snd_soc_card db1200_ac97_machine = { |
36 | .name = "DB1200_AC97", | 37 | .name = "DB1200_AC97", |
37 | .dai_link = &db1200_ac97_dai, | 38 | .dai_link = &db1200_ac97_dai, |
38 | .num_links = 1, | 39 | .num_links = 1, |
39 | .platform = &au1xpsc_soc_platform, | ||
40 | }; | ||
41 | |||
42 | static struct snd_soc_device db1200_ac97_devdata = { | ||
43 | .card = &db1200_ac97_machine, | ||
44 | .codec_dev = &soc_codec_dev_ac97, | ||
45 | }; | 40 | }; |
46 | 41 | ||
47 | /*------------------------- I2S PART ---------------------------*/ | 42 | /*------------------------- I2S PART ---------------------------*/ |
@@ -49,12 +44,12 @@ static struct snd_soc_device db1200_ac97_devdata = { | |||
49 | static int db1200_i2s_startup(struct snd_pcm_substream *substream) | 44 | static int db1200_i2s_startup(struct snd_pcm_substream *substream) |
50 | { | 45 | { |
51 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 46 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
52 | struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; | 47 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
53 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | 48 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
54 | int ret; | 49 | int ret; |
55 | 50 | ||
56 | /* WM8731 has its own 12MHz crystal */ | 51 | /* WM8731 has its own 12MHz crystal */ |
57 | snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK, | 52 | snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL, |
58 | 12000000, SND_SOC_CLOCK_IN); | 53 | 12000000, SND_SOC_CLOCK_IN); |
59 | 54 | ||
60 | /* codec is bitclock and lrclk master */ | 55 | /* codec is bitclock and lrclk master */ |
@@ -80,8 +75,10 @@ static struct snd_soc_ops db1200_i2s_wm8731_ops = { | |||
80 | static struct snd_soc_dai_link db1200_i2s_dai = { | 75 | static struct snd_soc_dai_link db1200_i2s_dai = { |
81 | .name = "WM8731", | 76 | .name = "WM8731", |
82 | .stream_name = "WM8731 PCM", | 77 | .stream_name = "WM8731 PCM", |
83 | .cpu_dai = &au1xpsc_i2s_dai, | 78 | .codec_dai_name = "wm8731-hifi", |
84 | .codec_dai = &wm8731_dai, | 79 | .cpu_dai_name = "au1xpsc_i2s.1", |
80 | .platform_name = "au1xpsc-pcm.1", | ||
81 | .codec_name = "wm8731-codec.0-001b", | ||
85 | .ops = &db1200_i2s_wm8731_ops, | 82 | .ops = &db1200_i2s_wm8731_ops, |
86 | }; | 83 | }; |
87 | 84 | ||
@@ -89,12 +86,6 @@ static struct snd_soc_card db1200_i2s_machine = { | |||
89 | .name = "DB1200_I2S", | 86 | .name = "DB1200_I2S", |
90 | .dai_link = &db1200_i2s_dai, | 87 | .dai_link = &db1200_i2s_dai, |
91 | .num_links = 1, | 88 | .num_links = 1, |
92 | .platform = &au1xpsc_soc_platform, | ||
93 | }; | ||
94 | |||
95 | static struct snd_soc_device db1200_i2s_devdata = { | ||
96 | .card = &db1200_i2s_machine, | ||
97 | .codec_dev = &soc_codec_dev_wm8731, | ||
98 | }; | 89 | }; |
99 | 90 | ||
100 | /*------------------------- COMMON PART ---------------------------*/ | 91 | /*------------------------- COMMON PART ---------------------------*/ |
@@ -106,18 +97,16 @@ static int __init db1200_audio_load(void) | |||
106 | int ret; | 97 | int ret; |
107 | 98 | ||
108 | ret = -ENOMEM; | 99 | ret = -ENOMEM; |
109 | db1200_asoc_dev = platform_device_alloc("soc-audio", -1); | 100 | db1200_asoc_dev = platform_device_alloc("soc-audio", 1); /* PSC1 */ |
110 | if (!db1200_asoc_dev) | 101 | if (!db1200_asoc_dev) |
111 | goto out; | 102 | goto out; |
112 | 103 | ||
113 | /* DB1200 board setup set PSC1MUX to preferred audio device */ | 104 | /* DB1200 board setup set PSC1MUX to preferred audio device */ |
114 | if (bcsr_read(BCSR_RESETS) & BCSR_RESETS_PSC1MUX) | 105 | if (bcsr_read(BCSR_RESETS) & BCSR_RESETS_PSC1MUX) |
115 | platform_set_drvdata(db1200_asoc_dev, &db1200_i2s_devdata); | 106 | platform_set_drvdata(db1200_asoc_dev, &db1200_i2s_machine); |
116 | else | 107 | else |
117 | platform_set_drvdata(db1200_asoc_dev, &db1200_ac97_devdata); | 108 | platform_set_drvdata(db1200_asoc_dev, &db1200_ac97_machine); |
118 | 109 | ||
119 | db1200_ac97_devdata.dev = &db1200_asoc_dev->dev; | ||
120 | db1200_i2s_devdata.dev = &db1200_asoc_dev->dev; | ||
121 | ret = platform_device_add(db1200_asoc_dev); | 110 | ret = platform_device_add(db1200_asoc_dev); |
122 | 111 | ||
123 | if (ret) { | 112 | if (ret) { |