From b98aafd2029d7aac84ab92e0193075298b0381a7 Mon Sep 17 00:00:00 2001 From: Inha Song Date: Wed, 30 Apr 2014 16:04:28 +0900 Subject: [PATCH] ASoC: Samsung: Don't register idma device as platform device 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 --- sound/soc/samsung/idma.c | 30 ++++++++---------------------- sound/soc/samsung/idma.h | 4 +++- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c index 6e5fed3..8c3f912 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c @@ -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, "); MODULE_DESCRIPTION("Samsung ASoC IDMA Driver"); diff --git a/sound/soc/samsung/idma.h b/sound/soc/samsung/idma.h index 8644946..b12c47f 100644 --- a/sound/soc/samsung/idma.h +++ b/sound/soc/samsung/idma.h @@ -14,8 +14,10 @@ #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 -- 2.7.4