[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-i2c
Subject: Re: How to use one I2C device from two modules?
From: Jean Delvare <khali () linux-fr ! org>
Date: 2011-05-20 8:07:19
Message-ID: 20110520100719.4107397a () endymion ! delvare
[Download RAW message or body]
Hi Lars,
On Mon, 16 May 2011 01:10:22 -0700 (PDT), Lars Michael wrote:
> --- On Fri, 13/5/11, Jean Delvare <khali@linux-fr.org> wrote:
> > No, this doesn't seem right. A given system may have more
> > than one PCA950x chip. And symbol dependencies are a hell
> > to handle as soon as things get more complex. Such an export
> > will never be accepted upstream.
>
> You are right, and this quick solution was not meant to be submitted.
>
> > I can think of 2 ways to handle your problem.
> >
> > If neither works for you for whatever reason, maybe we can
> > add a helper function to i2c-core to retrieve an i2c_client
> > by bus number and address. Maybe others would find it useful
> > as well.
>
> I was looking for such a function, it could be very handy. And btw
> a get adapter by id already exists.
This function could certainly be added if someone ever really needs it.
But in your case, it seems better to write a proper gpio driver for your
device and then have your subdrivers cleanly request the GPIO pins they
need. And you don't need to access the i2c_client from the subdrivers
if you do this.
--
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic