[i2c] [PATCH] basic gpio_chip support for 16-bit PCA9539 GPIO expander

David Brownell david-b at pacbell.net
Tue Dec 4 04:33:42 CET 2007


On Monday 03 December 2007, eric miao wrote:

> > 	  Did you
> > verify that nobody in mainline needs legacy driver support for
> > these chips, by the way?
> >
> 
> #> grep -iR "pca9539" *
> 
> gave me the following potential users of pca9539:
> 
> arch/mips/configs/bigsur_defconfig:CONFIG_SENSORS_PCA9539=y
> arch/mips/configs/mtx1_defconfig:CONFIG_SENSORS_PCA9539=m
> ...
> arch/arm/configs/picotux200_defconfig:CONFIG_SENSORS_PCA9539=m
> ...
> 
> and I doubt if these defconfigs are sane about their I2C configurations
> (if you don't mind take a look into these files :-),

I've seen that issue with a few defconfigs, yes.


> and also with Ben's 
> acknowledgment, I don't think this would be a problem. If you don't
> feel good about this, I can try adding those sysfs stuffs back, though
> the final code might be a bit uglier.

No, I don't much like that sysfs interface.  If nobody actually
needs it (Ben might be the best person to know), I have no qualms
with removing it.

 
> > 		 (FWIW
> > the only I2C driver I know of in mainline that handles any kind
> > of pluggable IRQ handler is the menelaus driver in that same
> > directory.  It doesn't use irq_chip.)
> >
> 
> Yes, because it's not an IRQ chip, the menelaus driver tries
> only to access the I2C bus within interrupt context.

I don't quite follow.  It doesn't access I2C from IRQ context;
no I2C driver can do that.  AFAIK the driver predates genirq,
but I'm not sure it would have used irq_chip anyway ... 


> > This driver seems like it should handle pca9535 chips too;
> > the key difference seems to be that the '39 has a reset input
> > instead of the extra address pin on the '35.
> >
> > Plus several other chips in this family look to be similar
> > enough that this driver should be able to handle them without
> > much work at all. ...
> 
> I don't have those chips to test, so I'd prefer someone modifying
> this later.

Check the pca9535 docs though; I think you'll find that updating
docs and Kconfig to say the '39 driver should handle the '35 is
a "safe" change.

- Dave



More information about the i2c mailing list