linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* spi_write_then_read with different tx/rx bits_per_word
@ 2014-01-08 22:35 Philippe De Muyter
       [not found] ` <20140108223538.GA2861-NqYOdiUDesgPnqCj3zZnUQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe De Muyter @ 2014-01-08 22:35 UTC (permalink / raw)
  To: linux-spi-u79uwXL29TY76Z2rM5mHXA

Hello linux spi architects,

I am currently writing a driver for a peripheral that uses spi
for its configuration.  The spi interface of that device
presents a set of read-only or read-write registers with 7-bit
addresses, but 8- or 16-bit values.

Is there a convenience function similar to spi_write_then_read
to handle that case or must I roll my own one in my driver ?

Thanks in advance

Philippe De Muyter
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: spi_write_then_read with different tx/rx bits_per_word
       [not found] ` <20140108223538.GA2861-NqYOdiUDesgPnqCj3zZnUQ@public.gmane.org>
@ 2014-01-10 10:27   ` Mark Brown
       [not found]     ` <20140110102745.GA29039-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2014-01-10 10:27 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

On Wed, Jan 08, 2014 at 11:35:38PM +0100, Philippe De Muyter wrote:

> Is there a convenience function similar to spi_write_then_read
> to handle that case or must I roll my own one in my driver ?

Try regmap?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: spi_write_then_read with different tx/rx bits_per_word
       [not found]     ` <20140110102745.GA29039-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
@ 2014-01-13 13:35       ` Philippe De Muyter
       [not found]         ` <20140113133518.GA6613-NqYOdiUDesgPnqCj3zZnUQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe De Muyter @ 2014-01-13 13:35 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA

On Fri, Jan 10, 2014 at 10:27:45AM +0000, Mark Brown wrote:
> On Wed, Jan 08, 2014 at 11:35:38PM +0100, Philippe De Muyter wrote:
> 
> > Is there a convenience function similar to spi_write_then_read
> > to handle that case or must I roll my own one in my driver ?
> 
> Try regmap?

Thanks.

Actually it was late in the evening and I was confusing read in
`spi_write_then_read' with read as in 'read a register'.

`spi_write_then_read' should probably better be named `spi_xmit_then_rcv'

Best regards

Philippe

-- 
Philippe De Muyter +32 2 6101532 Macq SA rue de l'Aeronef 2 B-1140 Bruxelles
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: spi_write_then_read with different tx/rx bits_per_word
       [not found]         ` <20140113133518.GA6613-NqYOdiUDesgPnqCj3zZnUQ@public.gmane.org>
@ 2014-01-13 15:36           ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-01-13 15:36 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

On Mon, Jan 13, 2014 at 02:35:18PM +0100, Philippe De Muyter wrote:
> On Fri, Jan 10, 2014 at 10:27:45AM +0000, Mark Brown wrote:
> > On Wed, Jan 08, 2014 at 11:35:38PM +0100, Philippe De Muyter wrote:

> > > Is there a convenience function similar to spi_write_then_read
> > > to handle that case or must I roll my own one in my driver ?

> > Try regmap?

> Thanks.

> Actually it was late in the evening and I was confusing read in
> `spi_write_then_read' with read as in 'read a register'.

> `spi_write_then_read' should probably better be named `spi_xmit_then_rcv'

Well, the main application of the function is actually to implement
register I/O.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2014-01-13 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 22:35 spi_write_then_read with different tx/rx bits_per_word Philippe De Muyter
     [not found] ` <20140108223538.GA2861-NqYOdiUDesgPnqCj3zZnUQ@public.gmane.org>
2014-01-10 10:27   ` Mark Brown
     [not found]     ` <20140110102745.GA29039-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-01-13 13:35       ` Philippe De Muyter
     [not found]         ` <20140113133518.GA6613-NqYOdiUDesgPnqCj3zZnUQ@public.gmane.org>
2014-01-13 15:36           ` Mark Brown

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).