public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Query about regmap SPI
@ 2012-03-06 15:06 Ashish Chavan
  0 siblings, 0 replies; 5+ messages in thread
From: Ashish Chavan @ 2012-03-06 15:06 UTC (permalink / raw)
  To: linux-kernel

Hi,
  I am planning to add SPI support for da7210 codec driver. SPI for this
codec has slightly different format than others. It has 8 bit register
address and 8 bit data. Out of 8 bits of register address, one bit (i.e.
LSB) is used to indicate read or write. Value of 1 at LSB denotes READ
while value of 0 at LSB denotes write operation.

Thus in order for SPI READ to work correctly, the register address need
to be left shifted by one and then ORed with 0x1. In the same way for
SPI WRITE to work correctly, it need to be left shifted by one.

I have gone though the regmap sources and found that ORing can be
achieved by setting correct read_flag_mask. But I couldn't find anything
by which I can tell regmap core to shift the register address before
ORing it with read_flag_mask. Am I missing anything here?

Is there any other way to achieve this using regmap? The only other way
I can think of is providing a wrapper function to read and write in
codec driver and doing the shifting job inside that wrapper.

TIA!



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-06 19:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1331045140.32512.7.camel@matrix>
2012-03-06 15:08 ` Query about regmap SPI Ashish Chavan
2012-03-06 16:30   ` Mark Brown
2012-03-06 17:34     ` Ashish Chavan
2012-03-06 19:59       ` Mark Brown
2012-03-06 15:06 Ashish Chavan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox