Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1484464
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] gpiolib: Add possibility to mask which GPIOs are added to IRQ domain |
| Date | 2016-09-15 21:00 +0200 |
| Message-ID | <shK37-2fY-5@gated-at.bofh.it> (permalink) |
| References | <shEh4-75Z-25@gated-at.bofh.it> <shHeV-rB-19@gated-at.bofh.it> <shHoB-Ln-1@gated-at.bofh.it> <shJqp-22F-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, 15 Sep 2016, Mika Westerberg wrote: > On Thu, Sep 15, 2016 at 05:07:58PM +0100, Marc Zyngier wrote: > > Mika, > > > > On 15/09/16 16:52, Mika Westerberg wrote: > > > When using GPIO irqchip helpers to setup irqchip for a gpiolib based > > > driver, it is not possible to select which GPIOs to add to the IRQ domain. > > > Instead it just adds all GPIOs which is not always desired. For example > > > there might be GPIOs that for some reason just cannot be used as interrupts > > > at all. > > > > > > To make this possible we add valid_mask to each gpio_chip and by default > > > assume all GPIOs can be used as interrupts. Drivers can then tune this > > > using clear_bit() or similar before they call gpiochip_irqchip_add(). > > > > > > Suggested-by: Linus Walleij <linus.walleij@linaro.org> > > > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> > > > --- > > > drivers/gpio/gpiolib.c | 32 +++++++++++++++++++++++++++++--- > > > include/linux/gpio/driver.h | 1 + > > > 2 files changed, 30 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > > > index 53ff25ac66d8..d84c23b47f44 100644 > > > --- a/drivers/gpio/gpiolib.c > > > +++ b/drivers/gpio/gpiolib.c > > > @@ -1186,6 +1186,18 @@ int gpiochip_add_data(struct gpio_chip *chip, void *data) > > > if (status) > > > goto err_remove_chip; > > > } > > > + > > > +#ifdef CONFIG_GPIOLIB_IRQCHIP > > > + chip->valid_mask = kcalloc(BITS_TO_LONGS(chip->ngpio), sizeof(long), > > > + GFP_KERNEL); > > > > Do we really want to make this a mandatory thing? In most cases, I'd > > expect this valid_mask to have all bits set, so you might as well not > > allocate it at all in that case (and only allocate it if you actually > > need it). > > We can make drivers to allocate it and only if set use it in core. Make it a flag in gpio_chip which allocates it here when requested so we don't end up with driver writers getting the alloc/free/error handling wrong over and over. Thanks, tglx
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-11 10:10 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Phidias Chiang <phidias.chiang@canonical.com> - 2016-09-12 09:00 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-12 11:10 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Phidias Chiang <phidias.chiang@canonical.com> - 2016-09-12 15:10 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-12 15:30 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Linus Walleij <linus.walleij@linaro.org> - 2016-09-13 11:20 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-13 11:40 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Linus Walleij <linus.walleij@linaro.org> - 2016-09-13 14:30 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-13 15:00 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Linus Walleij <linus.walleij@linaro.org> - 2016-09-13 23:00 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-14 10:30 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Linus Walleij <linus.walleij@linaro.org> - 2016-09-14 14:50 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-14 17:20 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Linus Walleij <linus.walleij@linaro.org> - 2016-09-15 14:50 +0200
Re: [PATCH] pinctrl: cherryview: Do not mask all interrupts on probe Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-15 17:50 +0200
[PATCH 2/2] pinctrl: cherryview: Do not add all southwest and north GPIOs to IRQ domain Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-15 18:00 +0200
[PATCH 1/2] gpiolib: Add possibility to mask which GPIOs are added to IRQ domain Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-15 18:00 +0200
Re: [PATCH 1/2] gpiolib: Add possibility to mask which GPIOs are added to IRQ domain Marc Zyngier <marc.zyngier@arm.com> - 2016-09-15 18:10 +0200
Re: [PATCH 1/2] gpiolib: Add possibility to mask which GPIOs are added to IRQ domain Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-15 20:20 +0200
Re: [PATCH 1/2] gpiolib: Add possibility to mask which GPIOs are added to IRQ domain Thomas Gleixner <tglx@linutronix.de> - 2016-09-15 21:00 +0200
Re: [PATCH 1/2] gpiolib: Add possibility to mask which GPIOs are added to IRQ domain Linus Walleij <linus.walleij@linaro.org> - 2016-09-18 13:20 +0200
csiph-web