linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Walleij <linus.walleij@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-doc@vger.kernel.org, Bartosz Golaszewski <brgl@bgdev.pl>
Subject: [PATCH v2 0/3] simulated interrupts
Date: Tue,  1 Aug 2017 16:50:25 +0200	[thread overview]
Message-ID: <20170801145028.7558-1-brgl@bgdev.pl> (raw)

Some frameworks (e.g. iio, gpiolib) use irq_work to implement simulated
interrupts that can be 'fired' from process context when needed and
requested just like normal interrupts. This is useful for testing and
development purposes.

Currently this code is reimplemented by every user. This series
proposes to add a new set of functions that can be used by drivers
that want to simulate interrupts without having to duplicate any
boilerplate code.

The first patch adds a simple irq simulator framework. The second
extends it with resource management. The third uses the new
functionality in the gpio-mockup testing driver.

NOTE: The next candidate for using this API would be iio-dummy-evgen.

v1 -> v2:
- added a call to irq_work_sync in irq_sim_fini()

Bartosz Golaszewski (3):
  irq/irq_sim: add a simple interrupt simulator framework
  irq/irq_sim: add a devres variant of irq_sim_init()
  gpio: mockup: use irq_sim

 Documentation/driver-model/devres.txt |   1 +
 drivers/gpio/Kconfig                  |   2 +-
 drivers/gpio/gpio-mockup.c            |  77 ++--------------
 include/linux/irq_sim.h               |  41 +++++++++
 init/Kconfig                          |   4 +
 kernel/Makefile                       |   1 +
 kernel/irq_sim.c                      | 162 ++++++++++++++++++++++++++++++++++
 7 files changed, 217 insertions(+), 71 deletions(-)
 create mode 100644 include/linux/irq_sim.h
 create mode 100644 kernel/irq_sim.c

-- 
2.13.2


             reply	other threads:[~2017-08-01 14:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-01 14:50 Bartosz Golaszewski [this message]
2017-08-01 14:50 ` [PATCH v2 1/3] irq/irq_sim: add a simple interrupt simulator framework Bartosz Golaszewski
2017-08-12 11:43   ` Jonathan Cameron
2017-08-14  9:54     ` Bartosz Golaszewski
2017-08-14 10:04       ` Jonathan Cameron
2017-08-01 14:50 ` [PATCH v2 2/3] irq/irq_sim: add a devres variant of irq_sim_init() Bartosz Golaszewski
2017-08-12 11:47   ` Jonathan Cameron
2017-08-01 14:50 ` [PATCH v2 3/3] gpio: mockup: use irq_sim Bartosz Golaszewski
2017-08-12 11:46   ` Jonathan Cameron
2017-08-13 12:16   ` 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=20170801145028.7558-1-brgl@bgdev.pl \
    --to=brgl@bgdev.pl \
    --cc=bamvor.zhangjian@linaro.org \
    --cc=corbet@lwn.net \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=tglx@linutronix.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).