From nobody Mon Dec 2 13:18:47 2024 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013046.outbound.protection.outlook.com [52.101.67.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBA2F7A15A; Thu, 31 Oct 2024 06:30:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730356237; cv=fail; b=gGULCFMZYcT3zMlMHFwkTM2D3qkmuzPByfwRMVw8iNF5VTqSHj+uRTki88eZ/hgwvCxhSkND2P6Wzv5mGMDkxj4aDrZgK6D3lL+QPHwbfYZQHEFbL66ZyWUv0VnyrTrfApRWb/Mgt4aphiUJRcr1TKtbHE0PsnS/+Eo8UU6X/m0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730356237; c=relaxed/simple; bh=2JgJUp0muyY6HKUfcYE7hCw4Uywu17MgmCICSXHZvnE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Vfs2PNzeIZk01Re4RvghnB63v6Gbf8KtyA5zISV0WbCJ11zVqBAkQUfQTcaqSV831hxnhMzns6BXrXW5L0NPyoxWexEqtPbLQUVB2nzrCMaybcw4iZ2GbPKZ6wXQUymY6eXA1woL50qQmNjsShnyWpRzcAHsKaioZ2jD2cVUYKs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=GfINoTzN; arc=fail smtp.client-ip=52.101.67.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="GfINoTzN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oaJX25RzUZ4FWx6/VQdJ25gbZJ3Rp56S6Xwo3WJB0eat0Wlkp0uqWcT8lzqdNx2pNz9+LMhx4PlxP6Wm7bRb045u+q8bnRXAxzCkaq7x5B2tDaSa0lg19gZVay0aXhWLGqNxvLn05IFx406IDZ9+y8wWqsyG+EkA/fBlmm/2TdONhjMFMT23x/YPb+QGOirxiWG67+xce3lZrm9hDB2dJZWIbluF5mgNxJ2dx2AdRsrR0T4+hrIW+0VKgXQFYSp2ZkwYTK7VdXPsdeTDqkFXP0rCqsg2sD5J27bfN9J4qD5jc0s/Sql1CZ4Tmm+FOU9VfBDYamnp+j2tF9qym9GgaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ElWlJbJZR8MOatkQ6tjF16LmsPBk6+DHoeCHsZS8qMM=; b=lRTx+CPzELIgygvsqAqniPMeBAh9sewKnPWtgPt9imySMldFMjazO4R2ay6kjko6bJCM/96Jgf0GqRMvb+FxI87F4hQGpCgjtQ6cXuvuI7Nx/+mIfm4F0c7WY9HPwG2XI3LrGu4ABD6RX8xAdL0J8eHmRSQSc6HEy7uJ3t5GxdBW1kh46bdu2m69AfiGpavXPmC5HwAxExVPJ69YCRXZzR/q31ccgAm+tXKy4vcDwBemJo7ywW+1J1bqCesLLPADCW8tQsLJctokP6BLR6YhNZd9Gk8I9/jkk0nrorRi5knx3NKr99Nq9J9ENAFOGJE/uPKP+AV+acPiML0fyn+8Kw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ElWlJbJZR8MOatkQ6tjF16LmsPBk6+DHoeCHsZS8qMM=; b=GfINoTzNZS2uhBbRb7z23AQWZHHxJtEoYWpPQwPtR767zAO2VmrUfvdFYQADY0VbweTroMgkNAEwfayfs53EKFM4Lkv/FG3PDHuH52lvCBEk/nlLCHCjeUDB1W/TKsAlBvNO6sg7QaCQTqT70kTe5RgxmbFQjw/4eM422saCgP18AMqImyIDfwynW+3bmHtzqhPk8JkIZKcq/MZyHqTbcn5Qk3VCNdcUTZ+aD3smXd3Dfdv9wjyx+YibWf0OtpE1aNov7SfgVFihe67DCAWVn94+XfSJ4vQhJ3JVNn00sWzPQ2YAjnCWFg0MEB9jXyH8dKssu6lFSoX/BkNv5AOq9g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) by PAVPR03MB9797.eurprd03.prod.outlook.com (2603:10a6:102:311::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.18; Thu, 31 Oct 2024 06:30:32 +0000 Received: from DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a]) by DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a%4]) with mapi id 15.20.8093.014; Thu, 31 Oct 2024 06:30:32 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-input@vger.kernel.org, devicetree@vger.kernel.org, Manuel Traut , HeDong Zhao Subject: [PATCH 1/6] Input: matrix_keypad - move gpio-row init to the init part Date: Thu, 31 Oct 2024 07:29:59 +0100 Message-Id: <20241031063004.69956-2-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031063004.69956-1-markus.burri@mt.com> References: <20241031063004.69956-1-markus.burri@mt.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: ZR0P278CA0087.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:22::20) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|PAVPR03MB9797:EE_ X-MS-Office365-Filtering-Correlation-Id: 34bee9d6-cb3a-41d7-5825-08dcf9758527 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?gBBGzupsebTPHTBV2vjtvnSwrEQH63Zh9I3GAz71UZ7FJcBFYdHEonTzvcih?= =?us-ascii?Q?+jxV0WwuPOKb3J7WfJJh8JdKdbOD3lxoSux7sRh5zE/t9zvpKNMt/hUEh4Oq?= =?us-ascii?Q?q/9PVw9Cw5GgVR65R0fVbrgWwLrdzxQU/33oA6xViS2U6ebnfIAE4rQTAG1r?= =?us-ascii?Q?Ld1bvH2jqVSx+LhGUATz5V6K/Ifq9SFcwpy4o2f8AFKSf1wrDhql8U6RvELh?= =?us-ascii?Q?OGRXoxz89RbCORVaomAzGcb2sgJDs7gwlAiNd+/w/WfK39zYueIZROB7qfAz?= =?us-ascii?Q?mpwafUL90X+EQk4Z4FmF2NcnOnZyhNI5n8Roh5X4gWOiobRMmFdnsb13B1cb?= =?us-ascii?Q?02Blc+9S1miLKEo8zEYHiFUlfrKX6zi227B56pPRkeNXIyFHL4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gX0eeT5McrMVsEkv8QofEhuEY60FbSBF+c91eywXnTV3/E?= =?us-ascii?Q?fYa0GKS7mgGyYrSAQJpwALJueA/+rSFV2pcnPLvHv8dOMd6oOGLDluxEEg+6?= =?us-ascii?Q?BVdUTfw=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB5399.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vMSRwuBgpNFyRe6/E41lxDt7lYNlNSCMryuz2GOdMBK9LfKfJorPVmYzs9Rr?= =?us-ascii?Q?R85r0MC8XSMsTEUStIyXXOjb4j7CAMSCKp61YCMNZZdC3k4FtKGy/8i0YoPJ?= =?us-ascii?Q?yFTjZ5Qa2VUyfduFoFLFV/GQszE6Xc23qXh8bCWe3hruPAmhcJUHAq2JQMes?= =?us-ascii?Q?J5g7OL8VGg2spcUj7jCj53cNy+u4Hcuc0B8JkeYxRec2wXiiR81NiYqoqwQq?= =?us-ascii?Q?2kOL2kwXunYKxhQ/KVSMf9Iu5IRhWjWS3503cjCTOz0yYZ1bDePnP9LH73jD?= =?us-ascii?Q?z2hQN5VD/7h4+QXEu9QA4RV/XsUmtyHciTEc4Saqb9cfIv9NYDfq8Q1UXR0L?= =?us-ascii?Q?TqGR0iFhcTpzuiPdCS4VTeEo0dLFiS5wDdDS3TB8Fwpw7ihHl+tBJqVzhzKG?= =?us-ascii?Q?eNgJ6dPEug1EOeT1jpSsEeMAbL9ex5x/Q/M6ZJsfLE5LY4KJdHga2wDGmWGH?= =?us-ascii?Q?Zb/hqrpU/FY/Bk1/juy+X441rxwxUPcDlUKpaHqrRqPTLy0w/1i6uttcX/h5?= =?us-ascii?Q?U1lebzyIxkQa9+VurfWI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t8HSel?= =?us-ascii?Q?TbmS9Cseru8ooXuWUZ51h/IsxYj4tHQfV/26qWPjKZM+eoljkq1Uk3fpnYnz?= =?us-ascii?Q?T+jtS7lxfHVLOGbI3yGORW64BjtcHoicC/JuerhM+k83YHncPV19Pk0xKh5+?= =?us-ascii?Q?WrKw3wANlq4yAm0g7xagsloccPgFt1xh1Xw4Gauy?= X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: 34bee9d6-cb3a-41d7-5825-08dcf9758527 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 06:30:32.1017 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 02/HTA1LlGn3OQA3RaWYxbfgginRuThcQotbXcZRRNs+ALDS0eqFGnFvjcAOl9l/8EUqouSFCdvGVig1xeA64w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR03MB9797 Content-Type: text/plain; charset="utf-8" If the matrix keypad is wired over a slow interface (e.g. a gpio-expansion over i2c), the scan can take a longer time. Move the initialisation of row gpio from scan to the init function will reduce the scan time and therefore increase scan performance. Signed-off-by: Markus Burri Reviewed-by: Manuel Traut Tested-by: HeDong Zhao --- drivers/input/keyboard/matrix_keypad.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboar= d/matrix_keypad.c index 3c38bae..a2ec9f6 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -118,9 +118,6 @@ static void matrix_keypad_scan(struct work_struct *work) =20 memset(new_state, 0, sizeof(new_state)); =20 - for (row =3D 0; row < keypad->num_row_gpios; row++) - gpiod_direction_input(keypad->row_gpios[row]); - /* assert each column and read the row status out */ for (col =3D 0; col < keypad->num_col_gpios; col++) { =20 @@ -326,6 +323,8 @@ static int matrix_keypad_init_gpio(struct platform_devi= ce *pdev, =20 if (active_low ^ gpiod_is_active_low(keypad->row_gpios[i])) gpiod_toggle_active_low(keypad->row_gpios[i]); + + gpiod_direction_input(keypad->row_gpios[i]); } =20 return 0; --=20 2.39.5 From nobody Mon Dec 2 13:18:47 2024 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012053.outbound.protection.outlook.com [52.101.66.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BB7B13D899; Thu, 31 Oct 2024 06:30:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730356246; cv=fail; b=ZKsMHJFwGsjBv216DMnMaFlwOB+Gp22q4WL7RcG759+efcKytupkscDnOhtJyr4IYdUVFJSF2a7THGcgJUh0oVG9CKIxcXf9qVd4Fz+/VANmBm1g2f4/yMlZHIw/HFXQhDrfPAgW+gVlr2F/Qr3XPXBqRBWpTRv2PxQmy/HJK1M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730356246; c=relaxed/simple; bh=y1MYnZ8vRwLXpf1FgeyiXnH/v+nZAQNao5ioxg1AoLc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=fLq3zM//4YHIF4llXLhodi9cc5sO2Eqizk5iWfmgn051iiqqPl5oXIceSWqGZV79ut5+hgyoYBNNU4Mgg2re3v5KuUIAcxgL9B7Z8VdD6xEGARZm1BiAenr8dTXi+g7zh0D5Wh1JkoKtWj6cz9GJTBpvLemoQqfmxkv+/CeF35U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=kG27Ymze; arc=fail smtp.client-ip=52.101.66.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="kG27Ymze" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=twQF5qjnymRbdtCXnjswM+AU3AL0DwBbWnlc9vk3mJfpP/06HDy41urjdTKljJl4hhEHNGTqTyeWY0OOQCjAsBTDBWHhPnwhK5ANBuHCBJz6/ZayTXcWGe7lz5jxeif5z+VOMbRBOCRTuTy6BCJC5+dCmiF+aVc55ktLvEVlgC8kg/szG2E3bUJvnBWltplBN5IxlbC7EVMxeaHUS61nXjBmC9NVXhwg9bphiMe1yDnGvNCv2bcF3KCmXO42qxGFh1jtHuuW3oV71XfH0TL6aiUL5GFytY+Swn8HwCG42iPbU+sPx3/VLazHQhD8lKAKSBvRLZPs3JOkSRnRNp3SdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eYVicDZ7a8ijNc4JdHRVIRf7abz+NCb0Ez3C/vfMo3s=; b=XgZRBlXV2sdCohErl9p9BG0ze5ngfNy+XMbrF078a6LZvA6OZfWgP7ygG5EP/KxLqnSSjTbNPtkRkHuS3AJnq0AZA3mdwIRGOiUjMhY8ZBy9GziMQ/uk2njuIkrODqwASd5IBLX4FH4ZzWfuLvUrK36hEJ5i7iEMbqjs4LCge1pR+Y/5iuGT5kSWWyUvJoLspLTwxuAj9gUE5JJV0u78JSjFw3hOnkXa8XtssC3KmYT3Fug0RFo7RXlr+CHMr6NdVGxM1hOxsgDAIrSyv7QALIrpDiMA6JIWBQbft3qchUU84ETbbuBggpizFqtjOmif+eDDfVqquH+pcwytkf9sjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eYVicDZ7a8ijNc4JdHRVIRf7abz+NCb0Ez3C/vfMo3s=; b=kG27YmzeFX+uT3hMg2aQJRZu0sVwMcx3jzaXCOrZP1msqF4qc3H6B2SlmzUfr67Dbh8JcRehQbZ2WXnZuKFM3S+DzbNKoC7zJyLDxZkMedMY/0qF9rri/03OBXKqN1YqqRSf00jdd2299l8oA7sbyADzXWoAlW0B5XHaE+KajXu61WuL6Fqn+Ht5Xf+2NjGu+pXdSz3wFsiY+KhQ2CV2zw7jPp12GsSX2m4LWjOvrm2DxPPMdnNp4apLzsHV3vQ6spzrNfHulBNbFmqM2RED9u1mKjuUuwJVhu289v6avHfzJRaAKZvuv3op2e3pLxEbgrRFR+jlvlP3nsLW1H43hg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) by PAVPR03MB9797.eurprd03.prod.outlook.com (2603:10a6:102:311::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.18; Thu, 31 Oct 2024 06:30:41 +0000 Received: from DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a]) by DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a%4]) with mapi id 15.20.8093.014; Thu, 31 Oct 2024 06:30:41 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-input@vger.kernel.org, devicetree@vger.kernel.org, Manuel Traut , HeDong Zhao Subject: [PATCH 2/6] Input: matrix_keypad - use fsleep for variable delay duration Date: Thu, 31 Oct 2024 07:30:00 +0100 Message-Id: <20241031063004.69956-3-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031063004.69956-1-markus.burri@mt.com> References: <20241031063004.69956-1-markus.burri@mt.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: ZR0P278CA0125.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:20::22) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|PAVPR03MB9797:EE_ X-MS-Office365-Filtering-Correlation-Id: 84be9a38-8be3-4aa4-a6ee-08dcf9758ac0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?bvyDUSqm7vc+u5wu59wdjoUoO3NG2jIifDuxuWBpNwBbCQlB8cJXgwdj7bvg?= =?us-ascii?Q?FfiPKv1jGqBlszs8HZ5CaDEOm7lkNk0NNKCs9usHzmCFa8xvHFSEfRBmMpAb?= =?us-ascii?Q?e+Z38jgwvXOVva2FHlBFGSVpuNZpLitI3a8lB0lSi1G9WfAFbjwo2vZNdsBi?= =?us-ascii?Q?2KhVjnT80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d1ynEHk?= =?us-ascii?Q?HWdFR0GrV8cseZEYb199QbtkZXzJ5iVGceY0FqrESpydWiGPsEztbHzOtVhG?= =?us-ascii?Q?ol7ekfzZ6enfsKLdsUr2PqG2O7AeKftsvQc9qG7ZBQCzNg5cJaUVtOiqN6nt?= =?us-ascii?Q?hz6MlzlZU2CsUGTIi3nf8D9GbeUYlewU2EDjeJNAXq/Foj54YmzpnPMCchyb?= =?us-ascii?Q?TT016HmBTGnSf/5nQ15kBslpQzEUNJgVI6vZVK7wC41nPf2yVfdIlD4KVUwj?= =?us-ascii?Q?F8YuqaZh8192anYqvgiCAeEP2CctdkdsG99ethE2zejnqkUY//bgyuh2VVqv?= =?us-ascii?Q?HOm8zWAtfSMdrTbl8yNBLU1Olpz/?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB5399.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?FwpJiapOXDMStrk8CLnPIInossNHJraRixCQGQ3M+fMoOxib2jIFb/IoS0T1?= =?us-ascii?Q?1CRExr1yVpOEoDX52lzr/whuYltrxM0Wbk7j/iM+Xb0nyMRW0lm5k4cSFQfq?= =?us-ascii?Q?mTe3BZplAWnAA6cGjFM+Kp9RQZarCfdsD+Blvl3ZjU8+H3NaXusv2v/i+axc?= =?us-ascii?Q?m7vBTOiX9wRCamGvp5Z+H6eK7eJX4mVZhFtX998YsH6DYmwSNEZwozjLX+fH?= =?us-ascii?Q?7a2xDIFRV/k+Ykh0ThgvdGMG42h5LTXh2+O9ByURtIP+nqaEfLMPc29Y/DiD?= =?us-ascii?Q?MWlzwySK8Kzdn9aI6Z70W+nn558ITUW3Ka4MqCfFH/CvTv4LP+d0ng6Z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Z99iHBw/WOrraTdSq6vHq+Nq?= =?us-ascii?Q?nU1FN+omfx9iY6voNkxaLOizHItAXzZFujcUSiNeY+FxczpB1hN97awbSlJ7?= =?us-ascii?Q?YZAFdqGpR3rsrlNYKy5PuRT6eAPg7vHrjCrGZ9jxk7KHo/lvRVk+Omc6iBN5?= =?us-ascii?Q?I0DbrvABl2eq8BtNzohevUAd0JD9i+WJaCCYJmxPc5H1Xmcz8geu0lQ9XKP5?= =?us-ascii?Q?MLLyO8qgmwLafzsAYzFXx+wabiXLORClf0yGrp/mGvg18Miex/y5dOpXzaXH?= =?us-ascii?Q?1ccoGAqcDiom7VIxGr40Wgb5cvTj0B3tfoCl86erEDybOzaqorYq+5bvhen6?= =?us-ascii?Q?623BlW0z0QqgmjlJ4vZXqURtqkSjsU9JFZo2uOyC?= X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84be9a38-8be3-4aa4-a6ee-08dcf9758ac0 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 06:30:41.4986 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Mo+8n2WPMdwimPh0ivFywD9Loqi59D5RKqCec3J9GQNBJGkl+QEgE0CxkUeMHZy6pAp/SYT1cJwGASH+3ThR2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR03MB9797 Content-Type: text/plain; charset="utf-8" The delay is retrieved from a device-tree property, so the duration is variable. fsleep guesses the best delay function based on duration. Link: https://www.kernel.org/doc/html/latest/timers/timers-howto.html Signed-off-by: Markus Burri Reviewed-by: Manuel Traut Tested-by: HeDong Zhao --- drivers/input/keyboard/matrix_keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboar= d/matrix_keypad.c index a2ec9f6..e08d7d5 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -69,7 +69,7 @@ static void activate_col(struct matrix_keypad *keypad, in= t col, bool on) __activate_col(keypad, col, on); =20 if (on && keypad->col_scan_delay_us) - udelay(keypad->col_scan_delay_us); + fsleep(keypad->col_scan_delay_us); } =20 static void activate_all_cols(struct matrix_keypad *keypad, bool on) --=20 2.39.5 From nobody Mon Dec 2 13:18:47 2024 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013025.outbound.protection.outlook.com [52.101.67.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70DAD146A71; Thu, 31 Oct 2024 06:30:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730356256; cv=fail; b=aSvCqvup2wAsGX/TomqaO0DuzpDmEvj/Sb8CNto0Y7v4ADls/IYewat89fR05IndedVmWaGnw8TabMoy30mYDhMJ2e8aflKIV4NcJrgy0BOQTKxCtHTs5iMp70EmnWkC6QuhCacXOa1CEQkbVL2oiNoCn+/Qcc8nx58a/Kf8ajE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730356256; c=relaxed/simple; bh=0TL3eszPsXS15LWRzFBdD5LNuJOQOlWN2vuPYINr93E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=L/M/pfF+LXOz72X92iFHE//on9WRl2pRu1vlz/oEefNAWc3o6rPN7twgLhjkRYoiSvePD4HfLTKRlMNkIDW3ULa7GvN1mr3p8Oomppx0tIq85MstRMfP3naYNZrVWWVsA9Yg2E6UAv9rbe/qf6aI7msxgvjkBtFRBucXZc5RVeY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=Fu91qiNO; arc=fail smtp.client-ip=52.101.67.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="Fu91qiNO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ImIlhm4qIOAn8WGb17w1vriO9SMH3e5uURBd/e5U/HctNOrYjIxqPVYxdpZutLViiqw4yGD7sbyo3hAxa7ifZwS46S4ORO6LKzVdpIdHnjo6cvtJkH8CoOZZF8WRnmCXkRhw5nochh2/JkWB16l9k+XAXNzJs5AQsM/ib3XL77C5TByHHAuUEQElehhoLPdpFr1h3/OjcxI0z9cYWrWv8Ttwt8CDE9fC/OSsTVHmiw9oEB7BRUrN1cNc39FKptr1FFo/oMAWbziJQnGqnWAlew8RD6JYN3rWD0OFsM8sqJzHpQLMk+afWCPHoTE4GKX2VyHlc9nx3UqAkqJaFlADNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bqsdfSW+AIXNzHY2JAESylM/5d99FguRZSl9P9cv3OI=; b=SpmOARpyygsF3dNXi9VjWe6KsLod65afEEIlkmFOt94+BL/g8cDjtJ//Wmde8aK/DTPrKgdKVuNMEjToPXHx9Noorvt6YZNlIXLqs4gqeETfKpCmzzpq+D3RgFKcCbjKK4fZQFcnfU7XmMy5l0mgphicgCnmR4h5c18ZMOwKH1XvkMDLC2NW5ijdtMQcdqLCHRyDH80uh7yCFzoalUF056ucc8eYhu0hrSzIdZBFxpDcsOGYrKbxn69WQOIsr5D6Y1TxsnChpnS/SyzQddjt5Y2vv+PSYU2MKeoAZsMN2Za7aY1zRtNPGk/r6plrRPaPwVkWY2NhY9xFqL53WRqiNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bqsdfSW+AIXNzHY2JAESylM/5d99FguRZSl9P9cv3OI=; b=Fu91qiNOdt/1K7PhrybctTAsQIcXg4Ki33YV+vPz0O6n57j62gbaE1krb5R4oJWL4VXfbzoc9XYtwQMRWbElbSKNYCyx70M4xtfZfhGsRErNptk2/8O7kTPSjrda8ko18EGjO/KPu2mbEB+63dVom4yNix4cqj+VSdvmkFPFZLcfVJDsYSPxt9SSGiCzqBvQap7AHam5TWTAT9tA4mGY7w1SUHth9tAaAH/iD1XPEgBALCk7rSVpAnXV8PxyOpoSDJLihnBP8CbEfVA/+Wpg2nfkqneXi5obWaR6Ptk/DDBgEtKLrhESFnzDkCFIUNQp/GjN5dSbLYonCfprwBOUfg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) by PAVPR03MB9797.eurprd03.prod.outlook.com (2603:10a6:102:311::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.18; Thu, 31 Oct 2024 06:30:51 +0000 Received: from DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a]) by DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a%4]) with mapi id 15.20.8093.014; Thu, 31 Oct 2024 06:30:51 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-input@vger.kernel.org, devicetree@vger.kernel.org, Manuel Traut , HeDong Zhao Subject: [PATCH 3/6] Input: matrix_keypad - add function for reading row state Date: Thu, 31 Oct 2024 07:30:01 +0100 Message-Id: <20241031063004.69956-4-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031063004.69956-1-markus.burri@mt.com> References: <20241031063004.69956-1-markus.burri@mt.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: ZR2P278CA0018.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:46::16) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|PAVPR03MB9797:EE_ X-MS-Office365-Filtering-Correlation-Id: f386ac41-3ebd-493e-1dcd-08dcf97590a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?WwxrPTnEwsQ6Obh53jLzReDShkKkjTR3fQeMl8QXb+blEI7pM7jyPKeAaGsg?= =?us-ascii?Q?jbJD1gZEjmJslxdj2taU2n4Fra0jxuqUHK6zwF6MfuINMklEd4I6tYNMvLQo?= =?us-ascii?Q?pHFVYxUaREoDVxip4KrvyjKmZED3Eqym7LvDoXyCAaUi6al8yH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v8JdkRB4s5IxidtjEIe02qME?= =?us-ascii?Q?dBc7dm7l169KvDeiFck3KV68rA+rU3QYm+QdJ4MbxBKSFdWxNfRi0vilA2O3?= =?us-ascii?Q?YlJxEWCDvoKNSnWZHyaiCBszzENA7HaXxuXIRisgNwOm7HuyMOxhKcGbTLn/?= =?us-ascii?Q?MB5b6kUuho2lCEOcXHqwPVAgTdATRRnv/sWNwKo3NuzqOdNWd66n04WD49Xe?= =?us-ascii?Q?eWF2++d90KEEH04WO7S1g6IJM/qbhwZeyDTFLRsi2oSzGlI7f0jS5QoJBL7s?= =?us-ascii?Q?O/tB1kDS+2xuyMU0awXnN/duTvOMv6QjAA4HTLVQvJSj9WHFjZHy/xSOGBK7?= =?us-ascii?Q?G6lGJQE=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB5399.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Cyd96F7epd0FaEK01YFSvtT1tp41krdXQlkPwCE+NuoPhfrQCsgQouWhw1Oc?= =?us-ascii?Q?4T8hXbuBGqee7MKR4HPbchOo1mJVOYZKHUbmTRVZ+c7BRFoAp8uqpZLZnsmj?= =?us-ascii?Q?XdUHNOJOQvC+ZBCqE7RuFhkgWUKzMessIfi2A/rX9bsW1d4zdmqxP/RZsNhT?= =?us-ascii?Q?7NyAvypt+kHIRP/81C2Qcc4AsuVWu1uk3jgB+qqtR3QtuXSz4VE2drVdyxs2?= =?us-ascii?Q?MyMvmQ+WP+OoaTJMcsGh/JCxG5kGzXQF3UPGOa+EaqjEqLu4WqxVmcEjh7Lm?= =?us-ascii?Q?lYNnymmMlgdT5TlSNu1Ws0P0hOrGkPmGSV3HDODxlgiadgxp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snko6BPTna5yhhvReHZuHOeDwG9KJSqq?= =?us-ascii?Q?mFXiV7LLRxDvkSdK9rGInmQvzkFc6bxpBSkNJQLdzOaDUyzLIsKYXJHQ2s5Y?= =?us-ascii?Q?QEDN5D2FPxJx2HDigWQVrHe1Mqm8vNdU9CMLZ9rli5P+3FGmAdZtJDD5QEEX?= =?us-ascii?Q?M3zboSHYdC1sdLr6cS2q6tmkF4uaUnWyDSCmqjm8i/NJSBOdW967wgBmr9Fs?= =?us-ascii?Q?BdpriaYrYsSTUog8ipO0f9rA3+mJDyDmFK4kRA/A0aFFsq1Zz4VouJYXdQtT?= =?us-ascii?Q?Nb+V7h5HMuiEpuFK8zj48ynk3T1F8XY4xz+EZq37bcDZTzC2Y8vRwGoqnfCj?= =?us-ascii?Q?TSmnzfd25f7jcpyokyK6tMMxN8THmFsfcE+2fveE?= X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: f386ac41-3ebd-493e-1dcd-08dcf97590a9 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 06:30:51.4298 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CUEIB/9bkMpGBN9RyrZ/84aDFO+gRJmgtCDAyiQKi78bkeo+E4Ltsk79DIgQXYUe+Ko5VEp+2GYLgNnxmR4buw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR03MB9797 Content-Type: text/plain; charset="utf-8" Move the evaluation of a row state into separate function. It will be also used by a change later in this series. Signed-off-by: Markus Burri Reviewed-by: Manuel Traut Tested-by: HeDong Zhao --- drivers/input/keyboard/matrix_keypad.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboar= d/matrix_keypad.c index e08d7d5..c091f90 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -101,6 +101,16 @@ static void disable_row_irqs(struct matrix_keypad *key= pad) disable_irq_nosync(keypad->row_irqs[i]); } =20 +static uint32_t read_row_state(struct matrix_keypad *keypad) +{ + int row; + u32 row_state =3D 0; + + for (row =3D 0; row < keypad->num_row_gpios; row++) + row_state |=3D row_asserted(keypad, row) ? BIT(row) : 0; + return row_state; +} + /* * This gets the keys from keyboard and reports it to input subsystem */ @@ -123,9 +133,7 @@ static void matrix_keypad_scan(struct work_struct *work) =20 activate_col(keypad, col, true); =20 - for (row =3D 0; row < keypad->num_row_gpios; row++) - new_state[col] |=3D - row_asserted(keypad, row) ? BIT(row) : 0; + new_state[col] =3D read_row_state(keypad); =20 activate_col(keypad, col, false); } --=20 2.39.5 From nobody Mon Dec 2 13:18:47 2024 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013026.outbound.protection.outlook.com [52.101.67.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 961F813DDAE; Thu, 31 Oct 2024 06:31:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.26 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730356264; cv=fail; b=KrbjcFF+6BBsDQbGiAArlpc3YtLCupmul0JOqZiEdhjy6bWK6QWrEwQISASWmJaHDTMU8Lx6rTmtDDsn/qMtirrUIhnHpHzBZULqeGr9EabiR0GLZ5XAYVe7Ua7tiJM7329wMy2WU8L+1LZ8rAtJpHqlQ/G1X0jaQGUo4USrJ0M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730356264; c=relaxed/simple; bh=SLiygjteYy3D9gMTmdomf5GpacK9XT+u+eebMlGsj3A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=i5wJ86RIeGwZv+pjJNw85BSHsyr0+EaJaVpaaR9+faBffeUI18lf/b6pTiYbeaEOjq1XQ8QxlU7qKM7BjLZA4ugMHMFqJJ3a1jX8+658CKQyBeUZDaaaT236KN/oqxIj2hWr5TCEPCJf8pkHFxzWXEJ8HtAB4S2ZPfN10uCuav0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=KcHxJL76; arc=fail smtp.client-ip=52.101.67.26 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="KcHxJL76" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pHOowlrpOtV/eR6QIAlg+hx10hwRnXXia+W9PuCcpIe4q/We9vWRobhiY7eR7DmCTJs11LUwzdtub9XtM00DR3aKJDpEZoutZJBwu55XiqlEctNgFCScez9lyKV+ReelyIhvZrhpjd84f3Xb25I7aWLpBfl2KaW9hk55eztj4fnALeuFjjDT/z+ea7HTbqX8mYKjw8mFEpZwCXxOeIp71PGIo4wsUQdcNGM2ANT1wiLEC8fdG1b6AwcRkjsDJH/mbn2e4PXsgtFP67J1TWFcl7AERgho29k+KUTcyHMYT+QD2iwB628te3Wb8ziN+Yw+ARheYzUW0G6YsenOuJgX9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zgGdKJiKCKSfW2OkGCQhkNI0k9EPY4wttilOMOkC1r0=; b=TOoZDL8TsLdh3fzLXdY/dnbajovAyp7isGRNczea9mDb1ahL6R8ouovS98kTy2MMBAOqrVA8D+9UiYTsflUmieJY+S25ZRg7hYm5pNzSpP2MEPTCPvtzyygtWgqoPdX/xtYHE4TRCN8C6a2rvu7P63Tk+BleH8BEc8gRkMxuRFEdMTdBLVuSvE8sFkIY0xUmu8fuYJTZLQsRImEhwxj+zQZSaKaajuIaW1677grecGN39UhnffMDSQWZULoctTEm52TKoYSyaf5IE815HAMZIlsH5ziUzraoxNSoAKZgYBX1nAhCS0boonU3GxpkBi9BShU+cw7S7HipRjBXUhqvrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zgGdKJiKCKSfW2OkGCQhkNI0k9EPY4wttilOMOkC1r0=; b=KcHxJL76z8QkznfYisCF6JcaV1qY2IQOG53UwUDgF4JsY6KeLyow3a5zW0wthF/8E5h/7NSyWF1VyHA30VQbojmrCZyNOE26sM6g5BqCWKPIzbPgjUrR/JIfszMyRZruGaB8fRlT5o6OFEz4TqHxwTvTidyAHgeGLY3V9y1mjxmYLUnNrNPvJIAqUXaQr6n7HioPa2P9noll3wlbGogoh7a+n4EvxiUOVKCoINrFg6sRY1RSmXOCWqklyOgyi3/RVoz665erpnrKgyfz5Hy5JPAeK0quhhmXLsJC6zkY2JsNsSTBQb5b4yMjwDgQxz6M7JYTRsLuUnHNS7fDUMjwDg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) by PAVPR03MB9797.eurprd03.prod.outlook.com (2603:10a6:102:311::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.18; Thu, 31 Oct 2024 06:30:59 +0000 Received: from DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a]) by DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a%4]) with mapi id 15.20.8093.014; Thu, 31 Oct 2024 06:30:59 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-input@vger.kernel.org, devicetree@vger.kernel.org, Manuel Traut , HeDong Zhao Subject: [PATCH 4/6] dt-bindings: input: matrix_keypad - add settle time after enable all columns Date: Thu, 31 Oct 2024 07:30:02 +0100 Message-Id: <20241031063004.69956-5-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031063004.69956-1-markus.burri@mt.com> References: <20241031063004.69956-1-markus.burri@mt.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: ZR2P278CA0015.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::19) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|PAVPR03MB9797:EE_ X-MS-Office365-Filtering-Correlation-Id: a07a9efb-30bc-4baa-1877-08dcf97595a3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message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OGvT5Mq1NLZY0AmENJQ+nAh+Y7Ve3yj6E41?= =?us-ascii?Q?BT+6tEsRwED5BL/QCqpO1EJ4duCEVa939ep3Qo6Vl+jXZasyENnc21r0nTj8?= =?us-ascii?Q?QZWR501dPP2rndAkEoVS5RvhR/EpaFpoP7L1KZJZXyfziWh4Zn1mSr7ns6i9?= =?us-ascii?Q?+eiQ+aeIyra3mzLNvH3NPiVlQLADA5zgOScCfQFmSXxendY2b+0NXpeIB/78?= =?us-ascii?Q?xDx5rWqbGeR86mj6NXcqg0N4tGVOB9XSxPCrLj3RwPwgPdfRXasyfXrRGahs?= =?us-ascii?Q?M7JAGxUU+TrSS49aSKZJ469kEa1qlL3f55/oq+NK1euTjWlBfmhomom79JcG?= =?us-ascii?Q?QPhV8YDwANgImoiPoEt25fQCXwbNh4gaIIRhIfufnMVwdiSQjkQ5iBdfy/GB?= =?us-ascii?Q?3PpBAlxWvGXImO9KssIfT0LIN0i7dDzMVhkTnH5wEDByARya+tcFHMgaIYfH?= =?us-ascii?Q?LzvYG+3uNr4QOpic9kX8lRx8Eh5kA3+SvRscLG0nMDucHcdNoMp7KxwvcrMg?= =?us-ascii?Q?cSjTJZU=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB5399.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?z+woOE9cnOzgQKdtDaX0c1oj1WU8lydo6yBeEWdFohI+NADTApExhlmw1cCz?= =?us-ascii?Q?qKUHWhA1NaIuUD1VHNknCklSlbS14S6/vAfy9Aviqzw4UoZzWWFJdRGnu9tx?= =?us-ascii?Q?v95ihZHNmcpo9VyBqVX7SFwhoFAIjleQCjksbwPIFfFHEV42dOKXS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1Pyh298OpYWARizHX2+EbJLFG?= =?us-ascii?Q?5F5rwzvbOyIHRqgpoxl8wxjUFWXn/8nLm3gYROU5i2GNg0yHHeqY/dO989QB?= =?us-ascii?Q?Kma1tp5Mj5+2pmgzd1JgjX8aIuHksjwkUzoJdg7RzHNOIyKxqA9uRKUZKaNN?= =?us-ascii?Q?giNw1i6XJB8ucb09aN29nctK9o+CgrMUe5Hj52EX6HURzpwqV0p0T0CqA+XC?= =?us-ascii?Q?C/HTPxmk+ocn24+jH3mrDuDPNKkU/MzHwNdS1WmMuBpAVBSNwM3IJlsXrmXj?= =?us-ascii?Q?Sr1JnW4ZlVWBrZfr3vp5du1s8FI4NpUnpYTOBjOA52t+hIzDons+2DfWnwNo?= =?us-ascii?Q?a76dXbRXhR3kz5oRz/QM4RIlz5bbaQdktBafzvg/v9HRit4p6YFLdJSc1Pz5?= =?us-ascii?Q?BUsDUhi7niDRIt41sE4ieYtHZpYwO1Kjc2KpceW0BO4EY90334I7aISHJfSa?= =?us-ascii?Q?wOIvvZ6P9Dli6bV7+R3c44LaZhuL5ZtrBZShjrmz8avaSbyuQlUXgH8NFyVI?= =?us-ascii?Q?KHnEwwpbM+H0ve2OnSU6fp8M+yVnkhBtwvE9Aknt?= X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: a07a9efb-30bc-4baa-1877-08dcf97595a3 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 06:30:59.7947 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lLFujr8LpeXJE0IAm1tP9jISKjNz6mLOsmgQ0saIdn/lYQTdNbV9JV1x80CSePP0i6pXptp5cUfPE2iXQgm4vw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR03MB9797 Content-Type: text/plain; charset="utf-8" Matrix_keypad with high capacity need a longer settle time after enable all columns. Add optional property to specify the settle time Signed-off-by: Markus Burri Reviewed-by: Manuel Traut Tested-by: HeDong Zhao --- Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt= b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt index 570dc10..cf43fa0 100644 --- a/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt +++ b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt @@ -24,6 +24,8 @@ Optional Properties: - debounce-delay-ms: debounce interval in milliseconds - col-scan-delay-us: delay, measured in microseconds, that is needed before we can scan keypad after activating column gpio +- all-cols-on-delay-us: delay, measured in microseconds, that is needed + after activating all column gpios, default is no delay. - drive-inactive-cols: drive inactive columns during scan, default is to turn inactive columns into inputs. =20 --=20 2.39.5 From nobody Mon Dec 2 13:18:47 2024 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013056.outbound.protection.outlook.com [52.101.67.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1496C146D6E; Thu, 31 Oct 2024 06:31:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730356273; cv=fail; b=cnHkrbaIqOqTAwRmwWvDh/Bvf7i8TAZ5rxOEVwwBu/1lQIcB/ZWgNiZdPm+uosN2576xcrWZ1hL69FbDJXsXEaPB3Qmim1LQ7kH3uLs9mPW+c2Ppt0iHi3WExLFG/cEHH0jpKMi0srvjvADrjddKlP2Y1ARNHagoAA/UOfCfbI8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730356273; c=relaxed/simple; bh=St5a4cm327l1cBWkQVf5p1hsDXxmtaWCJlFZ8JJvnXc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=H36c+njyMeqkP/Aj9MGOHNdBNvQGa8WX6/Tfk5dJUHcKAPz1herfaS6zm0s8FT3mbslHwwyvgrE6NEhmVcxrPSzAZn6ODK+9IDhXDGOSYIOxigogoiMrsCDvBHFfX6VRqZHSE3iU1OSTpFZseJ5H63U/daY45Cesv54KS3cCsXA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=lvr79fEz; arc=fail smtp.client-ip=52.101.67.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="lvr79fEz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cam0XomqzzVAkkWvVW68/t9J9jYsvgzG4EkXJQ92HU2+gKGhSUX86UBN6hdhwQ8eV3tKQZlv690BWtmlodx5bk5PUUO4JPUup5x6WxlwqE3OVejGV7T0huYoBOizP7GLx2jIU9bTC35D57yFsbCB3hIXGAq4vyf5ae0UZ3tBhYCFGX7XcTy5181ghQeB3alGAkr7YGg2cw4JQtFp52SDtxIRRLVn3SDgjY+Ruvf/rLG5PHZ1KXNfdSwvu6cEfxvpnAlEWKhfWAoudTqePwToaQJSJii8ndMQEM5yHm3Un4yy3BTO9Q1XUCL6tL8GZUZGtEyZFw0iDR0tWTEMBnyLGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EaW40cTlogoneT8tAEqcXOHyjc/wCnOytjchG3JYfM4=; b=pUtHdqL2y59h0NRAbHz8uaR7rh0L1R/m6XmpsL2clMX4d2NiW7rZrTb6acBPiYKbfB6eFidQOirDMVI6jbZO5t5ZFO0F3L4Sneb95H3rg1XkW3Aa0cfxs1F74uC+txFnRF2UvycAhTusjJGsGG/rXXWl/eDFjg0QWI2rC+7b8UQkU6avAQ2P6R6A3rVvpD8lGU5TY9yDhldxcWV/SSoSwmu6OJo9gCHv20/B057nEH5nWBCI5bQOS932uiWfCX2vcSjdlnJN4gcVXltcP945g+ZKIOqqZ52RUyp5YDlwXU67AxoDofTUD7QtTyYOrl99ZGDjW7+/oEqY6N0JFk4UEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EaW40cTlogoneT8tAEqcXOHyjc/wCnOytjchG3JYfM4=; b=lvr79fEzlgaoUlR8EcCunXXS3bUxFFiWaZ7GGQGzSHrMFY3XSoCpJg5cMljHSHuGwNEcGtINdgpedFYAVCjYv05OQopx3yiyYtju91pEcJVjxPmGlFZRrIIgRsjy2cxEdNtL2SKhiN2GMKDwliFNfL1Q9tX1jSLieu8xwoNLcOSyS7hxkZm+/lYmFIVBVm3dTuvxvJkZ8Y+teEZlGDp8xdB5B4LLdSXZIvg4HOMyhRPPvVL+I/hRVDp7BaNlz57PwZ+4CQ54pWT3T1n+jVjs4YtuLyglu+cJpG2o2z9PCEmUFGWM8UmqIj5xnTvjTHsOkXjpugpUTZNAOwRH2CsmqQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) by PAVPR03MB9797.eurprd03.prod.outlook.com (2603:10a6:102:311::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.18; Thu, 31 Oct 2024 06:31:08 +0000 Received: from DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a]) by DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a%4]) with mapi id 15.20.8093.014; Thu, 31 Oct 2024 06:31:08 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-input@vger.kernel.org, devicetree@vger.kernel.org, Manuel Traut , HeDong Zhao Subject: [PATCH 5/6] Input: matrix_keypad - add settle time after enable all columns Date: Thu, 31 Oct 2024 07:30:03 +0100 Message-Id: <20241031063004.69956-6-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031063004.69956-1-markus.burri@mt.com> References: <20241031063004.69956-1-markus.burri@mt.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: ZR2P278CA0006.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::12) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|PAVPR03MB9797:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a213cdf-fbfc-4b5c-830d-08dcf9759abf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?rYE/yV9vZnxAATaUnaxZ88M4c1/XQJgEYTy0hgZJKzXuuMXPT1FfGgDaHerW?= =?us-ascii?Q?ydW8e5NbJzQvxoQ5n+yVfhSRWVj7+ki71zGLMIQEDeDqv4vVIoJd+4mPk/Ii?= =?us-ascii?Q?twoYHbjCeG7wHHU2jbhCOxjmWfsddYV/cdrwkLeqYiWStWljKZNsyfdcXP3x?= =?us-ascii?Q?b5bsHuU1s7iO5REZRdXRZgHddNT20X5PWAwy2iouoz0z6KBDV6tmOicAnvUb?= =?us-ascii?Q?efaHSGWOMUNutJBUptHetMjPQ7n9wnnaLF3TJb35e2VpFF9xHGYJzHzPTZRA?= =?us-ascii?Q?nVO4qeVYArKHwEARcQ08uAreupwUXK1GIXZdRB/kKhfMR/rwVsXbIEXaEnLj?= =?us-ascii?Q?epFeLg/RUwQ0HhvoljdXPwTW9o0+Og45gcyXxWtqR7+uCbRG1V3BjpmLf1U2?= =?us-ascii?Q?Qe+72Iejqcqxqn4tpVgkgUNGhPCLLGCosIPcNW/zN6BKsUjtJlPxRUFbyKjd?= =?us-ascii?Q?ts8F8gIQ9GbydB0OaBVylbGFr0QXY+Pnjiv+IB4CZ1T2ohNnZcFDfZBPV0aK?= =?us-ascii?Q?IBlBIyRoTgzH2CnyBvsg+xCOx837SFZfGTKN75tE5p2L0V0pMjkgBERUgFED?= =?us-ascii?Q?0dAgMu9jYstuvM6bRQCCqii1wVm2eYyIzUpwaNPJpvfZrszN512yXa7VaRgJ?= =?us-ascii?Q?H00YhFjouByQD1Nx7bHECboNiRgBn5iGWOJ32QwoncKiaQZCUMCMbrVIjGyz?= =?us-ascii?Q?mIcWqEabcRq1bs3lMYEpRmsLddkMfY2CUzBZ9wIxF4PElOAtxfOATsiCs5xP?= =?us-ascii?Q?YGB7uILWqsnXIFvqaEAvRT+4S8Hao9TQCgTTHP8FonY6MSd0UfJ3calUtlBk?= =?us-ascii?Q?8iJsTNjT6cgtFrlrIx7f2BJgqkmYZwWNRoIJvdzPhEFK2XWv/9axK4XcLWWH?= =?us-ascii?Q?4XmSJe5qO1tHJArnYIkhduFt+odTyzBjV79C8krtSDh0TOVWiEo0pJpm7F5X?= =?us-ascii?Q?M50fA2UfcftKAlqD0iBQvI3cLlCgrJs5XPmGI1q6ncFrEJYfeav4ziWcP0jC?= =?us-ascii?Q?Yud2gMMloa7KInwLahg2h90HP+xdQXlksPIJA/SMxQIzflMOQdRAQDWrA9xs?= =?us-ascii?Q?YMeIXgxKqQ7nzOoFTzxab/gI4MlAh3H9KBgeloszERCjHCu3CheziNjv7adr?= =?us-ascii?Q?DEcY2rxOm5nN+8cKu7lVv5Fz0jtgWkEMVfjPHo+KxH+RzAyMQkv5jUwjE2Il?= =?us-ascii?Q?/iyy+WeDIvjyRPTbR2USgei8pyLISTs89cLM3GzDKnZnHrPEkxuZG30UrysA?= =?us-ascii?Q?88nPgfDM9pJUyAXx9+9f1h2/qfJM2YcxRockSursiDL9rkh8HlJ2dsO/5qNA?= =?us-ascii?Q?6FSGCtKBcs22MzWGfwscgG0JLxb1aNktI8jekOLeyvLnWAFWOSwv27N9jmLa?= =?us-ascii?Q?F+DDNkk=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB5399.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?dcSnUtxKC5OacpPfDc3CA1Lo4lgtHZEnKvLXmX4qfquyf31caOWqtk6qW18e?= =?us-ascii?Q?nuDb/BJP7kEQea7AVPg66UConEsHalQeHLV4iKBHnZxZLR50krbLCHknxTOV?= =?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UAk6hAEURII?= =?us-ascii?Q?HrYvBDzqw4cXuezWQuf2QvFp4XSgHjVkXhIsjU1ipFCnlfGGGsXdnpEvcV32?= =?us-ascii?Q?o8bsqN5iMyDKuiFbPrBrsOzmTA8kgG7gBIXzEysD0Rbk7QgCP9z4fKDUmrNH?= =?us-ascii?Q?TkftrpfMW+nBLqnyr9HbvXR/wP3XcbKB7AhIJWH0ruM3jJ6RZ7hO0laTysPc?= =?us-ascii?Q?erXoXtiVnlhxLMBo4X6lQ4rRuj2Grkeag6yA2oeTK0u82TipyB+Ofn05gek5?= =?us-ascii?Q?/LCQcTlptRwaawENF+kWPb+K+SOhZpCeiVx14MYja3OIipPqNB/WsBQ9cPwn?= =?us-ascii?Q?8mhkCr2kWn9j0oumW2DcGqripB0buqlc92Jx8vTOWFgBrC1vH05J6o+83icb?= =?us-ascii?Q?clTmeU+DVr6pasW5JSdTC6PPICV7QGGv/yZu74njGgW0WgCQ+QIdxchtQrHE?= =?us-ascii?Q?6suTdlJw9vD2tESedutPj66eSzHQa00xZJ6nYPhnyAdh4Oih4M/81Is9npUE?= =?us-ascii?Q?3uAsghIew/bz2KRfSiIyzM0x4/idwtw3pFI85QQMg6tB63n5E2iuV2iS2kiT?= =?us-ascii?Q?c32rA0SDaFMscNTRYR5uWYxrVtnMqMNRNq62hCZq?= X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a213cdf-fbfc-4b5c-830d-08dcf9759abf X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 06:31:08.3517 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aklhE9Tk0sm42J+g9wIl+loFX1Ot+udDyesceSWfxQ+cj2Gf9ig6LULd5z65CjU42Ob31dXvySB4+QaVP+m6mw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR03MB9797 Content-Type: text/plain; charset="utf-8" Matrix_keypad with high capacity need a longer settle time after enable all columns and re-enabling interrupts. This to give time stable the system and not generate interrupts. Add a new optional device-tree property to configure the time before enabling interrupts after disable all columns. The default is no delay. Signed-off-by: Markus Burri Reviewed-by: Manuel Traut Tested-by: HeDong Zhao --- drivers/input/keyboard/matrix_keypad.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboar= d/matrix_keypad.c index c091f90..f0d3004 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -27,6 +27,7 @@ struct matrix_keypad { unsigned int row_shift; =20 unsigned int col_scan_delay_us; + unsigned int all_cols_on_delay_us; /* key debounce interval in milli-second */ unsigned int debounce_ms; bool drive_inactive_cols; @@ -78,6 +79,9 @@ static void activate_all_cols(struct matrix_keypad *keypa= d, bool on) =20 for (col =3D 0; col < keypad->num_col_gpios; col++) __activate_col(keypad, col, on); + + if (on && keypad->all_cols_on_delay_us) + fsleep(keypad->all_cols_on_delay_us); } =20 static bool row_asserted(struct matrix_keypad *keypad, int row) @@ -402,6 +406,8 @@ static int matrix_keypad_probe(struct platform_device *= pdev) &keypad->debounce_ms); device_property_read_u32(&pdev->dev, "col-scan-delay-us", &keypad->col_scan_delay_us); + device_property_read_u32(&pdev->dev, "all-cols-on-delay-us", + &keypad->all_cols_on_delay_us); =20 err =3D matrix_keypad_init_gpio(pdev, keypad); if (err) --=20 2.39.5 From nobody Mon Dec 2 13:18:47 2024 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010070.outbound.protection.outlook.com [52.101.69.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 617FA146D59; Thu, 31 Oct 2024 06:31:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730356283; cv=fail; b=l0AlJGKD2DHKQjcvt1+CY1/jvkw19MqPKVONSLChRrLpBaHrf7AA+4cyM5bu2COeIN7iJHWQcUkZJyBbo/BB4eeMPyl8mYfB3WfDxLemYgAnB31NsoLWr5MqQEAfv8SLuH2lHeXlPHd0XSUz1NkgR2DiNwmWAGxlVL4edmz0zsQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730356283; c=relaxed/simple; bh=4fbsm3p05dHdFKozzpdHPtHRQIg2i58rUrg4QP6dj8k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=rtzZMQmvfhgNOkoJzgH85uHsd7i6gEfonm1k1Gpv3VlSZthufTFcpazz6Z1qNoYhIiy828lImr+B3JHJEfW0lPLs6W5/N/hG/GQge6K6/8m1D3U6C++mliyGerBDQP4p90evbvHT5TzK8b7Mncb8vRtuCGiI7W7oYE0p1kSFthQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=Yg9p1bS8; arc=fail smtp.client-ip=52.101.69.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="Yg9p1bS8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XwCn2XIdS3urRfqkooQ62VB3vKF17LZTTL72h4X8DnFfDEstQv56l1c40C3fWmbSet7XFUG/+hfwcys2/Ac4V3ykMt3jP8DBmTzZKSG3l1/9mCIlqARCIwYJkXGHsyfsDeabHn7keIsS9HiZEDt+RY0LFr6wwUcEGMXPXV45CNlrB3O1yS0OuyR38UrdTrySPFK7DlBEM0cJqEIwl7/rgqPz1vgd1iB1z2F11w16BSX+pZRa78ckhLtbHtyAsAnPqCdw3ogDy/xt5Z4DEYlCc2+zVpyZlaeeYJwIY1Va4E4aLEmNFEdnrAvQzvcFW/Ex3fbsfaloLLYMdaWcJbrs2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=40sO2nvbbkMxOTpX0qWijE4NSJtlb6hxD2NqP2tGPiM=; b=YuIPRTe6nxE+APOAl03XvkGAcc89Ap8lBAnCdH53MZH70CcfzhU+LV56Hg6XvJhTsREyAXwsyYpRhZhGKWDJvnI7TiQF1rw7YJpkzgh5CZJkOXaGwnbzZKD3g3d8EvAV8jTWnn9/IDTzFf2Ewc1ibhuoKAaZwKeKISrULLilM6LArEuKJZ8Lc4FV0KSqnH/q1SUhI5hRxilHCZH9xoqwZ+aqLUal0EI3QHaRtwJbZ7hK2wsNMvF9aXLYXD+uC7eZB0sK2dBn/BGuVCVNU7+kCoHwRNKWGuGbDmaEJyzBZOaBLKeOdxSG1qRq7Cl8uGUQmU4MAp8pX4un10sMliAigA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=40sO2nvbbkMxOTpX0qWijE4NSJtlb6hxD2NqP2tGPiM=; b=Yg9p1bS8FTdC4x8B2DBYJEOihd2r+LsH0Zi4z93Mk6BQMIF9BENMGzvHWZ4Uk08z3vMN2kapcAqcby1DbONRD95u+qOpWWgtmQm3iqYBrnezynXzknLQTSmpEkUhKsTdF5uvuHHJwCuHMaRUcdie7oU+4x6hCZzTL5T8JgextgS1p9vJsG8me50i7Rtm6/DeV7UZtLu3ub5VCSr+UKjw1jAonOnJbTny0ZlKXrLnYDR5g50sMPr1cqi0ZDMsZGkXWR177QzWyar7zfeOSxnzyjCAQcZxy//mdTY6NGNhku0QRjsFb2dyf5d41GXBedIEiZDCTniZNUBmFKhfrRp6dQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) by PAVPR03MB9797.eurprd03.prod.outlook.com (2603:10a6:102:311::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.18; Thu, 31 Oct 2024 06:31:17 +0000 Received: from DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a]) by DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a%4]) with mapi id 15.20.8093.014; Thu, 31 Oct 2024 06:31:17 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-input@vger.kernel.org, devicetree@vger.kernel.org, Manuel Traut , HeDong Zhao Subject: [PATCH 6/6] Input: matrix_keypad - detect change during scan Date: Thu, 31 Oct 2024 07:30:04 +0100 Message-Id: <20241031063004.69956-7-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031063004.69956-1-markus.burri@mt.com> References: <20241031063004.69956-1-markus.burri@mt.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: ZR0P278CA0011.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:16::21) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|PAVPR03MB9797:EE_ X-MS-Office365-Filtering-Correlation-Id: ffed2d29-159a-434f-ed07-08dcf975a04a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?BEmwpQsYnJBlDXPwkxuz1LiNJ1qDCQJB05xG4KAVoJ+s0qxNu9m7rVG9FJNQ?= =?us-ascii?Q?rBTZdeCieD0AQh8XMQX6PfPxcvwzct8HZvNSlFO3GtKS9oIf7sINo3eGeASB?= =?us-ascii?Q?lFtlLaJumNiRYvON+Ipy0axxoH08v8F0WcZIeLkLlkiPPvm8iFdQBPC65f7y?= =?us-ascii?Q?0fGvwPI5oZH9pku/VZi2DinUBzz56TuhtvyM/cRgAmHG23UEb8chKwp6UlsB?= =?us-ascii?Q?f3tiutVdZ5fz9uL+fyMmpmfHDKj1C86k9fbqKQYSqBgpNDWt9wGBUmC6LAfL?= =?us-ascii?Q?QtRCUHzK3C2t0ahX0Z+esaEOhio8S1RXQx46IRX1k1C4B9bTzvnfQ7/x6pJi?= =?us-ascii?Q?kFfshuM0D1KqNMYbVjCn6cIkEIPIVFIZXeFCZA0tjFmlAsbWVBGKjEqiq/wa?= =?us-ascii?Q?G/Mw/McfZJmYP6UtCIad+muiCnzX5W7P1LKMfDz3Z/rQ8VEL8XomZEs92Whv?= =?us-ascii?Q?4hQS2AHwkT7OdhiSkqtAgI5HQ2+2pAfYi7rGlcqhTxCzoNtelToRhEyd05vO?= =?us-ascii?Q?KbB+FOodBhP8LKpbVmAWuRanQ35xKedErSFay2fqodM3cnYSw3XEdmxNCUm9?= =?us-ascii?Q?vMr1oIpRyQlI8FbzP5LMYtpHGExAH3yM+1isYnL9IK0KcxuqQpOZ/Ahs9aoZ?= =?us-ascii?Q?3JydjOiZULLW2QUhmiXtQyeb1YNbCIKKvl4c9E2bSTKd33EE5J/NcuV4O974?= =?us-ascii?Q?2+DoW2cHBBlV0YNCbn7QoqAooXwn/lMB3VjGs56RLDAcyaDB0cVmdBYlRfO3?= =?us-ascii?Q?XhivwnaO+kJvdO5S7haca3yYmZ/V5WTdCYbPGMHJ476F5mskz4Fz4gxMJXrd?= =?us-ascii?Q?rAMvySLeqda7dqcUK4hQ5UbOlIg0eelL7HVosoUTZfEP3Z6IUa0wS0xJo9VE?= =?us-ascii?Q?LXHCGg/ePuhr1/3fEhDRKBHmGzKBh7t5qqmMPz+D+cLLhRvSRgfbbz4ymaxv?= =?us-ascii?Q?pcxdGLKOAxefBSRGocjQSjV1DTxGfZnhH0HKomfVj0P6ClL3atZ2NLUIw0mI?= =?us-ascii?Q?oeA9CAP9PX20KyJDyApj2425vqncV+EN/qFjrh5OlRRJf1WPpU4wCeTqQVxP?= =?us-ascii?Q?Fy7dToG7/cf9M/k70bWcx0/GHymGR88ko2RK70bRu6dbRRhMGNZIG2CTy+ol?= =?us-ascii?Q?HklXIYIfKImE0Qf6j56tTU/gx1GOJIej2C03zOnbPBq7xEx+MObgkoRaRpV0?= =?us-ascii?Q?2V7YkVv57huI/TtYhMXSkSzhhaVbXeUh6geAK3EkfmAY6DK14ctdCNjDV1AI?= =?us-ascii?Q?AKqeHy8uEDzr+MRZYsprNlTRO1je+Gef2jYQYKMu0qRZE7fwYHQ3/4kAiRTL?= =?us-ascii?Q?hA1AHjcpx9pgdgebe6hQOqOg8taEWNOs2aabu77QtV6WxULO1bjfs8H70ZEH?= =?us-ascii?Q?YKDgQVU=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB5399.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?IWV0J3/OGe2e0/RhHd1zfR1960n9RuINc5BlPfdmtGY4lO5HlvbRjCmWXK2X?= =?us-ascii?Q?sCmgSPWnnSQj8aCkUvcrKLPLMYz9H6oOfYg6ywj7IMXzbAZq/y7PzGSIaZoA?= =?us-ascii?Q?VA/8WTqnSFhiLn/NkLOKa8nz2Sz6BlDLDQiAsTNR0EehcT77vr82J70FbPIv?= =?us-ascii?Q?eJvTdn8JkUQVA51Wl7+If4iInJpkVtvDZ36o4I5RRIwa8NP5oDKHtIjMl8r+?= =?us-ascii?Q?+YLKE8oaf67qjK+w0odTQ3Z0WX5xPPnsxa7HYeH8SdnUhn2YgkxU30+fCtpI?= =?us-ascii?Q?VvGM/DqKq4WwQ2ayBaeWhwrhjkJi4wyZbt8xMSz0G/9kQnhpC6MVWsLzNKr1?= =?us-ascii?Q?4C4/zdkJH5tIvp6u/g2OnCk8jLPoMfXNA8vtbHx4RI3KZNaMFK1tdZA1gp1g?= =?us-ascii?Q?iUn2ih3k7C6PvPS1lll9vPbDWT3ViQWXR7z/E7/jS6Y2y/62sL6q/glSBxJ4?= =?us-ascii?Q?N/PvT2jaylsbCyVoynm+hjhuTk6zxQyRT7FM0ApBL2TPJ3qxEn27QFF5/3/j?= =?us-ascii?Q?vvU2cT21MbWIJr97hBn9Nd19ojNkILKmxv/ovJiBxTpC2UQWcO98ohAaRRCy?= =?us-ascii?Q?HJMM+YMH0XdFg3y55sgTKTxdwDd0wy1SPElafK8na4tTKYk8oApkr2Ec7Z7k?= =?us-ascii?Q?CUk6ty4djG/7X4fd2V0TC1lrhOCnbHL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Q?daGSfNfYOisVwbKpghP2VQwjkhI2KS0cmvc/QZ98?= X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: ffed2d29-159a-434f-ed07-08dcf975a04a X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 06:31:17.6769 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OS73Qkl9RhAIZBMiQ9AhEggTGJf6JNsD2qqQ80ABVFPXW/K8KoI2ydypOa1B3iI2v8l1gbYC+2WwOjRKDULKCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR03MB9797 Content-Type: text/plain; charset="utf-8" For a setup where the matrix keypad is connected over a slow interface (e.g. a gpio-expansion over i2c), the scan can take a longer time to read. Interrupts need to be disabled during scan. And therefore changes in this period are not detected. To improve this situation, scan the matrix again if the row state changed during interrupts disabled. Signed-off-by: Markus Burri Reviewed-by: Manuel Traut Tested-by: HeDong Zhao --- drivers/input/keyboard/matrix_keypad.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboar= d/matrix_keypad.c index f0d3004..428b36e 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -126,6 +126,10 @@ static void matrix_keypad_scan(struct work_struct *wor= k) const unsigned short *keycodes =3D input_dev->keycode; uint32_t new_state[MATRIX_MAX_COLS]; int row, col, code; + u32 init_row_state, new_row_state; + + /* read initial row state to detect changes between scan */ + init_row_state =3D read_row_state(keypad); =20 /* de-activate all columns for scanning */ activate_all_cols(keypad, false); @@ -171,6 +175,19 @@ static void matrix_keypad_scan(struct work_struct *wor= k) keypad->scan_pending =3D false; enable_row_irqs(keypad); spin_unlock_irq(&keypad->lock); + + /* read new row state and detect if value has changed */ + new_row_state =3D read_row_state(keypad); + if (init_row_state !=3D new_row_state) { + spin_lock_irq(&keypad->lock); + if (likely(!keypad->scan_pending && !keypad->stopped)) { + disable_row_irqs(keypad); + keypad->scan_pending =3D true; + schedule_delayed_work(&keypad->work, + msecs_to_jiffies(keypad->debounce_ms)); + } + spin_unlock_irq(&keypad->lock); + } } =20 static irqreturn_t matrix_keypad_interrupt(int irq, void *id) --=20 2.39.5