RFC: pca953 new platform specific changes

From: Darren Hart
Date: Wed Jun 20 2012 - 22:44:43 EST


I'm working on support for a device which combines a pair of PCA9555
gpio chips with an LIS331DLH accelerometer on an I2C bus.

I'm awaiting some documentation to confirm, but as I understand it the
accelerometer connects one of its interrupt lines to one of the pins on
the first PCA9555, which is then connected to SMB ALERT, which if I
understand is somehow tied to an ACPI GPE (0x0B)).

I have a hacked together set of patches to support this device which do
some horrible things to the pca953x driver. I'm trying to clean these up
and handle the platform changes properly in order to get them
upstreamed. I'd like to let you know what I'm attempting up front in
case you have any preference regarding the implementation as I'm new to
the GPIO subsystem and driver writing.

Key:
o Platform specific properties
[ ] My approach to support them

For this platform:
o Only IO 0,1,3,4,6, and 15 can be written to on the first PCA555 (0x20)
[ ] Add output bitbmask to platform data
[ ] Don't allow the output_direction function to vary from this if
provided
o All pins have a specified function
[ ] Add Pin names to platform data
o Pin assignments vary slightly based on board revision, read from 2nd
PCA555
[ ] ? Provide a function to perform the test to the platform data ?
o The accelerometer needs to have its interrupt line set to open-drain
The current hack does this in a new pca53x detect function
[ ] ? Move this to a platform data function for the accelerometer ?
o This device needs a GPE handler rather than a traditional irq thread
[ ] Provide GPE or IRQ data in the platform data, choose which to
setup based on that (rather large blocks of ifdefs per platform
in the driver).
o Only the fist PCA555 has accessory input lines on this device, so the
second should not get an interrupt handler setup.
[ ] Setup different platform data based on I2C device address with
appropriate GPE/IRQ data in the platform data setup

Does this approach seem appropriate?

--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/