Date: Tue, 10 Mar 2015 07:21:17 +0100 From: Milan Obuch <freebsd-arm@dino.sk> To: Luiz Otavio O Souza <lists.br@gmail.com> Cc: freebsd-arm@freebsd.org Subject: Re: Raspberry Pi SPI device example? Message-ID: <20150310072117.2cf020de@zeta.dino.sk> In-Reply-To: <CAB=2f8x4OyX-xgJsrybP3xQR2d9Yr1LZezVgWmXxUCEy6cPTjQ@mail.gmail.com> References: <20150216093418.3d1be83b@zeta.dino.sk> <CAB=2f8xUGKWUPu1nk4PoD1ea4PO1BEy=fOZF8X2Y_hNEvTTPtg@mail.gmail.com> <20150219075342.7d2e7eec@zeta.dino.sk> <20150302124103.689135d3@zeta.dino.sk> <CAB=2f8zgy8WdFVK9wdN8VXUSw5vpUCOhqPxv2cSHAxiiAw23KA@mail.gmail.com> <20150303215040.13f8439f@zeta.dino.sk> <CAB=2f8x0MRWDXm30BA_Pc8VSEpLvHt5szb_9L4QEDuz1J%2BLstA@mail.gmail.com> <20150305123903.1050694f@zeta.dino.sk> <CAB=2f8xqq=dMr12qb8WSiG5AMBnH%2BXzayiKch9kOC_YebO3M8g@mail.gmail.com> <20150306191957.0603e0f3@zeta.dino.sk> <CAB=2f8x4OyX-xgJsrybP3xQR2d9Yr1LZezVgWmXxUCEy6cPTjQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 10 Mar 2015 01:00:37 -0300 Luiz Otavio O Souza <lists.br@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150310072117.2cf020de>