[i2c] [PATCH] PXA I2C: Update PXA platforms to support new-style I2C drivers.

Jean Delvare khali at linux-fr.org
Wed Jun 20 10:37:03 CEST 2007


Hi David,

On Tue, 19 Jun 2007 09:24:18 -0700, David Brownell wrote:
> On Tuesday 19 June 2007, Rodolfo Giometti wrote:
> > Signed-off-by: Rodolfo Giometti <giometti at linux.it>
> > ---
> >  drivers/i2c/busses/i2c-pxa.c |    7 ++++++-
> >  1 files changed, 6 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
> > index 8a0a99b..f29c3e6 100644
> > --- a/drivers/i2c/busses/i2c-pxa.c
> > +++ b/drivers/i2c/busses/i2c-pxa.c
> > @@ -926,7 +926,12 @@ static int i2c_pxa_probe(struct platform_device *dev)
> >  		i2c->adap.class = plat->class;
> >  	}
> >  
> > -	ret = i2c_add_adapter(&i2c->adap);
> > +	if (dev->id >= 0) {
> 
> I suggest you just always use the add_numbered() call.
> 
> Not only does nothing actually use negative IDs in the
> current kernel ... but if they did, the right way to
> handle it would be as bus number zero.  The reason to
> do so is to avoid sysfs names that only make sense when
> there are multiple adapters.

Good point. Rodolfo, can I have an updated patch?

David, would this also apply to the i2c-gpio driver?
http://lists.lm-sensors.org/pipermail/i2c/2007-June/001458.html

> > +		i2c->adap.nr = dev->id;
> > +		ret = i2c_add_numbered_adapter(&i2c->adap);
> > +	}
> > +	else
> > +		ret = i2c_add_adapter(&i2c->adap);
> >  	if (ret < 0) {
> >  		printk(KERN_INFO "I2C: Failed to add bus\n");
> >  		goto eadapt;

-- 
Jean Delvare



More information about the i2c mailing list