* [PATCH 4/7] ASoC: S3C64XX: USE DMA info from platform data
@ 2009-12-09 4:29 jassisinghbrar
2009-12-09 11:00 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: jassisinghbrar @ 2009-12-09 4:29 UTC (permalink / raw)
To: alsa-devel; +Cc: broonie, Jassi Brar, ben-linux
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;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 4/7] ASoC: S3C64XX: USE DMA info from platform data
2009-12-09 4:29 [PATCH 4/7] ASoC: S3C64XX: USE DMA info from platform data jassisinghbrar
@ 2009-12-09 11:00 ` Mark Brown
2010-01-28 4:27 ` Ben Dooks
0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2009-12-09 11:00 UTC (permalink / raw)
To: jassisinghbrar; +Cc: alsa-devel, Jassi Brar, ben-linux
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 4/7] ASoC: S3C64XX: USE DMA info from platform data
2009-12-09 11:00 ` Mark Brown
@ 2010-01-28 4:27 ` Ben Dooks
2010-01-28 6:38 ` jassi brar
0 siblings, 1 reply; 4+ messages in thread
From: Ben Dooks @ 2010-01-28 4:27 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, jassisinghbrar, Jassi Brar, ben-linux
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?
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 4/7] ASoC: S3C64XX: USE DMA info from platform data
2010-01-28 4:27 ` Ben Dooks
@ 2010-01-28 6:38 ` jassi brar
0 siblings, 0 replies; 4+ messages in thread
From: jassi brar @ 2010-01-28 6:38 UTC (permalink / raw)
To: Ben Dooks; +Cc: alsa-devel, Mark Brown, Jassi Brar
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.html
is pending too for the same reason.
ofcourse, I will resend as you decide how to proceed.
thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-28 6:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-09 4:29 [PATCH 4/7] ASoC: S3C64XX: USE DMA info from platform data jassisinghbrar
2009-12-09 11:00 ` Mark Brown
2010-01-28 4:27 ` Ben Dooks
2010-01-28 6:38 ` jassi brar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).