All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Takashi Iwai <tiwai@suse.de>,
	uclinux-dist-devel@blackfin.uclinux.org,
	Scott Jiang <scott.jiang.linux@gmail.com>,
	alsa-devel@alsa-project.org
Subject: Re: snd soc spi read/write
Date: Thu, 11 Aug 2011 03:50:33 +0200	[thread overview]
Message-ID: <4E433569.7000702@metafoo.de> (raw)
In-Reply-To: <20110811003311.GA10574@opensource.wolfsonmicro.com>

On 08/11/2011 02:33 AM, Mark Brown wrote:
> On Wed, Aug 10, 2011 at 11:31:06PM +0200, Lars-Peter Clausen wrote:
> 
> That's not complicated, though - like I'm sure I've said to you before
> it seems like we just need to make the read bit controllable by drivers.
> Some other devices need that too, and a shift of the address also
> (there's one 7 bit address device I saw recently which has the address
> in the top 7 bits of an 8 bit value).
> 

Yes, I think I brought it up during the regmap review.

> Like I say I'm really not happy about adding further non-standard driver
> specifics to the Analog drivers, they're already not the best and they
> don't really seem to be getting much attention from anyone so I'm not
> confident anyone will come along and reverse any temporary bodges.  I'd
> be reasonably happy with something temporary for 3.1 if we already have
> a fix in place for 3.2 but I don't have much confidence that anyone will
> work on that.

So, just switch the ad193x driver to a rbcache.

> 
>> And if we have to add our own read function we could as very well add our own
>> write function which simply reinstates the old caching behavior.
> 
> If the driver needs its own custom I/O it should do both read and write.

We don't need reads if we cache writes. In the old ASoC IO code there wasn't
even SPI read support.

>> In my opinion it would be nice if we could add a register cache base address,
>> which specifies the offset at which the cache-able registers start. For example
>> I have a codec driver in the queue where all non-volatile registers at 0x8000
>> and I don't really want to add 16k of zeros to the driver for the default
>> register cache.
> 
> I don't think it's worth adding a special case like that when fixing the
> more general issues for sparse registers also solves these problems - we
> still need to fix the sparse register maps anyway.  Blocking registers
> together in rbtree (which we do already) means that if you've got one
> block of registers at a massive offset then the block with an offset
> just flops out of the code.

Yes, I had a look at the rbcache the other day. The current code doesn't seem
to be optimal. For example adjacent don't seem to be joined, so for example if
I have 3 registers and write them in the order 0,2,1 I'll still end up with 2
blocks. But that's of course something that can be fixed. And I had almost been
sold on it, if there wasn't the default register issue.

> If we also provide a more compact way of
> representing the defaults that devices with sparse registers can use
> then that problem will go away too.

What do you have in mind for this? An array of pairs of register and value?

- Lars

  reply	other threads:[~2011-08-11  1:52 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
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 [this message]
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=4E433569.7000702@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=scott.jiang.linux@gmail.com \
    --cc=tiwai@suse.de \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.