From patchwork Wed Sep 9 09:11:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 515769 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E7BF91402AB for ; Wed, 9 Sep 2015 19:11:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752112AbbIIJLa (ORCPT ); Wed, 9 Sep 2015 05:11:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53057 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751886AbbIIJLa (ORCPT ); Wed, 9 Sep 2015 05:11:30 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 02478461E1; Wed, 9 Sep 2015 09:11:29 +0000 (UTC) Received: from shalem.localdomain.com (vpn1-6-29.ams2.redhat.com [10.36.6.29]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t899BRjJ012676; Wed, 9 Sep 2015 05:11:28 -0400 From: Hans de Goede To: Dmitry Torokhov Cc: Maxime Ripard , linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree , linux-sunxi@googlegroups.com, Hans de Goede Subject: [PATCH 1/4] devicetree: bindings: Update gpio-keys-polled with support for abs/rel axis Date: Wed, 9 Sep 2015 11:11:23 +0200 Message-Id: <1441789886-5868-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The devicetree binding for gpio-keys-polled already allows specifying what type of events (key / rel / abs) a button generates when pressed. But for rel / abs axis we also need to specify which value this specific gpio represents. One usecase is digital joysticks / direction-pads which are hooked up to gpio, in this case we've left and right buttons which we want to map to EV_ABS, ABS_X and we want generate events for left with a value of -1 and for right with a value of +1 (and similar for up / down and ABS_Y). Signed-off-by: Hans de Goede Acked-by: Rob Herring --- Documentation/devicetree/bindings/input/gpio-keys-polled.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/input/gpio-keys-polled.txt b/Documentation/devicetree/bindings/input/gpio-keys-polled.txt index 313abef..ab4b09b 100644 --- a/Documentation/devicetree/bindings/input/gpio-keys-polled.txt +++ b/Documentation/devicetree/bindings/input/gpio-keys-polled.txt @@ -13,11 +13,16 @@ Subnode properties: - gpios: OF device-tree gpio specification. - label: Descriptive name of the key. - - linux,code: Keycode to emit. + - linux,code: Key / Axis code to emit. Optional subnode-properties: - linux,input-type: Specify event type this button/key generates. If not specified defaults to <1> == EV_KEY. + - linux,input-value: If linux,input-type is EV_ABS or EV_REL then this + value is send for events this button generates when pressed. + EV_ABS axis will generate an event with a value of 0 when all + buttons with linux,input-type == EV_ABS and linux,code == axis + are released. - debounce-interval: Debouncing interval time in milliseconds. If not specified defaults to 5. - gpio-key,wakeup: Boolean, button can wake-up the system.