Skip to contentSkip to conversation

powerpc/alsa: update MPC8610 HPCD audio drivers to support multiple components

PATCH In review Timur Tabi 1 participant 1 message Apr 26, 2010

Subsystems (3)
lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH 2/2 powerpc/alsa: update MPC8610 HPCD audio drivers to support multiple components

Update the Freescale MPC8610 HPCD audio drivers to support the new multiple- component architecture in ASoC.

---
 sound/soc/fsl/fsl_dma.c      |   42 +--
 sound/soc/fsl/fsl_dma.h      |    1 +
 sound/soc/fsl/fsl_ssi.c      |   88 ++--
 sound/soc/fsl/fsl_ssi.h      |   23 -
 sound/soc/fsl/mpc8610_hpcd.c | 1188 ++++++++++++++++++++----------------------
 5 files changed, 637 insertions(+), 705 deletions(-)

rewrite sound/soc/fsl/mpc8610_hpcd.c (64%)

sound/soc/fsl/fsl_dma.c +8 -34
index 857e9f7..326b852 100644
@@ -15,7 +15,6 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
@@ -844,6 +843,7 @@ EXPORT_SYMBOL_GPL(fsl_soc_platform);
 int fsl_dma_configure(struct fsl_dma_info *dma_info)
 {
 	static int initialized;
+	int ret;
 
 	/* We only support one DMA controller for now */
 	if (initialized)
@@ -859,42 +859,16 @@ int fsl_dma_configure(struct fsl_dma_info *dma_info)
 	dma_global_data.assigned[1] = 0;
 
 	initialized = 1;
-	return 1;
-}
-EXPORT_SYMBOL_GPL(fsl_dma_configure);
-
-static int __devinit fsl_soc_platform_probe(struct platform_device *pdev)
-{
-	return snd_soc_register_platform(&pdev->dev, -1, &fsl_soc_platform);
-}
-
-static int __devexit fsl_soc_platform_remove(struct platform_device *pdev)
-{
-	snd_soc_unregister_platform(&pdev->dev, -1);
-	return 0;
-}
 
-static struct platform_driver fsl_pcm_driver = {
-	.driver = {
-			.name = "fsl-pcm-audio",
-			.owner = THIS_MODULE,
-	},
-
-	.probe = fsl_soc_platform_probe,
-	.remove = __devexit_p(fsl_soc_platform_remove),
-};
-
-static int __init snd_fsl_pcm_init(void)
-{
-	return platform_driver_register(&fsl_pcm_driver);
-}
-module_init(snd_fsl_pcm_init);
+	ret = snd_soc_register_platform(dma_info->dev, -1, &fsl_soc_platform);
+	if (ret) {
+		dev_err(dma_info->dev, "could not register platform");
+		return 0;
+	}
 
-static void __exit snd_fsl_pcm_exit(void)
-{
-	platform_driver_unregister(&fsl_pcm_driver);
+	return 1;
 }
-module_exit(snd_fsl_pcm_exit);
+EXPORT_SYMBOL(fsl_dma_configure);
 
 MODULE_AUTHOR("Timur Tabi <[email protected]>");
 MODULE_DESCRIPTION("Freescale Elo DMA ASoC PCM module");
sound/soc/fsl/fsl_dma.h +1 -0
index 253bd3c..62bb617 100644
@@ -140,6 +140,7 @@ struct fsl_dma_info {
 	dma_addr_t ssi_srx_phys;
 	struct ccsr_dma_channel __iomem *dma_channel[2];
 	unsigned int dma_irq[2];
+	struct device *dev;
 };
 
 extern struct snd_soc_platform_driver fsl_soc_platform;
sound/soc/fsl/fsl_ssi.c +56 -32

166 lines not on this page · raw message

sound/soc/fsl/fsl_ssi.h +0 -23
index 965fd86..7cb229b 100644
@@ -196,29 +196,6 @@ struct ccsr_ssi {
 #define CCSR_SSI_SOR_WAIT(x) (((x) & 3) << CCSR_SSI_SOR_WAIT_SHIFT)
 #define CCSR_SSI_SOR_SYNRST 		0x00000001
 
-/* Instantiation data for an SSI interface
- *
- * This structure contains all the information that the the SSI driver needs
- * to instantiate an SSI interface with ALSA.  The machine driver should
- * create this structure, fill it in, call fsl_ssi_create_dai(), and then
- * delete the structure.
- *
- * id: which SSI this is (0, 1, etc. )
- * ssi: pointer to the SSI's registers
- * ssi_phys: physical address of the SSI registers
- * irq: IRQ of this SSI
- * dev: struct device, used to create the sysfs statistics file
- * asynchronous: 0=synchronous mode, 1=asynchronous mode
-*/
-struct fsl_ssi_info {
-	unsigned int id;
-	struct ccsr_ssi __iomem *ssi;
-	dma_addr_t ssi_phys;
-	unsigned int irq;
-	struct device *dev;
-	int asynchronous;
-};
-
 extern struct snd_soc_dai_driver fsl_ssi_dai;
 
 #endif
sound/soc/fsl/mpc8610_hpcd.c +572 -616

1,188 lines not on this page · raw message

Signature · 1 line
1.6.5