linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve <steve.explores-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Do you always need a client driver to access a I2C device?
Date: Wed, 24 Feb 2010 19:11:00 +0000	[thread overview]
Message-ID: <4B8579C4.7080502@googlemail.com> (raw)

Hi,

I am modifying an embedded kernel driver to use the Linux I2C sub-system 
rather than the RTOS I2C calls it previously used. The driver just needs 
to make a very small number of I2C read/writes to a device on the I2C 
bus at a fixed address and does not need to expose any methods to 
user-space via /dev or sysfs. An algorithm and adapter driver are 
provided for the SoC that controls the board, but there are no client 
drivers.

I have been reading the Documentation/i2d doc and looking at some of the 
existing drivers. I only need to read/write a few bytes to the device 
but from the doc, examples and i2c api it appeared I would need to write 
a client driver for the device to obtain the i2c_client ptr I needed to 
do that. Along with the appropriate board_info for the devices on the board.

However I noticed that the DTV demodulator drivers, e.g. 
drivers/media/dvb/frontends/au8522.c, appear to be doing it simply using 
a i2c_adapter ptr and i2c_transfer().

For my simple needs, access fixed embedded device, no need for user 
space access, is the i2c_adapter ptr a simple and "appropriate" way to 
go or am I missing something that makes it more complex than it seems? 
This assumes its straight forward to get the adapter ptr from the SoC 
adapter driver of course. Perhaps I should be doing a client driver 
instead after all?

I think I have spent too long looking through the sub-system 
infrastructure source and have ended up confusing myself somewhat. I 
just want to make sure I am on the correct path before continuing with 
my reading and investigating. The kernel version is 2.6.27.39.

Thanks

Steve

             reply	other threads:[~2010-02-24 19:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24 19:11 Steve [this message]
     [not found] ` <4B8579C4.7080502-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2010-03-04 15:06   ` Do you always need a client driver to access a I2C device? Jean Delvare

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=4B8579C4.7080502@googlemail.com \
    --to=steve.explores-gm/ye1e23mwn+bqq9rbeug@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@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).