linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <acourbot@nvidia.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	Kevin Hilman <khilman@linaro.org>,
	linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Subject: [RFC PATCH 3/5] gpio: omap: convert driver to use gpio_chip_ops
Date: Tue,  8 Apr 2014 20:20:13 +0200	[thread overview]
Message-ID: <1396981215-24888-4-git-send-email-javier.martinez@collabora.co.uk> (raw)
In-Reply-To: <1396981215-24888-1-git-send-email-javier.martinez@collabora.co.uk>

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

  parent reply	other threads:[~2014-04-08 18:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 18:20 [RFC PATCH 0/5] add gpio_chip_ops to hold GPIO operations Javier Martinez Canillas
2014-04-08 18:20 ` [RFC PATCH 1/5] gpio: add a vtable to abstract GPIO controller operations Javier Martinez Canillas
2014-04-08 18:20 ` [RFC PATCH 2/5] gpiolib: set gpio_chip operations on add using a gpio_chip_ops Javier Martinez Canillas
2014-04-08 18:20 ` Javier Martinez Canillas [this message]
2014-04-08 18:20 ` [RFC PATCH 4/5] gpio: twl4030: convert driver to use gpio_chip_ops Javier Martinez Canillas
2014-04-08 18:20 ` [RFC PATCH 5/5] gpio: switch to use struct struct gpio_chip_ops Javier Martinez Canillas
2014-04-10  7:36 ` [RFC PATCH 0/5] add gpio_chip_ops to hold GPIO operations Alexandre Courbot
2014-04-10  9:34   ` Javier Martinez Canillas
2014-04-10 11:00     ` Andy Shevchenko
2014-04-10 11:46       ` Javier Martinez Canillas
2014-04-22 11:36 ` Linus Walleij
2014-04-22 12:28   ` Javier Martinez Canillas
2014-04-22 14:17     ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396981215-24888-4-git-send-email-javier.martinez@collabora.co.uk \
    --to=javier.martinez@collabora.co.uk \
    --cc=acourbot@nvidia.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=khilman@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=santosh.shilimkar@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).