linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: linux-kernel@vger.kernel.org
Cc: linus.walleij@linaro.org,
	Philippe Langlais <philippe.langlais@linaro.org>,
	Lee Jones <lee.jones@linaro.org>
Subject: [PATCH 01/21] gpio: ab8500: Activate and port AB8500 GPIO driver to new framework
Date: Fri, 14 Dec 2012 16:19:19 +0000	[thread overview]
Message-ID: <1355501979-1157-2-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1355501979-1157-1-git-send-email-lee.jones@linaro.org>

From: Philippe Langlais <philippe.langlais@linaro.org>

The AB8500 GPIO driver is currently marked as broken, as it's still
using the old framework. This patch brings it back up to scratch and
enables it so we can make good use of it once more.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
---
 drivers/gpio/Kconfig       |    2 +-
 drivers/gpio/gpio-ab8500.c |   60 +++++++++++++++++++++++---------------------
 2 files changed, 32 insertions(+), 30 deletions(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 47150f5..6bf9575 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -624,7 +624,7 @@ config GPIO_JANZ_TTL
 
 config GPIO_AB8500
 	bool "ST-Ericsson AB8500 Mixed Signal Circuit gpio functions"
-	depends on AB8500_CORE && BROKEN
+	depends on AB8500_CORE
 	help
 	  Select this to enable the AB8500 IC GPIO driver
 
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index 050c05d..db40acb 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -207,7 +207,7 @@ static struct gpio_chip ab8500gpio_chip = {
 
 static unsigned int irq_to_rising(unsigned int irq)
 {
-	struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+	struct ab8500_gpio *ab8500_gpio = irq_get_chip_data(irq);
 	int offset = irq - ab8500_gpio->irq_base;
 	int new_irq = offset +  AB8500_INT_GPIO6R
 			+ ab8500_gpio->parent->irq_base;
@@ -216,7 +216,7 @@ static unsigned int irq_to_rising(unsigned int irq)
 
 static unsigned int irq_to_falling(unsigned int irq)
 {
-	struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+	struct ab8500_gpio *ab8500_gpio = irq_get_chip_data(irq);
 	int offset = irq - ab8500_gpio->irq_base;
 	int new_irq = offset +  AB8500_INT_GPIO6F
 			+  ab8500_gpio->parent->irq_base;
@@ -261,15 +261,16 @@ static irqreturn_t handle_falling(int irq, void *dev)
 	return IRQ_HANDLED;
 }
 
-static void ab8500_gpio_irq_lock(unsigned int irq)
+static void ab8500_gpio_irq_lock(struct irq_data *data)
 {
-	struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+	struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
 	mutex_lock(&ab8500_gpio->lock);
 }
 
-static void ab8500_gpio_irq_sync_unlock(unsigned int irq)
+static void ab8500_gpio_irq_sync_unlock(struct irq_data *data)
 {
-	struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+	struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
+	unsigned int irq = data->irq;
 	int offset = irq - ab8500_gpio->irq_base;
 	bool rising = ab8500_gpio->rising & BIT(offset);
 	bool falling = ab8500_gpio->falling & BIT(offset);
@@ -316,21 +317,22 @@ static void ab8500_gpio_irq_sync_unlock(unsigned int irq)
 }
 
 
-static void ab8500_gpio_irq_mask(unsigned int irq)
+static void ab8500_gpio_irq_mask(struct irq_data *data)
 {
-	struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+	struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
 	ab8500_gpio->irq_action = MASK;
 }
 
-static void ab8500_gpio_irq_unmask(unsigned int irq)
+static void ab8500_gpio_irq_unmask(struct irq_data *data)
 {
-	struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+	struct ab8500_gpio *ab8500_gpio =  irq_data_get_irq_chip_data(data);
 	ab8500_gpio->irq_action = UNMASK;
 }
 
-static int ab8500_gpio_irq_set_type(unsigned int irq, unsigned int type)
+static int ab8500_gpio_irq_set_type(struct irq_data *data, unsigned int type)
 {
-	struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+	struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
+	unsigned int irq = data->irq;
 	int offset = irq - ab8500_gpio->irq_base;
 
 	if (type == IRQ_TYPE_EDGE_BOTH) {
@@ -344,28 +346,28 @@ static int ab8500_gpio_irq_set_type(unsigned int irq, unsigned int type)
 	return 0;
 }
 
-unsigned int ab8500_gpio_irq_startup(unsigned int irq)
+unsigned int ab8500_gpio_irq_startup(struct irq_data *data)
 {
-	struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+	struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
 	ab8500_gpio->irq_action = STARTUP;
 	return 0;
 }
 
-void ab8500_gpio_irq_shutdown(unsigned int irq)
+void ab8500_gpio_irq_shutdown(struct irq_data *data)
 {
-	struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+	struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
 	ab8500_gpio->irq_action = SHUTDOWN;
 }
 
 static struct irq_chip ab8500_gpio_irq_chip = {
 	.name			= "ab8500-gpio",
-	.startup		= ab8500_gpio_irq_startup,
-	.shutdown		= ab8500_gpio_irq_shutdown,
-	.bus_lock		= ab8500_gpio_irq_lock,
-	.bus_sync_unlock	= ab8500_gpio_irq_sync_unlock,
-	.mask			= ab8500_gpio_irq_mask,
-	.unmask			= ab8500_gpio_irq_unmask,
-	.set_type		= ab8500_gpio_irq_set_type,
+	.irq_startup		= ab8500_gpio_irq_startup,
+	.irq_shutdown		= ab8500_gpio_irq_shutdown,
+	.irq_bus_lock		= ab8500_gpio_irq_lock,
+	.irq_bus_sync_unlock	= ab8500_gpio_irq_sync_unlock,
+	.irq_mask		= ab8500_gpio_irq_mask,
+	.irq_unmask		= ab8500_gpio_irq_unmask,
+	.irq_set_type		= ab8500_gpio_irq_set_type,
 };
 
 static int ab8500_gpio_irq_init(struct ab8500_gpio *ab8500_gpio)
@@ -374,14 +376,14 @@ static int ab8500_gpio_irq_init(struct ab8500_gpio *ab8500_gpio)
 	int irq;
 
 	for (irq = base; irq < base + AB8500_NUM_VIR_GPIO_IRQ ; irq++) {
-		set_irq_chip_data(irq, ab8500_gpio);
-		set_irq_chip_and_handler(irq, &ab8500_gpio_irq_chip,
+		irq_set_chip_data(irq, ab8500_gpio);
+		irq_set_chip_and_handler(irq, &ab8500_gpio_irq_chip,
 				handle_simple_irq);
-		set_irq_nested_thread(irq, 1);
+		irq_set_nested_thread(irq, 1);
 #ifdef CONFIG_ARM
 		set_irq_flags(irq, IRQF_VALID);
 #else
-		set_irq_noprobe(irq);
+		irq_set_noprobe(irq);
 #endif
 	}
 
@@ -397,8 +399,8 @@ static void ab8500_gpio_irq_remove(struct ab8500_gpio *ab8500_gpio)
 #ifdef CONFIG_ARM
 		set_irq_flags(irq, 0);
 #endif
-		set_irq_chip_and_handler(irq, NULL, NULL);
-		set_irq_chip_data(irq, NULL);
+		irq_set_chip_and_handler(irq, NULL, NULL);
+		irq_set_chip_data(irq, NULL);
 	}
 }
 
-- 
1.7.9.5


  reply	other threads:[~2012-12-14 16:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
2012-12-14 16:19 ` Lee Jones [this message]
2012-12-14 16:19 ` [PATCH 02/21] gpio: ab8500: Make pins configurable Lee Jones
2012-12-14 16:19 ` [PATCH 03/21] gpio: ab8500: Fix alternate function register address Lee Jones
2012-12-14 16:19 ` [PATCH 04/21] gpio: ab8500: Read register corrected in get_value api Lee Jones
2012-12-14 16:19 ` [PATCH 05/21] gpio: ab8500: Allow direction and pullups configuration Lee Jones
2012-12-14 16:19 ` [PATCH 06/21] gpio: ab8500: Add api to enable pulldown Lee Jones
2012-12-14 16:19 ` [PATCH 07/21] gpio: ab8500: Write argument value instead of hardwired 1 Lee Jones
2012-12-14 16:19 ` [PATCH 08/21] gpio: ab8500: Fix gpio offset bounds for irq mapping Lee Jones
2012-12-14 16:19 ` [PATCH 09/21] gpio: ab8500: Fix bad include name after renaming Lee Jones
2012-12-14 16:19 ` [PATCH 10/21] gpio: ab8500: Add support for the AB9540 Lee Jones
2012-12-14 16:19 ` [PATCH 11/21] gpio: ab8500: Add support for AB8505 Chip Lee Jones
2012-12-14 16:19 ` [PATCH 12/21] gpio: ab8500: Allow gpios to wake the system from suspend Lee Jones
2012-12-14 16:19 ` [PATCH 13/21] gpio: ab8500: Use most recent run-time platform checker Lee Jones
2012-12-14 16:19 ` [PATCH 14/21] gpio: ab8500: Remove ENUMs from linux/mfd/abx500/ab8500-gpio.h Lee Jones
2012-12-14 16:19 ` [PATCH 15/21] gpio: ab8500: Add support for the ab8540 Lee Jones
2012-12-14 16:19 ` [PATCH 16/21] gpio: ab8500: Add internal pull up on GPIO of ab8540 Lee Jones
2012-12-14 16:19 ` [PATCH 17/21] gpio: ab8500: Add the action range for the internal pull up function on GPIO Lee Jones
2012-12-14 16:19 ` [PATCH 18/21] gpio: ab8500: Fix parameter uninitialized warning for ab8540 Lee Jones
2012-12-14 16:19 ` [PATCH 19/21] gpio: ab8500: Update gpio ab8540 interrupt mapping Lee Jones
2012-12-14 16:19 ` [PATCH 20/21] gpio: ab8500: Fix ab8540 setting direction output error Lee Jones
2012-12-14 16:19 ` [PATCH 21/21] gpio: ab8500: Add explicit dependencies Lee Jones
2012-12-19 14:18 ` [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Linus Walleij
2012-12-19 22:49   ` Grant Likely
2012-12-20  7:51     ` Lee Jones
2013-01-04 14:17   ` Linus Walleij
2013-01-04 14:46     ` Lee Jones
2012-12-19 22:26 ` Grant Likely

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=1355501979-1157-2-git-send-email-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philippe.langlais@linaro.org \
    /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).