* Re: Query about regmap SPI
[not found] <1331045140.32512.7.camel@matrix>
@ 2012-03-06 15:08 ` Ashish Chavan
2012-03-06 16:30 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Ashish Chavan @ 2012-03-06 15:08 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, linux-kernel, lrg
On Tue, 2012-03-06 at 20:15 +0530, Ashish Chavan wrote:
> On Tue, Mar 06, 2012 at 12:53:51PM +0500, Ashish Chavan wrote:
>
> Please always CC the relevant mailing lists on postings. I shouldn't
> need to remind you about this stuff.
Yes, I agree :-(
It's my mistake that I missed linux-kernel@vger.kernel.org
> No, implementing stuff like this in individual device drivers rather
> defeats the point of having frameworks. It sounds like it should be
> trivial to add support for this to regmap.
I also think that there should be a way to handle this kind of stuff by
the framework. May I know if you have any plan to add this to regmap? or
should I come up with a patch to extend regmap to support this and
propose you?
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Query about regmap SPI
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
0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2012-03-06 16:30 UTC (permalink / raw)
To: Ashish Chavan; +Cc: alsa-devel, linux-kernel, lrg
[-- Attachment #1: Type: text/plain, Size: 403 bytes --]
On Tue, Mar 06, 2012 at 08:38:52PM +0530, Ashish Chavan wrote:
> I also think that there should be a way to handle this kind of stuff by
> the framework. May I know if you have any plan to add this to regmap? or
> should I come up with a patch to extend regmap to support this and
> propose you?
I have no need for it so I'm unlikely to work on it myself, if you were
to send a patch that'd be great.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Query about regmap SPI
2012-03-06 16:30 ` Mark Brown
@ 2012-03-06 17:34 ` Ashish Chavan
2012-03-06 19:59 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Ashish Chavan @ 2012-03-06 17:34 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, linux-kernel, lrg
On Tue, 2012-03-06 at 16:30 +0000, Mark Brown wrote:
> On Tue, Mar 06, 2012 at 08:38:52PM +0530, Ashish Chavan wrote:
>
> > I also think that there should be a way to handle this kind of stuff by
> > the framework. May I know if you have any plan to add this to regmap? or
> > should I come up with a patch to extend regmap to support this and
> > propose you?
>
> I have no need for it so I'm unlikely to work on it myself, if you were
> to send a patch that'd be great.
OK, I will go through regmap sources in detail to find out appropriate
place to put this. BTW do you have any recommendation in terms of a good
way to achieve this. e.g. will it be useful and generic enough if we
introduce two more fields like read/write_flag_mask to indicate shifting
and use those fields before applying read/write_flag_masks?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Query about regmap SPI
@ 2012-03-06 7:53 Ashish Chavan
2012-03-06 12:10 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Ashish Chavan @ 2012-03-06 7:53 UTC (permalink / raw)
To: alsa-devel; +Cc: broonie, lrg
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] 7+ messages in thread
* Query About regmap SPI
@ 2012-03-05 13:20 Ashish Chavan
0 siblings, 0 replies; 7+ messages in thread
From: Ashish Chavan @ 2012-03-05 13:20 UTC (permalink / raw)
To: alsa-devel
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.
This message contains information that may be privileged or confidential and is the property of the KPIT Cummins Infosystems Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins Infosystems Ltd. does not accept any liability for virus infected mails.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-03-06 19:59 UTC | newest]
Thread overview: 7+ 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 7:53 Ashish Chavan
2012-03-06 12:10 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2012-03-05 13:20 Query About " Ashish Chavan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).