diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /sound/soc/fsl/mpc5200_psc_i2s.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'sound/soc/fsl/mpc5200_psc_i2s.c')
-rw-r--r-- | sound/soc/fsl/mpc5200_psc_i2s.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c index 534f04cb15d7..87cf2a5c2b2c 100644 --- a/sound/soc/fsl/mpc5200_psc_i2s.c +++ b/sound/soc/fsl/mpc5200_psc_i2s.c | |||
@@ -40,7 +40,7 @@ static int psc_i2s_hw_params(struct snd_pcm_substream *substream, | |||
40 | struct snd_soc_dai *dai) | 40 | struct snd_soc_dai *dai) |
41 | { | 41 | { |
42 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 42 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
43 | struct psc_dma *psc_dma = rtd->dai->cpu_dai->private_data; | 43 | struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(rtd->cpu_dai); |
44 | u32 mode; | 44 | u32 mode; |
45 | 45 | ||
46 | dev_dbg(psc_dma->dev, "%s(substream=%p) p_size=%i p_bytes=%i" | 46 | dev_dbg(psc_dma->dev, "%s(substream=%p) p_size=%i p_bytes=%i" |
@@ -88,7 +88,7 @@ static int psc_i2s_hw_params(struct snd_pcm_substream *substream, | |||
88 | static int psc_i2s_set_sysclk(struct snd_soc_dai *cpu_dai, | 88 | static int psc_i2s_set_sysclk(struct snd_soc_dai *cpu_dai, |
89 | int clk_id, unsigned int freq, int dir) | 89 | int clk_id, unsigned int freq, int dir) |
90 | { | 90 | { |
91 | struct psc_dma *psc_dma = cpu_dai->private_data; | 91 | struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(cpu_dai); |
92 | dev_dbg(psc_dma->dev, "psc_i2s_set_sysclk(cpu_dai=%p, dir=%i)\n", | 92 | dev_dbg(psc_dma->dev, "psc_i2s_set_sysclk(cpu_dai=%p, dir=%i)\n", |
93 | cpu_dai, dir); | 93 | cpu_dai, dir); |
94 | return (dir == SND_SOC_CLOCK_IN) ? 0 : -EINVAL; | 94 | return (dir == SND_SOC_CLOCK_IN) ? 0 : -EINVAL; |
@@ -107,7 +107,7 @@ static int psc_i2s_set_sysclk(struct snd_soc_dai *cpu_dai, | |||
107 | */ | 107 | */ |
108 | static int psc_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format) | 108 | static int psc_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format) |
109 | { | 109 | { |
110 | struct psc_dma *psc_dma = cpu_dai->private_data; | 110 | struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(cpu_dai); |
111 | dev_dbg(psc_dma->dev, "psc_i2s_set_fmt(cpu_dai=%p, format=%i)\n", | 111 | dev_dbg(psc_dma->dev, "psc_i2s_set_fmt(cpu_dai=%p, format=%i)\n", |
112 | cpu_dai, format); | 112 | cpu_dai, format); |
113 | return (format == SND_SOC_DAIFMT_I2S) ? 0 : -EINVAL; | 113 | return (format == SND_SOC_DAIFMT_I2S) ? 0 : -EINVAL; |
@@ -129,8 +129,7 @@ static struct snd_soc_dai_ops psc_i2s_dai_ops = { | |||
129 | .set_fmt = psc_i2s_set_fmt, | 129 | .set_fmt = psc_i2s_set_fmt, |
130 | }; | 130 | }; |
131 | 131 | ||
132 | struct snd_soc_dai psc_i2s_dai[] = {{ | 132 | static struct snd_soc_dai_driver psc_i2s_dai[] = {{ |
133 | .name = "I2S", | ||
134 | .playback = { | 133 | .playback = { |
135 | .channels_min = 2, | 134 | .channels_min = 2, |
136 | .channels_max = 2, | 135 | .channels_max = 2, |
@@ -145,28 +144,22 @@ struct snd_soc_dai psc_i2s_dai[] = {{ | |||
145 | }, | 144 | }, |
146 | .ops = &psc_i2s_dai_ops, | 145 | .ops = &psc_i2s_dai_ops, |
147 | } }; | 146 | } }; |
148 | EXPORT_SYMBOL_GPL(psc_i2s_dai); | ||
149 | 147 | ||
150 | /* --------------------------------------------------------------------- | 148 | /* --------------------------------------------------------------------- |
151 | * OF platform bus binding code: | 149 | * OF platform bus binding code: |
152 | * - Probe/remove operations | 150 | * - Probe/remove operations |
153 | * - OF device match table | 151 | * - OF device match table |
154 | */ | 152 | */ |
155 | static int __devinit psc_i2s_of_probe(struct platform_device *op, | 153 | static int __devinit psc_i2s_of_probe(struct platform_device *op) |
156 | const struct of_device_id *match) | ||
157 | { | 154 | { |
158 | int rc; | 155 | int rc; |
159 | struct psc_dma *psc_dma; | 156 | struct psc_dma *psc_dma; |
160 | struct mpc52xx_psc __iomem *regs; | 157 | struct mpc52xx_psc __iomem *regs; |
161 | 158 | ||
162 | rc = mpc5200_audio_dma_create(op); | 159 | rc = snd_soc_register_dais(&op->dev, psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai)); |
163 | if (rc != 0) | ||
164 | return rc; | ||
165 | |||
166 | rc = snd_soc_register_dais(psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai)); | ||
167 | if (rc != 0) { | 160 | if (rc != 0) { |
168 | pr_err("Failed to register DAI\n"); | 161 | pr_err("Failed to register DAI\n"); |
169 | return 0; | 162 | return rc; |
170 | } | 163 | } |
171 | 164 | ||
172 | psc_dma = dev_get_drvdata(&op->dev); | 165 | psc_dma = dev_get_drvdata(&op->dev); |
@@ -207,7 +200,8 @@ static int __devinit psc_i2s_of_probe(struct platform_device *op, | |||
207 | 200 | ||
208 | static int __devexit psc_i2s_of_remove(struct platform_device *op) | 201 | static int __devexit psc_i2s_of_remove(struct platform_device *op) |
209 | { | 202 | { |
210 | return mpc5200_audio_dma_destroy(op); | 203 | snd_soc_unregister_dais(&op->dev, ARRAY_SIZE(psc_i2s_dai)); |
204 | return 0; | ||
211 | } | 205 | } |
212 | 206 | ||
213 | /* Match table for of_platform binding */ | 207 | /* Match table for of_platform binding */ |
@@ -218,7 +212,7 @@ static struct of_device_id psc_i2s_match[] __devinitdata = { | |||
218 | }; | 212 | }; |
219 | MODULE_DEVICE_TABLE(of, psc_i2s_match); | 213 | MODULE_DEVICE_TABLE(of, psc_i2s_match); |
220 | 214 | ||
221 | static struct of_platform_driver psc_i2s_driver = { | 215 | static struct platform_driver psc_i2s_driver = { |
222 | .probe = psc_i2s_of_probe, | 216 | .probe = psc_i2s_of_probe, |
223 | .remove = __devexit_p(psc_i2s_of_remove), | 217 | .remove = __devexit_p(psc_i2s_of_remove), |
224 | .driver = { | 218 | .driver = { |
@@ -234,13 +228,13 @@ static struct of_platform_driver psc_i2s_driver = { | |||
234 | */ | 228 | */ |
235 | static int __init psc_i2s_init(void) | 229 | static int __init psc_i2s_init(void) |
236 | { | 230 | { |
237 | return of_register_platform_driver(&psc_i2s_driver); | 231 | return platform_driver_register(&psc_i2s_driver); |
238 | } | 232 | } |
239 | module_init(psc_i2s_init); | 233 | module_init(psc_i2s_init); |
240 | 234 | ||
241 | static void __exit psc_i2s_exit(void) | 235 | static void __exit psc_i2s_exit(void) |
242 | { | 236 | { |
243 | of_unregister_platform_driver(&psc_i2s_driver); | 237 | platform_driver_unregister(&psc_i2s_driver); |
244 | } | 238 | } |
245 | module_exit(psc_i2s_exit); | 239 | module_exit(psc_i2s_exit); |
246 | 240 | ||