linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Flávio Alberto Lopes Soares" <flavioalsoares-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Analog Digital Converter - ADS1256 extreme newbie questions
Date: Fri, 10 Sep 2010 10:11:35 -0300	[thread overview]
Message-ID: <AANLkTi=iQVwpd-PymaWSKapfntmf4aRrt51Jutsz=D_g@mail.gmail.com> (raw)

Hello all,
I'm working 9 years as a Linux C/C++ programmer but I spent 99,9% of this
time working in user space programming, now I need to write a driver to use
the ADS1256 Analog-Digital converter (
http://focus.ti.com/docs/prod/folders/print/ads1256.html ) in an ARM board
using S3C2440 processor, my lecture start point
was Documentation/spi/spi-sumary from 2.6.32.2 kernel tree version and
drivers/misc/eeprom/at25.c code (this is an eeprom driver but I want look
the SPI general view), reading the text and the code I found some conceptual
doubts, my initial idea was create a character device driver and attach the
device read operation with a ADS1256 start lecture and pass the ADC channel
data to this device, this concept is correct ? There's some standard
interface to do this if my idea is wrong ?

Looking in at25.c in at25_probe(struct spi_device *spi) function this
"struct spi_device *spi" parameter represents the S3C2440 SPI controller and
came from SPI core subsystem ? If yes how the SPI controller knows that this
is an eeprom device in the snippet bellow ?
...
const struct spi_eeprom *chip;
...
/* Chip description */
chip = spi->dev.platform_data;

who provides this platform_data structure and who knows it must be a struct
spi_eeprom object ?

Thanks for all help

Flávio Alberto Lopes Soares
------------------------------------------------------------------------------
Automate Storage Tiering Simply
Optimize IT performance and efficiency through flexible, powerful, 
automated storage tiering capabilities. View this brief to learn how
you can reduce costs and improve performance. 
http://p.sf.net/sfu/dell-sfdev2dev

             reply	other threads:[~2010-09-10 13:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-10 13:11 Flávio Alberto Lopes Soares [this message]
     [not found] ` <AANLkTi=iQVwpd-PymaWSKapfntmf4aRrt51Jutsz=D_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-10 17:18   ` Analog Digital Converter - ADS1256 extreme newbie questions Grant Likely
     [not found]     ` <20100910171858.GA11284-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-09-12 14:39       ` Flávio Alberto Lopes Soares
     [not found]         ` <AANLkTikXq6Wm0kA_cHiAyZc+5kOJQBvP_2gOSbnihv5i-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-12 20:30           ` Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2010-09-10  5:13 Flávio Alberto Lopes Soares

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='AANLkTi=iQVwpd-PymaWSKapfntmf4aRrt51Jutsz=D_g@mail.gmail.com' \
    --to=flavioalsoares-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).