From patchwork Tue Jan 7 13:56:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Burri X-Patchwork-Id: 13928961 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2084.outbound.protection.outlook.com [40.107.22.84]) (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 6D7451EF0AF; Tue, 7 Jan 2025 14:02:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258589; cv=fail; b=jJ4qM1ISdiKvs4mjT862PSVL9YqEYZOkMOB7gqKk0J+/HU2zvWb5odzeToTfk3cj45w455zOnDycE+BzbYlL//vJjtmCIgyOaf9DpFsd1t3sv9AoX+fu7iNPC8sdaQjF2MLf+O/YsyY3nR62WLZxGaK15gPpE/QYMD7+x22Gw6k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258589; c=relaxed/simple; bh=1XTyf7P5Oq8kqojjd6xrJvnnSNp+qcboT0eNC5AyLIY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=l7W1PsVXPhCSPCUyFg0xCv/LiF3mbYGI7cMcxRBo+y1wqQrFDJ4np9fnTuU2wXsdenXqb0Z7loVAAq2mKB7c7EEuPE/e57Gvm2pmZGumDNCQrNZQUFmhLqQ5RLCtFWlI9mZehXlRv7fAPPxGV5Vs/4fzaaArF2FR5Ri45jQErhA= 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=cz8rEMJg; arc=fail smtp.client-ip=40.107.22.84 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="cz8rEMJg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WO6mG/klPrt1KwwRehlZ2lzLVpsT7vIGKLnklyH5sufUVlSt+oEJVtkrVfDIAbQTeQITE4wbvUQ6PoMUSe6SPCFVI9H30s7NVKRe1hA5A1p3CpvTWWM5CsJ5mAKZ0YjlTL29c67H45h2+Evy3Jxv+U8K9aigR+fm5HcfqxvQG7hS7HXcPyFPLdHDw7dx5tsLiQixdKCjnS3aql0519OTzK3w3/wVDIZHn66Ek6WdOh1RyX9GMLw63BB5NoS6P4cKJPlYcPKZEIAmzrcfrnecXqozHw4E5OTzmcDk1hnP5qutZxPveijvfFFJkRBuPRMx+ch9YORzYI3RtSgo8t2hSg== 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=Kr1stF5XRfTsaYvohzOZiPIp8IX3Y3c3wUsDSMsTnQg=; b=F7fvQ0x6roNy+vUnZF5NDPgY5rBr0Kxl7M6lp9CWyzXWGn6m86qMt7iMt5tQlH94N4Lf/T/pgJw+AJM/hIiop08dYxbirDHGwdJAi8z1PzIhepLZLeyMFgvhpwo1Wi7OE8XToUQXl5Kh+F+ZzqdxKdTH5KeMg65SlGoH3xxXReWkfj55Y/+qm3lOqjUXZnHEYWTMELDnAW5iLp11hTipwMZnOnNckMw3yV0cdIqCk5iDWXZuWyuDYpsJk+cJrXxJkr6tMzpqhMfIapZ8w13lOMDAWm353tGaOAHlAo65rexxoiV4oMpXD+i/ogYLlGXYvRx03EoSYciFiq979hGdQQ== 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=Kr1stF5XRfTsaYvohzOZiPIp8IX3Y3c3wUsDSMsTnQg=; b=cz8rEMJgBPXKco5OLhguzdpwYUEeLkLIDwEg9R2//hxlgvYAGXiRRyn7QaejQ0jdOIeccDA0ZaOfXs9kWKZPMhTyyd3hCZniRbgfqUywAhQs3+dykGzW68oy8ok/Pzd1VlZpfE3TVRSCFb/VeRDVtldZxNxejH+CDJrltHEX7D7nmVi3dIqAR8bgmzRozynoaogxi4wzFIu/k3YYWyB6bfMbgxGB4xXWnnjbkkeMzgYuG9LwIkZnRkA8vwt/neDuBvcAUAfLqTZaUTi6fmCkpJxkhZBeb7yHuhXCiXO+8F4AXHursOqgZ1J6GO3otevKbdM1SacO5xmtnz1BL1jWDw== 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 VI1PR03MB6544.eurprd03.prod.outlook.com (2603:10a6:800:19c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.16; Tue, 7 Jan 2025 14:02:39 +0000 Received: from DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a]) by DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a%3]) with mapi id 15.20.8314.018; Tue, 7 Jan 2025 14:02:38 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Vasut , linux-input@vger.kernel.org, devicetree@vger.kernel.org, Manuel Traut Subject: [PATCH v3 1/7] Input: matrix_keypad - use fsleep for variable delay duration Date: Tue, 7 Jan 2025 14:56:53 +0100 Message-Id: <20250107135659.185293-2-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107135659.185293-1-markus.burri@mt.com> References: <20250107135659.185293-1-markus.burri@mt.com> X-ClientProxiedBy: ZR0P278CA0170.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:45::12) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|VI1PR03MB6544:EE_ X-MS-Office365-Filtering-Correlation-Id: a34198af-c1f5-4fd0-dad9-08dd2f23f1ca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: lOfRmZ0J7waCl0RSHFIsjlT+CKSnPZYP46VlVPtsxNTxqmyU9URk3j0eHX2GFPszteY8zx9W+qFRtQIaXLQBnoCahuOuho4vH9v2bVg0I1tsdYYzJoDE9P8CQJC84NKcZ6WNc20yftF1GGBZ0BwROtH26O4thTqYwpJxYq15jNMWzsSLSgq6jNnT7HyysoyemV679Sw6nfmqJwD6eT5Oqb16GslGmtIuRJ+OLuEHcSxoLNwyZTUAO2MUFktICAC+8aaanXaZYncAY1Sv9x9y7FdBEhU9qKRTMnJIJ5WeqAehpsG9smeEUWpj+D4mGYtu9p31L13pWCRNFqYPuGNFCLbfPqxHZTt22SE6R9BdzJT8ymUpU3n9ItXPYpH8hcYksQOht4rliAAeyMVZNzhtnQkLDmSxhDPudoSF20uompx30w06J4T6Fze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IPV:NLI;SFV:NSPM;H:DBBPR03MB5399.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uNA9b6XULrk8fiRYPvknSHiNegVlBHW6MjV3BqjQ/3XNyTxTtJoekaEF/laYTNqGRbEpLKMaLu9T985n9bovJv1YNg0/sUaa1+DHtevDw3+3OrroC1d1uzaCsve1UkMbZEP3y6ZliKA3oNZy0dZxVQoUHZOGo91+SpO77SwLGrq4rhaSQB99J5HznJsAF0UjKwzha6PFqz6WebSzIgaBurdwmdUj2+fGbkX0+pziuNbPqqTlKFNXR3IgO2fQ8fulIXq2EICt/o95kgGmkZbKhcHaSqC4f68+EHxtw+cOpzs8V6453JF1bVb7psilg5+5nRBnyXBWOc7nX0ImfH+ICLv5z7pVQtoP03evrsKGMyYzatlXWl0P/MZ6oy2CGoY3gMxc/HiBcqO3uBj4P+b/6guQXSH2762i5H5QumMtn7GTZzJ8SWZMGHIICSl+W4BUW2dZ7PAtkqMQ3HlXv9GW90Z8BReLSrvG4egSKWVq+LN9BnQt3B63bVO7QHrQXlqjQHTo3ZDbiCu+G5pRXS8v/T+upynPBogubcB7o1DrbVUzSrsaai7gpzfsJBnQ/lw9fXEFgVUwWCUyL1HsrvjNw43JjuzDyot8kqwAKM7CbVWscDDSFNSmz7uNHT0s58xhIINpIXuVA9ed0i4CbYutZTO8wGU3gtvvSsqaSS35ABmhrIbfgK9c3WYNEgg64YoMiKZ74xNDm/3p+dnpJXCDA63OnAocyTgBITaD5QAqJhahHi2vFya/8kGC/vfERcEo38NPr9c3lQBrRVpQG8n1lU/kEzoT3+J9wPBCE/lXsl0+EiooN1T7sHqJJHkyyIT4jfwJwCTZh0u44g02eMqQ+3oadDvo379wVwnh2cv9AcaDFNknBF9TwpCb54QutGq5ICN/1Ry5VutvjOQoJbMA6kwt3Xv94VT2+qtR1t/jl3QL6gCySvGEVUGDIq9d+XZV98/5MDL7BMt+ea5E4Nwxb+8bKxTZRI8Chz4qZ/utXKpA5bFXpa0uFsJDPQyG+IKbqKwG3LjOqY4sxGG0GXltoSx0UNLMO5vDkiCU1EDjcYPr3D0J1xcWrQsjXFL7KPzYRWqXzyNzbeY1jC3UAEW5m3NCf6gGKtKfY7fSBc8eZSBFAAGuIGGe9ZnxtZ25wH0xfY5f+iXHtpeZs0H8A2q3iCnGmEGT9xW7+5RngYPjzOp0SH/Oj9Yb34DOJMV2p2uEuzlmrP9Y6fcFwVKU0s1rg8/y27KWqqAAT2yzbD7/UdM0zCE0fumGprrABi2hLjwy8mjhYPwBiemYlLKHFJ8dDptenJzNqGZoLBEXLPFIFOdrsZxOV5U9wAsVikdvob8tw/5uMen8KdqtA8DM2/CHDai38CpmzTW/WyUZaT/7zEjNZBR5DCiO1etqvSmu6jgcNygsYjFRaTQOsnnaT8aD0cuOQmFLn8V495WAp+8gASl/DamlRBks0fR6MgBjZeN0VojtP6og1/1e3WRtcZ/wnqDrIdriLFA5G+jpOvcij2rI1RcY9AAmwWkQavf6+p8ttHrffP4rcujPiVyZpArx9bbCZvavn51PjukuREMc0cdg2Ef5UDFgaoxCJ0o/Lbg8 X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: a34198af-c1f5-4fd0-dad9-08dd2f23f1ca X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 14:02:38.5415 (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: baUV8zyb/5jv6t5A0ZcZNqKPRoKEOUViOJxcw455LaN41Wo8hsNsMXpa63RQk+NZFmZ5YESusg3BIiEwyhob5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6544 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 --- 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/keyboard/matrix_keypad.c index 2a3b3bf..5571d2e 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -68,7 +68,7 @@ static void activate_col(struct matrix_keypad *keypad, int col, bool on) __activate_col(keypad, col, on); if (on && keypad->col_scan_delay_us) - udelay(keypad->col_scan_delay_us); + fsleep(keypad->col_scan_delay_us); } static void activate_all_cols(struct matrix_keypad *keypad, bool on) From patchwork Tue Jan 7 13:56:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Burri X-Patchwork-Id: 13928962 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2084.outbound.protection.outlook.com [40.107.22.84]) (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 1BA321F8F15; Tue, 7 Jan 2025 14:03:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258609; cv=fail; b=mFidtq5DxoInOVCIa9xQLlKciOiQ+aYjY1nRrTjR91AJF2JOeYG0/xAFnm7usCMzIzxpjOjKPiaR+q4u7+C3BckXRQ2fX/rf49sIC54goEsFN69NWRCdQKqVfOsnamyAYdiIODfdhbGxx2Dg8plqkbvk/fIR22YrX8wFAPVhBOU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258609; c=relaxed/simple; bh=Xfzox5PcAJY0Vf93eXYbjU2/B3WWS3ocjTDoCwCZ4yo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Mqwj6r7KDMkWqmMfeUIgJup/PhomyjEumywqkg9sZDGj23pqTDj8cSyYdtf+0H2K9GY1w7kZHNsBeW/qIgYyuamb8yEV1+J1KDFSLpjkitvMwwzQl1qGNF3xd/jgwp/oQ5PV2wV3SCsZNxjdRFWauO5i/LBurvseEhL+uElZe7M= 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=DfD95fVF; arc=fail smtp.client-ip=40.107.22.84 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="DfD95fVF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KCKc3CkqNNv2P7jHcN08MrY1AJIvBZPadGX/07g4kITsCDABjxVevYtQT1+bNlTUvrPEIATyIR9Kp0qrRcOMJziNbHATxSEK5+Q530n2JI+emD8yXPtn9SZrZh4Mp23hN2nGrASyTnjnSYA49gIyp7XxwJD+f6L6GR6BV4ZS7w26pPf74KUIR/7zQ81KCx+6TEsN7ZW1o1g/v/uwonUo6+cWt82aEsxb2gEyL/dM3HixA5UbwJje6qfBcGZRi4kQ1NF+MslkUTc2672YqsB9/YL+zikhGqtbLI+8xWysOZOjtoVs/j2HO3JKUHqc5ZQbK1zLFQSPdyq6y5WqxgdvlQ== 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=YZI3BvU8z1GIGEddIcbgkXGABPLGMCgmwctzoeViF9I=; b=iERUV2iv9B8k45Cy2NWZlRydJEaKcdLlFr1wE1qvBZRofAScER4QMtQPzbjp5bgCflXFlsrD4W/m1kLBbifsK2HYTnxSpanq4bU3DPLmj2m2hiS4cSNIMwNX7Ggc066E47pKuHmS7AyyvTKAbn5ucWoxgRZjmHuElBkuxAi1GRPlej5CUg/y3rLtkJTp+6JwW8Q34kEk8D4DMszGDCKYe1dSCTrfmXX01XeTc8NLC2k0VLxwhkXGcUoRixa8Vy4B5EBkDT+r0TVLtbpGAMXOwAL26lHkKkzA1NRobFNRvi/HSShoWqZrp2Kk9hnBx/4I5rQDAP4RmfbiRIUfot+WGw== 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=YZI3BvU8z1GIGEddIcbgkXGABPLGMCgmwctzoeViF9I=; b=DfD95fVFPDyiAKkgIdmPSsGAARB3A+O9Zhqz+/xQe9I8dJHpHuEtrJq02cRYbzmBLpaQiZNW5JepK9nNEbGER0ZsnqtTIl215RtIaTrA+tEbga+gqZ52xBQDTyscZCaHOI/4yJJ0Mq7lQShs7Xi6gdLmvC+WUN5+OmhoWRsndYM3xqtNwl24exBUD3ONLOHgNSFzk/Swd0pK4A7HW+WHYlLmGS4tb2WYp+5tQbCmt/b0a9r99/6dHatnziwyb83o+RmdN8p/OOJHyQW3FlQASkFczT6zT+GTAWZlHsvyinKQZn3oZDFZlReDhYUMv2LO44i4svW2eN5QYqvCgWLllQ== 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 VI1PR03MB6544.eurprd03.prod.outlook.com (2603:10a6:800:19c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.16; Tue, 7 Jan 2025 14:02:47 +0000 Received: from DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a]) by DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a%3]) with mapi id 15.20.8314.018; Tue, 7 Jan 2025 14:02:47 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Vasut , linux-input@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 2/7] Input: matrix_keypad - add function for reading row state Date: Tue, 7 Jan 2025 14:56:54 +0100 Message-Id: <20250107135659.185293-3-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107135659.185293-1-markus.burri@mt.com> References: <20250107135659.185293-1-markus.burri@mt.com> X-ClientProxiedBy: ZR0P278CA0048.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::17) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|VI1PR03MB6544:EE_ X-MS-Office365-Filtering-Correlation-Id: 2fca062b-4964-406e-56e2-08dd2f23f6f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014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+ER5nFHe+bfmdpf2PUjeHTUvQ5ajAj4cRxr5KKEkd0lS3r9HIFKI4R2xfeBHU7KSDBcPkOD6G1Hho3G8hWJnwk/LFFFFBR6USxGeLDd9fyR4AApEvSwIs5sOZoEiFCMFw6wws6Rqsh/2kS29juVEv+enj589ysi6QPBFwMPxVIezlNqhaZkVFn7tAB3Dn/H8qn7C/XIiCHTpvTgeFhMLHL/bWu9wxkRg4rytC7BMYD63JR6tV9ZFNMuHy/D3Ab3CYhEWZQJ4ADpg6pfDzCp3l1YevVRUdsZKNG7B4IZV/sD10IriLZxZEs1AbxlssWzjIChFthDI/LZDtMdeBW/JZUQ6D/05gNwnabAt3HIvaexK54kp9WQPuD1bS7Vn5aEsYaVp/eRMx8DkQb0J4xg7zX7Va48jm0WYEOxYbXn1LJXofaKBr07IL47NOA 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)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aY02L6UL/dmlNOgsDKwPUwxhoSRVFeVrThJMclEkPLIVmGmi2YXl23EoMyKCu03hGg4TsSmTH8MXtVnSqIIos+dONoeQoEJen3kiwT0//EBkSZo2CJz63xQiRkRDGJt84t+VC4BRzyjUR5g2nd1CgRgAdzg9RfVttnvI/3NPSOPnUGXwytnBuTm/9vYAnB2GBOPpscKy/nq6iNg+OWP9e4DuO8vjtu56+dgjlcgnNCkUQJ9+AeuTQaWyD1Kmn8tBrJPD8bVA00py0w8acZF4+z+qMp9Nc+kd8IIV7Wk/e/QT5ovdGk7JFiTW+WrZDNazvy9zOJ89uvQ8F3JSZICbHhcchITUdus77bC8CRstAGJtxtZnEoNHyy5heJnLQJgBviaL5TkJONDJeyU1IA5kPtn4m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KsoxXHkopoN7JWkj+mYDT9hPznmx5k9D8lmw5ZX29VHNF4F44yBhmJh24lNEFWIKxlGv2cCZ3AlhaRQvA3DutNkCBMS4Pg15EsvUFsG2NpFsBDS/TBJ X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fca062b-4964-406e-56e2-08dd2f23f6f3 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 14:02:47.1018 (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: YV+TZmtcxypYljbGOCmuLMR7FJuCo15HxxbUjNC/CXO/YYWb4sYsqbvdDJdr0mdmrQXatG+j5OlljPBFeAt0OQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6544 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 --- 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/keyboard/matrix_keypad.c index 5571d2e..90148d3 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -100,6 +100,16 @@ static void disable_row_irqs(struct matrix_keypad *keypad) disable_irq_nosync(keypad->row_irqs[i]); } +static uint32_t read_row_state(struct matrix_keypad *keypad) +{ + int row; + u32 row_state = 0; + + for (row = 0; row < keypad->num_row_gpios; row++) + row_state |= row_asserted(keypad, row) ? BIT(row) : 0; + return row_state; +} + /* * This gets the keys from keyboard and reports it to input subsystem */ @@ -125,9 +135,7 @@ static void matrix_keypad_scan(struct work_struct *work) activate_col(keypad, col, true); - for (row = 0; row < keypad->num_row_gpios; row++) - new_state[col] |= - row_asserted(keypad, row) ? BIT(row) : 0; + new_state[col] = read_row_state(keypad); activate_col(keypad, col, false); } From patchwork Tue Jan 7 13:56:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Burri X-Patchwork-Id: 13928963 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2084.outbound.protection.outlook.com [40.107.22.84]) (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 500441F473E; Tue, 7 Jan 2025 14:03:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258623; cv=fail; b=A71bx2Ate0qyvhFD9uPq2TdgSoPGgnStiTOqVhITbGPdqyIgbkP5RWfsQ5trVCLcPm5UfGsRMpfEshdw39iHPm0IFclRkSapPJuB+Y9yT4zKk0j2tRHErlucYcxdK1JGdI5nzjITcmKM6197vV8+xOkNbXOwYf4ck9uh2ZX5dzU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258623; c=relaxed/simple; bh=lo1JZHFh1bx56WO3zjG5NJDCUvVKRuMOKiC3Me7DG80=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=cyyO8P47gQkPWiqIkHhY1vYI/TLpE7YzBs1fHRRZnZICHlCAp0ctJa+mc64gJJTbPOVQmbDamZySaauP5Y4isuJvLO7jMBrOqkiJUnwVHCBoVH7Clsw9W29wPx6PQzUqQZxlW9OrEnTDGcDhPLWSxbEYLwxhEOTl+ODMlF+EiJI= 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=N7vdTPwB; arc=fail smtp.client-ip=40.107.22.84 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="N7vdTPwB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Y3I98qsXnWZLmGF8Vr/SKPuk9uBdxIz407V2uMg5vu/1jfjFO1o9bV6LPFeFiTHI9/Sceb4mYMeE0+MOayONyM8L9AlVHMG3rttD+YIWXV2DBcDpCAwBYZB9TYzA1miYPtX/wrcuwn1CSWDODrIjTFxFPj3ox9X1RtoRUyfPS/+MXI+GTC3SDka3cJ6kL3b0AjGV5Y8eYCxNq+f/VxCbCpZ2l/aMz96oGsMTSjJctZ3omnSnDXt5+q/4dIawjVhL62VmoAHlO6ShXdT1eygcXPVD4oRaZFInWZ4S88pVntS6Vcwk9sXhgT+gtvb/zVHlZ8kiJ7mtUADGUFrXrzOYEA== 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=+vUQq9nW9RLfwuf1Tsz72XuEDcFwyKJoZZ7YDR/csMM=; b=mV0RKoOlitnICuGoAteCcxmIvPzJCRZ/UwK/izm/p5WcUzJCyQTAG2pqUYRzE+DOyFyiJb2mvYQLCdxNZqdkrh6XAarhl6fdYLZHksGJWyWRL/9qrssWyl8PBSxMsMuYGFP9ow1o85sjj3uoab51eihHjNrHM2Syv6m1KouvqTpRLUlHd9ycQZ5FDYGmiehhHIzquDslIogp6/xAgZsL/7su2O8GMkTv2LdKpHt5Ee4wD4EC6PiskUQW/LgnzjAO6bVpOHJW6iNCpPdYpOayoT2gsjtv1+HRyJgtVdFzbEgiz1CWWE9HJ3JtGmeKn4fKtyDuBq71FbAIuudzVRR0xA== 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=+vUQq9nW9RLfwuf1Tsz72XuEDcFwyKJoZZ7YDR/csMM=; b=N7vdTPwB+DZqno/Py8pNYTQ+bW7BMcNdPnOxu3vlC39KCq0mkwy4m1mI6PveHg0y/BZ1nDzrJjYUInc1buKqh3B3xB31fjQKoYanoIj/hKczewJridcSoSyF2BZF32c6tJ+nqHw982pub8rPgMuhh5wEJ7T+tjdEDjajJfDtyJs3YS5B2W/eZw96w0aXajgjrjmFUA3WmtLdg6EQ+OCUjvtkd1jwAPz38qJ++HNu+F+yQLTUkvbUCs+bwq3jCZOLbANuZN6QqRckWmblSDnGzNHtFEPlbRhslJzT0reYtG2aek+KKEU/wRwrZV/yS5AJyQZvqQ5WEsVk2IVMUA1ZbQ== 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 VI1PR03MB6544.eurprd03.prod.outlook.com (2603:10a6:800:19c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.16; Tue, 7 Jan 2025 14:02:56 +0000 Received: from DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a]) by DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a%3]) with mapi id 15.20.8314.018; Tue, 7 Jan 2025 14:02:56 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Vasut , linux-input@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 3/7] dt-bindings: input: matrix_keypad - convert to YAML Date: Tue, 7 Jan 2025 14:56:55 +0100 Message-Id: <20250107135659.185293-4-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107135659.185293-1-markus.burri@mt.com> References: <20250107135659.185293-1-markus.burri@mt.com> X-ClientProxiedBy: ZR2P278CA0022.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:46::7) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|VI1PR03MB6544:EE_ X-MS-Office365-Filtering-Correlation-Id: 00615f96-dfab-4095-8441-08dd2f23fc7e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: lAGnVijBBVk7yJ9ZXit31LLZTMjEyFXU5uPC4aOpbrjIl/gm0gtZdrGzghu0VWWyDXHqbSpLMV7/hVZ/S3gvPpqfLul9sqTmD4NYqrvVFV0HBy6KzqntQGOABID/EiLi8wKa6r24uHQIZDVWfMifrjeUh+M0Y0s7wRMR/bRad5a0UNfYeKlXuOPtEsBB/12jGz7t8pak6/0lJbMOKLcwY3po5kfrIobVX0kw/TlVhRgbJE0ksG/IWGBq0cRxYvvQFBOsNQWXb+r1pHRx26j+v1XjgTo7U2dRmcoby7uv63f0gYuniUayfjJ/KDPNUUt0JCKsl8gJDHuiRvq012AeBPmEX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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)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Z1IFZr4YvtvjBlsmIbP6kSfBZIMkgzWghxl8lskyTVhBdarqe++9ITQ1UR42Z2TQjg+8jy/Fw827Jx+XLXDbhZJ0/61Ys/aSW+Dr2aCw/6ZpnUdQEQHbzN+OhL3g/tZCCZLV+CQQwFIcKNEU4HO2gjNdZL2meM+in7iXOSOnNnKAMliFPU1Ex7dpg1tfql+f6f67zqzxeobvlFXw0EkHv6yuFVbUOnsbOD8+Y7GWOWwdeqd9MBNv6Umb9NN1GVUhyoV1nbobdgEYJwLkgVZ1402t6oM6po+LicK7/fZz8z4z7k7ifW4CEayGVo+0OG2LD6Rrib4dCvSLSEDnH6vt9JOIU/WkRb7G7Vcb7Ir35tmdEOdLJ9xDYovpC3JGZHeC/I1IcUtINIoccHCKEbvB4JkPwJIsR8Akah0iAvF75M6wVtFjieDhVhf+nYZqmzZ89h8s3xP7Mo7M9UkmjlSlhlQyULaU8y30sVxqMXm6XvGQHYDPn8rs+5BjUyVwmquGd3pvH0LbN74cf/4jpAh+KCiJN1IFkqPx7XGjKnM9I/fIMZkWp6PUbzIHajPOVuEXX8ex/hZwWQ8ARCkSX01bouMEtKH+P7vUSUCSPpL7pj/JjQckW4QEnKq8xFMRb5zsTbRL/oSokpjQR1EPBiWz0uRD0TMVm40kKChJ2tp28aq41BTA0HWn0KEPRr7ypZ0SlAV1JQwcSwcZuqzfeI0RTgAUcwdIhOcEQd9dZqyzQ5aATX1OkYyw27sviqXEKTn2jI0vuwnlbZk04Tjp/03A8eysUMe9JnRXNKErE7g+ZNKP3LBUkBeR51yuJ0l3k20fdyuRbjSZOzc8R5Ql/9VFSPUC3ZLny1Rozr1LRs6qPTKWiYAGQsUVAyz7wWZoRZskjRUKFmaWIPx9ZEemzQpgugAhlqNze+LaWul/vhZOVdQT6aGwQ4Ftxa9lHo/5viQjrZNuRDa+gX5+La0QMbs1KMxgzjJFcqEoslBWaMFFLTg8kv9mv0WvGcYMHwMlTVtWmLo+qI1VcJpbxagHgLU9fcBGkBNWavW0qPRkfG0OcoaOto9ojdIgKxzslMcCn9pR2T89tPInvFBuhVkDJXDcbfEtA9FZpIzpIiIJPEPvH0KM31yf9Z7HxGy2b3bIQx8Fv3I6/EnR3TlGoWirZlcZ7fYPhcUaQuSCVgsHD11H7Lt/23Kfk4SsrNbpWYaLwahJbTQYNAgJbpFuzQk0y2gNsZdFrgu0qa4PQq62tDoo7yHul7wuznueflbBHTn2yXQp7RYdpDGMmjlluzrmhPubRWkoJBKHBx10vdsne1yZE+gvOYj498jv3FMeicM5GdPjSD/dSxa/N/dAiQoZQwAQTL/+gEW9fpsQxMwasBychEChSvq7lFaSaiO4BP5GMPrusBBJMu/6ql2dvmMl7bBBs/boL5GKNNywhEUwZRMC6RWlYVkdtFReTNrBK3UEBh2dq416RoVWCuXPATVv0JOru3tYvjOLjCzdUzks3iZQMvtpqgeq+/LfEtTkhCyc2Rh6U7/M83mk87/V6zGOwQqNUiN8gzVst9hLOsFVoCk3O/OifADwly05piEUdNvX51qk X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00615f96-dfab-4095-8441-08dd2f23fc7e X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 14:02:56.3970 (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: HY0aggMBApK0pQd00mt+DuNZ29TdZe/fVok+dHX/fBEASSgxNOcF/Opxhfa59LcZaVuZIMqXLCz88vJUNn3Ymw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6544 Convert the gpio-matrix-keypad bindings from text to DT schema. Signed-off-by: Markus Burri --- .../bindings/input/gpio-matrix-keypad.txt | 49 ----------- .../bindings/input/gpio-matrix-keypad.yaml | 86 +++++++++++++++++++ .../bindings/power/wakeup-source.txt | 2 +- 3 files changed, 87 insertions(+), 50 deletions(-) delete mode 100644 Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt create mode 100644 Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml diff --git a/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt deleted file mode 100644 index 570dc10..0000000 --- a/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt +++ /dev/null @@ -1,49 +0,0 @@ -* GPIO driven matrix keypad device tree bindings - -GPIO driven matrix keypad is used to interface a SoC with a matrix keypad. -The matrix keypad supports multiple row and column lines, a key can be -placed at each intersection of a unique row and a unique column. The matrix -keypad can sense a key-press and key-release by means of GPIO lines and -report the event using GPIO interrupts to the cpu. - -Required Properties: -- compatible: Should be "gpio-matrix-keypad" -- row-gpios: List of gpios used as row lines. The gpio specifier - for this property depends on the gpio controller to - which these row lines are connected. -- col-gpios: List of gpios used as column lines. The gpio specifier - for this property depends on the gpio controller to - which these column lines are connected. -- linux,keymap: The definition can be found at - bindings/input/matrix-keymap.txt - -Optional Properties: -- linux,no-autorepeat: do no enable autorepeat feature. -- wakeup-source: use any event on keypad as wakeup event. - (Legacy property supported: "linux,wakeup") -- 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 -- drive-inactive-cols: drive inactive columns during scan, - default is to turn inactive columns into inputs. - -Example: - matrix-keypad { - compatible = "gpio-matrix-keypad"; - debounce-delay-ms = <5>; - col-scan-delay-us = <2>; - - row-gpios = <&gpio2 25 0 - &gpio2 26 0 - &gpio2 27 0>; - - col-gpios = <&gpio2 21 0 - &gpio2 22 0>; - - linux,keymap = <0x0000008B - 0x0100009E - 0x02000069 - 0x0001006A - 0x0101001C - 0x0201006C>; - }; diff --git a/Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml new file mode 100644 index 0000000..75975a1 --- /dev/null +++ b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml @@ -0,0 +1,86 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- + +$id: http://devicetree.org/schemas/input/gpio-matrix-keypad.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: GPIO matrix keypad + +maintainers: + - Marek Vasut + +description: + GPIO driven matrix keypad is used to interface a SoC with a matrix keypad. + The matrix keypad supports multiple row and column lines, a key can be + placed at each intersection of a unique row and a unique column. The matrix + keypad can sense a key-press and key-release by means of GPIO lines and + report the event using GPIO interrupts to the cpu. + +properties: + compatible: + const: gpio-matrix-keypad + + row-gpios: + description: + List of GPIOs used as row lines. The gpio specifier for this property + depends on the gpio controller to which these row lines are connected. + + col-gpios: + description: + List of GPIOs used as column lines. The gpio specifier for this property + depends on the gpio controller to which these column lines are connected. + + linux,keymap: + $ref: /schemas/input/matrix-keymap.yaml#/properties/linux,keymap + + linux,no-autorepeat: + type: boolean + description: Do not enable autorepeat feature. + + + debounce-delay-ms: + description: Debounce interval in milliseconds. + default: 0 + + col-scan-delay-us: + description: + Delay, measured in microseconds, that is needed + before we can scan keypad after activating column gpio. + default: 0 + + drive-inactive-cols: + type: boolean + description: + Drive inactive columns during scan, + default is to turn inactive columns into inputs. + +required: + - compatible + - row-gpios + - col-gpios + - linux,keymap + +additionalProperties: false + +examples: + - | + matrix-keypad { + compatible = "gpio-matrix-keypad"; + debounce-delay-ms = <5>; + col-scan-delay-us = <2>; + + row-gpios = <&gpio2 25 0 + &gpio2 26 0 + &gpio2 27 0>; + + col-gpios = <&gpio2 21 0 + &gpio2 22 0>; + + linux,keymap = <0x0000008B + 0x0100009E + 0x02000069 + 0x0001006A + 0x0101001C + 0x0201006C>; + }; diff --git a/Documentation/devicetree/bindings/power/wakeup-source.txt b/Documentation/devicetree/bindings/power/wakeup-source.txt index 27f1797..66bb016 100644 --- a/Documentation/devicetree/bindings/power/wakeup-source.txt +++ b/Documentation/devicetree/bindings/power/wakeup-source.txt @@ -23,7 +23,7 @@ List of legacy properties and respective binding document 1. "gpio-key,wakeup" Documentation/devicetree/bindings/input/gpio-keys{,-polled}.txt 2. "has-tpo" Documentation/devicetree/bindings/rtc/rtc-opal.txt -3. "linux,wakeup" Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt +3. "linux,wakeup" Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml Documentation/devicetree/bindings/mfd/tc3589x.txt Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml 4. "linux,keypad-wakeup" Documentation/devicetree/bindings/input/qcom,pm8921-keypad.yaml From patchwork Tue Jan 7 13:56:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Burri X-Patchwork-Id: 13928964 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2084.outbound.protection.outlook.com [40.107.22.84]) (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 E9F961F239A; Tue, 7 Jan 2025 14:03:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258630; cv=fail; b=B06tcMDFSuh7iEIATK58xKLTduFjV2+qoI0zLVEa19/rGERt4iqdTdYy1a4Zr8/dNGD8MXh5TWeyLtQqcaqx7tNaVthFxQKeNbhOjhUmn2nwh1yAY47TANNOVfCcu+dwlB8dWkXQ5K2wjzh+rfS4+oACu+dJ8PjkIxGOYSa/HSE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258630; c=relaxed/simple; bh=lOLQphsu8SLWGtQVUcwoPXsIiWgcNjIpzB9++8fZwcs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=XeDmc9qKfdt4a0dGsG+NzAVkXRO6eTArYXyNKkochjUcRd649l/4Qi1Q9JTIQeK2H3YK7MlEDDCKW1KTkMkR7ScdkaM8mzL3juuVnCeCll2iLXY2onfrIGIOidR0ZL39JPhtPSmu/VzHmosan5XW3tnTIUUOXZ33Fba526x2WTk= 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=mfjZbao8; arc=fail smtp.client-ip=40.107.22.84 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="mfjZbao8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PlWzxBOXCH50I4+Kj/FcbTiwnZAOhmCevuL4hUnSfWaTNPKVp3rRNAFkK6ewu71dtznY+Qy1CMrs/x4kCTFGBnpqj3a1UFeDfuhg151rg9J+Bg6qQb3lCGRiFCEvd7yUUpqYNlBJvj2r1madKcPup6ZPDHqvu7rsJkdg5bY9FCKWIlN2gRxK/8V93cqDnNf0vKFW0Dee3al5fYTsmJ3k6+L3mNZFmZJyXaRSqRhPHrqGb/vKJDGg6+FE9llbDRtbtfiI/hHTJM10mX0W6QbBqbIQlzXA5I+yjxCBjV9l2xG/SVtfk30f1gkMyhsOuAB9BXO9TAFlUNNvH1jS8oLLNw== 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=xD/WYeTnwfz4gIUoEAH2KQvQg/fFteugY95cueWhNBI=; b=OBLXpe+51locXRzbV45FZtmd/lzF+89XbvPbLRWoxhfQv8vQNrDZrgwUk+PPQDtAfGrPCossEd3RKIB1KhE7udgkOHadLFxHO3FmGcRbz7stdv/YG+36PhWk7f1GJnJSw8F+r0d/7iMStEohNXCNTTBsX215iykV5vfDLH5HBoOjordLamLA4oEf6Kk+pxAD7pBAQl3m8vRjSA4Ah/30uAUpjj0JBEomy2pLuDV1KZysjGsjfXSJclxe9cy7m9E4e0hQ16ZLKWx2fpm3WgMDXdi67tKkI2kZgjMPtynf/iF1MjXD3MHvGovO2uwMGOcdCthnfntDzv8zOQzXO/hHnA== 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=xD/WYeTnwfz4gIUoEAH2KQvQg/fFteugY95cueWhNBI=; b=mfjZbao8lUrU2n2i++LtJpvqZGbrztvYEGyBC3cdryqh7zUwTS06BtSKhFxreMZc9a1nIsoe7BEhewcBRrNYc2p65gUkJ7kTI21x/iRWc7be/dDYxMGfz24sygEuz6oUzZIF8hK7xfI3yeJOm3vB/KNtjTKXqmlx0ANVGgi0jwD6WPx8qmdbH1bZH7QKWxREboFD3pvrrd0N3V5ISaEvKYemThY2qzWMe+8RzhEPyd/xKOTvW1OvKTobE8CeGnM/2gb8AxSDbTHxkku2havoOEcfZjU0thP5JPM36JAmG0kGCwgBb2rgvr+vP/rak1dz27UWyOUaq5+jmJIjY2UYBg== 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 VI1PR03MB6544.eurprd03.prod.outlook.com (2603:10a6:800:19c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.16; Tue, 7 Jan 2025 14:03: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%3]) with mapi id 15.20.8314.018; Tue, 7 Jan 2025 14:03:08 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Vasut , linux-input@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 4/7] dt-bindings: input: matrix_keypad - add missing property Date: Tue, 7 Jan 2025 14:56:56 +0100 Message-Id: <20250107135659.185293-5-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107135659.185293-1-markus.burri@mt.com> References: <20250107135659.185293-1-markus.burri@mt.com> X-ClientProxiedBy: ZR0P278CA0075.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:22::8) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|VI1PR03MB6544:EE_ X-MS-Office365-Filtering-Correlation-Id: af55140f-c7c1-4b39-c8e5-08dd2f2403b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: oreadwkuJtyyDitApM1nTB4bOqnrTGxFTMFX5Y/ZAKDmEdtZppv/SZzdUPPGZiNYP1gdb1EQQBhrmdZOEWoZVo9gkVgdMgv4e8gCH5XIfAmExPN6P7I6r1HKRBW7rx3VEuJLhXfb8HCwVCDUp2Nm7A1ZEOJ8M/ZCXaz2T8q6ri2iJkn8bkF64/ACJHu2d3AvnGNc8pXuYjmLUPItBt8CQ8bCKPQJixRL9yIg2QTiBsFNT218OJ5w9tgA5Ccpuu+u4uDFREdfr0sRRec2eEg2IRM2K1UBDyiWbH23km6NneTGhGZwSw5E/i8GU4gc7UGISnpc9+Z2gozAXIsXPMJ1CgF6BEm960MKIAsofA4q/KGAQc01UcX+PIPlQVUVlrkMhQaRwEVZTDtf0YZNOZ+jxR5KUiBiuyaNQH8yUUdkiT2MP48HH2MOsFtg971H9hH7jCjnoFHO2B8+6qFFkxxBbZnMOKe4O8hL7ALaGtTqPuHQxSbTw8rhlJsfeEQN1Pfyk6PpA4GZDwPnP3lGftirYh9mF2YDq8LY+FKDRsbWLZvFfVmdLqnVDtrP19ejdo6HUqch+8/33H2YEtUHgTzV7ABP/gegN4/XhUqfb2d/963pOc51PGa97KdM5yAhvywG5DJ3vmBvP6N9xIEPamOyWxt+nnEvmujrGwoO8O5jbXq/AvpLq1Jh6JdXNMghPN5CzoznGN8m6dTYiX+QD2N6H0kR+bF8rE+bWGWYEVIyXJqqoRPKhYPdCjKyaETDk9WEsp3RCLJyMtXu5s4zUq38GqiOULGwSWpxeghx6u8btbMxDHg3ltV0TUb/NzTnuUnnMoULFv+6Lop53vxaJD2C66Ela80DhWS38ET0AfODcjQHfPt5jYRHcK99yYvGaRbnugEsHDGHtiDszJazQoM8JFIcWF2IOfyTzBxeLQJ3Y+VBVfa5jjiun8o9Wc64LjXOuX4rX172EiX63XOBE8bXnx7ngOnx3SLzowwWfSEhLfIXrHmMeuSVPZZy0ARnHLIam9MTggZMm168KF2zQpYmsqRDra9zhf1fThDjAyIO1o4pq3L+1r/exWxn2ad67npXQGBOjZcZVnrokSwyFgv5rlEc5kV6APsADWVxOebONZ5t0K0N2bOd7ClwWmA3dU1rZoVWZxSjyhU8YA56818x7fxSKSxAo9R8FMzMdxf9UPo3nIzNcbWDI1N1aOKNCr9DebsrIWb9aaX5nk5mfPIxEMp+eax9jtuU0aQ+mCruC5NKtlO6DJli43sev14k/JBCjM1BG+ebbuypa0Ii7IHXe+ehD7Kuk8yQL84rhy/OWZwPAPTywQ6v/svipN4J8b60z8qrB01396airyQD1FTgINFLsaQo/IjIzo7vzqEwLZNe9MoVo4E41xre1YmMSAoDei7ieNgL+udkWzv2e1+zKULleNJ0kgWP1UMk2BdebZtifG9qxRiWLQQUxkPuNizL 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)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GjuAgqQyJ0UPkAx9lSoLMdeS9bMclezfbuTqFynIkSPoXoejpAu2CCn+oTpWLX5GSrcD9/xR1TFon46cDro25/istkTw3iLZ+xhQj0exKeAP+bcrEN1YJfnU9UKMcQ7TdvmvMkUNbCAAyt96hfFUVDJfVUu1nUBmEz6Br3Ox3+wPak30GwAbQB5hakTtKAAGx5uGQJQjav0o19BO4urQOEpQj6gcuM6uItE6Rf4sQBiM7BoHOAGgl608M1bSRFAld/aQWGMgXG6Z45f5so1FtWA2Ivxtn0ngq3PICyu3fQaLW5VN9+P4HezABDXhBaie5dsX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7YxfQrFlCj5iuVmy5x+cotqvS4+GzKMo7vIw/yeBjkm0pdeBU4nwNeKEk7/uTpbr9QX/4+yOd4tqp7s4R3B86CuRYqo2KDExW+GT0a26LmE3Ozrt7TaKEL0BL/EPd2hmAHTnWW0TndsBRXXEh4eoqi/4EUX9TI9oPu278gXG8LRRwQ6gzd+LcW0rpx4OlqXEogO7ATYt3 X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: af55140f-c7c1-4b39-c8e5-08dd2f2403b7 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 14:03:08.5193 (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: 0e/BK5ptAQUgElH2KG3Xs1tfw12B81qRfjxipG1BNIIR5G80zl9sWs0Y/a8T6m+dcyhfHXCItmhVIq0Ozm3wpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6544 The property is implemented in the driver but not described in dt-bindings. Add missing property 'gpio-activelow' to DT schema. Signed-off-by: Markus Burri --- .../devicetree/bindings/input/gpio-matrix-keypad.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml index 75975a1..b10da65 100644 --- a/Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml +++ b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml @@ -38,6 +38,9 @@ properties: type: boolean description: Do not enable autorepeat feature. + gpio-activelow: + type: boolean + description: The GPIOs are low active. debounce-delay-ms: description: Debounce interval in milliseconds. From patchwork Tue Jan 7 13:56:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Burri X-Patchwork-Id: 13928965 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2084.outbound.protection.outlook.com [40.107.22.84]) (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 4653C1F37A9; Tue, 7 Jan 2025 14:03:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258635; cv=fail; b=fuQmZ6uO2xyC6VN4yYzpdbqkDiNlmxU46NrwnnqQfa5TADVCI/Jl6LkyWZiQM5dgG+VYAOpabNJO8VVbWSuYv8o01Ag9dnw2Go3EaWEawfTaOLtdAo4TlX0tRjY+WspbuzvN0EqkZHpYUY+j3Pt/NzI7faHOCFkjPC1/UXrkvCY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258635; c=relaxed/simple; bh=7h6h9w6vEUzZigk2JdoCjfHo3ypu/ZX/g1RMssC2Ows=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=nbkGwEzdzJeePATTkR0KpCViE4o0n9vK0D4cmJzQGbXFR77l3ZeRRZ9dZaC2cKAo2VNDBmwrkZUKQnmEteQmibRMRVaBp6XOn0txRI7CNsqKJVy6G4ixR4vSxkkUx4G2U9LPCAj52B9b0MoDnFT1c22njrdGXVaFU75W9FU1ixI= 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=KlKMmb1z; arc=fail smtp.client-ip=40.107.22.84 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="KlKMmb1z" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xzr5IAtjBzW7ks+CVaDmgHAh/V27AEulPnMPgImzfdu3t6QZUgDNEweG05z6wH8SZgQ8MT5/5+mlABdkTs30mMOxNpaNi4cTBIXk0EJLiditeQf+/OBXVdUKE+/BVUhYrw8FBQZUhCyYg4tG1ywp/9ha/VeU4OMTsuH+J/+dY8GBW/iw8i+y1lx8wRtF9eavZJbzVJkwKsC71yv21p0ldCzMGHe5Fz6pfotSgjsLP2ncF1MBZBYPSqTGrg5P1JlAhCYn5lx7UtKYmuFPfbjiA5o2FpdlidF2R6V+3AzUJh2iv/6JFxn7E9+0gw1NvMYFWN5EF0mq3K2f+lHE1gojhA== 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=uTrPZW+q3wg5Z2hgOj1Ic3fDii2ONsyXjf9jC040i1k=; b=PTHtfD0xFuV3npWPB2PeP0iHYmAsHm30dNe49PVeSq+qfYXrRB/wifQGoN5Kk4NNaIeIXx0sUgZmoMSFbe3HpPYswKygtMnlf1A+x/8S3+JyCtZyKt9Jvu+JJ4mdpGVj7voAGOeuEjD1MBoGb8GwBQ4kj5gzKwwjZaI1zbMINSrmDxfPsNtKtUWhErSUnMCUA9z9QDY7HZVdz7ghAM3oU/A2Az2qN6svYZ5w1kFsiVrxYOZUiVy7eUMJna1LnM1qjHLOJCYwDZ7oDV1rX68cCxD1fak2CJGxDwAEtGc9pu+8/EMnlFHtIAu69V/w5513Tt0iHvnVFnj7ccjoE3TOLQ== 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=uTrPZW+q3wg5Z2hgOj1Ic3fDii2ONsyXjf9jC040i1k=; b=KlKMmb1z1Ewcx6voQL0ltKL/vQLtA22exfJAXPXXFNIKcstmj4qvMiDGLMkaCXIH6ZlvevNHzB2mcWqUViyeQGTxTexYexH8PuZkOWv0TmRI/AXDJGu2rl/CzyRrOVXYs4pj1etJzgc/jFa7x8qudClB4ZAR3XUCLQR4p+jMzcsH2mEfNKVabtO018y7BbamBppniQua/wnvt21EQ6/bPMkT0HX7bZeJlvo+yo5Do2kKc9yyz2Fgzvs7x3sZATmMIkzOVjqI79ViotmGdb8MmBZrGcjj/VlwxjF2caND3eNOSB9HeW19Jm4N3YAW8K850QfQt1hF4a2gVdHhrWm89A== 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 VI1PR03MB6544.eurprd03.prod.outlook.com (2603:10a6:800:19c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.16; Tue, 7 Jan 2025 14:03:16 +0000 Received: from DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a]) by DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a%3]) with mapi id 15.20.8314.018; Tue, 7 Jan 2025 14:03:16 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Vasut , linux-input@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 5/7] dt-bindings: input: matrix_keypad - add settle time after enable all columns Date: Tue, 7 Jan 2025 14:56:57 +0100 Message-Id: <20250107135659.185293-6-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107135659.185293-1-markus.burri@mt.com> References: <20250107135659.185293-1-markus.burri@mt.com> X-ClientProxiedBy: ZR0P278CA0039.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::8) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|VI1PR03MB6544:EE_ X-MS-Office365-Filtering-Correlation-Id: 5662d712-3247-4ff1-e3b3-08dd2f240836 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: HJH1Mlgv5MiDUPMt+gmtw3cAt8lESjTXjZlLYiyk/ZAFni2e/hLtodTG/ufqUb7HiXRFlyPjIztblqZ2y9cD3jA0AFrTeP+HwAxKrUp7LrnvzfnYpqEW3WuKQoOJzu/HgAaG4MlHcBRxFhJ03abRm9IRoGDuZMKiYFPV9wSzOo7rQgPtwQuV8SCIv4blEpILhl0kzvQ65iCVQ8GQGYkXldpV+xMvk4kirFIg+3CnUqAWIHckEG6A00xDUdHrOiNR+Atw8095QHgp5wsg/NrEw04mn4BuEW5uUnbHQJhRdd29+2Qb/QAp9bJfP3pPpUiFwoo5/bOosIgLHqq3GHAwxRjgzi95q4iNiCTJJNkMebZ6xdKzzRYnbAHFR2MJ8/1PEzlF0L158xzV5r3G5Hp8OvDCCvTjxHcTlMezA3XY+virECNRBP/9OhlFe5hQrR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:NLI;SFV:NSPM;H:DBBPR03MB5399.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9AoK+yMUJDibHDyAqwPIqU5tBWZREu+6b6yt7SnSZpngKlZqv3anLlurcOFSyUYdipi31dzqZdfRPre0irhFJ1ECdhgrFaJfNiwara8myFthsP74qYUCP1sr/srVnY4D3xAmgK38H9w6ueFc/9WHByznrjL0vG4lXc0Toe8RZ78RgFuS/sK26bIZncGFjCWQVvbWuULCU2H70emg+QmpFgMF0HFoBkEX+B4kTSJeEkwjStpm93Rh88irdk5WTcNWKmOmmZngGr0VpBWt5pfzXUhYJumGgPhizUuVZp7oLzmp4lqY3bf6a2RXw+6DwkZibOcXX82J7hrjq0R251udVHWnsLdmeh5OS0VL8prghRRWKv6gFwoisE6uno0lFmy7gExusaFhw/0QliBqFUGN6azGo6ObXpMJ/W63pVLTdZLahrPw35BR1EJdgS3HagahiQQSiQD4vCyTc56oR5eIJpHf2BQEoccvX30Aaw4ukcyHdH7NYMRv1KBo+X4XyFbcLicYrYpa2jRzgZD6GJeyi18iGW+2+99BvvHCdM48fz09hzZ3P9P2GBat4QUvofLSKz/c/5xDpVfC+d4yYLO8AQrTB1u4Dl0xTwAvaPb9KQ0Gq/7svo7bHGff2jhceH7sOfbX5C3YJVK4P6feA5nLpvR3+xPAaK87wrklwNIQK9TvPFNLzfQACguPO+KYNndmFnWwPsoqJi3qyRUVem3Nc4ozfRnY18iXo76SaYwLOIylmMZIAy+OR5iMrI7vvjRn0AXCrGtlRuCITdKQryMM+XVHxw7npr+xWzl6IibfjSAzNYDmeaQig1/IU9eTcEIqtCTSWElOGO5zIElexQ44fDAUgGjmT6t/CkIx9JJkTJv8H3ZzsSegDHZzCh288smOot64Gfo7PQg2XKmDNlrKnI9tbpcMxP5doNJExcNFhfvhN2vsqVCe4hNcTBfcDaD3pojAfzAs9q6hNy4AZ+bgXmcvZOwdGeohTorn3tisssP5HmQmQf4NhA5fiHsIuV8c68GQu7K7WZVJDHZSQHr8Z6dkJnpM0zuO60IRytZok/0+DRsiICQNMZ/hOv8MXxPjYr6m1pj1Aanrib8b6iWCLwZqup36k0dNxnxXj6dPyDuGtTv41Q9ePCXn119zNPf3n+s7FsApbKEi/0wywF69ONTDJtjB0NAW0zDAQVIDQzuJ2hzyVypSlYGZgQwix+4IH9rWqHVbjDN9/tz5e9AzjG2U1XG0aQ8PHp7LTmhi0KQtitKJ4nhGMSn6kn5wTHV0x9kGyoE3pIqeNLI2zHQNoQVr8W2ER2bVEcVfKz1Uf29iKETkW/QKEKyldrW+LhR6am6663zNaFmfCcnPetFLj/IjqDhM5aVTgEmx+41y4bsnu+zZP950QV077FvYuECDhSmvoMRRUc1JhRK/+aCJ4sBrhj08ERZtRzJtx1i8DhSkWgfJNMDgjT4nHG0wqU3q7uEg8HN9Xcfm2DKJ4XKgg3WP+oaMZoBVp6AkIyH+CjOghqKuLmsvvIK92BhGf4V04pj9j+DBDuXtOQ6DJ3cwObXpvy3cqUsJ2Hw5HiKAkqEICUXzkm3YRbt2tY8RYDQH X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5662d712-3247-4ff1-e3b3-08dd2f240836 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 14:03:16.0387 (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: RJ9DCISJv3eD8st+ovJSnyqXK6trrOUB/IGUPSNpfz7Ki8JfRjYyTJm+nyYJ+phLcKJs+RadMOEjaNEPIjD+Wg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6544 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: Rob Herring (Arm) --- .../devicetree/bindings/input/gpio-matrix-keypad.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml index b10da65..f527f33 100644 --- a/Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml +++ b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.yaml @@ -52,6 +52,12 @@ properties: before we can scan keypad after activating column gpio. default: 0 + all-cols-on-delay-us: + description: + Delay, measured in microseconds, that is needed + after activating all column gpios. + default: 0 + drive-inactive-cols: type: boolean description: From patchwork Tue Jan 7 13:56:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Burri X-Patchwork-Id: 13928966 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2084.outbound.protection.outlook.com [40.107.22.84]) (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 97C951F541A; Tue, 7 Jan 2025 14:03:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258639; cv=fail; b=T7GzphrZIGiGHMqN6BaWCdAOR9V02X83zBdHohge6MNkqmSZHn/ogDiz0DwKYctO7CMRtgpTi1w5ExU2MeV3aPai7+toA7F16UuSbNLzRdyQ5QtMji/aEa2O9sHN8D9WD+bjLx9WcSBxFWjwl72wLkF9woa2zl5HBUwsM78S6Rs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258639; c=relaxed/simple; bh=nMe7EhCD91o19QktC0RODj/qDgszHJkHyESftwpSiRg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=JQxeahXFWtKm6ZGSYAS+1J68dU5aZg+CRG7QQKDWxJXX5jzOI2mLRx88VtyKlcWFA+nvu6ED596NNC+3X2bNuPTiws+i3544rVsE/qaDZOsTofFqQbwECdOM/T2hFLXkFbQbx/qkiXMs6mIsinu7ENTVF0iNg3SZHAnoUznvo/s= 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=uSzM8jui; arc=fail smtp.client-ip=40.107.22.84 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="uSzM8jui" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dQc8cICANuMGKpFs8W2AaoRJLbQZjvfkA51XGdc0RopuEL2foI4LuJqO5h/dpCoDsmGsxpOi8tMmvtQMRDR5g9C31VMsbZA60pXRZGTYvXIMgamkBIMbBznGDHw8etltnogi2CRDE1svUF69rt2wRLQvUj+8HBsITdxvvluaBDpKGlCer+nd4IU0G6BVOE5kbmWtE3RrifuJsGKf1dwyAaDsA+eSw/a+UkiPlClnjQLLfZ2WvMN0nFZIozKpxJrU7mtHFhiVhrvta9rQNO5id9L94cEN+TLQuItEKj6aVmHxRNH+DbCTsvkgvjjp/qgNlouo5VHiWKOwEBLdJPprMg== 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=xCCAe3gwWWk/SzoxiQZ69oiM2Zdt3nZ74Ng8gDK68jQ=; b=WI2uuaKw1BVhT9xvQPDd9hXplHuitPLajXdxWnqPTDh5PeLi7Y3pSsQm6TT+cbPZtodIFnAm8yh3Gr8n8pNQvlgxMVc8iPXzzHYrC6VFTQ0uizNuaXrS23unlkzNXDmNwZUaAwhUSmGgQM4WfE6N/KDDILn7fr8O3xrpVZgPO7qdic1zTAZre/yO8YnF0qccxZKoNTGt1XTNzNwinPJpxdA3AoILWyjnkySyRmLV3dv0GY8bNeAO8JoE0Akv1axwwx1YdzWqJakKb7ZMN7LxTXo5vCjLPaxgpStGBzJkkZE3omLdn+7Ux1D7GBSSXaxueaE6SFFHHwhh4LUGM1yJKg== 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=xCCAe3gwWWk/SzoxiQZ69oiM2Zdt3nZ74Ng8gDK68jQ=; b=uSzM8juifJg0X+x+qmcWc5blIyzQL609wISWsswjlicbXaEcVuusqpnuv7yNamrc5Vl2gcOLeeVNLBkv6ElaInIPVrQ9XKKWRA56Rv5GGzD/Si1vf/YQh/sdIseFZYXANoUhrE9ua97BeDXCdN622gm0aa/JsOAKvMvwdj0XzGu9hgwME8/P29OZD4GLJZTv4PEmPNj3CRsFshOU4+gDa5w9vcXtzDJ1ozQW6vKAfyprHSHLG19s1XbimpKHnvwyjHNjNKeb8ZveRQzxhY6dIStSXSGdTcA9f3li6bUx4Anb8vmemVU0kxRl899VL+q5lVYWmfH/253gH3oKz31gTw== 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 VI1PR03MB6544.eurprd03.prod.outlook.com (2603:10a6:800:19c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.16; Tue, 7 Jan 2025 14:03:24 +0000 Received: from DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a]) by DBBPR03MB5399.eurprd03.prod.outlook.com ([fe80::2fec:64f5:1893:f53a%3]) with mapi id 15.20.8314.018; Tue, 7 Jan 2025 14:03:24 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Vasut , linux-input@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 6/7] Input: matrix_keypad - add settle time after enable all columns Date: Tue, 7 Jan 2025 14:56:58 +0100 Message-Id: <20250107135659.185293-7-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107135659.185293-1-markus.burri@mt.com> References: <20250107135659.185293-1-markus.burri@mt.com> X-ClientProxiedBy: ZR0P278CA0198.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:44::12) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|VI1PR03MB6544:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b71c7a6-8dc3-4167-12b2-08dd2f240d10 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: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NJjBIrxV1Upwh6AGpIyI9UNpTp2nC/+BrWS5xzERPOEDxM4G2hblWg9Y9wt7v/2GQxcTS4pp24oPw/io82BYP4f8/EZQLEsGLJTwvCsFXEqJUVQMGIWrfTteRSOh9kP5lWV3On2XxGTtXHubDw74V00ya63DBheD0RZWmVb8q+Qr9in+WUCJ6UBvYUA90JbDcKnFd39veXEympkWQsNEaRpN8lfJlxym+E6cvg3OlN98JqN4rz7Nyr3nVFVtHijBrcNnZBtGh6kANjBmOGxaAkz3vwiVOAop8SwaBwqeJauN068PAEdXj+eKEovVJOqaBmoIzPQhS4C5IKc75fu8Cmg/bEVbd2+zK1/qrxZSOts1j53ldL7WJNXhsfwaJZNKwMZSzytmcQ5yMmRGR4mdL7z2y 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)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: K7yqHLFnvxR35Hj6r4syVFolnN4xFCbR7HEKsNbfrmk9nNZnfXF/PaDEkELC8r7xErGuTZHF1LqA9/1BBe7iKJXFTFrlsqHROUl7p5prlrvVBwUxl8/+xkt0t+Tibdlk9Swr5uTgVtSAcGInwsgWuW4ofvzPaJyEZhDXc+Ma42wL3R3kP21DOsDwntz1EvwlEL7wYHE/Ar+8rdtyIfDDcOKAz/JARhHC4sH6RqymXaV09hTnWfsdu4RmqO/ppDhir2kw2mMs2M1mHKSvmRXbYJCJGbFudOM2/O75Xv688TFrScUIn8fNu2ATgcKa29aeaju9iEYeJX3YIlzMDJ4LHYpTA9AX8RoyWT1qEDpnJ34XreHH0c5ssbLDhJdpt9z3pDP0M787eL93rCHIDEywHHfHHstFkRvu5sLlJDtFGRL1BW4r6PqkWhUeUSKTOggCEzU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fnATXS/rZOpbDDgbxz+LCL8Q4IJMvepv/hKVN/ZOvNw0KHQuWzKMnXlmBIG5Mr490vyk8WMOgjDOG/8 X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b71c7a6-8dc3-4167-12b2-08dd2f240d10 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 14:03:24.3337 (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: Ybs2fnVHSaxNoPtD4JGDoTSB6zx++w6mnRNgPJi/CHMCA9Y8V/nS+UB9GwQkMCDsbdSenGVIiWf3STxeXNb4eQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6544 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 --- drivers/input/keyboard/matrix_keypad.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 90148d3..fdb3499 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -26,6 +26,7 @@ struct matrix_keypad { unsigned int row_shift; 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; @@ -77,6 +78,9 @@ static void activate_all_cols(struct matrix_keypad *keypad, bool on) for (col = 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); } static bool row_asserted(struct matrix_keypad *keypad, int row) @@ -400,6 +404,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); err = matrix_keypad_init_gpio(pdev, keypad); if (err) From patchwork Tue Jan 7 13:56:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Burri X-Patchwork-Id: 13928967 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2084.outbound.protection.outlook.com [40.107.22.84]) (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 E733B1F9A84; Tue, 7 Jan 2025 14:03:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258643; cv=fail; b=FD+hEpdmGMSW4crcM+cTB1tE42aOZPd8RSRpwyIHyXPOdNSt9+GBPKU6MK8zqpcP1oYU+/e00q/9ISu0TLwZaKUgvYdwrgXxalB1aJXPhdCmErn6EKgTfO7mUeDQOjXgWncozfboRAKDo5p7He7ay+pmUi/m73B3nxSlka5FFQI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736258643; c=relaxed/simple; bh=wZKztcSCxUa1Q0/2iO88ZANFu8JTsEu5QBy5/sq+cHc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=N2ZqQc86ZzZHyiCr+5oa0SylUi7aYbuVTK8AI2p6dhW5kw1y9UC9+KX92JDJq5yiNMoywDK0XaluwHmM1P9BfhPRPXVrXISr/12Rl0kmkoCCK16J/AsZvU11UTJY0O7Wx7+NS8SGUPQtOKyvmV2askwOdjcMomNqan55urr4gGw= 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=SVFN/g97; arc=fail smtp.client-ip=40.107.22.84 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="SVFN/g97" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F23z1+Fkfaxa33Dzjfy5W/BJOq1Vs15GWDV14GQteiOvLncaEUxFeMckwSemydjVX/SWiQ4PjpcvUklN7FYocOdXRXGExCsqckr3iFDY+RP5mTqzSh7LLhc+qeYiPL2sTot64LnzKvVsrWdDrDpkh0yl07GhDEGKrnWK4hv2f1E08N0iu/FH8vpWd/PZs95Qie1Iyt8ZB2L0D7A3x2UNtwAl0UYegI+NYxSA0vahl/RXsbbg7DhqgE04z/D4dJUetrFb9L+FpgAyVSpd3OO2n5Lz8xdMKwgy+TJG2SPwsXdvDn6GiA7rD+JfsB2z5pn1auauX89QyT1lHiRFcswnQQ== 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=EdIlIoIZIKlDFiBC7W2CODcO88jqW/eEFkDLvDhehGk=; b=pMRVXuyFqZHdZmP2HsI94KNX5y3hQs+aCNNrYOY5vgyWgLqsxDdOz+8acp114pporTdYLc9j7MFUFjRWlXm5bZoITIKQ9tjZVAZTUUtG2BaUsxfa8A3FmEHWNAi50MafH3fx22oKGwfOqXoQntL70cfZalIXphQXfpPIf5PCHIhgQ1OfvKFY9STSj/k0S0e6NxMLdb7pQ2uqxwgfjSuh3IbjOVLYrz05RmmxjvbPvca9CCiqRwVK2/lPEuX/uzgWMt9PtK0+apEX2h2zreadeuEvFmSkQ/Ilb+vy3C8FSrG+saeTWlNLR3BwoCXskU+tS6o+E3blotpqQ+X9GTiEKQ== 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=EdIlIoIZIKlDFiBC7W2CODcO88jqW/eEFkDLvDhehGk=; b=SVFN/g97V0Ha96GLwMUfoAzvOh9RhEMxsqYApil0VUzDmwUnh3e+eoa12L2QhNC/iruWPnBk6DsPHJcwRNQEPwkseTttSZkYonaN5cOm2zni2BX2JR+NAPbABg1lRsBSpTG0t9Uyku/9jVHL58zqzom/dq6V2mHzLcR2prtdIwWuaSsdEswyB5fRVxra3IZYDCvqcb3mEW9RlWVdFYmerpM0HAI7MZpt0JV6DUSObGuFILtwjbcmTIE241/b7BTINdZG7zSnFzG0hKEAt/M6Pv23u1eZSz5dLv2gYGlJdp7+CSolPt0W32BWgOgRtZLnrENfWAdDeDDjr5cAzAwpyA== 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 VI1PR03MB6544.eurprd03.prod.outlook.com (2603:10a6:800:19c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.16; Tue, 7 Jan 2025 14:03: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%3]) with mapi id 15.20.8314.018; Tue, 7 Jan 2025 14:03:32 +0000 From: Markus Burri To: linux-kernel@vger.kernel.org Cc: Markus Burri , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Vasut , linux-input@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 7/7] Input: matrix_keypad - detect change during scan Date: Tue, 7 Jan 2025 14:56:59 +0100 Message-Id: <20250107135659.185293-8-markus.burri@mt.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107135659.185293-1-markus.burri@mt.com> References: <20250107135659.185293-1-markus.burri@mt.com> X-ClientProxiedBy: ZR2P278CA0022.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:46::7) To DBBPR03MB5399.eurprd03.prod.outlook.com (2603:10a6:10:f5::22) Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB5399:EE_|VI1PR03MB6544:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f2bd340-9d65-4363-2f92-08dd2f2411e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: qvri4j3t2n7nddTaPMn6PZb9VxyMQdQq5JTM3ZsFheVRhssqbRXF/KIHEaAK70daX29B+WNq8K1oaTt2DG/EkLRy6aaGHrzVgyUm1tZ8NlbgGnsUADr9AYt0a5GfmN/KLmFFvdHkFKRq0uVgMPIJFWcswkSqoWJZl6qQvrtWHlGtlXPGFNXXWQpRaHcVP7RpkmMDqjO2PJn229TptSocEFKn/swKAEozfY5AjhAUVIODMNPFHeWJKg6lOq2XgxYKS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zU/zNn3WVjDuBEZmGKQUAlvkvoF9z9gZMAHr91SUF/4VPb4d9H/VOUXLvv/zN6AAvYZpbbnap5MDflSscDbqwT9bYn2zKtghwFRr/uZsm9yTpYM7ihkz3rrYaZwlpPIAIosOzhCBm6ofaDWPR1sskc 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)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: znCn+JRiEemlprdGv132SqNS9j3nB0gCixpzlaOfWTCMCQCB43CWkhS0sBTU6TT0t0a6yeITQBMd8yN+WYza+627v6sJtGfzftD0IbUjZzn8S1d5/M0i4e12mN1RQk9o9px4bSINajdC7kUf35eJbsJB0ZTLhJEMp7XiTVclxCEvufbaefYgCdU3u0lreyP68DfjYVUZiGlmPG7WaOLcI32pv1cXQtOyCjPed3nYSYFd00kGtsprbgU5bnZFfMW//EQpxVZWXX+dc9W6knPcC5DRfhDRJeKMpSQKeog/XnqHe/VhnIQ932FSc/GjS+wvFuc67KNpv4Pk1Pw/4p36Ci+SRT93f6IpqQYa2XRgWf2+2Mzt24Jk8KEiVQo8zRAkbwGYxcL+87gEcBbUy2eoWFp3bGP7KUqTB3H+Qhui7gUF5YuspB8PU/EznX4SZA018336N7tudKuC90c+kDteMLU48gcaUaIaRl39GDogmV60QHzblesGGbTpFe4TLGcTrqg3rz5R7HBxU+pGe7uRTP0xRpUlsizYH1rtwkqWXG2zH+hu6qIUMUIYNFatVCOeu0iRz+DgT+pI8yyfIQJVKZq+r5kQRUpF8aahHpG2yB5wCTfES39MlkuoG7zYwZTdCAvKLQThqKoWxhqW7obX8g/TRK+HYEgj3zT/MAHzFxkQfHU8zxdbn6PBsmzKpkTOLQJxHcWhtuzWLQwWf2aXK7xlCPh18oWUodcwfGJrnXTA4iQD/EJ5etzZFzAp2In0UgZCeUkJnURiI25CnIrfCGK99xRpYDpRsVo1ouHo2Y3sckLmkle49vj6ohqkYxs2RrSIsiOUZL9ZE+3S7SOcdnmjl/1q+G19axScklaWLzJGd+mkbnN9gdFJ8FOLzrIYRnuOPf+Xw+DNeB0sz9/HkgajTEtO9PO+GlpM6/tvig64h8QWOLhBNJJnWUW6ldrADh8/dryc4YkSwuHd13fI+rHR2KXI/F4nO3VAWNuIYhGbNaAaigNQ3Ay2Sd+w/vnbrZzQyRWtzcWjQmQ3QsvoaHjR0WGWP2tjpU95XE8MvwRo6PCQG15MjJLTIm9+nIccWf0AAy7z2jVQnKv/w2T3wuuy+RlvbvreUdAaDA9nNEPkxecUjnh54F6M+ilXAkrQh4nS8J0oHLmnZijAtFyAjR3aGoeSZwy2a7XL+WFVaVm6c4GYXHWW1CLA+/gcVKm148xnRD7ZKtTSLSzkFwm5uSSA7AyP7Wcxug2X8pUGnnJjRvD0BdEIlRUU7MXHJs3V/vpKamQC6XOwU89yQYtd7Qfz5BW9kS9SHrR5zzIA/dKTE+7NItI1hl0r8rZDZor42JGbKm7L9jfefd4Txi8uRWrxjejE8Y7dFMfbeoyuJqjm7p4NG3IL4cpfMku1Yuyt3tGS9/b32oufisjrgBQbYnGA10wTP6fuSE7XotD9lyNSEjfgOQJmIFFS99fMNR5RKBJfu4XRRnZL/Z0C2Ay6Me2LWBLgm0FsFdN8bG4ngaQidoZaTS8H/nup1R1Ig+Wk43woGKFJbpYTnq31cm8xF0yqskTaH+iu9W7qoIN3cNUVvNqhRYLdM5yIaMgRplvZ X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f2bd340-9d65-4363-2f92-08dd2f2411e2 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB5399.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 14:03:32.2965 (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: WJXdlJhSfuFPGzV+lAHFtLro03/teUm5HqkHBZViMw9hCVxOnMtdp+D8NPX3Ouh6FkuUpv/qsNcY/UpRSi+xJg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6544 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. The rescan is repeated until no change is detected anymore. Signed-off-by: Markus Burri --- drivers/input/keyboard/matrix_keypad.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index fdb3499..ddf2672 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -125,6 +125,10 @@ static void matrix_keypad_scan(struct work_struct *work) const unsigned short *keycodes = 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 = read_row_state(keypad); /* de-activate all columns for scanning */ activate_all_cols(keypad, false); @@ -173,6 +177,19 @@ static void matrix_keypad_scan(struct work_struct *work) keypad->scan_pending = false; enable_row_irqs(keypad); } + + /* read new row state and detect if value has changed */ + new_row_state = read_row_state(keypad); + if (init_row_state != new_row_state) { + scoped_guard(spinlock_irq, &keypad->lock) { + if (unlikely(keypad->scan_pending || keypad->stopped)) + return; + disable_row_irqs(keypad); + keypad->scan_pending = true; + schedule_delayed_work(&keypad->work, + msecs_to_jiffies(keypad->debounce_ms)); + } + } } static irqreturn_t matrix_keypad_interrupt(int irq, void *id)