From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Alexandre Courbot
<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 03/12] gpio: Move irq_nested into struct gpio_irq_chip
Date: Mon, 3 Apr 2017 18:05:23 +0200 [thread overview]
Message-ID: <20170403160532.20282-4-thierry.reding@gmail.com> (raw)
In-Reply-To: <20170403160532.20282-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
In order to consolidate the multiple ways to associate an IRQ chip with
a GPIO chip, move more fields into the new struct gpio_irq_chip.
Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
drivers/gpio/gpiolib.c | 12 ++++++------
include/linux/gpio/driver.h | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index d403a0572d4b..5aa920cb4653 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1588,7 +1588,7 @@ void gpiochip_set_nested_irqchip(struct gpio_chip *gpiochip,
struct irq_chip *irqchip,
unsigned int parent_irq)
{
- if (!gpiochip->irq_nested) {
+ if (!gpiochip->irq.nested) {
chip_err(gpiochip, "tried to nest a chained gpiochip\n");
return;
}
@@ -1626,7 +1626,7 @@ int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
irq_set_lockdep_class(irq, chip->lock_key);
irq_set_chip_and_handler(irq, irqchip, chip->irq_handler);
/* Chips that use nested thread handlers have them marked */
- if (chip->irq_nested)
+ if (chip->irq.nested)
irq_set_nested_thread(irq, 1);
irq_set_noprobe(irq);
@@ -1645,7 +1645,7 @@ void gpiochip_irq_unmap(struct irq_domain *d, unsigned int irq)
{
struct gpio_chip *chip = d->host_data;
- if (chip->irq_nested)
+ if (chip->irq.nested)
irq_set_nested_thread(irq, 0);
irq_set_chip_and_handler(irq, NULL, NULL);
irq_set_chip_data(irq, NULL);
@@ -1779,9 +1779,9 @@ static int gpiochip_add_irqchip(struct gpio_chip *gpiochip)
data);
}
- gpiochip->irq_nested = false;
+ gpiochip->irq.nested = false;
} else {
- gpiochip->irq_nested = true;
+ gpiochip->irq.nested = true;
}
/*
@@ -1904,7 +1904,7 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip,
pr_err("missing gpiochip .dev parent pointer\n");
return -EINVAL;
}
- gpiochip->irq_nested = nested;
+ gpiochip->irq.nested = nested;
of_node = gpiochip->parent->of_node;
#ifdef CONFIG_OF_GPIO
/*
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 223645a1d80f..07d93ffb49af 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -36,6 +36,7 @@ struct module;
* @num_parents: the number of interrupt parents of a GPIO chip
* @parents: a list of interrupt parents of a GPIO chip
* @map: a list of interrupt parents for each line of a GPIO chip
+ * @nested: True if set the interrupt handling is nested.
*/
struct gpio_irq_chip {
struct irq_chip *chip;
@@ -49,6 +50,7 @@ struct gpio_irq_chip {
unsigned int num_parents;
unsigned int *parents;
unsigned int *map;
+ bool nested;
};
#endif
@@ -124,7 +126,6 @@ struct gpio_irq_chip {
* @irq_chained_parent: GPIO IRQ chip parent/bank linux irq number,
* provided by GPIO driver for chained interrupt (not for nested
* interrupts).
- * @irq_nested: True if set the interrupt handling is nested.
* @irq_need_valid_mask: If set core allocates @irq_valid_mask with all
* bits set to one
* @irq_valid_mask: If not %NULL holds bitmask of GPIOs which are valid to
@@ -202,7 +203,6 @@ struct gpio_chip {
irq_flow_handler_t irq_handler;
unsigned int irq_default_type;
unsigned int irq_chained_parent;
- bool irq_nested;
bool irq_need_valid_mask;
unsigned long *irq_valid_mask;
struct lock_class_key *lock_key;
--
2.12.0
next prev parent reply other threads:[~2017-04-03 16:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-03 16:05 [PATCH 00/12] gpio: Tight IRQ chip integration and Tegra186 support Thierry Reding
2017-04-03 16:05 ` [PATCH 02/12] gpio: Implement tighter IRQ chip integration Thierry Reding
2017-04-03 16:05 ` [PATCH 05/12] gpio: Move irqchip into struct gpio_irq_chip Thierry Reding
2017-04-03 16:05 ` [PATCH 06/12] gpio: Move irq_valid_mask " Thierry Reding
[not found] ` <20170403160532.20282-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-03 16:05 ` [PATCH 01/12] gpio: Use unsigned int for interrupt numbers Thierry Reding
[not found] ` <20170403160532.20282-2-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-13 12:17 ` Linus Walleij
2017-04-03 16:05 ` Thierry Reding [this message]
2017-04-03 16:05 ` [PATCH 04/12] gpio: Move irqdomain into struct gpio_irq_chip Thierry Reding
2017-04-03 16:05 ` [PATCH 07/12] gpio: Move lock_key " Thierry Reding
2017-04-03 16:05 ` [PATCH 08/12] gpio: Move irq_chained_parent to " Thierry Reding
2017-04-03 16:05 ` [PATCH 09/12] gpio: Move irq_default_type " Thierry Reding
2017-04-03 16:05 ` [PATCH 11/12] gpio: Move irq_base " Thierry Reding
2017-04-03 16:05 ` [PATCH v3 12/12] gpio: Add Tegra186 support Thierry Reding
[not found] ` <20170403160532.20282-13-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-13 12:38 ` Linus Walleij
[not found] ` <CACRpkdaQacEqqW9Vdn7mtnZMH_VvL1B-35VFV=PcORwgtLz2eg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-13 15:19 ` Thierry Reding
2017-05-11 8:30 ` Linus Walleij
2017-04-13 12:22 ` [PATCH 00/12] gpio: Tight IRQ chip integration and " Linus Walleij
2017-04-03 16:05 ` [PATCH 10/12] gpio: Move irq_handler to struct gpio_irq_chip Thierry Reding
2017-04-06 22:34 ` [PATCH 00/12] gpio: Tight IRQ chip integration and Tegra186 support Thierry Reding
[not found] ` <20170406223449.GH27728-EkSeR96xj6Pcmrwk2tT4+A@public.gmane.org>
2017-04-13 12:23 ` 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=20170403160532.20282-4-thierry.reding@gmail.com \
--to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).