linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFD 0/3] Add gpio test framework
@ 2015-11-14  8:51 Bamvor Jian Zhang
  2015-11-14  8:51 ` [PATCH RFD 1/3] gpio/mockup: add virtual gpio device Bamvor Jian Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Bamvor Jian Zhang @ 2015-11-14  8:51 UTC (permalink / raw)
  To: linux-gpio; +Cc: linus.walleij, broonie, Bamvor Jian Zhang

These series of patches try to add support for testing of gpio
subsystem based on the proposal from Linus Walleij.

The basic idea is implement a virtual gpio device(gpio-mockup) base
on gpiolib. Tester could test the gpiolib by manipulating gpio-mockup
device through sysfs and check the result from debugfs. Both sysfs
and debugfs are provided by gpiolib. Reference the following figure:

   sysfs  debugfs
     |       |
  gpiolib---/
     |
 gpio-mockup

Find two issues with my patch series[1]

Futher work and discussion:
1.  Test other code path(if exists).

2   Add pinctrl and interrupt support(Linus suggest trying the
    eventfd) in next steps.

3.  I feel that we could rework the debugfs in other gpiolib based
    drivers to the code in gpiolib.c with generic gpiolib_dbg_show or
    chip->dbg_show.

4.  Currently, gpio-mockup does not support the device tree. There are
    pros and cons if we do not support device tree:
    Pros: do not need to mix with the real hardware dts.
    Cons: could not test the dt_gpio_count, of_find_gpio which rely on
    device tree. And other function such like gpiod_get_index which
    rely on the correctness of the above functions.

    If we want to test the above functions, we could provide a
    dedicated device tree for gpio-mockup device which could be
    included by other device tree. And we could use device tree
    overlay to provide multiple device tree testcases.

5.  Given that this gpio test framework is based on sysfs and debugfs.
    I feel that it could be a generic gpio test script other then a
    dedicated script for gpio-mockup driver. Although, my script only
    support gpio-mockup driver at this monment.

[1] http://article.gmane.org/gmane.linux.kernel.gpio/11878

Bamvor Jian Zhang (3):
  gpio/mockup: add virtual gpio device
  selftest/gpio: add gpio test case
  gpio: MAINTAINERS: Add an entry for GPIO mockup driver

 MAINTAINERS                          |   9 ++
 drivers/gpio/Kconfig                 |   9 ++
 drivers/gpio/Makefile                |   1 +
 drivers/gpio/gpio-mockup.c           | 216 +++++++++++++++++++++++++++++++
 tools/testing/selftests/Makefile     |   1 +
 tools/testing/selftests/gpio/gpio.sh | 238 +++++++++++++++++++++++++++++++++++
 6 files changed, 474 insertions(+)
 create mode 100644 drivers/gpio/gpio-mockup.c
 create mode 100755 tools/testing/selftests/gpio/gpio.sh

-- 
2.1.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-11-26 16:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-14  8:51 [PATCH RFD 0/3] Add gpio test framework Bamvor Jian Zhang
2015-11-14  8:51 ` [PATCH RFD 1/3] gpio/mockup: add virtual gpio device Bamvor Jian Zhang
2015-11-26  9:34   ` Linus Walleij
2015-11-26 14:54     ` Bamvor Jian Zhang
2015-11-14  8:51 ` [PATCH RFD 2/3] selftest/gpio: add gpio test case Bamvor Jian Zhang
2015-11-26  9:50   ` Linus Walleij
2015-11-26 16:18     ` Bamvor Jian Zhang
2015-11-14  8:51 ` [PATCH RFD 3/3] gpio: MAINTAINERS: Add an entry for GPIO mockup driver Bamvor Jian Zhang

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).