ASoC: Samsung: Don't register idma device as platform device
authorInha Song <ideal.song@samsung.com>
Wed, 30 Apr 2014 07:04:28 +0000 (16:04 +0900)
committerChanho Park <chanho61.park@samsung.com>
Thu, 7 Aug 2014 05:32:08 +0000 (14:32 +0900)
Previously, the ASoC idma was instantiated via a platform_device.
But it was a virtual device with sole purpose to call snd_soc_register_platform().

Each Samsung DAI now registers the ASoC 'platform' itself.

Change-Id: Ie1c9b2bdf5522dc085fe2bbb271cd9ceb86252f7
Signed-off-by: Inha Song <ideal.song@samsung.com>
sound/soc/samsung/idma.c
sound/soc/samsung/idma.h

index 6e5fed3..8c3f912 100644 (file)
@@ -405,11 +405,12 @@ static int idma_new(struct snd_soc_pcm_runtime *rtd)
        return ret;
 }
 
-void idma_reg_addr_init(void __iomem *regs, dma_addr_t addr)
+void idma_reg_addr_init(void __iomem *regs, dma_addr_t addr, int irq)
 {
        spin_lock_init(&idma.lock);
        idma.regs = regs;
        idma.lp_tx_addr = addr;
+       idma_irq = irq;
 }
 EXPORT_SYMBOL_GPL(idma_reg_addr_init);
 
@@ -419,32 +420,17 @@ static struct snd_soc_platform_driver asoc_idma_platform = {
        .pcm_free = idma_free,
 };
 
-static int asoc_idma_platform_probe(struct platform_device *pdev)
+int asoc_idma_platform_register(struct device *dev)
 {
-       idma_irq = platform_get_irq(pdev, 0);
-       if (idma_irq < 0)
-               return idma_irq;
-
-       return snd_soc_register_platform(&pdev->dev, &asoc_idma_platform);
+       return snd_soc_register_platform(dev, &asoc_idma_platform);
 }
+EXPORT_SYMBOL_GPL(asoc_idma_platform_register);
 
-static int asoc_idma_platform_remove(struct platform_device *pdev)
+void asoc_idma_platform_unregister(struct device *dev)
 {
-       snd_soc_unregister_platform(&pdev->dev);
-       return 0;
+       snd_soc_unregister_platform(dev);
 }
-
-static struct platform_driver asoc_idma_driver = {
-       .driver = {
-               .name = "samsung-idma",
-               .owner = THIS_MODULE,
-       },
-
-       .probe = asoc_idma_platform_probe,
-       .remove = asoc_idma_platform_remove,
-};
-
-module_platform_driver(asoc_idma_driver);
+EXPORT_SYMBOL_GPL(asoc_idma_platform_unregister);
 
 MODULE_AUTHOR("Jaswinder Singh, <jassisinghbrar@gmail.com>");
 MODULE_DESCRIPTION("Samsung ASoC IDMA Driver");
index 8644946..b12c47f 100644 (file)
 #ifndef __SND_SOC_SAMSUNG_IDMA_H_
 #define __SND_SOC_SAMSUNG_IDMA_H_
 
-extern void idma_reg_addr_init(void __iomem *regs, dma_addr_t addr);
+extern void idma_reg_addr_init(void __iomem *regs, dma_addr_t addr, int irq);
 
+int asoc_idma_platform_register(struct device *dev);
+void asoc_idma_platform_unregister(struct device *dev);
 /* dma_state */
 #define LPAM_DMA_STOP  0
 #define LPAM_DMA_START 1