From patchwork Fri Jul 19 15:22:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13737383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80B14C3DA59 for ; Fri, 19 Jul 2024 15:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=WqRlvxjPo10/PKom4QdM1Ycywdzatx/Q2b1NA4cCbLE=; b=0wOpSYu1ZZupHea0sbtgyhtCzg t3aHi6VFBC/bsoQ7AaRbufMzdPGL4rZlAH6gJnkxBIbXWFHrPdKGRvNzb/rJ7WLaJW9F/IS8U895m d5xLQ701q0x+DwIiUu44NctwtCcI18/qfv4tdYlhiOZjjFST1/qims3nqwsGoZPTrpfIqVPbOXKWQ 7ylW2T0XLKQP2D6IhSnpjT3wE0muN2+B4OlHALxHsQoq3FfqgLyrbWsrR2+Rqg4NZWVBWJhnpsx1M jE4OcfFV6jcMbyD7jxR4j7CBF0Z1UjIWOzTFqvOz0ERkg5j09i9nf8VqsDK/yJqs1CZwruY78xEMO aeexP1Dw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUpSU-000000034lV-0lb1; Fri, 19 Jul 2024 15:23:46 +0000 Received: from mail-northeuropeazlp170120003.outbound.protection.outlook.com ([2a01:111:f403:c200::3] helo=DU2PR03CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUpS7-000000034gz-2HAk for linux-arm-kernel@lists.infradead.org; Fri, 19 Jul 2024 15:23:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hdoCGZ8u+gaqV/0VjIBZQSJFQI/VYUSpgTiWTxkCU3+KBxpK7f4O7PNUE25cEPCKx2BEIADvzmGQMwygNwoeB32yV0DfNCfjkb/2W1mBFLBG2aIGcsk1QOAh2V/n3kig0JwOptCxaSdtEfVfFX5hz6R9AWPsAjAu7E9S7CZDh8ymPQ3CgaUupJI6QAHolhc8TeT7JNsobcYcx+JoYtHkYNS5zgRCkupdrU6mDL31xADJEAoH06EsJwsbQDnn2bT8ZKDy17OMXQVBSfu7dflIp3KG2SHXiS4UtmxDvQytgRM6sBOvrvebjgMbu3x3mOVjxPRkHFXx1qWNmZPWsLmMaw== 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=WqRlvxjPo10/PKom4QdM1Ycywdzatx/Q2b1NA4cCbLE=; b=QhkILBTIdbcOu+OyY69jA8X3VvOcISi9caRMKPcBAOSUaURKn9Qy413LRFISmuex60tLFEHzSQrM0zFF3gRnH9D6GlCAj1JE7iwGu/R9y20l7hxa5YEBAO4QNU+YHY0NKNvfDTP54Kg+wRdNAMCh8iSDIIGYK+cOejaJEyRaeKWltWUSSGpzXxZVgSsdpMAHgx/KH3YbsjCI5iUXiLQtuVFI2lwDgrq1mCJpa8SUb6tI7h04I9TL4VMvD03L64NxWiEfCmnrRLZbOPIcD2gnOfFrXE82tP8JCrmzUazhXrOLTQZ5Ov9h2KT/sMjHUvqSClg6a2VSkfy6EmPixSZGqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WqRlvxjPo10/PKom4QdM1Ycywdzatx/Q2b1NA4cCbLE=; b=KD4E9LauA7iL9GHY1rTbk67RSyGuedJ1Ff/ekfetuomS2ot7YTT5XLyfexCil3RN5ZHzCLlN+XXZmYU2D9Sn/NIU1GB56EDdcZJECqte1siUnilB5nrF6Rr9KEJDo2qdGC8fhJLx5xmjzNhDgZZEq6K2NvrsL89k2QNzv4c2NKs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by AM0PR04MB6770.eurprd04.prod.outlook.com (2603:10a6:208:187::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.18; Fri, 19 Jul 2024 15:23:15 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%5]) with mapi id 15.20.7784.017; Fri, 19 Jul 2024 15:23:15 +0000 From: Frank Li To: Dmitry Torokhov , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Nitin Garg , Abel Vesa , linux-input@vger.kernel.org (open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...), imx@lists.linux.dev (open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE), linux-kernel@vger.kernel.org (open list) Cc: imx@lists.linux.dev Subject: [PATCH v2 1/1] input: imx_sc_key: Enable wakeup according to dts property wakeup-source Date: Fri, 19 Jul 2024 11:22:58 -0400 Message-Id: <20240719152259.760457-1-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: BY5PR03CA0029.namprd03.prod.outlook.com (2603:10b6:a03:1e0::39) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AM0PR04MB6770:EE_ X-MS-Office365-Filtering-Correlation-Id: ac9755a0-f1b8-42ca-88d0-08dca806b5ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|52116014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: /X6aWee9ua5KEGMC8JCi/gzq6b4+PSP8Ca9HwxnR1HAIT/iZtLzXWPuVlq/JfPGh/EYGQtn/1FOA6+g8nZdPHbGcYcJhussbgq6kqR4o0/sIdaRnTVMOCSDInz2myGfSbiuKojfF/Tb5A0zkJibojDJchyhhqKArz4Ht0QLxLa1NDKVUdHbjYFwbVBX6Ht7BT73BG/6awcgCYnkI2CmSrZ86LUSROB3/wiDh1xw5qflOCJuCG3iqIaxYawXkoO83nXNnBQQqFK5kCQLY/hHl+A86Aq4+mW6CHzCuy+Scc8I4+i69RnTOOQ7VD0MRtkCq+89W2PGmQAdpI4OoEtHgv56CW41lXXVuPikGbIsKYn0kEOGML9Ajxe96/DewtLZYaC9CQb1G61di5/yZqRTWEnJxlBZsiCIl7DBigvMl0/UvjRmO2Y9SS8weZZOlNm2blAjpNtJAZ0lZeEaQj06AHw9oM7FRdpIhv5r0HpZhxWSR0e8pcUacFBW1gCHxfE7SjHTq8/HVHRnsNj3Jg4pKTYfPwhhx/JLECQKANHiITDnRDxlkQrOFy90IUquD+PeWxnsDPgXNLD9wCU08HM2mhuGYdFpmFt9BHIEEtZMnlNNfxPqAPewp8G9U2akdYFXPWl3NU7MQviq0Qo155nm+60kgpvkW9vPI/d9m5e4htuxbwEWyeoK3kBJGtXPl0LGa/a7ojitOU6Aa0Jwgr5FWmK1sxcMcsZxOsFKm/mYVoH2mTeUUbymYjxKFnD7jLi2ypcr2DrGke4UXuzLUffMXXTHe1lw6kIVi0QnYyLrEX7jqMV2HBhF5z9ZalMZJr5VQLzjXV4qDdD+fPqBArOV/KMrXcqnF+s4hVjiTYFDXfVq9r+Y5fp+7wL3d37/Yz9YKNY5xy5hom/Rqb9I3gspaI7/sJSZXMVOtxpWFySHFLytn0MKb/pyErfPvdU2JTysf8OOt0JtY2ycnx42fDxEpyACNx8XLbBmHiEj9X9Q3VnssL39G2yttH9XlFV0o5iinHjkEx4Nqe8DHhCEB6cQ6yceomEQ9iHMLnUOW52yDTaxbOljMeDdkiXAedeMygU4+8DfnRvLz0WBdx75MYYnNT2SDBElr8scKY6oTj437trwJQK52be50QNDVlEPldInCVLVARR5IvhzQ/W3/XygulC65kK/a0XSij6+l/lNfx15ElE+M1hcH5AxWp5f1BC1OjZxDv/kepVctrlLPJaJCoZ1zYqe15AeKc3ienPE7U4bwTylpncZcNiTzQay/ZoBYaAywt8DC4evSqloePdr33rx7+Ee2QFypjXWP9VB3bpv1J1PLc0n/KysNPlpYRgejFf6zE5mxABeZAq4TFeVYpZPrm9xwA8mzSEIoDaYj7cITMhZWbz4cmBQLNcPhGF+03teyuM5YBiP61uICEbiqh3YgRqpW4QpwRgr2zGr8UNo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(52116014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 40r9pG6R2EVbKqcnQSU3Ps2wgCSyRrk2SD5eNnrihV3XPRm22y1V3Pdb/5elQLe00rMOccuj1CBr8fjhl3GlBQuXQ/iBEOFWUBRONmMV7M2fj75LBSqIgmsaI0RRpYjxGaQUfIgQofSzLUimQVFPkOLyeGlL2gjT6ZyFmmH4KVmneEaLTrSJ3DXICLv2ZaJ3NWjEgJV41+GPhizNVA6PhahLOPMx2a0qZiqMdsl6GKr+eLXU0AHXytj3KIFTidxCtZdS9lrrDG4zPwHt/DP58XFDVH7T8pjuBPiSanpw4/JVwjBOccyAXUwDlSPauonTtqM7lrpyQpeJy9msuDC49uvnJpIzvrPf6yxm9h3R2NqFaANIn36jFpqAw6oZoRZOp0p1tIdC7SMeR3pBEJqnPEArY+SJmonUD3ofV/9K9rdYzh5hTSlhx0aYXy3WhHzFAwvgqsWsQcixaE4bqRMuerb/Dv2TESKouEzSXXEJ5oJXRvHeow2fY0d3m4L0j6m8dCKEjY0RAS1DUuGqNyRUnJPUWL+xWiErmayf3fCybjMxrkF0Fig02xE03XOaELpP89BOJcllFVaDnzK/2pGyz35CIIZ+WEgx04QcdfslLLzORKZLGOyr+nVhGLgAeNTqofzgZvWsOLJO8tELafLl7gRw0qCN0DrGSVvIuF/tlK3xTUQ2+Q/eKD+zy9eNyM+dsr0oEhxreDCOzemjsFiPWJqh7l7SGnZZoQFkLpu3Id85uRE8ZjoaQ2VDPsMJSnoQfZGmhOSZo6rbg2Bb6+xtEmJGIBZuHjAEgVWWRrCw5N6qcBA0mDXAlJBf9BgkBDcaEzTiV9THs8z1cGyzbJg7izF3pDj4HO6SPb5jDpTKJXlxxXyjsWQATR4VeYrKsHxBu2pl5gtbuBOLbltXDKzZAZuYPHdeNcIFUzT/Pcxq2HmpQELqxqWb48cpOrwELwdqDLRswkBU7TeY8lzFxe0c/Up83rsfqJ64K6bJDKCYQ/lE2SvpU3mdHk4DH3m3afDEW0bdNUSjJbk1xVyl1it5DDJhYENdV8Kjod9YgqrneHtYGbUUndBtSgkNkAVrk14WQsvARpgXA/MEvE1BZbMesMWmA/c0+SwHyieOoHO7/3vdPjcs+CeqUX1U0kEvuIz/C+2OXkSiuJluF/Ta48qDZFSL+cqx6bBHGW4YQfstkzHpydElIsskgsXP7AvBvIig+kfFHtbmZO7FTvka1pZxouUkyhRSCHSldNNakhiAbCWapXVedcyu4hEmLxlj/NPYddTTIoBnXdl5YxBTnkGgFYxT8Hfs4+bXqzGNGUTX7evzyrNL8NyeqUg2ul4/xZsiwCeXRSXOjZg+0gw7pUdTfUXGywdvJP8QS96SZktK8KMc9z5ZSJijzleY4J3/iHIlPnt25Lw0PXFl/xKPfjWC+TqWWrMVbQovkYCp8fEnrz01/OBjDJV0oAvnvAD5YkpvwahN434Upmg8tVFlISqU6BikF2jQvWOstmQiF55w8bEl5CrGBpOf5vZb0GPR/vPEHL13a9PsweVmDQjdPAVASfd1RCj9H5XIwTlLVhzWG00bPLx04hch26LWSD9AiyDQ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac9755a0-f1b8-42ca-88d0-08dca806b5ed X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2024 15:23:15.7886 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: heiXoS3lIpNGzXplfTPUWrFREQgEwI3NykVldi6l7YpVsZ5q/5xUOecAiYHe8ub+sywZcsN8RB8CyrhXE9DUMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6770 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240719_082323_607730_A48852CE X-CRM114-Status: GOOD ( 12.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Abel Vesa Enable default wakeup according to dts property 'wakeup-source'. Signed-off-by: Abel Vesa Reviewed-by: Nitin Garg Signed-off-by: Frank Li --- Change from v1 to v2 - change int to bool - move of_property_read_bool() just before device_init_wakeup() - drop !! --- drivers/input/keyboard/imx_sc_key.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/input/keyboard/imx_sc_key.c b/drivers/input/keyboard/imx_sc_key.c index d18839f1f4f60..fc1492088b645 100644 --- a/drivers/input/keyboard/imx_sc_key.c +++ b/drivers/input/keyboard/imx_sc_key.c @@ -110,8 +110,10 @@ static void imx_sc_key_action(void *data) static int imx_sc_key_probe(struct platform_device *pdev) { + struct device_node *np = pdev->dev.of_node; struct imx_key_drv_data *priv; struct input_dev *input; + bool wakeup; int error; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); @@ -151,6 +153,9 @@ static int imx_sc_key_probe(struct platform_device *pdev) priv->input = input; platform_set_drvdata(pdev, priv); + wakeup = of_property_read_bool(np, "wakeup-source"); + device_init_wakeup(&pdev->dev, wakeup); + error = imx_scu_irq_group_enable(SC_IRQ_GROUP_WAKE, SC_IRQ_BUTTON, true); if (error) {