All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Gardiner <bengardiner@nanometrics.ca>
To: Kevin Hilman <khilman@deeprootsystems.com>,
	davinci-linux-open-source@linux.davincidsp.com,
	linux-input@vger.kernel.org,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Chris Cordahi <christophercordahi@nanometrics.ca>,
	Paul Mundt <lethal@linux-sh.org>, Sekhar Nori <nsekhar@ti.com>,
	Gabor Juhos <juhosg@openwrt.org>
Subject: [PATCH v5 0/5] da850-evm: add gpio-{keys,leds} for UI and BB expanders
Date: Wed, 24 Nov 2010 16:59:29 -0500	[thread overview]
Message-ID: <cover.1290635422.git.bengardiner@nanometrics.ca> (raw)
In-Reply-To: <cover.1290540916.git.bengardiner@nanometrics.ca>

Note: I must regrettably move on to other projects for awhile and will thus
be unavailable to continue this integration effort. I am posting the most
recent version of the series with a modified version of Gabor Juho's driver
in the hopes that it will make the integration effort easier for whoever picks
up the task when the time is right -- whether or not that is me.

My apologies for the patchbomb. I will do my best to make time for reviews 
and testing of any future versions of the series.

Best Regards,
Ben Gardiner

---

The da850-evm baseboard (BB) and its UI board both have tca6416 IO expanders.
They are bootstrapped to different I2C addresses so they can be used
concurrently.

The expander on the UI board is currently used to enable/disable the
peripherals that are available on the UI board. In addition to this
functionality the expander is also connected to 8 pushbuttons. The expander
on the baseboard is not currently used; it is connected to deep sleep enable,
sw reset, a push button, some switches and LEDs.

This proposed patch series enables the push buttons and switches on the UI and
BB expanders using the gpio-keys polling mode patch by Gabor Juhos. Some
work was performed to test irq-based gpio-keys support on the expanders (a WIP
patch can be posted on request) but I believe that it is not possible to use 
irq-based gpio-keys on IO expanders for arm systems at this time. 

The attempt started when I noticed the patch of Alek Du and Alan Cox [1] which 
was recently committed [2]; a stab at integrating irq-based gpio-keys support
based on that patch was attempted. I found that I either got a warning that the
irq could not be mapped for the given gpio ; or, when N_IRQ was increased, a
system freeze.

>From what I have read (particularly the message by Grant Likely [3]) IRQs on
IO expanders are not ready in ARM yet. I _think_ that the sparse IRQ rework by
Thomas Gleixner [4] will resolve the blocker to irq-based gpio-keys support. 

In the meantime we have buttons and switches that we would like to excersise
in our prototyping development. The patch to convert this series to irq-based
gpio-keys will be straighforward once the support in arch/arm is there.

There is an existing tca6416-keypad driver with polling support which I did not
employ because it isn't possible to keep the gpio's used for peripheral
enable/disable on the UI board or the LEDs on the baseboard registered while
simultaneously registering the pushbuttons or switches as a tca6416-keypad 
instance.

I tested this patch series using evtest on the resulting /dev/input/eventN 
devices and also on the event node of a non-polling gpio-keys instance to 
ensure that irq-based input handling is not broken by the introduction of the
polling-mode gpio-keys patch. The non-polling instance creation and
registration is not included in this series since it uses one of the boot-mode
DIP switches and woult not (I think) be suitable for mainline.

Disclaimer: 
I'm not an expert in irq's or gpio-keys; this is, in fact, my first proposed
feature. Please feel free to correct me -- I welcome the chance to learn from
your expertise.

Ben Gardiner (4):
  da850-evm: add UI Expander pushbuttons
  da850-evm: extract defines for SEL{A,B,C} pins in UI expander
  da850-evm: add baseboard GPIO expander buttons, switches and LEDs
  da850-evm: KEYBOARD_GPIO_POLLED Kconfig conditional

Gabor Juhos (1):
  [WIP] input: add input driver for polled GPIO buttons

 arch/arm/mach-davinci/Kconfig             |    3 +
 arch/arm/mach-davinci/board-da850-evm.c   |  306 +++++++++++++++++++++++++++--
 drivers/input/keyboard/Kconfig            |   16 ++
 drivers/input/keyboard/Makefile           |    2 +
 drivers/input/keyboard/gpio_keys_polled.c |  240 ++++++++++++++++++++++
 include/linux/gpio_keys_polled.h          |   26 +++
 6 files changed, 581 insertions(+), 12 deletions(-)
 create mode 100644 drivers/input/keyboard/gpio_keys_polled.c
 create mode 100644 include/linux/gpio_keys_polled.h

---

Changes since v4:
 * integrated Gabor Juhos' polling gpio button driver in place of the
   gpio-keys patch of Paul Mundt and Alex Clouter
 * dont' line break error messages (Sekhar Nori)
 * whitespace cleanup (Sekhar Nori)

Changes since v3:
 * introduced patch 5 in the series by extracting the Kconfig changes proposed
   in patch 2 of v3.
 * not gpio_request()'ing the sw_rst and deep_sleep_en lines as requested 
   (Sekhar Nori)

Changes since v2:
 * register a single input device for switches and keys on the baseboard since
   there is no benefit to separate devices with different polling intervals
   (Dmitry Torokhov)
 * use static array intialization and range intialization for platform data 
   structure to minimize the amount of runtime intialization needed:
   (Sekhar Nori)
 * Use the da850_evm variable name prefix for static symbols in
   board-da850-evm.c

Changes since v1:
 * use locally defined functions that are no-ops/error checkers when
   INPUT_POLLDEV is not defined.
 * disable polling mode support when input-polldev is a module and gpio_keys
   is builtin
 * set INPUT_POLLDEV default for DA850_EVM machine, but don't select it
   unconditionally
 * adding note to description about why tca6416-keypad was not used


  parent reply	other threads:[~2010-11-24 21:59 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1289835508.git.bengardiner@nanometrics.ca>
     [not found] ` <8891d088e9a16122c780f737b1b1ec35f9517c36.1289835508.git.bengardiner@nanometrics.ca>
2010-11-16  9:36   ` [PATCH 1/4] input: gpio_keys: polling mode support Paul Mundt
2010-11-16 18:28     ` Ben Gardiner
2010-11-16 19:39 ` [PATCH v2 0/4] da850-evm: add gpio-{keys,leds} for UI and BB expanders Ben Gardiner
2010-11-16 19:39   ` [PATCH v2 0/4] da850-evm: add gpio-{keys, leds} " Ben Gardiner
2010-11-16 19:39   ` [PATCH v2 1/4] input: gpio_keys: polling mode support Ben Gardiner
2010-11-16 19:39   ` [PATCH v2 2/4] da850-evm: add UI Expander pushbuttons Ben Gardiner
2010-11-19  9:58     ` Nori, Sekhar
2010-11-19  9:58       ` Nori, Sekhar
2010-11-19 15:38       ` Ben Gardiner
2010-11-19 15:38         ` Ben Gardiner
2010-11-22 11:49         ` Nori, Sekhar
2010-11-22 11:49           ` Nori, Sekhar
2010-11-22 13:50           ` Ben Gardiner
2010-11-22 13:50             ` Ben Gardiner
2010-11-23 12:38             ` Nori, Sekhar
2010-11-23 12:38               ` Nori, Sekhar
2010-11-23 13:29               ` Ben Gardiner
2010-11-23 13:29                 ` Ben Gardiner
2010-11-23 15:48               ` Kevin Hilman
2010-11-23 15:48                 ` Kevin Hilman
2010-11-23 17:58                 ` Ben Gardiner
2010-11-23 17:58                   ` Ben Gardiner
2010-11-24  6:09                 ` Paul Mundt
2010-11-24  6:09                   ` Paul Mundt
2010-11-24 17:17                   ` Ben Gardiner
2010-11-24 17:17                     ` Ben Gardiner
2010-11-16 19:39   ` [PATCH v2 3/4] da850-evm: extract defines for SEL{A,B,C} pins in UI expander Ben Gardiner
2010-11-16 19:39     ` [PATCH v2 3/4] da850-evm: extract defines for SEL{A, B, C} " Ben Gardiner
2010-11-19 11:19     ` Nori, Sekhar
2010-11-19 11:19       ` Nori, Sekhar
2010-11-19 15:38       ` Ben Gardiner
2010-11-19 15:38         ` Ben Gardiner
2010-11-16 19:39   ` [PATCH v2 4/4] da850-evm: add baseboard UI expander buttons, switches and LEDs Ben Gardiner
2010-11-19 12:14     ` Nori, Sekhar
2010-11-19 12:14       ` Nori, Sekhar
2010-11-19 15:40       ` Ben Gardiner
2010-11-19 15:40         ` Ben Gardiner
2010-11-19 17:02         ` Dmitry Torokhov
2010-11-19 17:02           ` Dmitry Torokhov
2010-11-19 17:15           ` Ben Gardiner
2010-11-19 17:15             ` Ben Gardiner
2010-11-22 12:00         ` Nori, Sekhar
2010-11-22 12:00           ` Nori, Sekhar
2010-11-22 14:15           ` Ben Gardiner
2010-11-22 14:15             ` Ben Gardiner
2010-11-23 12:42             ` Nori, Sekhar
2010-11-23 12:42               ` Nori, Sekhar
2010-11-23 13:32               ` Ben Gardiner
2010-11-23 13:32                 ` Ben Gardiner
2010-11-19 21:37   ` [PATCH v3 0/4] da850-evm: add gpio-{keys,leds} for UI and BB expanders Ben Gardiner
2010-11-19 21:37     ` [PATCH v3 1/4] input: gpio_keys: polling mode support Ben Gardiner
2010-11-19 21:37     ` [PATCH v3 2/4] da850-evm: add UI Expander pushbuttons Ben Gardiner
2010-11-19 21:37     ` [PATCH v3 3/4] da850-evm: extract defines for SEL{A,B,C} pins in UI expander Ben Gardiner
2010-11-19 21:41       ` [PATCH v3 3/4] da850-evm: extract defines for SEL{A, B, C} " Victor Rodriguez
2010-11-19 21:41         ` Victor Rodriguez
2010-11-19 22:25         ` Ben Gardiner
2010-11-19 22:25           ` Ben Gardiner
2010-11-19 21:37     ` [PATCH v3 4/4] da850-evm: add baseboard GPIO expander buttons, switches and LEDs Ben Gardiner
2010-11-23 19:40     ` [PATCH v4 0/5] da850-evm: add gpio-{keys,leds} for UI and BB expanders Ben Gardiner
2010-11-23 19:40       ` [PATCH v4 1/5] input: gpio_keys: polling mode support Ben Gardiner
2010-11-23 19:40         ` Ben Gardiner
2010-11-23 19:40       ` [PATCH v4 2/5] da850-evm: add UI Expander pushbuttons Ben Gardiner
2010-11-23 19:40         ` Ben Gardiner
2010-11-24 13:16         ` Nori, Sekhar
2010-11-24 13:16           ` Nori, Sekhar
2010-11-24 17:16           ` Ben Gardiner
2010-11-24 17:16             ` Ben Gardiner
2010-11-23 19:40       ` [PATCH v4 3/5] da850-evm: extract defines for SEL{A,B,C} pins in UI expander Ben Gardiner
2010-11-23 19:40       ` [PATCH v4 4/5] da850-evm: add baseboard GPIO expander buttons, switches and LEDs Ben Gardiner
2010-11-23 19:41       ` [PATCH v4 5/5] da850-evm: KEYBOARD_GPIO and INPUT_POLLDEV Kconfig conditionals Ben Gardiner
2010-11-23 19:41         ` Ben Gardiner
2010-11-24 21:59       ` Ben Gardiner [this message]
2010-11-24 21:59         ` [PATCH v5 1/5] [WIP] input: add input driver for polled GPIO buttons Ben Gardiner
2010-11-24 21:59           ` Ben Gardiner
2010-11-24 21:59         ` [PATCH v5 2/5] da850-evm: add UI Expander pushbuttons Ben Gardiner
2010-11-24 21:59           ` Ben Gardiner
2010-11-24 21:59         ` [PATCH v5 3/5] da850-evm: extract defines for SEL{A,B,C} pins in UI expander Ben Gardiner
2010-11-24 21:59         ` [PATCH v5 4/5] da850-evm: add baseboard GPIO expander buttons, switches and LEDs Ben Gardiner
2010-11-24 21:59         ` [PATCH v5 5/5] da850-evm: KEYBOARD_GPIO_POLLED Kconfig conditional Ben Gardiner
2010-11-24 21:59           ` Ben Gardiner
2010-12-09 21:51         ` [PATCH v6 0/5] da850-evm: add gpio-{keys,leds} for UI and BB expanders Ben Gardiner
2010-12-09 21:51           ` [PATCH v6 1/5] Input: add input driver for polled GPIO buttons Ben Gardiner
2010-12-09 21:51             ` Ben Gardiner
2010-12-10 15:50             ` Kevin Hilman
2010-12-09 21:51           ` [PATCH v6 2/5] da850-evm: add UI Expander pushbuttons Ben Gardiner
2010-12-09 21:51             ` Ben Gardiner
2010-12-09 21:51           ` [PATCH v6 3/5] da850-evm: extract defines for SEL{A,B,C} pins in UI expander Ben Gardiner
2010-12-09 21:51           ` [PATCH v6 4/5] da850-evm: add baseboard GPIO expander buttons, switches and LEDs Ben Gardiner
2010-12-09 21:51           ` [PATCH v6 5/5] da850-evm: KEYBOARD_GPIO_POLLED Kconfig conditional Ben Gardiner
2010-12-09 21:51             ` Ben Gardiner
2010-12-10 16:16           ` [PATCH v6 0/5] da850-evm: add gpio-{keys,leds} for UI and BB expanders Kevin Hilman
2010-12-10 16:33             ` Ben Gardiner
2010-12-10 16:33               ` Ben Gardiner
2010-12-11  0:04               ` Kevin Hilman
2010-12-11  0:04                 ` Kevin Hilman
2010-12-13 17:02               ` Ben Gardiner
2010-12-13 17:02                 ` Ben Gardiner
2010-12-13 21:53                 ` Kevin Hilman
2010-12-13 21:53                   ` [PATCH v6 0/5] da850-evm: add gpio-{keys, leds} " Kevin Hilman
2010-12-14  4:31                   ` [PATCH v6 0/5] da850-evm: add gpio-{keys,leds} " Ben Gardiner
2010-12-14  4:31                     ` Ben Gardiner
2010-12-14 16:17                   ` Ben Gardiner
2010-12-14 17:10                     ` Kevin Hilman
2010-12-17 15:15                       ` Ben Gardiner

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=cover.1290635422.git.bengardiner@nanometrics.ca \
    --to=bengardiner@nanometrics.ca \
    --cc=christophercordahi@nanometrics.ca \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=juhosg@openwrt.org \
    --cc=khilman@deeprootsystems.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nsekhar@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.