Skip to content

PowerPC: implement GPIO API

Anton Vorontsov linuxppc-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 16 repliesIn review

Changes since RFC from the cover letter

- Implemented #gpio-cells handling;
- Per-bank spinlocks removed;
- Added a patch which implements GPIO API for CPM1;
- Few minor fixes.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Implement GPIO API embryoarch/powerpc/Kconfig arch/powerpc/kernel/prom_parse.c include/asm-powerpc/gpio.h +1 more+137 -03 replies
2/4QE: implement GPIO APIarch/powerpc/platforms/Kconfig arch/powerpc/sysdev/qe_lib/qe_io.c+81 -20 replies
3/4CPM2: implement GPIO APIarch/powerpc/platforms/Kconfig arch/powerpc/sysdev/cpm2_common.c+122 -02 replies
4/4CPM1: implement GPIO APIarch/powerpc/platforms/8xx/Kconfig arch/powerpc/sysdev/commproc.c+178 -13 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] PowerPC: implement GPIO API

Hi all,

OF device tree GPIOs bindings are similar to IRQs:

pario0: gpio-controller@0 {
	#gpio-cells = <2>;
	num-ports = <7>;
};
device@0 {
	gpios = <bank pin bank pin bank pin>;
	gpio-parent = <&pario0>;
};

"bank pin" scheme is controller specific, so controllers that want to implement flat mappings or any other could do so.

So far I implemented GPIO API for QE and CPM2 chips. GPIO API for CPM1 implemented by Jochen Friedrich <[email protected]>, included in this patchset.

- QE GPIO API tested to work with FSL UPM NAND driver and MPC8360E-RDK (STMicro NAND512W3A2BN6E);
- CPM2 GPIO API tested to work with MPC8555E+Samsung HY27UF081G6 (LP);
- CPM1 GPIO API untested.

GPIO API is described in Documentation/gpio.txt, and these patches are tend to support most of it.

As an additional bonus, PowerPC now gets access to few pleasing drivers:

- drivers/leds/leds-gpio.c (we could use it to play with on-board LEDs);
- drivers/i2c/busses/i2c-gpio.c (generic I2C bit-banging driver);
- drivers/input/keyboard/gpio_keys.c - gpio keys (requires gpio_to_irq, so far not implemented);
- Could be more (I named the ones I knew about).

Also, in the upcoming kernels, there will be GPIOLIB[1] addition to the generic GPIO API, to support off-chip GPIO expanders (like MFDs on I2C/LBC). But so far we support on-chip GPIOs only, with single controller built-in.

Changes since RFC:
- Implemented #gpio-cells handling;
- Per-bank spinlocks removed;
- Added a patch which implements GPIO API for CPM1;
- Few minor fixes.

Thanks,

[1] http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.24-rc4/2.6.24-rc4-mm1/broken-out/generic-gpio-gpio_chip-support.patch

Signature · 4 lines
Anton Vorontsov
email: [email protected]
backup email: [email protected]
irc://irc.freenode.net/bd2