From: "stanley.miao" <stanley.miao@windriver.com>
To: Mark Brown <broonie@sirena.org.uk>
Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org
Subject: Re: [alsa-devel] [PATCHv2 1/1] OMAP_TWL4030 SoC Audio driver.
Date: Thu, 27 Nov 2008 23:56:05 +0800 [thread overview]
Message-ID: <1227801365.14497.136.camel@localhost> (raw)
In-Reply-To: <20081127131923.GC3933@sirena.org.uk>
On Thu, 2008-11-27 at 13:19 +0000, Mark Brown wrote:
> On Thu, Nov 27, 2008 at 08:50:57PM +0800, Stanley.Miao wrote:
>
> > Add a shared omap_twl4030 driver to avoid reduplicate code among omap drivers.
> > This drive also provides a extended interface for some board specific features.
>
> As discussed in the thread following your initial submission it'd be
> better to do something like having flags specifying which outputs are
> connected up rather than just leaving all that stuff to per-board code.
> At the minute all that's being shared is a bit of boiler plate (which
> will get smaller) and the hw_params function at the source code level.
>
> As I said in response to your original posting I'd strongly urge you to
> look at the s3c24xx_uda134x driver for an example of how something like
> this can be implemented.
I tried to make it work whether there is platform_data or not. If I
write it according to s3c24xx_uda134x style, every board should register
a platform_device.
>
> Some more specific comments below...
>
> > +config SND_OMAP_TWL4030_SPECIFIC
> > + bool
> > + default n
> > +
>
> This really needs some documentation. I think a better name should be
> possible too but see my comments below for the header...
>
<snip>
>
> > +#ifdef CONFIG_SND_OMAP_TWL4030_SPECIFIC
> > +extern void omap_twl4030_specific_init(struct snd_soc_device *);
> > +#else
> > +static inline void omap_twl4030_specific_init(struct snd_soc_device *snd_dev)
> > +{
> > + if(snd_dev == NULL)
> > + return;
> > + /* McBSP2 */
> > + *(unsigned int *)snd_dev->machine->dai_link->cpu_dai->private_data = 1;
> > + omap_twl4030_data = NULL;
> > +}
> > +#endif
>
> This still has the previous problem with your use of ifdefs: it means
> that it's not possible to build the driver for configurations that both
> do and don't need this.
This is why there is a SND_OMAP_TWL4030_SPECIFIC in Kconfig. If there
are some board specific features, SND_OMAP_TWL4030_SPECIFIC should be
selected under a board config, and omap_twl4030_specific_init() will be
difined in the board specific file.
Stanley.
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2008-11-27 15:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-27 12:50 [PATCHv2 0/1] OMAP_TWL4030 SoC Audio driver Stanley.Miao
2008-11-27 12:50 ` [alsa-devel][PATCHv2 1/1] " Stanley.Miao
2008-11-27 13:19 ` Mark Brown
2008-11-27 15:56 ` stanley.miao [this message]
2008-11-27 15:54 ` [PATCHv2 " 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=1227801365.14497.136.camel@localhost \
--to=stanley.miao@windriver.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@sirena.org.uk \
--cc=linux-omap@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox