From patchwork Tue Nov 1 10:25:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 9407131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 95AE360234 for ; Tue, 1 Nov 2016 10:34:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5D0529774 for ; Tue, 1 Nov 2016 10:34:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AB2E29776; Tue, 1 Nov 2016 10:34:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11FC129774 for ; Tue, 1 Nov 2016 10:34:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1168606AbcKAKeg (ORCPT ); Tue, 1 Nov 2016 06:34:36 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:57424 "EHLO outils.crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1168641AbcKAKeV (ORCPT ); Tue, 1 Nov 2016 06:34:21 -0400 From: Paul Cercueil To: Dmitry Torokhov , Laxman Dewangan , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Maarten ter Huurne , Paul Cercueil Subject: [PATCH 1/2] Input: gpio_keys - Also send release events for ABS codes Date: Tue, 1 Nov 2016 11:25:03 +0100 Message-Id: <20161101102504.3783-2-paul@crapouillou.net> In-Reply-To: <20161101102504.3783-1-paul@crapouillou.net> References: <20161101102504.3783-1-paul@crapouillou.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1477995914; bh=yDLqGE4SGMQIesBjIfKMu1fWdbmiOsvQXimdDmW7sRo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=egdB7L7qQWXNx7tLIEXXO3+qpKcWeuxZNQcBKI280U0PjsKBDuKwcvyBV9gxRbj0lXryAT5f2Y57WyWocj5xxS8j+f/TT92nEOFR7LsqHs/4Jw3YXH34iVh7E/Wj+WOHRgND8SsG+RS86dLxkKEsK1OxGUNMgRW+Is392BbgX0w= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Right now, the gpio-keys driver is mostly used with EV_KEY event types. However, this driver (and its devicetree bindings) support specifying a different input type, like EV_ABS, even though this doesn't work in practice: "key pressed" events are correctly received and treated, but "key released" are silently ignored. With this commit, keys configured as EV_ABS will inject an event with the value 0 when released. Signed-off-by: Paul Cercueil --- drivers/input/keyboard/gpio_keys.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 2909365..7018c49 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -369,6 +369,8 @@ static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata) if (type == EV_ABS) { if (state) input_event(input, type, button->code, button->value); + else + input_event(input, type, button->code, 0); } else { input_event(input, type, button->code, !!state); }