linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to correctly use spi_slave_tegra
@ 2012-11-13 20:08 Federico Vaga
  2012-11-15 18:47 ` Stephen Warren
  0 siblings, 1 reply; 8+ messages in thread
From: Federico Vaga @ 2012-11-13 20:08 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA
  Cc: a.sappia-197Af0g7QoUlk5EcyZIkJQ, puria.nafisi-yFROiS3d6cY

Hi,

I'm working on the SPI bus on a Nvidia Tegra 2 system (Toradex Colibri). I'm 
using kernel 2.6.32 with toradex and nvidia patches.

I need to use one of the Tegra SPI controller in Slave mode. I know that the 
Linux kernel does not support the Slave mode for SPI controllers, but I see 
the drivers/spi/spi_slave_tegra.c driver which is not documented and it is not 
commented, also the author name is missing. The only information available is 
the Nvidia Copyright 2011.

Toradex does not tested the spi_slave_tegra and cannot provides an example of 
driver which use the spi_slave_tegra.

I read the code and I see that spi_slave_tegra use the SPI framework also if 
the SPI framework supports only master controller. 

Anyone ever use the spi_slave_tegra? It works? Can you provide an example?

As I understand:
- obviously I must configure SPI before master start communication
- speed_hz must be the same of the master
- I must use spi_async (spi_sync can freeze the driver)
- Only messages with single transfer. If the master sends messages with 
multiple transfer, I must receive them with a single transfer
- I have two callback. the message->complete from the SPI framework and the 
spi_tegra_register_callback from the spi_slave_tegra

Any suggestions, comments, opinions are welcome.

Thank you for your help.

-- 
Federico Vaga

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-11-15 23:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-13 20:08 How to correctly use spi_slave_tegra Federico Vaga
2012-11-15 18:47 ` Stephen Warren
     [not found]   ` <50A538DA.2010906-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-11-15 19:04     ` Laxman Dewangan
     [not found]       ` <50A53CB7.1090705-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-11-15 19:19         ` Federico Vaga
2012-11-15 19:41         ` Federico Vaga
2012-11-15 23:23           ` Laxman Dewangan
     [not found]             ` <50A57959.1040208-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-11-15 23:37               ` Federico Vaga
2012-11-15 19:10     ` Federico Vaga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).