From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Scott Jiang <scott.jiang.linux@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: snd soc spi read/write
Date: Fri, 5 Aug 2011 06:42:10 +0100 [thread overview]
Message-ID: <20110805054210.GB16956@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <CAHG8p1AeeqL+Cj-4V4NwQpD33H4ogV0rfekHjMqfvG7wQ49fCA@mail.gmail.com>
On Fri, Aug 05, 2011 at 10:24:43AM +0800, Scott Jiang wrote:
> hw_write use 16bit reg, cache use 8bit reg, in former version
>
> data[0] = (reg >> 8) & 0xff;
> data[1] = reg & 0xff;
> data[2] = value;
>
> reg &= 0xff;
> if (reg < codec->reg_cache_size)
> cache[reg] = value;
>
> ret = codec->hw_write(codec->control_data, data, 3);
Which is just obviously insane and buggy as with that code the same
cache slot will be used for 256 different registers that differ only in
the upper byte.
> now in do_hw_write
> if (!snd_soc_codec_volatile_register(codec, reg) &&
> reg < codec->driver->reg_cache_size &&
> !codec->cache_bypass) {
> ret = snd_soc_cache_write(codec, reg, value);
> if (ret < 0)
> return -1;
> }
> reg > reg_cache_size, so will not write to cache
Which is exactly what we'd expect - we won't have allocated a cache
beyond register reg_cache_size and the driver is telling us not to cache
those registers.
> > Note that all this code will be replaced with regmap for 3.2.
> Do you mean I must update to 3.2 to solve this problem?
I don't see any problem here. What is the problem you're experiencing?
next prev parent reply other threads:[~2011-08-05 5:42 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-04 10:24 snd soc spi read/write Scott Jiang
2011-08-04 10:35 ` Mark Brown
2011-08-05 2:24 ` Scott Jiang
2011-08-05 5:42 ` Mark Brown [this message]
2011-08-05 6:26 ` Scott Jiang
2011-08-05 6:34 ` Mark Brown
[not found] ` <CAHG8p1BBza_M_Cgrq2O2U+Xc-=rPHeNBKMD_KwfZsLX5Npz9jA@mail.gmail.com>
[not found] ` <20110805072908.GA28149@opensource.wolfsonmicro.com>
2011-08-05 8:00 ` Scott Jiang
2011-08-05 8:30 ` Mark Brown
2011-08-09 3:41 ` Scott Jiang
2011-08-09 16:04 ` Mark Brown
2011-08-10 11:54 ` Takashi Iwai
2011-08-10 14:55 ` Mark Brown
2011-08-10 15:00 ` Takashi Iwai
2011-08-10 15:03 ` Mark Brown
2011-08-10 15:15 ` Takashi Iwai
2011-08-10 15:34 ` Mark Brown
2011-08-10 16:02 ` Takashi Iwai
2011-08-11 3:17 ` Mark Brown
2011-08-10 21:31 ` Lars-Peter Clausen
2011-08-11 0:33 ` Mark Brown
2011-08-11 1:50 ` Lars-Peter Clausen
2011-08-11 2:46 ` Mark Brown
2011-08-11 3:09 ` Lars-Peter Clausen
2011-08-11 5:32 ` Mark Brown
2011-08-11 6:41 ` Lars-Peter Clausen
2011-08-17 9:16 ` Dimitris Papastamos
2011-08-05 6:11 ` Takashi Iwai
2011-08-05 6:21 ` Takashi Iwai
2011-08-05 6:27 ` 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=20110805054210.GB16956@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=scott.jiang.linux@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