Skip to content

RFC PowerPC: implement support for GPIO LIB API

Anton Vorontsov linuxppc-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3Implement support for the GPIO LIB APIDocumentation/powerpc/booting-without-of.txt arch/powerpc/Kconfig arch/powerpc/kernel/Makefile +2 more+376 -01 reply
2/3QE: split par_io_config_pin()arch/powerpc/sysdev/qe_lib/qe_io.c+39 -210 replies
3/3QE: implement GPIO LIB APIDocumentation/powerpc/booting-without-of.txt arch/powerpc/platforms/Kconfig arch/powerpc/sysdev/qe_lib/qe_io.c +1 more+96 -124 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH RFC 0/3] PowerPC: implement support for GPIO LIB API

Hi all,

Thanks for the previous review and ideas. Here is the RFC for the GPIO LIB support.

I'm using it like this:

	qe_pio_a: gpio-controller@1400 {
		#gpio-cells = <1>;
		compatible = "fsl,qe-pario-bank";
		reg = <0x1400 0x18>;
		gpio-controller;
	};

	qe_pio_e: gpio-controller@1460 {
		#gpio-cells = <1>;
		compatible = "fsl,qe-pario-bank";
		reg = <0x1460 0x18>;
		gpio-controller;
	};

	nand-flash@1,0 {
		compatible = "stmicro,NAND512W3A2BN6E", "fsl,upm-nand";
		reg = <1 0 1>;
		width = <1>;
		upm = "A";
		upm-addr-offset = <16>;
		upm-cmd-offset = <8>;
		gpios = <&qe_pio_e 18 &qe_pio_a 9>;
		wait-pattern;
		wait-write;
	};

As you can see I've split single "par_io" node into banks, thus the benefits:
- we can handle banks of different width (Jochen Friedrich asked for this, IIRC. Or I've misunderstood ;-).
- we can handle banks with different paddings (no more #ifdef PPC85xx).

Also, it's possible to specify different gpio-controllers in the gpios = <> property. gpio-specifier is controller specific.

The remaining question is about gpio.c placement. prom_parse.c doesn't feel as the appropriate place anymore. I think of:

- drivers/gpio/of_gpio.c (driver/gpio/ is in -mm tree);
- drivers/of/gpio.c
- keep it in arch/powerpc/kernel/ (though, there is nothing much PowerPC specific).

So, to try these patches you'll need apply these from the -mm tree:
generic-gpio-gpio_chip-support.patch generic-gpio-gpio_chip-support-fix.patch generic-gpio-gpio_chip-support-gpiolib-locking-simplified.patch

Or just issue this in your working tree:

git pull git://git.infradead.org/users/cbou/powerpc-gpio.git gpiolib

powerpc-gpio.git's gpiolib branch is galak/powerpc.git master branch + -mm patches + these patches.

Support for CPM2 is pending.

Thanks!

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