From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Arnaud Patard <apatard@mandriva.com>
Cc: alsa-devel@alsa-project.org, nico@fluxnic.net, saeed@marvell.com,
tbm@cyrius.com
Subject: Re: [patch 4/6] cs42l51: add asoc driver
Date: Wed, 12 May 2010 15:08:35 +0100 [thread overview]
Message-ID: <20100512140835.GC8082@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <m37hn9ut9u.fsf@anduin.mandriva.com>
On Wed, May 12, 2010 at 03:46:53PM +0200, Arnaud Patard wrote:
> Mark Brown <broonie@opensource.wolfsonmicro.com> writes:
> > On Tue, May 11, 2010 at 06:23:46PM +0200, apatard@mandriva.com wrote:
> >> + if ((reg < CS42L51_FIRSTREG) || (reg > CS42L51_LASTREG))
> >> + return -EIO;
> >> + return cache[reg - CS42L51_FIRSTREG];
> > Please just use the standard register cache access stuff in soc-cache.c.
> > The first register is 1 so you're only burning a single byte of RAM by
> > using the generic code.
> I'm using i2c_smbus_read_i2c_block_data() and didn't notice it in the
> soc-cache.c file. I didn't look further so it's possible that there's
> actually something working for my case.
The soc-cache stuff doesn't deal with initialising the cache so you can
still use that to initialise the cache. Generally people use the I2C
APIs rather than smbus ones, smbus is just an I2C subset.
> >> + ret = cs42l51_fill_cache(codec);
> >> + if (ret < 0) {
> >> + dev_err(&i2c_client->dev, "failed to fill register cache\n");
> >> + goto error;
> >> + }
> > Normal practice is to reset the chip so it's in a known sensible state
> > when the driver starts trying to use it. Is there a good reason not to
> > do this here?
> The default reset state is good except for the bits I'm changing few
> lines later.
In that case a table of register defaults plus doing a reset is likely
to be more robust.
> >> + * - Use signal processor
> > What does this mean? It sounds like something that would need to be
> > power managed via DAPM?
> there are 3 options for DAC:
> 00 - PCM Serial Port to DAC
> 01 - Signal Processing Engine to DAC
> 10 - ADC Serial Port to DAC
> but only the "signal processing engine to DAC" configuration is
> useful. Using others are dropping some functionnalities.
This sounds like useful stuff to offer to the user as a runtime option -
ADC->DAC can be used for bypass paths, and PCM to DAC will presumably
save power if the DSP is not in use.
> >> + /* route microphone */
> >> + ret = cs42l51_i2c_write(codec, ADC_INPUT, 0xF0);
> >> + if (ret < 0)
> >> + goto error;
> > Ditto.
> That's the only way to get microphone support, that's why I didn't
> consider it as an option.
The routing should be runtime configurable. I've no idea what the
options the chip offers are, but presumably some of the other options
are usable.
> >> + SOC_DOUBLE_R("PCM Playback Switch", PCMA_VOL, PCMB_VOL, 7, 1, 1),
> > I suspect that this should be managed via the DAI mute function.
> I wondered about this too and I choose to not use it. My thoughts was
> that if I was to go and implement the DAI mute, it should rather mute
> PCM playback and Analog playback channels at the same time I guess.
No, the purpose of the DAI mute is specifically to stop the data coming
out of the DAC while the digital audio interface is coming up - some
systems see noise there when starting up so we do the DAC unmute last in
the stream start to ensure that we don't play any of that back to the
user.
> >> + SOC_DOUBLE("Mic Powerdown", MIC_POWER_CTL, 2, 3, 1, 0),
> > What does this do? Sounds like it should be DAPM controls.
> It's to power down (or not) the 2 preamplifiers of the microphone
> channels and not to power down the microphone. Maybe the name is not the
> best one. Better names accepted.
> With this new explanation, should I convert it to DAPM or is it fine as
> mixer control ?
That's definitely something that should be managed via DAPM - we only
need to power up the amplifier when the signal is being used.
next prev parent reply other threads:[~2010-05-12 14:08 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-11 16:23 [patch 0/6] kirkwood openrd client audio support apatard
2010-05-11 16:23 ` [patch 1/6] kirkwood: add audio functions apatard
2010-05-12 8:56 ` Liam Girdwood
2010-05-11 16:23 ` [patch 2/6] openrd-client: initialise audio apatard
2010-05-12 7:09 ` saeed bishara
2010-05-11 16:23 ` [patch 3/6] asoc: Add SOC_DOUBLE_R_SX_TLV control apatard
2010-05-12 8:59 ` Mark Brown
2010-05-13 9:30 ` Mark Brown
2010-05-11 16:23 ` [patch 4/6] cs42l51: add asoc driver apatard
2010-05-11 19:36 ` Timur Tabi
2010-05-12 9:56 ` Mark Brown
2010-05-12 13:46 ` Arnaud Patard
2010-05-12 14:08 ` Mark Brown [this message]
2010-05-11 16:23 ` [patch 5/6] kirkwood: Add i2s support apatard
2010-05-12 10:24 ` Mark Brown
2010-05-12 10:43 ` Saeed Bishara
2010-05-12 10:48 ` saeed bishara
2010-05-12 10:54 ` Mark Brown
2010-05-12 14:38 ` Arnaud Patard
2010-05-12 14:59 ` Mark Brown
2010-05-11 16:23 ` [patch 6/6] kirkwood: Add audio support to openrd client platforms apatard
2010-05-12 10:26 ` Mark Brown
2010-05-12 6:47 ` [patch 0/6] kirkwood openrd client audio support saeed bishara
-- strict thread matches above, loose matches on Subject: below --
2010-05-15 15:29 [patch 0/6] kirkwood openrd client audio support - v2 apatard
2010-05-15 15:30 ` [patch 4/6] cs42l51: add asoc driver apatard
2010-05-16 17:27 ` Mark Brown
2010-05-27 12:57 [patch 0/6] kirkwood openrd client audio support - v4 apatard
2010-05-27 12:57 ` [patch 4/6] cs42l51: add asoc driver apatard
2010-05-31 11:20 ` 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=20100512140835.GC8082@rakim.wolfsonmicro.main \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=apatard@mandriva.com \
--cc=nico@fluxnic.net \
--cc=saeed@marvell.com \
--cc=tbm@cyrius.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).