All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shine Liu <shinel@foxmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, ben-linux@fluff.org
Subject: Re: [PATCH] ASoC: s3c24xx platform: Fix s3c2410_dma_started called at wrong time
Date: Sun, 23 Aug 2009 19:37:13 +0800	[thread overview]
Message-ID: <1251027433.732.42.camel@sl> (raw)
In-Reply-To: <20090823102841.GA737@opensource.wolfsonmicro.com>


> 
> This isn't quite what I was expecting - what I was expecting was more
> that the I2S driver would set up a function on startup which would be
> called by the ASoC DMA driver from its trigger function.  It does look
> like a reasonable approach, though.

Yes, I understand what you exactly want. I was intend to register the
callback function on I2S startup, but finally I found it is not possible
because there are two callback functions for the DMA driver:
s3c24xx_snd_txctrl() and s3c24xx_snd_rxctrl(), however, there's only one
slot for the callback function. So I choose not to setup the callback
functions dynamicly, when the task is playback, the callback funtion is
s3c24xx_snd_txctrl() and when the task is record, the funtion is
s3c24xx_snd_rxctrl().

However, there's another way to archive what you expect: combine the
s3c24xx_snd_txctrl() and s3c24xx_snd_rxctrl() into one function. That
would be like:

struct s3c24xx_snd_ctrl_data {
	int event;	//start or stop
	int direction;	//playback or record
};

static void s3c24xx_snd_ctrl(struct s3c24xx_snd_ctrl_data* data)
{
	if(data->direction == SNDRV_PCM_STREAM_PLAYBACK)
		s3c24xx_snd_txctrl(data->event);
	eles
		s3c24xx_snd_rxctrl(data->event);
}

Then we can register this callback funtion on I2S startup.

> 
> The way you've got things at the minute at least all the other S3C ASoC
> drivers will need to be updated to match the change in the DMA driver.
> 

I have posted the DMA driver patch to linux-arm-kernel yesterday:
http://lists.arm.linux.org.uk/lurker/message/20090822.153940.e15e3bd7.en.html

Hope there is no problem to merge the patch.

If the dma patch is accepted, I will post a formal patch here for ASoC
S3C24XX.

  reply	other threads:[~2009-08-23 11:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20  9:42 [PATCH] ASoC: s3c24xx platform: Fix s3c2410_dma_started called at wrong time Shine Liu
2009-08-20 10:15 ` Mark Brown
2009-08-20 11:59   ` Shine Liu
2009-08-20 12:18     ` Mark Brown
2009-08-20 13:38       ` Shine Liu
2009-08-20 14:52         ` Mark Brown
2009-08-20 15:45           ` Shine Liu
2009-08-20 18:47             ` Mark Brown
2009-08-21 10:00               ` Shine Liu
2009-08-23 10:28                 ` Mark Brown
2009-08-23 11:37                   ` Shine Liu [this message]
     [not found]                     ` <20090824101733.GA3591@rakim.wolfsonmicro.main>
2009-08-24 11:54                       ` Shine Liu
2009-08-24 12:05                         ` Mark Brown
2009-08-24 13:31                           ` Shine Liu
2009-08-25  3:04                   ` [PATCH] ASoC: S3C platform: Fix s3c2410_dma_started() called at improper time Shine Liu
2009-08-25 10:33                     ` Mark Brown
2009-08-25 12:05                       ` Shine Liu
2009-08-25 12:12                         ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1251027433.732.42.camel@sl \
    --to=shinel@foxmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=ben-linux@fluff.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.