linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: ananth <ananth86coolguy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: SPI Framework in Linux
Date: Tue, 6 Jul 2010 17:22:46 -0600	[thread overview]
Message-ID: <AANLkTimFzHdY6luh2UQOLoTlI8kjdwIeiazT6YSdWdMU@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimMpQXQyj4bmsIDxu-OtK15532g5ArjGIfQSMwy-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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

      parent reply	other threads:[~2010-07-06 23:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimFzHdY6luh2UQOLoTlI8kjdwIeiazT6YSdWdMU@mail.gmail.com \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=ananth86coolguy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).