From: Mark Brown <broonie@sirena.org.uk>
To: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Cc: sakoman@gmail.com, alsa-devel@alsa-project.org
Subject: Re: [PATCH 5/9] ASoC: TWL4030: Add PreDriv outupt mux and volume controls
Date: Mon, 24 Nov 2008 14:50:31 +0000 [thread overview]
Message-ID: <20081124145031.GH22394@sirena.org.uk> (raw)
In-Reply-To: <200811241619.18786.peter.ujfalusi@nokia.com>
On Mon, Nov 24, 2008 at 04:19:18PM +0200, Peter Ujfalusi wrote:
> On Monday 24 November 2008 15:48:09 ext Mark Brown wrote:
> > I know quite a few existing drivers use an array of enums but please
> > don't do this for new code - it doesn't help legibility to have to find
> > the enums in the table.
> I have seen this approach in several codec code, so I have also implemented
> in a same way.
> I will change it.
> Do you have a pointer, where should I look for existing code?
At least WM8990 and WM8903 do this with separate controls. Most of the
drivers should be fine to look at for examples, it's just that this was
done for some of the older drivers and it's never been worth changing
them.
> > Is this really an enum? The fact that it's described as a mixer and
...
> > in other drivers for examples. If it's really an enum then calling it a
> > mux is probably better.
>
> Hmmm, the situation is kind of both...
> The selection is done in a bitfield.
> Let's take the PREDL, as I used that in the helper function comment:
> bit 0 (0x1): voice_en
> bit 1 (0x2): Audio L1 enable (DACL1)
> bit 2 (0x4): Audio L2 enable (DACL2)
> bit 3 (0x8): Audio R2 enable (DACR2)
> The voice path can be enabled/disabled independently from the digital
> paths, but only _one_ of the DACL1, DACL2 or DACR2 can be selected at
> the time.
Oh, ick. There's a couple of ways I can think of to represent that to
DAPM. One would be to have a simple mixer with switches for everything
and an extended event on the mixer which returns an error if multiple
DAC inputs are enabled. The other is to have the DAC selection be a
custom mux like you've got and feed that into the mixer unconditionally.
The voice input should certainly be a separate control here.
> On top of that the mute can be performed by setting all four bits to 0.
> I don't know actually what that means, but probably than the PreDriv
> path will be effectively turned off.
That's just equivalent to turning off all the inputs so sounds like it
shouldn't need any special handling.
> On the side not: the voice path at the moment not in use -> the codec has
> to be in different mode to have the voice path enabled. But then lot's of
> things will behave differently.
Could you go into more detail about these modes? Sounds like it could
get tricky...
> Initially I did not wanted to spread these controls - to make it simple
> for myself, but I might separate the voice and DAC mux selections (separated
> enable for voice and mux the DACL/Rs selection).
Yes, that does sound like the best approach.
next prev parent reply other threads:[~2008-11-24 14:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-24 11:49 [PATCH 0/9] ASoC: TWL4030: Add mixer controls for outputs Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 1/9] ASoC: TWL4030: Change the Master volume control to TLV Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 2/9] ASoC: TWL4030: Add CGAIN volume control Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 3/9] ASoC: TWL4030: Add helper function for mux handling Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 4/9] ASoC: TWL4030: Add helper function for output gain controls Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 5/9] ASoC: TWL4030: Add PreDriv outupt mux and volume controls Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 6/9] ASoC: TWL4030: Add Headset " Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 7/9] ASoC: TWL4030: Add Carkit " Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 8/9] ASoC: TWL4030: Add Hands-free outupt mux control Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 9/9] ASoC: TWL4030: Add Earpiece outupt mux and volume controls Peter Ujfalusi
2008-11-24 13:48 ` [PATCH 5/9] ASoC: TWL4030: Add PreDriv " Mark Brown
2008-11-24 14:19 ` Peter Ujfalusi
2008-11-24 14:50 ` Mark Brown [this message]
2008-11-25 10:51 ` Peter Ujfalusi
2008-11-24 13:57 ` [PATCH 4/9] ASoC: TWL4030: Add helper function for output gain controls Mark Brown
2008-11-24 13:55 ` [PATCH 2/9] ASoC: TWL4030: Add CGAIN volume control Mark Brown
2008-11-24 13:55 ` [PATCH 1/9] ASoC: TWL4030: Change the Master volume control to TLV 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=20081124145031.GH22394@sirena.org.uk \
--to=broonie@sirena.org.uk \
--cc=alsa-devel@alsa-project.org \
--cc=peter.ujfalusi@nokia.com \
--cc=sakoman@gmail.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