From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754021AbbCaA2S (ORCPT ); Mon, 30 Mar 2015 20:28:18 -0400 Received: from mail-pd0-f201.google.com ([209.85.192.201]:34750 "EHLO mail-pd0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753942AbbCaA2N (ORCPT ); Mon, 30 Mar 2015 20:28:13 -0400 From: Andrew Bresticker To: Dmitry Torokhov Cc: devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Bresticker , Jonathan Cameron , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala Subject: [PATCH V2 2/3] Input: Add binding document for ADC keypad Date: Mon, 30 Mar 2015 17:28:08 -0700 Message-Id: <1427761689-5238-2-git-send-email-abrestic@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1427761689-5238-1-git-send-email-abrestic@chromium.org> References: <1427761689-5238-1-git-send-email-abrestic@chromium.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 Cc: Jonathan Cameron Cc: Rob Herring Cc: Pawel Moll Cc: Mark Rutland Cc: Ian Campbell Cc: Kumar Gala --- 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 = ; + linux,input-type = ; + channel = <0>; + min-voltage = <1600000>; + max-voltage = <1640000>; + }; + + ... +}; -- 2.2.0.rc0.207.ga3a616c