[alsa-devel] [PATCH 4/7] ASoC: S3C64XX: USE DMA info from platform data
From: Jassi Brar jassi.brar@samsung.com
Instead of hardcoding DMA channel numbers and address, for each controller in the driver, let the information be read from platform data.
Signed-off-by: Jassi Brar jassi.brar@samsung.com --- sound/soc/s3c24xx/s3c64xx-i2s.c | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/sound/soc/s3c24xx/s3c64xx-i2s.c b/sound/soc/s3c24xx/s3c64xx-i2s.c index 93ed3aa..8ca3c1d 100644 --- a/sound/soc/s3c24xx/s3c64xx-i2s.c +++ b/sound/soc/s3c24xx/s3c64xx-i2s.c @@ -147,6 +147,7 @@ static __devinit int s3c64xx_iis_dev_probe(struct platform_device *pdev) { struct s3c_i2sv2_info *i2s; struct snd_soc_dai *dai; + struct resource *res; int ret;
if (pdev->id >= MAX_I2SV3) { @@ -174,17 +175,27 @@ static __devinit int s3c64xx_iis_dev_probe(struct platform_device *pdev) i2s->dma_capture = &s3c64xx_i2s_pcm_stereo_in[pdev->id]; i2s->dma_playback = &s3c64xx_i2s_pcm_stereo_out[pdev->id];
- if (pdev->id == 0) { - i2s->dma_capture->channel = DMACH_I2S0_IN; - i2s->dma_capture->dma_addr = S3C64XX_PA_IIS0 + S3C2412_IISRXD; - i2s->dma_playback->channel = DMACH_I2S0_OUT; - i2s->dma_playback->dma_addr = S3C64XX_PA_IIS0 + S3C2412_IISTXD; - } else { - i2s->dma_capture->channel = DMACH_I2S1_IN; - i2s->dma_capture->dma_addr = S3C64XX_PA_IIS1 + S3C2412_IISRXD; - i2s->dma_playback->channel = DMACH_I2S1_OUT; - i2s->dma_playback->dma_addr = S3C64XX_PA_IIS1 + S3C2412_IISTXD; + res = platform_get_resource(pdev, IORESOURCE_DMA, 0); + if (!res) { + dev_err(&pdev->dev, "Unable to get I2S-TX dma resource\n"); + return -ENXIO; } + i2s->dma_playback->channel = res->start; + + res = platform_get_resource(pdev, IORESOURCE_DMA, 1); + if (!res) { + dev_err(&pdev->dev, "Unable to get I2S-RX dma resource\n"); + return -ENXIO; + } + i2s->dma_capture->channel = res->start; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) { + dev_err(&pdev->dev, "Unable to get I2S SFR address\n"); + return -ENXIO; + } + i2s->dma_capture->dma_addr = res->start + S3C2412_IISRXD; + i2s->dma_playback->dma_addr = res->start + S3C2412_IISTXD;
i2s->dma_capture->client = &s3c64xx_dma_client_in; i2s->dma_capture->dma_size = 4;
On Wed, Dec 09, 2009 at 01:29:38PM +0900, jassisinghbrar@gmail.com wrote:
From: Jassi Brar jassi.brar@samsung.com
Instead of hardcoding DMA channel numbers and address, for each controller in the driver, let the information be read from platform data.
Signed-off-by: Jassi Brar jassi.brar@samsung.com
OK, but this needs to go along with the arch/arm side to avoid breaking the driver.
On Wed, Dec 09, 2009 at 11:00:24AM +0000, Mark Brown wrote:
On Wed, Dec 09, 2009 at 01:29:38PM +0900, jassisinghbrar@gmail.com wrote:
From: Jassi Brar jassi.brar@samsung.com
Instead of hardcoding DMA channel numbers and address, for each controller in the driver, let the information be read from platform data.
Signed-off-by: Jassi Brar jassi.brar@samsung.com
OK, but this needs to go along with the arch/arm side to avoid breaking the driver.
I've applied the arch/arm side of the patch already, as this was quite eassy to do. It is then a case of whether I should take the patch to remove it from sound/soc/s3c24xx/s3c64xx-i2s.c or should we wait until my/rmk's tree has been merged into the mainline?
On Thu, Jan 28, 2010 at 1:27 PM, Ben Dooks ben-linux@fluff.org wrote:
On Wed, Dec 09, 2009 at 11:00:24AM +0000, Mark Brown wrote:
On Wed, Dec 09, 2009 at 01:29:38PM +0900, jassisinghbrar@gmail.com wrote:
From: Jassi Brar jassi.brar@samsung.com
Instead of hardcoding DMA channel numbers and address, for each controller in the driver, let the information be read from platform data.
Signed-off-by: Jassi Brar jassi.brar@samsung.com
OK, but this needs to go along with the arch/arm side to avoid breaking the driver.
I've applied the arch/arm side of the patch already, as this was quite eassy to do. It is then a case of whether I should take the patch to remove it from sound/soc/s3c24xx/s3c64xx-i2s.c or should we wait until my/rmk's tree has been merged into the mainline?
btw, patch 5/7 http://mailman.alsa-project.org/pipermail/alsa-devel/2009-December/023782.ht... is pending too for the same reason. ofcourse, I will resend as you decide how to proceed. thanks
participants (4)
-
Ben Dooks
-
jassi brar
-
jassisinghbrar@gmail.com
-
Mark Brown