From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Ola LILJA2 <ola.o.lilja@stericsson.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
Liam Girdwood <lrg@ti.com>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH 13/16] ASoC: codecs: Add AB8500 codec-driver
Date: Wed, 14 Mar 2012 13:45:08 +0000 [thread overview]
Message-ID: <20120314134508.GL3133@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <AC3CA153830A24419D7BF22D87B39D0557F2F28251@EXDCVYMBSTM006.EQ1STM.local>
[-- Attachment #1.1: Type: text/plain, Size: 4331 bytes --]
On Wed, Mar 14, 2012 at 02:27:13PM +0100, Ola LILJA2 wrote:
Fix your mailer to word wrap properly, I've reflowed your text for
legibility.
> > > diff --git a/sound/soc/codecs/ab8500_audio.c
> > > b/sound/soc/codecs/ab8500_audio.c
> > Everything else uses -codec.
> Could just see one codec named with "-codec". The reason for appending _audio
> Is that the AB8500 is not only audio and we already have files elsewhere named
> ab8500.c but I probably could rename it to ab8500-codec.c.
The drivers for MFDs pretty much all call themselves -codec internally
(as yours does).
> > Why are you doing this virtual register stuff? It's making the code a
> > lot more complex and doesn't look at all driver specific.
> There is a chain of events leading up to the decision of having it
> like this. The HW is designed so that only one coefficient-register
> is present and when we write a value to it the HW increases a HW-index
> so that the next time we write to it the value will set the next
> coefficient and so on. Also, we don't want to be able to first set
> all FIR/IIR-coefficients with the ALSA-controls And when we are happy
> we write all the coefficients to the HW by committing them using the
> strobe-control. Furthermore, we cannot read the coefficients from the
> HW, so to be able to provide this to userspace we use the
> SOC_HWDEP_MULTIPLE_1R, and since these values actually is not exposed
> as separate registers we use a set of virtual register. When we commit
> the coefficients we then take the values from the virtual registers
> and write them down to the HW in a loop.
Don't do this, this just makes things a lot more complicated in the
register I/O code and making it much more difficult to work with both
locally and from a framework point of view. Store the coefficients in
your driver data rather than shoehorning them into the register cache.
> > > +static const char * const enum_ena_dis[] = {"Enabled", "Disabled"};
> > > +static const char * const enum_dis_ena[] = {"Disabled", "Enabled"};
> > Why are the controls using these enums and not Switch controls? UIs
> > know how to display switches.
> We need to make the switches virtual, as we don't want them to
> actually set any bits, just break or complete a DAPM-chain. That is
> why we made the as MUX:es.
This is completely orthogonal to how the controls are displayed to
userspace, it's an implementation detail of your driver. Though if your
routing control doesn't actually touch the device one has to wonder what
it actually does...
> > > +/* Earpiece - Mute */
> > > +static const struct snd_kcontrol_new dapm_ear_mute[] = {
> > > + SOC_DAPM_SINGLE("Playback Switch", REG_MUTECONF,
> > > +REG_MUTECONF_MUTEAR, 1, 1), };
> > This looks like it's just a mute rather than a mixer input enable
> > (there's only one control...) so should be a regular sound control;
> > unless there's a very good reason mutes other than mixer inputs
> > normally don't affect the audio path as you might get pops and you
> > probably don't want to do things like stop clocking just because the
> > output is silenced. Similar thing applies in several other places.
> Most of the mutes need to be apart of the DAPM-chain to actually prevent
> click-n-pops. So it cannot be used by the user as a normal ALSA-control.
> Muting can be done by setting certain gains to -inf.
This explanation doesn't correspond to what you've actually written -
the code above will result in a user visible control.
> > > + unsigned int fmt,
> > > + unsigned int wl,
> > > + unsigned int delay);
> > > +void ab8500_audio_anc_configure(struct snd_soc_codec *codec,
> > > + bool apply_fir, bool apply_iir);
> > No, you shouldn't be exporting this stuff - it all looks like basic
> > framework stuff.
> Hmm.. ok... the power_control is needed for reasons explained before
> (vibra-driver and Accessory-detection-magic), but I guess I have to
> remove these features for now and I can then remove this export.
You've not mentioned accessory detection before... there's certainly
no obvious excuse for doing the power management for accessory detection
outside of DAPM, we've got a bunch of drivers in mainline already which
manage to do this quite successfully, but since you've not explained
what the issue you think you see is it's hard to comment.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2012-03-14 13:45 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 15:11 [PATCH 01/16] ASoC: core: Add multi reg control struct & macros Ola Lilja
2012-03-13 15:11 ` [PATCH 02/16] ASoC: core: Add 8bit multi reg control accessors Ola Lilja
2012-03-13 21:25 ` Mark Brown
2012-03-22 16:58 ` Kristoffer KARLSSON
2012-03-22 17:02 ` Mark Brown
2012-03-13 15:11 ` [PATCH 03/16] ASoC: core: Add range of " Ola Lilja
2012-03-13 21:23 ` Mark Brown
2012-03-13 15:11 ` [PATCH 04/16] ASoC: core: Add info accessor for mreg control Ola Lilja
2012-03-13 15:11 ` [PATCH 05/16] ASoC: core: Add strobe control Ola Lilja
2012-03-13 21:33 ` Mark Brown
2012-03-22 16:20 ` Kristoffer KARLSSON
2012-03-22 16:33 ` Mark Brown
2012-03-22 17:09 ` Kristoffer KARLSSON
2012-03-22 17:28 ` Mark Brown
2012-03-13 15:11 ` [PATCH 06/16] ASoC: core: Add macros for 8bit hwdep multi reg cntrl Ola Lilja
2012-03-13 21:36 ` Mark Brown
2012-03-13 15:11 ` [PATCH 07/16] ASoC: core: Add macro for hwdep range of regs control Ola Lilja
2012-03-13 15:11 ` [PATCH 08/16] ARM: ux500: Add DMA-channels for MSP Ola Lilja
2012-03-13 15:11 ` [PATCH 09/16] arm: ux500: Add audio-regulators Ola Lilja
2012-03-14 10:42 ` Linus Walleij
2012-03-13 15:11 ` [PATCH 10/16] arm: ux500: Add support for MSP I2S-devices Ola Lilja
2012-03-13 21:40 ` Mark Brown
2012-03-14 9:39 ` Linus Walleij
2012-03-14 11:44 ` Mark Brown
2012-03-13 15:11 ` [PATCH 11/16] ARM: ux500: Add placeholder for clk_set_parent Ola Lilja
2012-03-14 10:43 ` Linus Walleij
2012-03-13 15:11 ` [PATCH 14/16] ASoC: Ux500: Add platform-driver Ola Lilja
2012-03-13 22:48 ` Mark Brown
2012-03-14 10:50 ` Linus Walleij
2012-03-14 12:31 ` Mark Brown
2012-03-13 15:11 ` [PATCH 15/16] ASoC: Ux500: Activate the Ux500 ASoC-driver Ola Lilja
2012-03-13 15:11 ` [PATCH 16/16] ASoC: Ux500: Add machine-driver Ola Lilja
2012-03-13 23:03 ` Mark Brown
2012-03-13 21:39 ` [PATCH 01/16] ASoC: core: Add multi reg control struct & macros Mark Brown
2012-03-21 12:07 ` Kristoffer KARLSSON
2012-03-21 12:40 ` Mark Brown
2012-03-22 15:46 ` Kristoffer KARLSSON
2012-03-22 15:56 ` Mark Brown
[not found] ` <1331651503-16917-13-git-send-email-ola.o.lilja@stericsson.com>
2012-03-13 22:11 ` [PATCH 12/16] ASoC: Ux500: Add MSP I2S-driver Mark Brown
[not found] ` <1331651503-16917-14-git-send-email-ola.o.lilja@stericsson.com>
2012-03-13 22:45 ` [PATCH 13/16] ASoC: codecs: Add AB8500 codec-driver Mark Brown
2012-03-14 13:27 ` Ola LILJA2
2012-03-14 13:45 ` Mark Brown [this message]
2012-03-15 14:50 ` Ola Lilja
2012-03-15 15:29 ` Mark Brown
2012-03-16 13:09 ` Ola Lilja
2012-03-17 22:31 ` Mark Brown
2012-03-19 8:07 ` Ola Lilja
2012-03-19 8:23 ` Linus Walleij
2012-03-19 12:09 ` Mark Brown
2012-03-19 14:54 ` Ola Lilja
2012-03-19 15:43 ` 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=20120314134508.GL3133@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=linus.walleij@linaro.org \
--cc=lrg@ti.com \
--cc=ola.o.lilja@stericsson.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).