From: Mark Brown <broonie@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Oder Chiou <oder_chiou@realtek.com>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
Bard Liao <bardliao@realtek.com>,
Gustaw Lewandowski <gustaw.lewandowski@intel.com>,
Flove <flove@realtek.com>
Subject: Re: [PATCH v6] ASoC: add RT286 CODEC driver
Date: Mon, 12 May 2014 21:29:18 +0100 [thread overview]
Message-ID: <20140512202918.GG12304@sirena.org.uk> (raw)
In-Reply-To: <536B4708.8080203@metafoo.de>
[-- Attachment #1.1: Type: text/plain, Size: 2053 bytes --]
On Thu, May 08, 2014 at 10:57:44AM +0200, Lars-Peter Clausen wrote:
> There is still structure, the mapping function does not have to understand
> each register it only has to understand each verb and the driver uses maybe
> 6-7 different verbs, so it is not that bad. The code would basically look
> like this:
> write_reg(addr, val)
> {
> verb = EXTRACT_VERB(addr);
> nid = EXTRACT_NID(addr);
> pid = EXTRACT_PID(addr);
>
> switch (verb) {
> case VERB1:
> return write_verb1(nid, pid, val):
> case VERB2:
> return write_verb2(nid, pid, val):
> ....
> }
> }
> Where pid is verb specific additional addressing information that is used in
> the verbs payload.
Yeah, it's not exactly a model of niceness though. It's looking an
awful lot like we didn't manage to abstract things properly and setting
off alarm bells as a result.
> >So how does HDA handle this? We can obviously keep recording settings
> >in the same way as we do for virtual enums, writing them out shouldn't
> >be so hard. The cache code isn't going to buy us much if we have to
> >write things out control by control anyway, it essentially just boils
> >down to a fancy list walk.
> It's not just the DAPM stuff, but also the normal controls, for which we do
> not have per control caching.
That seems like a simple matter of programming to resolve.
> >If you really want to reuse regmap having a write only regmap internal
> >to the driver (not presented to ASoC) which just remembers the last
> >value written to every NID/VID combination might work and at least
> >avoids the ugly bits with trying to convince ASoC there are registers
> >since you don't need to worry about reading the data back and can just
> >pretend that read values match written values since we never look at
> >them except to write them back out.
> Yes kind of.
Kind of? It solves the cache sync case and if it's write only then we
won't need to go to the register map for reads anyway (outside of
interrupt handling and so on).
[-- 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:[~2014-05-12 20:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-14 5:59 [PATCH v6] ASoC: add RT286 CODEC driver bardliao
2014-04-15 12:04 ` Mark Brown
2014-04-16 13:26 ` Bard Liao
2014-04-16 21:11 ` Mark Brown
2014-04-17 5:39 ` Bard Liao
2014-04-18 10:37 ` Mark Brown
2014-05-06 12:04 ` Bard Liao
2014-05-07 17:21 ` Mark Brown
2014-05-07 17:46 ` Lars-Peter Clausen
2014-05-07 18:07 ` Mark Brown
2014-05-07 18:21 ` Lars-Peter Clausen
2014-05-07 19:49 ` Mark Brown
2014-05-08 7:05 ` Lars-Peter Clausen
2014-05-08 8:00 ` Mark Brown
2014-05-08 8:57 ` Lars-Peter Clausen
2014-05-12 11:08 ` Bard Liao
2014-05-12 14:51 ` Lars-Peter Clausen
2014-05-12 20:29 ` Mark Brown [this message]
2014-06-04 12:08 ` Bard Liao
2014-06-04 12:37 ` 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=20140512202918.GG12304@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=bardliao@realtek.com \
--cc=flove@realtek.com \
--cc=gustaw.lewandowski@intel.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=oder_chiou@realtek.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