Hi Mark!
After a lot of digging I found the API you are referring to in:
http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/include/linux/spi/spi.h
So when will this go in?
How would you recommend to connect your prepared structure to a specific
message?
There is no flag/field in spi_message to link that.
Would this mean that I would keep an internal list with the address of the SPI
message
any my "prepared data" and I need to iterate over that list every time I need
it?
This search might - worsted case - become a scaling issue if too many prepared
statements are created...
Ok, there are other constructs to store data in making lookup faster,
but does this not make the driver more complex than necessary?
It could lead to all drivers starting "simple" and then at some point it becomes
an issue as one driver makes heavy use of this showing it becomes a bottle-neck
and then all spi-bus-drivers would need to get touched to optimize things...
Why not provide a lookup function for the prepared data immediately and make
sure the drivers use this one. Then we only have to change it later in one place
and reduce code-replication across drivers.
(obviously you would also need put/delete methods to make that interface
complete.)
Also those function pointers do not have wrappers functions for ease of use,
so that they can get used in the individual drivers that know that they can
prepare the spi_message, as they do not change the transfer structure....
Thanks,
Martin
On 30.10.2013, at 22:57, Mark Brown wrote:
> On Wed, Oct 30, 2013 at 07:33:30PM +0100, Martin Sperl wrote:
>
>> I have seen your email and I have checked 3.12-rc7:
>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/linux/spi/spi.h?id=refs/tags/v3.12-rc7
>> (Assuming this is the latest, but I would say that the version of Linus
>> would
>> be authoritative)
>
> No, look in -next (or the SPI tree which you can see in MAINTAINERS):
>
> git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
>
>> The following would go into struct spi_master:
>> int (*prepare_message)(struct spi_device *dev,struct spi_message *mesg);
>> int (*unprepare_message)(struct spi_device *dev,struct spi_message *mesg);
>
> Which, like I say, is exactly what's there in terms of a driver API.
--
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