public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* Using SPI in a kernel module
@ 2010-06-27 18:25 Alfredo Quesada Sánchez
  2010-06-27 20:09 ` Mykhail Lodygin
  0 siblings, 1 reply; 6+ messages in thread
From: Alfredo Quesada Sánchez @ 2010-06-27 18:25 UTC (permalink / raw)
  To: linux-arm-kernel

After reading many things about SPI in linux (including the kernel Documentation, that is, spi_summary.txt) and having read many source files in the kernel itself I'm not sure which is the right way to deal with SPI from a kernel module if you don't want to use the spidev (neither the spi-gpio) implementation.

My goal is to create an spidev-like module, which generates a /dev entry (that is the easy part) and hides the details of the device, such as an EEPROM. The way to communicate with userspace using /dev files is simple, but the access to spi.h features isn't that much.

According to some board specific code there is one spi device registered in the system (it's wired to a serial dataflash in my development board), but I don't know how I can get a reference to the spi_device that should give me access to it.

By looking to other existing drivers I should register my own spi_driver, mostly providing probe and remove functions. And the questions are:
- When should I receive a probe call?
- What if I have more than 1 spi device on my system (let's say.. 3)? Will I receive 3 calls to probe?
- Is this the only way to get valid references to spi_device's? Is there any other way to access to the "list" of available spi_device's?

I did a small test with a fake module, which registers a spi_driver, but I did not receive any probe call, that's why this might not be the right way to access to the spi_device.
Besides in other low level code I can see calls to 

Regards



      

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

end of thread, other threads:[~2010-06-27 22:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-27 18:25 Using SPI in a kernel module Alfredo Quesada Sánchez
2010-06-27 20:09 ` Mykhail Lodygin
2010-06-27 20:55   ` Alfredo Quesada Sánchez
2010-06-27 21:26     ` Mykhail Lodygin
2010-06-27 21:47       ` Alfredo Quesada Sánchez
2010-06-27 22:30         ` Mykhail Lodygin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox