LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Bresticker <abrestic@chromium.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: devicetree@vger.kernel.org, linux-input@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andrew Bresticker <abrestic@chromium.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>
Subject: [PATCH V2 2/3] Input: Add binding document for ADC keypad
Date: Mon, 30 Mar 2015 17:28:08 -0700	[thread overview]
Message-ID: <1427761689-5238-2-git-send-email-abrestic@chromium.org> (raw)
In-Reply-To: <1427761689-5238-1-git-send-email-abrestic@chromium.org>

Add a binding document for a generic ADC keypad.  Buttons on an ADC
keypad are connected in a resistor ladder to an ADC.  The binding
describes the mapping of ADC channel and voltage ranges to buttons.
Note that this binding only describes simple ADC keypads where only
a single button press can be detected at once per ADC channel.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
---
Changes from v1:
 - Made linux,input-type a required property.
---
 .../devicetree/bindings/input/adc-keys.txt         | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/adc-keys.txt

diff --git a/Documentation/devicetree/bindings/input/adc-keys.txt b/Documentation/devicetree/bindings/input/adc-keys.txt
new file mode 100644
index 0000000..e531f25
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/adc-keys.txt
@@ -0,0 +1,41 @@
+Generic ADC keypad
+==================
+
+Required properties:
+ - compatible: "adc-keys"
+ - poll-interval: Polling interval time in ms.
+ - io-channels: List of IIO channels used by the keypad.
+   See ../iio/iio-bindings.txt for details.
+
+Optional properties:
+ - autorepeat: Enable auto-repeat.
+
+Each button on the ADC keypad is represented by a sub-node.
+
+Required sub-node properties:
+ - label: Descriptive name for the key.
+ - linux,code: Keycode to emit.
+ - linux,input-type: Event type this key generates.
+ - channel: IIO channel (index into the 'io-channels' above) to which this
+   button is attached.
+ - min-voltage: Minimum voltage in uV when this key is pressed.
+ - max-voltage: Maximum voltage in uV when this key is pressed.
+
+Example:
+
+adc-keypad {
+	compatible = "adc-keys";
+	poll-interval = <100>;
+	io-channels = <&adc 0>, <&adc 1>;
+
+	vol-up-button {
+		label = "Volume Up";
+		linux,code = <KEY_VOLUMEUP>;
+		linux,input-type = <EV_KEY>;
+		channel = <0>;
+		min-voltage = <1600000>;
+		max-voltage = <1640000>;
+	};
+
+	...
+};
-- 
2.2.0.rc0.207.ga3a616c


  reply	other threads:[~2015-03-31  0:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31  0:28 [PATCH V2 1/3] Input: Add event types to DT bidnings header Andrew Bresticker
2015-03-31  0:28 ` Andrew Bresticker [this message]
2015-03-31  0:28 ` [PATCH V2 3/3] Input: Add driver for a generic ADC keypad Andrew Bresticker

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=1427761689-5238-2-git-send-email-abrestic@chromium.org \
    --to=abrestic@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --subject='Re: [PATCH V2 2/3] Input: Add binding document for ADC keypad' \
    /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

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