aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl
diff options
context:
space:
mode:
authorEric Millbrandt <emillbrandt@dekaresearch.com>2012-09-13 17:43:11 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-18 23:03:42 -0400
commitf515b67381de0a4a28d639e0f1bb587a3a49f0d2 (patch)
tree6ad9f4317a532ed4e06dc2efdffedae2a28c37f9 /sound/soc/fsl
parentf3a50c95e275c2e553e2a6dcc646eef3daf98a3e (diff)
ASoC: fsl: mpc5200 combine psc_dma platform data
The mpc5200_psc_ac97 and mpc5200_psc_i2s modules rely on shared platform data with mpc5200_dma. Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r--sound/soc/fsl/mpc5200_dma.c24
-rw-r--r--sound/soc/fsl/mpc5200_dma.h3
-rw-r--r--sound/soc/fsl/mpc5200_psc_ac97.c5
-rw-r--r--sound/soc/fsl/mpc5200_psc_i2s.c5
4 files changed, 17 insertions, 20 deletions
diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c
index 9a3f7c5ab687..9997c039bb24 100644
--- a/sound/soc/fsl/mpc5200_dma.c
+++ b/sound/soc/fsl/mpc5200_dma.c
@@ -370,7 +370,7 @@ static struct snd_soc_platform_driver mpc5200_audio_dma_platform = {
370 .pcm_free = &psc_dma_free, 370 .pcm_free = &psc_dma_free,
371}; 371};
372 372
373static int mpc5200_hpcd_probe(struct platform_device *op) 373int mpc5200_audio_dma_create(struct platform_device *op)
374{ 374{
375 phys_addr_t fifo; 375 phys_addr_t fifo;
376 struct psc_dma *psc_dma; 376 struct psc_dma *psc_dma;
@@ -487,8 +487,9 @@ out_unmap:
487 iounmap(regs); 487 iounmap(regs);
488 return ret; 488 return ret;
489} 489}
490EXPORT_SYMBOL_GPL(mpc5200_audio_dma_create);
490 491
491static int mpc5200_hpcd_remove(struct platform_device *op) 492int mpc5200_audio_dma_destroy(struct platform_device *op)
492{ 493{
493 struct psc_dma *psc_dma = dev_get_drvdata(&op->dev); 494 struct psc_dma *psc_dma = dev_get_drvdata(&op->dev);
494 495
@@ -510,24 +511,7 @@ static int mpc5200_hpcd_remove(struct platform_device *op)
510 511
511 return 0; 512 return 0;
512} 513}
513 514EXPORT_SYMBOL_GPL(mpc5200_audio_dma_destroy);
514static struct of_device_id mpc5200_hpcd_match[] = {
515 { .compatible = "fsl,mpc5200-pcm", },
516 {}
517};
518MODULE_DEVICE_TABLE(of, mpc5200_hpcd_match);
519
520static struct platform_driver mpc5200_hpcd_of_driver = {
521 .probe = mpc5200_hpcd_probe,
522 .remove = mpc5200_hpcd_remove,
523 .driver = {
524 .owner = THIS_MODULE,
525 .name = "mpc5200-pcm-audio",
526 .of_match_table = mpc5200_hpcd_match,
527 }
528};
529
530module_platform_driver(mpc5200_hpcd_of_driver);
531 515
532MODULE_AUTHOR("Grant Likely <grant.likely@secretlab.ca>"); 516MODULE_AUTHOR("Grant Likely <grant.likely@secretlab.ca>");
533MODULE_DESCRIPTION("Freescale MPC5200 PSC in DMA mode ASoC Driver"); 517MODULE_DESCRIPTION("Freescale MPC5200 PSC in DMA mode ASoC Driver");
diff --git a/sound/soc/fsl/mpc5200_dma.h b/sound/soc/fsl/mpc5200_dma.h
index a3c0cd5382fb..dff253fde29a 100644
--- a/sound/soc/fsl/mpc5200_dma.h
+++ b/sound/soc/fsl/mpc5200_dma.h
@@ -81,4 +81,7 @@ to_psc_dma_stream(struct snd_pcm_substream *substream, struct psc_dma *psc_dma)
81 return &psc_dma->playback; 81 return &psc_dma->playback;
82} 82}
83 83
84int mpc5200_audio_dma_create(struct platform_device *op);
85int mpc5200_audio_dma_destroy(struct platform_device *op);
86
84#endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */ 87#endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */
diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c
index ffa00a2eb770..9a094535fb26 100644
--- a/sound/soc/fsl/mpc5200_psc_ac97.c
+++ b/sound/soc/fsl/mpc5200_psc_ac97.c
@@ -278,6 +278,10 @@ static int __devinit psc_ac97_of_probe(struct platform_device *op)
278 struct snd_ac97 ac97; 278 struct snd_ac97 ac97;
279 struct mpc52xx_psc __iomem *regs; 279 struct mpc52xx_psc __iomem *regs;
280 280
281 rc = mpc5200_audio_dma_create(op);
282 if (rc != 0)
283 return rc;
284
281 rc = snd_soc_register_dais(&op->dev, psc_ac97_dai, ARRAY_SIZE(psc_ac97_dai)); 285 rc = snd_soc_register_dais(&op->dev, psc_ac97_dai, ARRAY_SIZE(psc_ac97_dai));
282 if (rc != 0) { 286 if (rc != 0) {
283 dev_err(&op->dev, "Failed to register DAI\n"); 287 dev_err(&op->dev, "Failed to register DAI\n");
@@ -303,6 +307,7 @@ static int __devinit psc_ac97_of_probe(struct platform_device *op)
303 307
304static int __devexit psc_ac97_of_remove(struct platform_device *op) 308static int __devexit psc_ac97_of_remove(struct platform_device *op)
305{ 309{
310 mpc5200_audio_dma_destroy(op);
306 snd_soc_unregister_dais(&op->dev, ARRAY_SIZE(psc_ac97_dai)); 311 snd_soc_unregister_dais(&op->dev, ARRAY_SIZE(psc_ac97_dai));
307 return 0; 312 return 0;
308} 313}
diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c
index 7b530327553a..c0b7a23ebbfd 100644
--- a/sound/soc/fsl/mpc5200_psc_i2s.c
+++ b/sound/soc/fsl/mpc5200_psc_i2s.c
@@ -156,6 +156,10 @@ static int __devinit psc_i2s_of_probe(struct platform_device *op)
156 struct psc_dma *psc_dma; 156 struct psc_dma *psc_dma;
157 struct mpc52xx_psc __iomem *regs; 157 struct mpc52xx_psc __iomem *regs;
158 158
159 rc = mpc5200_audio_dma_create(op);
160 if (rc != 0)
161 return rc;
162
159 rc = snd_soc_register_dais(&op->dev, psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai)); 163 rc = snd_soc_register_dais(&op->dev, psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai));
160 if (rc != 0) { 164 if (rc != 0) {
161 pr_err("Failed to register DAI\n"); 165 pr_err("Failed to register DAI\n");
@@ -200,6 +204,7 @@ static int __devinit psc_i2s_of_probe(struct platform_device *op)
200 204
201static int __devexit psc_i2s_of_remove(struct platform_device *op) 205static int __devexit psc_i2s_of_remove(struct platform_device *op)
202{ 206{
207 mpc5200_audio_dma_destroy(op);
203 snd_soc_unregister_dais(&op->dev, ARRAY_SIZE(psc_i2s_dai)); 208 snd_soc_unregister_dais(&op->dev, ARRAY_SIZE(psc_i2s_dai));
204 return 0; 209 return 0;
205} 210}