Skip to contentSkip to conversation

spi_write_then_read with different tx/rx bits_per_word

DISCUSSION Philippe De Muyter 2 participants 4 messages Jan 8, 2014 – Jan 13, 2014 3 messages not in the archive SPI

lore
Share & tools
lore
#0 lore raw

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 2 lines · Philippe De Muyter

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?

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 6 lines · Mark Brown
Quoted 2 lines · Philippe De Muyter

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

Signature · 5 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 6 lines · Philippe De Muyter
Quoted 4 lines · Mark Brown
Quoted 2 lines · Philippe De Muyter

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 ?

Quoted 8 lines
Quoted 1 line

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.