gpio: add struct gpio_chip_ops to abstract GPIO controller operations

In the kernel there are basically two patterns to implement object
oriented code in C. You can either embed a set of function pointers
in a struct along with other members or have a separate virtual function
table (vtable) structure that hold all the functions and only store a
pointer to that vtable on our particular object.

The struct gpio_chip uses the former approach, but I don't know if that
is a design decision or is just that this code predates the fact that
the separate structure pattern is now so popular. Since having the
operations on a different structure has a number of benefits:

- A clean separation between state (fields) and operations (functions).
- Requires a single assignment instead of many in the driver's init function.
- Size reduction of struct gpio_chip since will only hold one pointer.
- These functions are not supposed to change at runtime so the const
  qualifier can be used to prevent pointers modification during execution.
- Similar drivers for a chip family can reuse their function vtable.

There is a drawback though which is that now two memory accesses are
needed to execute a GPIO operation since an additional level of
indirection is introduced but that should be minimized due temporal and
spatial memory locality.

This patch adds a struct gpio_chip_ops to be set by GPIO chip controllers.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
gpiolib: set gpio_chip operations on add using a gpio_chip_ops

This is a transitional change to avoid breaking git bisect-ability
while converting GPIO controller drivers to set their operations by
using the newly introduced struct gpio_chip_ops virtual function table.

It should be removed once all GPIO chip drivers have been converted.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
gpio: switch to use struct gpio_chip_ops

All GPIO controller drivers have been migrated to use the struct
gpio_chip_ops virtual function table so the embedded function
pointers in struct gpio_chip can now be removed.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
gpio: omap: convert driver to use gpio_chip_ops

The GPIO controller operations has been split to be stored
on a separate struct gpio_chip_ops virtual function table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
gpio: twl4030: convert driver to use gpio_chip_ops

The GPIO controller operations has been split to be stored
on a separate struct gpio_chip_ops virtual function table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
arm: scoop.c: convert driver to use gpio_chip_ops

The GPIO controller operations has been split to be stored
on a separate struct gpio_chip_ops virtual function table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
ARM: at91: convert driver to use gpio_chip_ops

The GPIO controller operations has been split to be stored
on a separate struct gpio_chip_ops virtual function table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
ARM: gemini: convert driver to use gpio_chip_ops

The GPIO controller operations has been split to be stored
on a separate struct gpio_chip_ops virtual function table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
ARM: imx: convert mx27 driver to use gpio_chip_ops

The GPIO controller operations has been split to be stored
on a separate struct gpio_chip_ops virtual function table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
ARM: ixp4xx: convert driver to use gpio_chip_ops

The GPIO controller operations has been split to be stored
on a separate struct gpio_chip_ops virtual function table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
arm: msm: trout: convert driver to use gpio_chip_ops

The GPIO controller operations has been split to be stored
on a separate struct gpio_chip_ops virtual function table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
ARM: s3c24xx: convert driver to use gpio_chip_ops

The GPIO controller operations has been split to be stored
on a separate struct gpio_chip_ops virtual function table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
ARM: sa1100: convert driver to use gpio_chip_ops

The GPIO controller operations has been split to be stored
on a separate struct gpio_chip_ops virtual function table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
ARM: w90x900: convert driver to use gpio_chip_ops

The GPIO controller operations has been split to be stored
on a separate struct gpio_chip_ops virtual function table.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>