linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* SPI Framework in Linux
@ 2010-07-01 15:10 ananth
       [not found] ` <AANLkTimMpQXQyj4bmsIDxu-OtK15532g5ArjGIfQSMwy-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: ananth @ 2010-07-01 15:10 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, glikely

Hi

  I am learning the SPI framework in linux. I read the spi-summary and
documentation. I couldn't get a clear picture of what's happening. Is there
any other document or article which gives a overview of the SPI framework in
linux?Also could you give me any driver which uses SPI for communicating
with devices like touchscreen or other SPI compatible sensors?

Thanks
Ananth
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

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

* Re: SPI Framework in Linux
       [not found] ` <AANLkTimMpQXQyj4bmsIDxu-OtK15532g5ArjGIfQSMwy-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-07-01 16:18   ` David Brownell
  2010-07-06 23:22   ` Grant Likely
  1 sibling, 0 replies; 3+ messages in thread
From: David Brownell @ 2010-07-01 16:18 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, glikely, ananth



--- On Thu, 7/1/10, ananth <ananth86coolguy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> 
>   I am learning the SPI framework in linux. I read the
> spi-summary and
> documentation. I couldn't get a clear picture of what's
> happening. Is there
> any other document or article which gives a overview of the
> SPI framework in
> linux?

Kerneldoc ... "make pdfdocs" and read the
section on SPI.


Also could you give me any driver which uses SPI for
> communicating
> with devices like touchscreen or other SPI compatible

Like the ads7846 driver?  Kind of old and
complex.  Or the at45 EEPROM driver, which
is much simpler.  There are also SPI flash
drivers in the MTD subtree.

Look harder in the kernel source tree...




------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

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

* Re: SPI Framework in Linux
       [not found] ` <AANLkTimMpQXQyj4bmsIDxu-OtK15532g5ArjGIfQSMwy-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2010-07-01 16:18   ` David Brownell
@ 2010-07-06 23:22   ` Grant Likely
  1 sibling, 0 replies; 3+ messages in thread
From: Grant Likely @ 2010-07-06 23:22 UTC (permalink / raw)
  To: ananth; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Thu, Jul 1, 2010 at 9:10 AM, ananth <ananth86coolguy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi
>
>   I am learning the SPI framework in linux. I read the spi-summary and
> documentation. I couldn't get a clear picture of what's happening. Is there
> any other document or article which gives a overview of the SPI framework in
> linux?Also could you give me any driver which uses SPI for communicating
> with devices like touchscreen or other SPI compatible sensors?

The SPI subsystem uses the Linux device model much the same way as
other bus types in the Linux kernel.  SPI master controller drivers
create instances of spi busses.  one or more spi_devices is registered
on the spi_bus_type as children of the spi_master bus.  spi_drivers
also get registered onto the spi_bus_type.  Whenever the spi subsystem
code finds an spi_device and an spi_driver that match (a driver that
is able to driver the device) it calls the probe() routine on the
spi_driver with a pointer to the spi_device structure.

So, for your spi bus controller, you need to have an spi master driver.
For each spi device, you need to have a matching spi_driver loaded
into the kernel.

Take a look at the book Linux Device Drivers 3rd edition for
information on the device model.  Read the source code for detailed
information about the spi bus type.

Cheers,
g.

>
> Thanks
> Ananth
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-01 15:10 SPI Framework in Linux ananth
     [not found] ` <AANLkTimMpQXQyj4bmsIDxu-OtK15532g5ArjGIfQSMwy-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-01 16:18   ` David Brownell
2010-07-06 23:22   ` Grant Likely

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).