Re: [PATCH 1/8] regmap: Add generic non-memory mapped registeraccess API

From: Mark Brown
Date: Wed Jun 22 2011 - 15:43:13 EST


On Wed, Jun 22, 2011 at 09:20:41PM +0200, Lars-Peter Clausen wrote:

> Well, then the spi regmap driver needs to use read_flag_bit = 7 instead of
> read_flag_bit = 8 and the BUG_ON should also be updated to read_flag_bit >= 8.

Bah, so it should.

> And the current code also disallows to use the first bit as the read_flag. So
> in my opinion using a one-based index here is a good idea.

Disallowing that case was half the intention, the main issue being that
if you're flagging in the bottom bit of the top byte on the bus then
you'll be in the middle of the bitfield used by the register which is
going to confuse things.

If something really needs to use the bottom bit we probably need to add
a second form of mangling which uses the bottom of the register rather
than the top, or allow buses to have bus specific register formatting.

Although come to think of it this doesn't actually help your cases at
all as those are per-device settings and this is a per bus setting so
I'm inclined to just revert back to the original code and say that for a
first pass those devices are being sufficiently odd that we don't
support them, we can add support as an extension later.
--
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/