All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Add support for gpio expander pca9505 used on Mirabox
@ 2013-01-22 21:10 ` Gregory CLEMENT
  0 siblings, 0 replies; 36+ messages in thread
From: Gregory CLEMENT @ 2013-01-22 21:10 UTC (permalink / raw)
  To: Linus Walleij, Grant Likely
  Cc: Maxime Ripard, Andreas Schallenberg, Roland Stigge, Jason Cooper,
	Andrew Lunn, Thomas Petazzoni, Sebastian Hesselbarth,
	linux-arm-kernel, linux-kernel, Gregory CLEMENT

Hello,

This patch set adds the support for the i2c gpio expander pca9505 used
on the JTAG/GPIO box which can be connected to the Mirabox.

To be able to use the pca9505 I had to do several changes in the
driver. Indeed, until now the pca953x driver accessed all the bank of
a given register in a single command using only a 32 bits
variable. This expander comes with 40 GPIOs which no more fits in a 32
variable. This patch set makes the accesses to the registers more
generic by relying on an array of u8 variables. This fits exactly the
way the registers are represented in the hardware.

Once the per-bank representation was added, it was easier to introduce
helpers to access to a single register of a bank instead of reading or
writing all the banks for a given register. As the GPIO API allows
only the accesses to a single GPIO at a time there was no point to read
and write all the other banks. Hence it should help to decrease the
latency especially for the pca9505.

However as the block GPIO API from Roland Stigge is incoming I kept
the helpers used to access all the banks in the same time. I had to
make some modifications in the arguments that these functions
received, so it will have a conflict here. Currently my patch set is
based on v3.8-rc4, but I am willing to rebase onto gpio-for-next once
the GPIO block will be merged into it.

After the feedback from Maxime Ripard on the second version, I
continue to abuse of his good will as I didn't get any information on
the Mirabox about the interrupt pin. Thanks to him I managed to fix
the bug related to the interrupt part. Now the IRQ part have been also
validated! Thanks again to Maxime for his help.

I have also updated the branch gpio-pca9505 available at:
https://github.com/MISL-EBU-System-SW/mainline-public.git

Linus, now you can apply the first two patches on your git tree. I
kept your acked-by for the 3rd one, as I didn't change anything for
this one.

Thanks,

Changelog:
V1->V2:

- Fix the way to calculate the shift used to apply to register to
  access a given bank.
- Fix all the pending issue in the IRQ part which appeared once I have
  enable CONFIG_GPIO_PCA953X_IRQ!

V2->V3:

- Rebased on v3.8-rc4
- Fix the interrupt handler and not try to call an handler if there is
  no irq pending on a gpio bank


Gregory CLEMENT (3):
  gpio: pca953x: make the register access by GPIO bank
  gpio: pca953x: add support for pca9505
  arm: mvebu: enable gpio expander over i2c on Mirabox platform

 arch/arm/boot/dts/armada-370-mirabox.dts |   10 ++
 drivers/gpio/gpio-pca953x.c              |  283 +++++++++++++++++++-----------
 2 files changed, 187 insertions(+), 106 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2013-02-17  0:49 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-22 21:10 [PATCH v3 0/3] Add support for gpio expander pca9505 used on Mirabox Gregory CLEMENT
2013-01-22 21:10 ` Gregory CLEMENT
2013-01-22 21:10 ` [PATCH v3 1/3] gpio: pca953x: make the register access by GPIO bank Gregory CLEMENT
2013-01-22 21:10   ` Gregory CLEMENT
2013-01-25  8:03   ` Linus Walleij
2013-01-25  8:03     ` Linus Walleij
2013-01-22 21:10 ` [PATCH v3 2/3] gpio: pca953x: add support for pca9505 Gregory CLEMENT
2013-01-22 21:10   ` Gregory CLEMENT
2013-01-25  8:16   ` Linus Walleij
2013-01-25  8:16     ` Linus Walleij
2013-01-25  8:36     ` Gregory CLEMENT
2013-01-25  8:36       ` Gregory CLEMENT
2013-01-25  8:51       ` Linus Walleij
2013-01-25  8:51         ` Linus Walleij
2013-01-26 22:02         ` Gregory CLEMENT
2013-01-26 22:02           ` Gregory CLEMENT
2013-01-28  1:58           ` Haojian Zhuang
2013-01-28  1:58             ` Haojian Zhuang
2013-01-28 10:25           ` Linus Walleij
2013-01-28 10:25             ` Linus Walleij
2013-01-22 21:10 ` [PATCH v3 3/3] arm: mvebu: enable gpio expander over i2c on Mirabox platform Gregory CLEMENT
2013-01-22 21:10   ` Gregory CLEMENT
2013-01-25  8:17   ` Linus Walleij
2013-01-25  8:17     ` Linus Walleij
2013-01-25 12:46     ` Jason Cooper
2013-01-25 12:46       ` Jason Cooper
2013-01-25 12:55       ` Linus Walleij
2013-01-25 12:55         ` Linus Walleij
2013-01-25 12:57         ` Linus Walleij
2013-01-25 12:57           ` Linus Walleij
2013-01-25 13:07           ` Jason Cooper
2013-01-25 13:07             ` Jason Cooper
2013-01-25 13:03         ` Jason Cooper
2013-01-25 13:03           ` Jason Cooper
2013-02-16 18:52   ` Jason Cooper
2013-02-16 18:52     ` Jason Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.