From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Daniel Mack <daniel@caiaq.de>
Cc: alsa-devel@alsa-project.org, Timur Tabi <timur@freescale.com>,
Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [PATCH] ALSA: ASoc: Add regulator support to CS4270 codec driver
Date: Wed, 25 Nov 2009 15:01:39 +0000 [thread overview]
Message-ID: <20091125150139.GC636@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <1259159787-21876-1-git-send-email-daniel@caiaq.de>
On Wed, Nov 25, 2009 at 03:36:27PM +0100, Daniel Mack wrote:
> + struct regulator *va_reg;
This should be three different supplies - there's separate digital and
control supplies, as well as a buffer supply. Board designs frequently
split the analog and digital supplies. The regulator API has bulk_
variants intended to make using multiple supplies en masse easier.
> static int cs4270_dai_mute(struct snd_soc_dai *dai, int mute)
> {
> struct snd_soc_codec *codec = dai->codec;
> struct cs4270_private *cs4270 = codec->private_data;
> - int reg6;
> + int reg6, err;
>
> reg6 = snd_soc_read(codec, CS4270_MUTE);
>
> if (mute)
> reg6 |= CS4270_MUTE_DAC_A | CS4270_MUTE_DAC_B;
> else {
> + if (cs4270->va_reg)
> + regulator_enable(cs4270->va_reg);
> +
This looks wrong - why is the power being controlled in the mute
function? If nothing else this is going to break recording since the
CODEC will only be unmuted during playback which means power will be cut
during record.
> +#ifdef CONFIG_REGULATOR
> + /* get the regulator if there is one read<y for us */
> + cs4270->va_reg = regulator_get(&pdev->dev, "va");
> +
> + if (IS_ERR(cs4270->va_reg))
> + cs4270->va_reg = NULL;
> +#endif
This isn't needed, the regulator API stubs itself out so you can just
unconditionally use it in consumer drivers. The same applies to the
enable/disable calls, a simple driver like this should never need to
check to see if the API is enabled (this is why you don't need to ifdef
out the calls in the mute function).
next prev parent reply other threads:[~2009-11-25 15:01 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 14:36 [PATCH] ALSA: ASoc: Add regulator support to CS4270 codec driver Daniel Mack
2009-11-25 15:01 ` Mark Brown [this message]
2009-11-25 15:20 ` Daniel Mack
2009-11-25 15:38 ` Mark Brown
2009-11-25 15:46 ` Daniel Mack
2009-11-26 15:48 ` Daniel Mack
2009-11-26 16:03 ` Mark Brown
2009-11-26 17:42 ` Daniel Mack
2009-11-27 11:25 ` Mark Brown
2009-11-27 12:41 ` Daniel Mack
2009-11-27 13:32 ` Mark Brown
2009-11-28 20:23 ` Timur Tabi
2009-11-28 20:31 ` Mark Brown
2009-11-28 22:18 ` Timur Tabi
2009-11-29 0:44 ` Daniel Mack
2009-11-29 4:34 ` Timur Tabi
2009-11-29 8:35 ` Daniel Mack
2009-11-30 10:12 ` Daniel Mack
[not found] ` <5610599F537DD74A8D1F5CC946A7507303478C40@az33exm25.fsl.freescale.net>
2009-11-30 12:01 ` Mark Brown
2009-11-30 12:36 ` Daniel Mack
2009-11-30 15:57 ` Daniel Mack
2009-11-30 16:12 ` Mark Brown
2009-11-30 16:51 ` Daniel Mack
2009-11-30 16:56 ` Daniel Mack
2009-12-04 12:00 ` Daniel Mack
2009-12-04 12:07 ` Mark Brown
2009-12-05 2:54 ` Timur Tabi
2009-12-05 3:51 ` Mark Brown
2009-12-05 17:03 ` Timur Tabi
2009-12-07 13:16 ` 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=20091125150139.GC636@rakim.wolfsonmicro.main \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=daniel@caiaq.de \
--cc=lrg@slimlogic.co.uk \
--cc=timur@freescale.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