of/gpio: Kill of_gpio_chip and add members directly to gpio_chip
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Tue, 8 Jun 2010 13:48:16 +0000 (07:48 -0600)
committerGrant Likely <grant.likely@secretlab.ca>
Mon, 5 Jul 2010 22:14:30 +0000 (16:14 -0600)
commita19e3da5bc5fc6c10ab73f310bea80f3845b4531
tree49b6e952f48e56d9701f92e0c24044a14b676a34
parentcedb1881ba32f7e9cd49250bd79debccbe52b094
of/gpio: Kill of_gpio_chip and add members directly to gpio_chip

The OF gpio infrastructure is great for describing GPIO connections within
the device tree.  However, using a GPIO binding still requires changes to
the gpio controller just to add an of_gpio structure.  In most cases, the
gpio controller doesn't actually need any special support and the simple
OF gpio mapping function is more than sufficient.  Additional, the current
scheme of using of_gpio_chip requires a convoluted scheme to maintain
1:1 mappings between of_gpio_chip and gpio_chip instances.

If the struct of_gpio_chip data members were moved into struct gpio_chip,
then it would simplify the processing of OF gpio bindings, and it would
make it trivial to use device tree OF connections on existing gpiolib
controller drivers.

This patch eliminates the of_gpio_chip structure and moves the relevant
fields into struct gpio_chip (conditional on CONFIG_OF_GPIO).  This move
simplifies the existing code and prepares for adding automatic device tree
support to existing drivers.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Bill Gatliff <bgat@billgatliff.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jean Delvare <khali@linux-fr.org>
15 files changed:
arch/microblaze/kernel/reset.c
arch/powerpc/platforms/52xx/mpc52xx_gpio.c
arch/powerpc/platforms/52xx/mpc52xx_gpt.c
arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
arch/powerpc/platforms/86xx/gef_gpio.c
arch/powerpc/sysdev/cpm1.c
arch/powerpc/sysdev/cpm_common.c
arch/powerpc/sysdev/mpc8xxx_gpio.c
arch/powerpc/sysdev/ppc4xx_gpio.c
arch/powerpc/sysdev/qe_lib/gpio.c
arch/powerpc/sysdev/simple_gpio.c
drivers/gpio/xilinx_gpio.c
drivers/of/gpio.c
include/asm-generic/gpio.h
include/linux/of_gpio.h