lkml.org 
[lkml]   [2014]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 3/5] gpio: omap: convert driver to use gpio_chip_ops
Date
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>
---
drivers/gpio/gpio-omap.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 8cc9e91..50f0938 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1072,6 +1072,16 @@ omap_mpuio_alloc_gc(struct gpio_bank *bank, unsigned int irq_start,
IRQ_NOREQUEST | IRQ_NOPROBE, 0);
}

+const struct gpio_chip_ops omap_gpio_ops = {
+ .request = omap_gpio_request,
+ .free = omap_gpio_free,
+ .direction_input = gpio_input,
+ .get = gpio_get,
+ .direction_output = gpio_output,
+ .set_debounce = gpio_debounce,
+ .set = gpio_set
+};
+
static int omap_gpio_chip_init(struct gpio_bank *bank)
{
int j;
@@ -1083,13 +1093,8 @@ static int omap_gpio_chip_init(struct gpio_bank *bank)
* REVISIT eventually switch from OMAP-specific gpio structs
* over to the generic ones
*/
- bank->chip.request = omap_gpio_request;
- bank->chip.free = omap_gpio_free;
- bank->chip.direction_input = gpio_input;
- bank->chip.get = gpio_get;
- bank->chip.direction_output = gpio_output;
- bank->chip.set_debounce = gpio_debounce;
- bank->chip.set = gpio_set;
+ bank->chip.ops = &omap_gpio_ops;
+
if (bank->is_mpuio) {
bank->chip.label = "mpuio";
if (bank->regs->wkup_en)
--
1.9.0


\
 
 \ /
  Last update: 2014-04-08 21:01    [W:0.100 / U:3.876 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site