Re: Looking for a solution for CPM FSL SPI driver that swaps 16 bits words

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 13, 2023 at 10:33:10PM +0000, Christophe Leroy wrote:

> Looking at another driver I'm even more puzzled. That's driver 
> drivers/leds/leds-dac124s085.c

> It also sets spi->bits_per_word = 16 , but is uses cpu_to_le16() to 
> prepare that data. So this one should then work with any host 
> endianness, but why the hell is it doing cpu_to_le16() if the data 
> should be big endian ?

I wouldn't take some random client driver as being particulary
meaningful - people often abuse APIs.  I wouldn't be sure that that
endianness conversion was doing anything on the system that the driver
was developed on.

> To be honnest, I'm really not sure anymore what is the way to go.

The expected behaviour is very clearly documented, I've quoted that
documentation at you and recommended that anything being done for
performance reasons be done in the controller driver.  I'm really not
sure what else to tell you, especially given that if the client driver
uses a byte stream (which is what it wants) this all becomes purely
internal to the controller
driver.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux