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: 13737380 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010040.outbound.protection.outlook.com [52.101.69.40]) (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 2A48C2F34; Fri, 19 Jul 2024 15:23:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721402601; cv=fail; b=ka96mvqaphid9VtFwVvjMEiOKWktj8H6pvsxL33j4Ve10tP8KHLnbfNygCq8xValEnq0LgWWI6xqZBlgNeSsCEyh2Ef6noq/+OjPRYeMaAfpKfh/op3at6hs3PPD3H76vUCaxr9a+JM9HeKK50vNXYc9ptL+iODY5HBa6n2WbvM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721402601; c=relaxed/simple; bh=yaSkYmULS9NfsYLN4ZAoO3dBfu7AXIudyy/4XfC5RNA=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=KXaTH14MC+BqOZu9I/LqUXF35u9wPYqE0wnN6Dv0YlYPFnkvoYgSs+O3NYWp/4eezJ6AMtbAGUEdHBRK6K03Gl9mN5E82hFT6bdHR0EyM545+fwYSRFVk0Igiy0YQejJ+EX4ffWVFMkAI+QTNsAomDHo/9trxiRI0o5GduBv9No= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=KD4E9Lau; arc=fail smtp.client-ip=52.101.69.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="KD4E9Lau" 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) 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: 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)(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fqJ64K6bJDKCYQ/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 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) {