On Tue, Mar 07, 2023 at 07:01:54PM +0000, Christophe Leroy wrote: > What about a new flag at SPI device registration to tell the SPI > subsystem that this SPI device driver wants "raw/native 16 bits" data > being sent as-is, that my loader would set in order to tell the > controler "I have prepared the data, send it in your native 16 bits > order mode" ? > And for all devices not setting that flags, the controller would > fallback to 8 bits mode. Oh, so the issue is that your controller is *not* swapping data? In that case if 16 bit transfers are more efficient and a buffer formatted for 8 bit transfers is already in the correct format then why not just tell the controller to use 16 bit words where possible? Nothing outside the controller cares about anything other than the memory and wire formats, if the controller correctly performs an 8 bit transfer when programmed for 16 bit words and it's faster then just do that. That will work a lot better in general, drivers just sending a byte stream aren't going to (and shouldn't) ask for anything other than 8 bit words. Word size configuration should only be used by a client driver when it wants things rewriting.
Attachment:
signature.asc
Description: PGP signature