From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Liam Girdwood <lrg@ti.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ASoC: dapm - Refactor widget IO functions in preparation for platform widgets.
Date: Thu, 9 Jun 2011 20:21:47 +0100 [thread overview]
Message-ID: <20110609192147.GA9916@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1307643049-3819-1-git-send-email-lrg@ti.com>
On Thu, Jun 09, 2011 at 07:10:49PM +0100, Liam Girdwood wrote:
> +static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg)
> +{
> + if (w->codec)
> + return snd_soc_read(w->codec, reg);
> + return 0;
> +}
I guess this and write() should return an error if they can't find
something to interact with. And realistically to also complain in the
logs given how usefully we can actualy handle errors.
I'm tempted to say let me post my regmap API that I've had sitting in my
-next queue over the weekend then we can just unconditionally use a
regmap here. I'd not been too happy with how it was handling mutli-word
I/O but there's only one user of that in ASoC so far. We still need the
_widget and so on versions wrapping them in ASoC of course so that we
can pass sensible objects in.
> +int soc_widget_update_bits(struct snd_soc_dapm_widget *w, unsigned short reg,
> + unsigned int mask, unsigned int value)
> +{
> + int change;
> + unsigned int old, new;
> +
> + old = soc_widget_read(w, reg);
> + new = (old & ~mask) | value;
Should do the & mask on value that I added to the vanilla one last week
- that would've avoided a genuine bug.
next prev parent reply other threads:[~2011-07-27 12:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 18:10 [PATCH] ASoC: dapm - Refactor widget IO functions in preparation for platform widgets Liam Girdwood
2011-06-09 19:21 ` Mark Brown [this message]
2011-06-10 12:11 ` Takashi Iwai
2011-06-10 14:44 ` Liam Girdwood
2011-06-10 14:58 ` Takashi Iwai
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=20110609192147.GA9916@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=lrg@ti.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