linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Octavian Purdila <octavian.purdila@intel.com>
To: gregkh@linuxfoundation.org, linus.walleij@linaro.org,
	gnurou@gmail.com, wsa@the-dreams.de, sameo@linux.intel.com,
	lee.jones@linaro.org
Cc: arnd@arndb.de, johan@kernel.org, daniel.baluta@intel.com,
	laurentiu.palcu@intel.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-i2c@vger.kernel.org,
	Octavian Purdila <octavian.purdila@intel.com>
Subject: [PATCH v8 3/4] gpiolib: add irq_not_threaded flag to gpio_chip
Date: Wed, 15 Oct 2014 17:48:10 +0300	[thread overview]
Message-ID: <1413384491-23703-4-git-send-email-octavian.purdila@intel.com> (raw)
In-Reply-To: <1413384491-23703-1-git-send-email-octavian.purdila@intel.com>

Some GPIO chips (e.g. the DLN2 USB adapter) have blocking get/set
operation but do not need a threaded irq handler.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
---
 drivers/gpio/gpiolib.c      | 2 +-
 include/linux/gpio/driver.h | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 15cc0bb..3fa7e73 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -447,7 +447,7 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
 	irq_set_lockdep_class(irq, &gpiochip_irq_lock_class);
 	irq_set_chip_and_handler(irq, chip->irqchip, chip->irq_handler);
 	/* Chips that can sleep need nested thread handlers */
-	if (chip->can_sleep)
+	if (chip->can_sleep && !chip->irq_not_threaded)
 		irq_set_nested_thread(irq, 1);
 #ifdef CONFIG_ARM
 	set_irq_flags(irq, IRQF_VALID);
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index e78a237..44161ac 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -56,6 +56,8 @@ struct seq_file;
  *	as the chip access may sleep when e.g. reading out the IRQ status
  *	registers.
  * @exported: flags if the gpiochip is exported for use from sysfs. Private.
+ * @irq_not_threaded: flag must be set if @can_sleep is set but the
+ *	IRQs don't need to be threaded
  *
  * A gpio_chip can help platforms abstract various sources of GPIOs so
  * they can all be accessed through a common programing interface.
@@ -101,6 +103,7 @@ struct gpio_chip {
 	struct gpio_desc	*desc;
 	const char		*const *names;
 	bool			can_sleep;
+	bool			irq_not_threaded;
 	bool			exported;
 
 #ifdef CONFIG_GPIOLIB_IRQCHIP
-- 
1.9.1

  parent reply	other threads:[~2014-10-15 14:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15 14:48 [PATCH v8 0/4] mfd: add support for Diolan DLN-2 Octavian Purdila
2014-10-15 14:48 ` [PATCH v8 1/4] mfd: add support for Diolan DLN-2 devices Octavian Purdila
2014-10-23 15:16   ` Johan Hovold
2014-10-27 13:21     ` Octavian Purdila
2014-10-27 14:36       ` Johan Hovold
2014-10-15 14:48 ` [PATCH v8 2/4] i2c: add support for Diolan DLN-2 USB-I2C adapter Octavian Purdila
     [not found]   ` <1413384491-23703-3-git-send-email-octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-10-16  6:58     ` Wolfram Sang
2014-10-23 15:19     ` Johan Hovold
2014-10-27 12:42       ` Octavian Purdila
2014-10-15 14:48 ` Octavian Purdila [this message]
2014-10-20  5:08   ` [PATCH v8 3/4] gpiolib: add irq_not_threaded flag to gpio_chip Alexandre Courbot
     [not found]     ` <CAAVeFuJ4B37YgvTBctXqmtWJtg3b19PDt1EEZF5Rc6KVXZzUtw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-20 10:19       ` Octavian Purdila
     [not found]         ` <CAE1zot+FL54r3a6-qJwDti3D2dGCSwN=a0g0ki28cy1ToXgSfg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-23  5:10           ` Alexandre Courbot
2014-10-15 14:48 ` [PATCH v8 4/4] gpio: add support for the Diolan DLN-2 USB GPIO driver Octavian Purdila

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=1413384491-23703-4-git-send-email-octavian.purdila@intel.com \
    --to=octavian.purdila@intel.com \
    --cc=arnd@arndb.de \
    --cc=daniel.baluta@intel.com \
    --cc=gnurou@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=laurentiu.palcu@intel.com \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=wsa@the-dreams.de \
    /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).