Re: Blockers on IIO usage of regmap.
From: Jonathan Cameron
Date: Tue Sep 06 2011 - 07:24:35 EST
On 09/06/11 12:14, Jonathan Cameron wrote:
> Hi Mark,
>
> Just a quick heads up that the big blocker for
> us making more use of regmap is lack of default
> control of cs_change for spi buses. That leads to
> a lot of hand crafted spi read / write routines and
> is rather tedious.
>
> When I have the time I'll look into sorting that side
> out.
>
> Also, we will need a couple of variants of bulk read for
> spi. Classic ones are
>
> TX Add0...Add7 XXXXXXXXXXX XXXXXXXXXXX XXXXXXXX
> RX XXXXXXXXXXX Da0.....Da7 Db0.....Db7 etc
oops, been a bit inconsistent here. Add0 should have been
Ada0 for first address. (thanks Anish) To clarify
Ada0..Ada7 is the address of first register for bulk read
(address incrementing assumed for later addresses)
Da0...Da7 is the data from that address.
XXXX is don't care.
>
> TX Add0...Add7 XXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXX
> RX XXXXXXXXXXX XXXXXXXXXXX Da0.....Da7 Db0....Db7
>
> TX Ada0...Ada7 Adb1...Adb7 Adc1...Adc7 etc
> RX XXXXXXXXXXX Da0.....Da7 Db0.....Db7 etc
One more common varient is a 'magic' register read which corresponds to
read all in a cyclic fashion. That one would be nasty for caching as
it won't be obvious to regmap which registers were actually read.
>
> Last one is a kind of 'simulated' bulk read where address is simply incremented
> (just for complexity that increment may well be by 2 rather than one...)
> That one is only sort of a 'bulk' read, but rather common.
>
> So basically we need some bus specific 'mode' hook somewhere.
> Given we have separate init functions for the buses could we
> add a struct regmap_spi_config to the parameter list?
>
> IIRC IIO has several drivers in each of the above categories so sharing
> the code via regmap would be great!
>
> What do you think?
>
> Jonathan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/