Raspberry Pi SPI device example?
Milan Obuch
freebsd-arm at dino.sk
Tue Mar 10 06:21:21 UTC 2015
On Tue, 10 Mar 2015 01:00:37 -0300
Luiz Otavio O Souza <lists.br at gmail.com> wrote:
> On 6 March 2015 at 15:19, Milan Obuch wrote:
> > Now there is another problem to solve - there are two devices on the
> > spibus0, ILI9341 and STMPE610, on chip selects 0 and 1 respectively.
> > In the end, there will be 'ili' driver for the former and 'tsc'
> > driver for the later. Both will use SPIBUS_TRANSFER to transfer
> > their respective bytes, but could they interfere as they are on the
> > same bus? Is it necessary to use some kind of protection against
> > that or does spi bus driver ensure transfers cound not interfere?
>
> The SPI support is very simple at moment, there is no bus
> serialization and neither userland access.
>
> At least on RPi, each SPI transfer is serialized by the driver, so
> once a thread start a transfer, any other transfers will be put to
> sleep until the first one finishes. The problem is only if you need
> to guarantee that consecutive transfers to the same device won't be
> interrupted by another threads (e.g. in a read-modify-write cycle).
>
> I hope to eventually fix this (unless someone make it first).
>
> Luiz
Thanks, that's enough for me now - if driver makes serialization this
way, nothing to worry about, collision probability is low I think,
anyway, as transfers are short and touchscreen controller will do one
only when touch event is detected, but I need to make sure.
Regards,
Milan
More information about the freebsd-arm
mailing list