linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: "Lindsey Ings -X (ingsl - Yoh Services LLC at Cisco)"
	<ingsl-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	giometti-AVVDYK/kqiJWk0Htik3J/w@public.gmane.org
Subject: Re: Sample DTS entries and sample user space code
Date: Tue, 14 Jul 2009 09:57:01 +0200	[thread overview]
Message-ID: <20090714095701.0aec363e@hyperion.delvare> (raw)
In-Reply-To: <50A8E1F8D9122546A7F67134915EDB7AB91AB4-1urkduz2x36J+CMdqUBC+pT4Y6eR2OpR0E9HWUfgJXw@public.gmane.org>

On Fri, 10 Jul 2009 17:09:47 -0400, Lindsey Ings -X (ingsl - Yoh Services LLC at Cisco) wrote:
> 
> 
> Resend of message in plain text form.
> 
> 
> I understand the concepts involved in this project but that doesn't help me actually make use of it.

For reference for other readers who have no clue what you're talking
about: Lindsey is referring to Rodolfo's I2C multiplexing support
project, described at:
http://i2c.wiki.kernel.org/index.php/I2C_bus_multiplexing

> Is there a sample of how to put the mux and (if feasible) I2C clients in a DTS?

Not yet. Rodolfo's code is not even in mainline. But once
implementation is complete, then yes it should be possible to declare
I2C multiplexers and other I2C devices in a DTS.

> Also is there a user application sample of how to access the devices downstream from the mux?

This wouldn't make sense. Multiplexing is handled in the kernel and
user-space does not even know it is happening.

> Are the mux's created as a device so that the devices downstream are accessed as non-mux'd devices? i.e. is dev D in segment 2 (from the diagram on the wiki) accessed as so:
> 
> int fd;
> fd = open( "/dev/i2c-2", O_RDWR );
> 
> #define ADDRESS 0x38 // address of dev D
> ioctl( fd, I2C_SLAVE, ADDRESS )
> 
> // Now r/w dev D
> 
> // Write 0xAA to dev D
> i2c_smbus_write_byte( fd, 0xAA );
> // etc.

Yes, this is how the code would look like.

Note that I am still waiting for Rodolfo to update his patch set so
that it applies again on top of Linus' latest kernel.

-- 
Jean Delvare

  parent reply	other threads:[~2009-07-14  7:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-10 21:09 Sample DTS entries and sample user space code Lindsey Ings -X (ingsl - Yoh Services LLC at Cisco)
     [not found] ` <50A8E1F8D9122546A7F67134915EDB7AB91AB4-1urkduz2x36J+CMdqUBC+pT4Y6eR2OpR0E9HWUfgJXw@public.gmane.org>
2009-07-14  7:57   ` Jean Delvare [this message]
     [not found]     ` <20090714095701.0aec363e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-07-14 14:31       ` Lindsey Ings -X (ingsl - Yoh Services LLC at Cisco)
2009-07-28 20:38       ` Lindsey Ings -X (ingsl - Yoh Services LLC at Cisco)
     [not found]         ` <50A8E1F8D9122546A7F67134915EDB7AC2D44D-1urkduz2x36J+CMdqUBC+pT4Y6eR2OpR0E9HWUfgJXw@public.gmane.org>
2009-07-31  7:27           ` 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=20090714095701.0aec363e@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=giometti-AVVDYK/kqiJWk0Htik3J/w@public.gmane.org \
    --cc=ingsl-FYB4Gu1CFyUAvxtiuMwx3w@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).