Message ID | 20221102165747.1528988-1-lis8215@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp32533wru; Wed, 2 Nov 2022 10:14:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6YYoiexI6XG2RvzSkL/VZE5iQUrgGN3UUiBZ6mvPMWIg845v1f/XEfGv/obtWSI7TmrFop X-Received: by 2002:a17:906:7621:b0:750:c4a3:8fcd with SMTP id c1-20020a170906762100b00750c4a38fcdmr25953385ejn.180.1667409255702; Wed, 02 Nov 2022 10:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667409255; cv=none; d=google.com; s=arc-20160816; b=mS2FLAbGmGXUP6rFrnUVoeofQc9bUEHO9aLvT7pBeKhdUbkELORTuCUt9l8GVFsrg2 9RJ+NEG/C7/Z/FUxN+bGpCHpqiTIoSkrCmsRXaAeH9PcuaANvvsKR/08OhrfSd1yt3Zz S2Vbzdg3Adg+SPQjPL/dSdjHVccfnFDhFwz9wel4iIlHGwneTE/8A94cHQTsAc047Pwp i9jYNQ6rqc7yyW82tljspw+KHX/R0JMttvAg2gKtZguKm+9dS+mGvVTgUYEqJNiPteSV 2MkYF392qN/UvKFw3WYp4vLSS91wAmCT5RFeipEpCkD8iFGDzUKSeHjzhntnS46uGVWE 5K/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=c/rGavM3FugbFBXko20gXd+JeFm1aC+oWeUZwwWY/lw=; b=0Mta1w4Tegs2A7g8RQV2ZaiA8tmTJYyjNRKl3Rduxk9xWO7qGnOfDFcirPTcEKeu38 lEggnpEL933Z3iy5xOIM7bJgEbLGr0uUQpoJYL3iCNKc48nef+MgKvrMbNCnYm3jThBF WCgH92q9e0u/oSQRiVNM5ORXJt24Gi7McN/5VyAhg8H0/k8EJyP78jrLTEWKArf1u7sm ajaJ83D/nHoPacdAE7Eid9BfevfHi1HjsFdcpofnvReCVrt48PyMQbv89bIE9FxBgOXO Xe2ExkAcfAqYExONX5Vq4Wggm5NELWzBtyNUWncu04fcuXmshwA/z8gK3etQkUapeiJA 3f2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=E3u3i4q3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r10-20020a05640251ca00b0045cd68a2bc5si18127781edd.17.2022.11.02.10.13.51; Wed, 02 Nov 2022 10:14:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=E3u3i4q3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231364AbiKBRAX (ORCPT <rfc822;yves.mi.zy@gmail.com> + 99 others); Wed, 2 Nov 2022 13:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229548AbiKBRAT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 2 Nov 2022 13:00:19 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 838A811145; Wed, 2 Nov 2022 10:00:18 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id g12so29268396lfh.3; Wed, 02 Nov 2022 10:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=c/rGavM3FugbFBXko20gXd+JeFm1aC+oWeUZwwWY/lw=; b=E3u3i4q3Tti6P3TxzuaAcCyRGnzta9nQ16qIWquesyNBecLL+RWDpubJuvcnAxt0Hy dxIgCb48MNn9+aGQKyzNg0/akwaZoQeSfg3cMgKo+jxjEIMnTcVL3oz5prkN2GCnYkc8 Tu3b70ax5lsH4Zbf3gEjtdnH6o5JFPZDPeKx7RBx73x11IviuoRs8y+VznaDpcZ9vMj7 AXrfs1TnBShWGcFCvlfeLZ1UBp5SSSrnBSI2PIknZ2wtgDKoi+Vi2dzUUXZ+FzJC8nWZ iaknqvmtSuxV6DPz5HiQFN7TdyXKJgNVisIkxQZPYeweBaHwvAHA1t+oM7lWPxIh5DVB Z/gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=c/rGavM3FugbFBXko20gXd+JeFm1aC+oWeUZwwWY/lw=; b=I9j4b9abFkZPoFAQKi/hyxDWU31vE0oihZ2UxiI0S2eYN/FaL0nVlHiksWy4DPFBDu VVOYmsyOa2kLoNSloX2eGAVkAm30eQZnZzddoexepEZPnQuPx497OzuO6/n8y3ShzhEn Qq8xJVyJDQ0EJ3Y2nYzB49Drf/f7xaXKlbjfq4WLiaFNk/HJboBAWFyZCVy4k6pGNfYM yqzfJVy3K3uR3J2v53y3e+bLtO8xaK5Q7accdfWY/RbOVwqS8BrCC2TkP6nNr+c6YU4L hCAMEoA0V7kxAQ9zo5R2hqxUIi0bKKQaou0rhEY2jx8lcbgtFzoo8OaDWPBmFhPJqmf4 +jgQ== X-Gm-Message-State: ACrzQf2AXASTo38d4NPGFTRPQeQBoZ4ne7uZCWK7PKP/35eNWzeevL/I ajgrGNw70AOe4u117kYoHy0= X-Received: by 2002:a05:6512:31c6:b0:4a2:7d3b:87f0 with SMTP id j6-20020a05651231c600b004a27d3b87f0mr9331998lfe.382.1667408416810; Wed, 02 Nov 2022 10:00:16 -0700 (PDT) Received: from hp-power-15.localdomain ([193.228.193.7]) by smtp.gmail.com with ESMTPSA id o14-20020ac25e2e000000b004896ed8dce3sm2078825lfg.2.2022.11.02.10.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 10:00:15 -0700 (PDT) From: Siarhei Volkau <lis8215@gmail.com> Cc: Paul Cercueil <paul@crapouillou.net>, Siarhei Volkau <lis8215@gmail.com>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Input: matrix_keypad - force switch rows to input mode Date: Wed, 2 Nov 2022 19:57:47 +0300 Message-Id: <20221102165747.1528988-1-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748405327519261312?= X-GMAIL-MSGID: =?utf-8?q?1748405327519261312?= |
Series |
Input: matrix_keypad - force switch rows to input mode
|
|
Commit Message
Siarhei Volkau
Nov. 2, 2022, 4:57 p.m. UTC
Some Pin/GPIO controllers can't get current GPIO status when interrupt
mode is set. Specifically Ingenic's JZ4755 always returns status at the
moment of interrupt.
The patch tries to fix that by forcibly setting pin mode to GPIO input
prior to reading actual row status. enable_row_irqs seems to set
interrupt mode back as it should be.
Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
---
drivers/input/keyboard/matrix_keypad.c | 3 +++
1 file changed, 3 insertions(+)
Comments
On Wed, Nov 02, 2022 at 07:57:47PM +0300, Siarhei Volkau wrote: > Some Pin/GPIO controllers can't get current GPIO status when interrupt > mode is set. Specifically Ingenic's JZ4755 always returns status at the > moment of interrupt. > > The patch tries to fix that by forcibly setting pin mode to GPIO input > prior to reading actual row status. enable_row_irqs seems to set > interrupt mode back as it should be. > > Signed-off-by: Siarhei Volkau <lis8215@gmail.com> Applied, thank you.
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 7dd3f3eda..b4c0325bb 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -127,6 +127,9 @@ static void matrix_keypad_scan(struct work_struct *work) memset(new_state, 0, sizeof(new_state)); + for (row = 0; row < pdata->num_row_gpios; row++) + gpio_direction_input(pdata->row_gpios[row]); + /* assert each column and read the row status out */ for (col = 0; col < pdata->num_col_gpios; col++) {