From patchwork Sat Sep 12 12:58:33 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: 7166451 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E26189F32B for ; Sat, 12 Sep 2015 12:58:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1DE972078E for ; Sat, 12 Sep 2015 12:58:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D50D207B0 for ; Sat, 12 Sep 2015 12:58:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754509AbbILM6v (ORCPT ); Sat, 12 Sep 2015 08:58:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46648 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbbILM6i (ORCPT ); Sat, 12 Sep 2015 08:58:38 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id B30EB373F42; Sat, 12 Sep 2015 12:58:38 +0000 (UTC) Received: from shalem.localdomain.com (vpn1-6-113.ams2.redhat.com [10.36.6.113]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8CCwYj4031610; Sat, 12 Sep 2015 08:58:37 -0400 From: Hans de Goede To: Dmitry Torokhov , Rob Herring , Maxime Ripard Cc: linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree , Hans de Goede Subject: [PATCH v2] devicetree: bindings: Update gpio-keys-polled with support for abs/rel axis Date: Sat, 12 Sep 2015 14:58:33 +0200 Message-Id: <1442062713-21260-2-git-send-email-hdegoede@redhat.com> In-Reply-To: <1442062713-21260-1-git-send-email-hdegoede@redhat.com> References: <1442062713-21260-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Changes in v2: -Add Rob's ack -s/send/sent/ -Make the remarks of axis reporting a value of 0 when all buttons tied to that axis are released also apply to EV_REL axis --- 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..283f85e 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 sent for events this button generates when pressed. + EV_ABS/EV_REL axis will generate an event with a value of 0 when + all buttons with linux,input-type == type 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.