From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: alsa-devel@alsa-project.org,
Kuninori Morimoto <morimoto.kuninori@renesas.com>,
Magnus Damm <damm@opensource.se>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
linux-sh@vger.kernel.org
Subject: Re: [alsa-devel] [PATCH 1/4] ASoC: add a WM8978 codec driver
Date: Wed, 20 Jan 2010 20:25:46 +0000 [thread overview]
Message-ID: <1264019146.6554.25.camel@odin> (raw)
In-Reply-To: <Pine.LNX.4.64.1001202051370.4151@axis700.grange>
On Wed, 2010-01-20 at 21:01 +0100, Guennadi Liakhovetski wrote:
> On Tue, 19 Jan 2010, Liam Girdwood wrote:
> >
> > It would be nice to have the relevant bits defined here for set_fmt()
> > etc instead of just the magic numbers used in the above codec driver.
>
> As I explained privately, I agree, that using names instead of bits helps
> - but (mostly) only where those bits are reused multiple times in the
> code. If you only have to initialise a register once with some bitmask, I
> think, code like
>
> /* Enable input X, output Y, set default W polarity to Z */
> __raw_writel(0x123, reg);
>
> looks better than
>
> __raw_writel(CHIP_INPUT_X_ENABLE | CHIP_OUTPUT_Y_ENABLE |
> CHIP_SIGNAL_W_POLARITY_Z, reg);
>
> so, unless there strong preferences in ALSA world, I'll try to combine
> both. Let me know if this contradicts the common ALSA style.
I disagree, it's far better to use the bottom example as I can see
explicitly which bits you intend to write. This makes it easier for
others to extend and debug your code.
Furthermore, WM codecs also have software generated register bits and
register macros (available upon request) that further reduce any effort
and any potential register value bugs.
Liam
next prev parent reply other threads:[~2010-01-20 20:25 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-19 8:08 [PATCH 0/4] ALSA: SH: add ASoC driver for SIU audio engine, an audio Guennadi Liakhovetski
2010-01-19 8:08 ` [PATCH 1/4] ASoC: add a WM8978 codec driver Guennadi Liakhovetski
2010-01-19 10:46 ` [alsa-devel] " Liam Girdwood
2010-01-20 20:01 ` Guennadi Liakhovetski
2010-01-20 20:21 ` Mark Brown
2010-01-20 20:25 ` Liam Girdwood [this message]
[not found] ` <20100119105729.GA32559@opensource.wolfsonmicro.com::587>
2010-01-20 19:50 ` Guennadi Liakhovetski
2010-01-20 20:17 ` [alsa-devel] " Mark Brown
2010-01-22 8:35 ` Guennadi Liakhovetski
2010-01-22 10:35 ` Mark Brown
2010-01-22 16:27 ` [PATCH 1/4 v2] " Guennadi Liakhovetski
2010-01-22 17:39 ` Liam Girdwood
2010-01-23 20:47 ` [alsa-devel] " Mark Brown
2010-01-26 13:04 ` Guennadi Liakhovetski
2010-01-26 13:26 ` Mark Brown
2010-01-26 14:08 ` Guennadi Liakhovetski
2010-01-26 15:22 ` Mark Brown
2010-01-19 8:09 ` [PATCH 2/4] ASoC: add DAI and platform drivers for SH SIU and support Guennadi Liakhovetski
2010-01-19 11:13 ` [alsa-devel] [PATCH 2/4] ASoC: add DAI and platform drivers Liam Girdwood
2010-01-19 12:34 ` [PATCH 2/4] ASoC: add DAI and platform drivers for SH SIU and Mark Brown
2010-01-22 18:09 ` [PATCH 2a/4 v2] ASoC: add DAI and platform / DMA drivers for SH SIU Guennadi Liakhovetski
2010-01-25 13:58 ` [PATCH 2a/4 v2] ASoC: add DAI and platform / DMA drivers for Liam Girdwood
2010-01-25 15:06 ` Mark Brown
2010-01-22 18:17 ` [PATCH 2b/4 v2] ASoC: add support for the sh7722 Migo-R board Guennadi Liakhovetski
2010-01-25 13:21 ` Mark Brown
2010-01-25 13:47 ` [alsa-devel] [PATCH 2b/4 v2] ASoC: add support for the sh7722 Liam Girdwood
2010-01-27 11:15 ` [PATCH 2b/4 v2] ASoC: add support for the sh7722 Migo-R board Guennadi Liakhovetski
2010-01-29 14:13 ` [alsa-devel] [PATCH 2b/4 v2] ASoC: add support for the sh7722 Mark Brown
2010-01-19 8:09 ` [PATCH 3/4] sh: add DMA slave definitions and SIU platform data to Guennadi Liakhovetski
2010-01-19 8:09 ` [PATCH 4/4] sh: audio support for the sh7722 Migo-R board Guennadi Liakhovetski
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=1264019146.6554.25.camel@odin \
--to=lrg@slimlogic.co.uk \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=damm@opensource.se \
--cc=g.liakhovetski@gmx.de \
--cc=linux-sh@vger.kernel.org \
--cc=morimoto.kuninori@renesas.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 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).