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: Mon, 24 Aug 2009 19:54:40 +0800	[thread overview]
Message-ID: <1251114880.3676.41.camel@shinel> (raw)
In-Reply-To: <20090824101733.GA3591@rakim.wolfsonmicro.main>


> ...but there's no need for the struct, just pass two arguments to the
> function, the event and either the substream or the direction.  The
> substream is probably easier since otherwise all the callers will need
> to parse the direction.

Finally, I decide to place the callback function in struct
s3c2410_dma_client instead of add a new struct:

 struct s3c2410_dma_client {

       ....

       /* callback funtion from client to generate the DMA REQ signal */
       int (*gen_request)(void *);

       /* callback funtion from client to end the DMA request */
       int (*end_request)(void *);

       /* argument for the callback function */
       void            *private_data;
 };

I think the callback function should have only one argument. If we have
more than one argument to pass, just embbed them into a internal struct
known to the callback funtions and pass the pointer to the object of
this struct to the callback function. 

If not, more filed will be needed in struct s3c2410_dma_client to place
the arguments. I think it's redundant for the generic DMA driver.

I've posted five new patches which regist the callback functions either
in the I2S/AC97 probe phase or by directly assiged in the source code
depended by whether the callback functions and the object of struct
s3c2410_dma_client are in the same source file.

Look forward for further comments on these patches. There should be some
defects in them.

Thanks.

  parent reply	other threads:[~2009-08-24 11:55 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
     [not found]                     ` <20090824101733.GA3591@rakim.wolfsonmicro.main>
2009-08-24 11:54                       ` Shine Liu [this message]
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=1251114880.3676.41.camel@shinel \
    --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.