Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp172351rwi; Wed, 2 Nov 2022 10:32:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM40+YOVQGa+qxKDiKh67vjGgdbpRCi4mm5R8l3U+j9yxeZfDtmtvgPZty3EzIlf4pVv6usC X-Received: by 2002:a17:902:eb92:b0:186:7067:3e9a with SMTP id q18-20020a170902eb9200b0018670673e9amr25802787plg.80.1667410349954; Wed, 02 Nov 2022 10:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667410349; cv=none; d=google.com; s=arc-20160816; b=sTZtLr4mwbM2l/gtEe3PfrQHugc83+pm8e9YGb+lVGMiY9DJl4v2xb1wVAnm7zZjSq b6Kir5Vo1+MJ2WzdEn7BUFf1p/0ap+oR0f6KePIUkubZidop4Gf4tDKlxTTdFzOPHo36 PgW/eoiAB+6x796IomDIbHB3mS2kMpSw5bM5Z1+UCTLsX+ci/7GO3Vs7KjFL5uXm98yB SloWDHfUk7mpPFOv/2DgZzl05o3YzJv1gbNkbqtWoVGgKRiDjP0V9vFfb64RO9+v+fG7 9uJP6XK+5S2OeGug25dgb3tNRBOOPol2iGvQo1UTrkSdWIrzHTtVRW4f7HqqaqqsEE3a 9kXQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb12-20020a17090b4a4c00b00201d6d4cc79si3501069pjb.113.2022.11.02.10.32.15; Wed, 02 Nov 2022 10:32:29 -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 + 98 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 ); 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 Cc: Paul Cercueil , Siarhei Volkau , Dmitry Torokhov , 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/input/keyboard/matrix_keypad.c | 3 +++ 1 file changed, 3 insertions(+) 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++) { -- 2.36.1