Re: How to use one I2C device from two modules?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lars,

On Mon, 16 May 2011 01:10:22 -0700 (PDT), Lars Michael wrote:
> --- On Fri, 13/5/11, Jean Delvare <khali@xxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux