linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Barry Song <21cnbao@gmail.com>
To: linus.walleij@linaro.org, linux-gpio@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, workgroup.linux@csr.com,
	Barry Song <Baohua.Song@csr.com>
Subject: [PATCH 3/4] gpio: make handler_data configurable while using gpiolib_irqchip
Date: Tue, 15 Apr 2014 14:43:48 +0800	[thread overview]
Message-ID: <1397544229-20545-4-git-send-email-21cnbao@gmail.com> (raw)
In-Reply-To: <1397544229-20545-1-git-send-email-21cnbao@gmail.com>

From: Barry Song <Baohua.Song@csr.com>

since it is called handler_data, drivers should have the ability to
set handler_data based on real hardware.
GPIOLIB_IRQCHIP doesn't use handler_data by itself, so it will not
break GPIO core.

Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
 drivers/gpio/gpiolib.c      |   10 +++-------
 include/linux/gpio/driver.h |    2 +-
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 761013f..4b90d14 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1351,24 +1351,20 @@ static struct gpio_chip *find_chip_by_name(const char *name)
 
 /**
  * gpiochip_add_chained_irqchip() - adds a chained irqchip to a gpiochip
- * @gpiochip: the gpiochip to add the irqchip to
+ * @handler_data: handler_data which will be used by ISR of interrupt parent
  * @irqchip: the irqchip to add to the gpiochip
  * @parent_irq: the irq number corresponding to the parent IRQ for this
  * chained irqchip
  * @parent_handler: the parent interrupt handler for the accumulated IRQ
  * coming out of the gpiochip
  */
-void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip,
+void gpiochip_set_chained_irqchip(void *handler_data,
 				  struct irq_chip *irqchip,
 				  int parent_irq,
 				  irq_flow_handler_t parent_handler)
 {
 	irq_set_chained_handler(parent_irq, parent_handler);
-	/*
-	 * The parent irqchip is already using the chip_data for this
-	 * irqchip, so our callbacks simply use the handler_data.
-	 */
-	irq_set_handler_data(parent_irq, gpiochip);
+	irq_set_handler_data(parent_irq, handler_data);
 }
 EXPORT_SYMBOL_GPL(gpiochip_set_chained_irqchip);
 
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 1827b43..52a0758 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -207,7 +207,7 @@ void gpiod_add_lookup_table(struct gpiod_lookup_table *table);
 
 #ifdef CONFIG_GPIOLIB_IRQCHIP
 
-void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip,
+void gpiochip_set_chained_irqchip(void *handler_data,
 		struct irq_chip *irqchip,
 		int parent_irq,
 		irq_flow_handler_t parent_handler);
-- 
1.7.5.4


  parent reply	other threads:[~2014-04-15  6:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15  6:43 [PATCH 0/4] pinctrl: sirf: switch to one gpiolib and gpiolib_irqchip helpers Barry Song
2014-04-15  6:43 ` [PATCH 1/4] pinctrl: sirf: wrap all gpio banks into one gpio_chip Barry Song
2014-04-22 18:27   ` Linus Walleij
2014-04-23 20:03   ` Linus Walleij
2014-04-15  6:43 ` [PATCH 2/4] pinctrl: sirf: switch driver to use gpiolib irqchip helpers Barry Song
2014-04-23 20:04   ` Linus Walleij
2014-04-15  6:43 ` Barry Song [this message]
2014-04-23 20:13   ` [PATCH 3/4] gpio: make handler_data configurable while using gpiolib_irqchip Linus Walleij
2014-04-23 22:55     ` Barry Song
2014-04-23 23:09       ` Linus Walleij
2014-04-23 23:23         ` Barry Song
2014-04-24 13:06           ` Linus Walleij
2014-04-24 15:43             ` Barry Song
2014-04-15  6:43 ` [PATCH 4/4] pinctrl: sirf: move to use irq_get_handler_data Barry Song
2014-04-23 20:17   ` Linus Walleij
2014-04-23 22:59     ` Barry Song
2014-04-24 12:59       ` Linus Walleij
2014-04-24 15:45         ` Barry Song
2014-04-16  9:54 ` [PATCH 0/4] pinctrl: sirf: switch to one gpiolib and gpiolib_irqchip helpers Javier Martinez Canillas
2014-04-16 10:05   ` Barry Song
2014-04-16 10:20     ` Javier Martinez Canillas
2014-04-22 21:47 ` Linus Walleij
2014-04-23 12:09   ` Barry Song
2014-04-23 20:02     ` Linus Walleij

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=1397544229-20545-4-git-send-email-21cnbao@gmail.com \
    --to=21cnbao@gmail.com \
    --cc=Baohua.Song@csr.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=workgroup.linux@csr.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).