From: Mark Brown <broonie@kernel.org>
To: bardliao@realtek.com
Cc: oder_chiou@realtek.com, alsa-devel@alsa-project.org,
lgirdwood@gmail.com, flove@realtek.com,
Gustaw Lewandowski <gustaw.lewandowski@intel.com>
Subject: Re: [PATCH v5] ASoC: add RT286 CODEC driver
Date: Fri, 14 Mar 2014 19:12:44 +0000 [thread overview]
Message-ID: <20140314191244.GZ366@sirena.org.uk> (raw)
In-Reply-To: <1394521896-27721-1-git-send-email-bardliao@realtek.com>
[-- Attachment #1.1: Type: text/plain, Size: 2410 bytes --]
On Tue, Mar 11, 2014 at 03:11:36PM +0800, bardliao@realtek.com wrote:
> From: Bard Liao <bardliao@realtek.com>
>
> This patch adds the ALC286 codec driver.
>
> ALC286 is a dual mode codec, which can run as HD-A or I2S mode.
> It is controlled by HD-A verb commands via I2C protocol.
Some or all of this documentation needs to end up in the code, we need
to be able to understand and maintain the code going forwards and
while the commit message is going to be kept it's still useful if the
code can be followed. Right now that's extremely hard.
> The following is the I/O difference between ALC286 and general I2S codecs.
> 1. A HD-A verb command contains three parts, NID, VID, and PID.
> And an I2S command contains only two parts: address and data.
It'd probably help to explain waht these are.
> 2. Not only the register address is written, but the read command also
> includes the entire write command.
> 3. rt286 uses different registers for read and write the same bits.
> As a result, standard regmap is difficult to be used on ALC286.
> We don't request a standard I/O by snd_soc_codec_set_cache_io anymore.
> Now we have ,reg_write and .reg_read functions for ALC286's I/O.
> And we don't use cache due to item 3 above.
> Some dummy registers (address <= 0xff) are defined for dapm routing.
> Thhe dummy registers are cache only.
Don't use dummy registers, DAPM already has virtual controls of various
kinds - if you need more let's extend them. Storing data in virtual
registers just makes things confusing and fragile. Some older CODEC
drivers did it and they're harder to work with now than they should be.
> Due to item 2 above, HD-A verb commands are put into the address part of regmap.
> When we issue HD-A verb write commands, the data part of regmap is zero.
I'm having a really hard time understanding how this follows. We do
have some other devices that do things like have multi-level register
addresses with registers collected in pages. By analogy here what I'd
expect to see is something which combines the various pieces of
addressing information into a bitfields within a single number that can
be used as a register address.
Or perhaps this just isn't anything like a register map at all?
Whatever is going on something that ignores the value part of the regmap
interfaces doesn't seem like it is a very good fit.
[-- 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-03-14 19:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-11 7:11 [PATCH v5] ASoC: add RT286 CODEC driver bardliao
2014-03-12 21:15 ` Lars-Peter Clausen
2014-03-13 5:29 ` Bard Liao
2014-03-13 8:35 ` Lars-Peter Clausen
2014-03-13 8:52 ` Takashi Iwai
2014-03-13 19:29 ` Mark Brown
2014-03-13 20:04 ` Takashi Iwai
2014-03-13 20:43 ` Mark Brown
2014-03-14 9:38 ` Bard Liao
2014-03-14 10:16 ` Mark Brown
2014-03-14 19:12 ` Mark Brown [this message]
2014-03-18 12:41 ` Bard Liao
2014-03-18 13:01 ` Mark Brown
2014-03-21 5:57 ` Bard Liao
2014-03-21 12:12 ` 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=20140314191244.GZ366@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=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