Message ID | 20230323093141.4070840-2-peng.fan@oss.nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2809445wrt; Thu, 23 Mar 2023 02:35:51 -0700 (PDT) X-Google-Smtp-Source: AK7set/0KhNJ/Anxs+Z39fbfCglpxJIbu+5Fxzcy6VJ5hFYXCNCvWDQmda0rohOQu0aKu/DtCh33 X-Received: by 2002:a17:902:ec8c:b0:19d:138b:7c4a with SMTP id x12-20020a170902ec8c00b0019d138b7c4amr7085540plg.3.1679564151643; Thu, 23 Mar 2023 02:35:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679564151; cv=pass; d=google.com; s=arc-20160816; b=mB51llVmLys/O1TDjTKn99yI1kGaIlSD6Mha/cH7SuZMnmOpMS6oekBytnlOuzBZg3 q9cm5kENT+J+DJcfF8CNzo3opx23KKZWR0ZFYhNoLsiVQEkSKNfCTU2UmssCB27Tq3+D 1Bp+Zxkjx+rNFWOJB/eJhwSdkAamM4fj1oplUko/jWjQ4BdlWf7lkvAGbOs4oYvzbuFf TD5NurtblvfW317HTnn27ZPTNywoxeX/u0qewl4fgOA9E0SxCjDO9LgluQCIdZBsAw2i nGMr2r7u/lufcipqgjTksP5rNeNzUnsjtnW4OzMR4E/ky7y1ayh2R9rO+4CBl9BIZ1IE MM0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GNqfyKCgdVd66995CTm9Q6VbVxxWeEAGCFI+VWWSogk=; b=rmpxL3X6w8I/uBZlfkn+mMnIaf7qI+FW95yddsCjkph8MG7mh2nK2BeAFaxyt60gam QhDlGzTHT7uD4IEBwVw1Jiitg1ghtuY+bTTR7EthT573EVPJYUNPykZiJaJjK5ObJOFF nMaV2ATucj6HzOs3L1jcTSG/qSr+6DDYY3hRVtTzRxplTFa7bTF9yf/WYVC0G0xWsRsN GEmozPHHqKhzFFensTU1NYd/Eo+oz3SimDI3Hs9UaHqSTBjUQ7AI9HuU7nh24jhiW+s1 0MhnckgLdMeMOqxMe9iCc03zvTv8Xa7CUo+L6vrzXRXnKbagmJ80gXyDNgUUUOO8ysYf 6c2Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=E7t6JsJ4; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kx7-20020a170902f94700b0019c14335fc0si17074578plb.70.2023.03.23.02.35.39; Thu, 23 Mar 2023 02:35:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=E7t6JsJ4; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231506AbjCWJbB (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Thu, 23 Mar 2023 05:31:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230211AbjCWJad (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 23 Mar 2023 05:30:33 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2049.outbound.protection.outlook.com [40.107.104.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEFCA3B0DC; Thu, 23 Mar 2023 02:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K0QK2GUhFDXulqDnlUGbXx2IaVpcwn7yAdBK6UjgnzgDFqkZwaXqq7CUoCOITKsJASHQKK+OcI8vFzM+ugbmSnQ5R8I5bsRy08sXmzNlr5H9N7icED+rSxxF0PmhhzbbFn1reByhB7359PHGcdatoaZwVIt3F+BXGwFiSEvzJapfD0JduOodO0YVQpQ8xaUzh0zpK+52Qau03L4sljUPiybRh5Y4FyvSWLKuPrz99ZR66bmb9N30984hBHuH0gaQJVZVQRKhNgJZSA+x4qjbbTgXuSFPaaRVBJonkXFyqr4imfgEjPBaD74/kRJK/+WP88jKeCCVhDg74gRBIWS5FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=GNqfyKCgdVd66995CTm9Q6VbVxxWeEAGCFI+VWWSogk=; b=R5mjDh8Ao8pnq6cFlpvUArDLoh92Erm5wcgmd/VfwfzeuCGXUE2Hpn+UYfF4MTD+3ITfP2c+bwMsqXECYKlt9xTqNjCwGNM/b6CLL6aAJvS8VGugM6PWg7mXw/bbneEnWI2as3At48bo1lWGdmamyIxT8AfVOJ58HLauUrcyp3A0vz6pTG9Sd1TooNcOWBIPY+Tx8wbeQvZ11Jc3TDN8jhqf/6O3x99m+jy1yBKZT2MPU1o2SwFpXPiTOlYOFkbkxjyGFPT7EgtnzfsTlmNKznpZ3/WzYP4dtSUeeiSvc/IOYX8FG3ISduD7MA1VnXnLD6mlNMn0ArK8hTj6RpknNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GNqfyKCgdVd66995CTm9Q6VbVxxWeEAGCFI+VWWSogk=; b=E7t6JsJ4/m3GqnEsahMh1S5MONkwSbMMPfUXgSelJdRDG0Y/LOObSadXmbiNxtRoijj+37RniHn219vFt5jGFKt8fhrJ2RLUiQaenGo76hfgfCMzjoq5YhmPQA31KNN4Iz1v0Ew+4m/Vv2Kq7xHZ86LQcLn/at6RkfrG4g7geSk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by AM9PR04MB8603.eurprd04.prod.outlook.com (2603:10a6:20b:43a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Thu, 23 Mar 2023 09:26:43 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::f55a:cf12:da08:6d2a]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::f55a:cf12:da08:6d2a%9]) with mapi id 15.20.6178.038; Thu, 23 Mar 2023 09:26:43 +0000 From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com> To: dmitry.torokhov@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: shawnguo@kernel.org, aisheng.dong@nxp.com, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, Peng Fan <peng.fan@nxp.com> Subject: [PATCH 2/2] input: imx_sc_key: add wakeup support Date: Thu, 23 Mar 2023 17:31:41 +0800 Message-Id: <20230323093141.4070840-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230323093141.4070840-1-peng.fan@oss.nxp.com> References: <20230323093141.4070840-1-peng.fan@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SGXP274CA0020.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::32) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|AM9PR04MB8603:EE_ X-MS-Office365-Filtering-Correlation-Id: d6269582-5155-4955-8302-08db2b80b6fc X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dG5StSBvl+IwP2I6YBRMtZQvToL5qOqQffZNHxMBuSV5jJvYGIF3mRa1eoVBxk703V27rgCrh+UsPLk5VhFsp3LBMoaPDJz9TVWyUy5ReRiWET1xmJHWTUTOx0fOaiJd9LPLlgESd8WODTNSNHJ987rEvR/RMjjGZ6WkpS6luKbVy37RU+7ytJAc2r5yz0iWt4i51Tla9vMTUxaC3wnrXbDooRp29mDuE2gkHmynvsFyRitcNIBm5hiaHJOF6ky0a2ulFv85sg9ZMHnLZEGxyw1hFv/I0Yb2V42Picq+KPbxMcRzVsKaoa9kZMz8dEmyUYMbJGLmEF+h+SvoSRO0MueehPTjcqW4+Cd13eyfXCbktQdagyzkAKu56+kZkaX9CLf8qkpqqu9+X7KMEkcSQMKD4SCl2IAifv07TB2dvKBNqiOsK9MbqZQlNwTWqXbYorS0IkhQ8ZWZpj5IkERv98BR2x0FrX0hk4dxr+VVXUspXa/kplZE9ZfrFnsbShoXbYEF2FKNFHH1Etl+K3XbZhVemsNxFJCEckofTXnxg37qPyCg2SrR2U6FVIlWhTilDV2eRnmIyOZTS7YrAhEPSqYIP1miUzkHrZOsSxby9Yel2axfWTb0EHeVFRjnNnQG8a0GGQopiSXcsRVzhxng4ORqr70hjVnLc+Ya22k7GC/wZmlp4sxtE08BdBR9joGWvFbbNOWgoG8qx02/mvlJiw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(346002)(376002)(136003)(396003)(451199018)(86362001)(38350700002)(38100700002)(2906002)(4744005)(41300700001)(66476007)(8676002)(4326008)(5660300002)(7416002)(8936002)(66556008)(66946007)(2616005)(186003)(6512007)(83380400001)(6506007)(1076003)(478600001)(316002)(26005)(52116002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nXcvYXEciiV8jQqG6sDGFWSMmrl7GpRjtqF1XPffPmXkN4ypdIwjD1Aq5al/qlYA6vZBh2Zo9sTzoOrhGAcQFjbRRme3vOb9bqPGO7892BAQd7kf24FBqOOkbbhepo9iFhetv2WihlVGFMEM4oVs+t2BKDwOhoEEwQVSX+vGOOMWNUo6h5iKkrMFiN+73aJrFEVHJPXqKpoZzAHk6t/kxWx7kh5iTDrgBVHd5FpzmG0WfRYK5b4V6UDtLPVn6Xi7XXd9ScstZ0NWJMjofwOT/c2EPX/vasAoSaSLMVQ15fGjxTF2sosJk5wU3NkA/b3MYLftuRhDNEF/vcWK0SGZNBRr44JMuVv93S5BXeUBRlK7Nva8UZoNxS0pxtnowA6vn5OlVkhDtB8qcsgIsJQnjqANdaZB78eszfZayRpNcVbvua5D67NcTE//5tKYx/YVjrz1baLrSOk9Wj5L/4TFWO7vDhCACSarG3mfdD20GAvXu+fBl3JUzqawTMy3uR7ZjNdLoNS8QtbDu7SFEWaBS5yQjSXQaSF6wASYz8VaHr1LsQm2WkgeyDSTkAdnrWZ2i11dYTNRcb6AhxrzJFdpjbDLIRdnSbUbZaGZS8zHw8s86Ma8+pAfkuFep+1KWvqvUPxYhvFO0e+XkysQG20/zwWWNla4fmCFM/h5ctfNinStLr01npb/Q9+BDU01HqjasBtlJH0dga2+OYquXeNHpMtFRon0G3j0QcyP3VM2mnw0Hg8tqilXXXoyX9svg2NesXmMOn2gyyy2N5rclhKJLz5tE/jSqXVbUHaZXYXWDRD3X8fXlwF6pb9Yuh1zgWwDpb11bcPYtm8Xg9cmC5FVuuSQVzQn8fwQrCYis9jcVH3+rab81OhV/yXll6DJx/1yc8LCChOV/KiMqJsDx3eJPNBqFUZDhEUaWf3zP2vr/FBSS9ft3Ry4SgeQtf0p4yo4TdkAa7A8SKh71hHqrNitkf4gKIFWwlM2MSJRFTRB4uUco7OUEqGAol5BhtqOzjPHEXxdmB498+Tq7rhX+YeuDEaBwfQ9whNv9wuVWWbFPWxfk4+zzg9OXBhcIPC+ubW88ImM40n2P4lyQRcfHVxifoNAyPjyU9W9g/hqOPvjyJwbHfn5eGLwX5Ansz3NPDPMCD19rL8Q3XVv1vJBPjTOi585wwyG3rn/MjBe6FthlCI7p/WLfx8X+5/yt+wTUUo/7e+xr0DRMqM02zfrYEWdr5rgXJscLz7nbmo63a/WmwVu5BmYHGq44mx8nfq8dZohIUNcrmcOLHg/GX2JM/HlJnoNjcZXgl/A+eSUuUCvuokYZ9cJVn3wxO6DISvXP+rEpWStaRP8gP1ZYPNwbERoIdW3M+TxRLA9QsX1lx0lrOz8/40kWDaT6U8iK/CBlvl5zTllXtEaHLfQCbgjOYRxlk+3xJE2cWHptjoMTP4uIfEsGc4YPUMEcu/iYDP7mbr7MeD42e+uUVRatpZOcQ6ryH4Huh/FPhPzSUU0BKskxbwwwohIRHDAjrj4qQnp+RLZWieTEp5TVvc2GB8+vgPMuvRRXkHo3z9o1J4wqNeAcjvFdl+k0Ez28+3cIN2YCeja X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6269582-5155-4955-8302-08db2b80b6fc X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2023 09:26:43.3085 (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: fxDBghMnInHJDvjwHWV6QedlYGzhwH66wbQS91uEF7cagPtmtkPrx1sm30PardpBXXXx0f1HPyI1dF9uYzbayQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8603 X-Spam-Status: No, score=-0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761150659638035891?= X-GMAIL-MSGID: =?utf-8?q?1761150659638035891?= |
Series |
[1/2] dt-bindings: input: fsl,scu-key: add wakeup-source property
|
|
Commit Message
Peng Fan (OSS)
March 23, 2023, 9:31 a.m. UTC
From: Peng Fan <peng.fan@nxp.com> Add support for waking up from system wide suspend. Signed-off-by: Peng Fan <peng.fan@nxp.com> --- drivers/input/keyboard/imx_sc_key.c | 2 ++ 1 file changed, 2 insertions(+)
Comments
On Thu, Mar 23, 2023 at 05:31:41PM +0800, Peng Fan (OSS) wrote: > From: Peng Fan <peng.fan@nxp.com> > > Add support for waking up from system wide suspend. > > Signed-off-by: Peng Fan <peng.fan@nxp.com> > --- > drivers/input/keyboard/imx_sc_key.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/input/keyboard/imx_sc_key.c b/drivers/input/keyboard/imx_sc_key.c > index d18839f1f4f6..234f23cf9990 100644 > --- a/drivers/input/keyboard/imx_sc_key.c > +++ b/drivers/input/keyboard/imx_sc_key.c > @@ -151,6 +151,8 @@ static int imx_sc_key_probe(struct platform_device *pdev) > priv->input = input; > platform_set_drvdata(pdev, priv); > > + device_init_wakeup(&pdev->dev, device_property_read_bool(&pdev->dev, "wakeup-source")); > + I wonder - could we move this to the device core? > error = imx_scu_irq_group_enable(SC_IRQ_GROUP_WAKE, SC_IRQ_BUTTON, > true); > if (error) { > -- > 2.37.1 > Thanks.
> Subject: Re: [PATCH 2/2] input: imx_sc_key: add wakeup support > > On Thu, Mar 23, 2023 at 05:31:41PM +0800, Peng Fan (OSS) wrote: > > From: Peng Fan <peng.fan@nxp.com> > > > > Add support for waking up from system wide suspend. > > > > Signed-off-by: Peng Fan <peng.fan@nxp.com> > > --- > > drivers/input/keyboard/imx_sc_key.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/input/keyboard/imx_sc_key.c > b/drivers/input/keyboard/imx_sc_key.c > > index d18839f1f4f6..234f23cf9990 100644 > > --- a/drivers/input/keyboard/imx_sc_key.c > > +++ b/drivers/input/keyboard/imx_sc_key.c > > @@ -151,6 +151,8 @@ static int imx_sc_key_probe(struct > platform_device *pdev) > > priv->input = input; > > platform_set_drvdata(pdev, priv); > > > > + device_init_wakeup(&pdev->dev, > device_property_read_bool(&pdev->dev, "wakeup-source")); > > + > > I wonder - could we move this to the device core? I see lots device drivers parse wakeup-source, so I also follow That. Not sure whether could move this feature to device core, but anyway I could give a try. Thanks, Peng. > > > error = imx_scu_irq_group_enable(SC_IRQ_GROUP_WAKE, > SC_IRQ_BUTTON, > > true); > > if (error) { > > -- > > 2.37.1 > > > > Thanks. > > -- > Dmitry
+Ulf > Subject: RE: [PATCH 2/2] input: imx_sc_key: add wakeup support > > > Subject: Re: [PATCH 2/2] input: imx_sc_key: add wakeup support > > > > On Thu, Mar 23, 2023 at 05:31:41PM +0800, Peng Fan (OSS) wrote: > > > From: Peng Fan <peng.fan@nxp.com> > > > > > > Add support for waking up from system wide suspend. > > > > > > Signed-off-by: Peng Fan <peng.fan@nxp.com> > > > --- > > > drivers/input/keyboard/imx_sc_key.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/drivers/input/keyboard/imx_sc_key.c > > b/drivers/input/keyboard/imx_sc_key.c > > > index d18839f1f4f6..234f23cf9990 100644 > > > --- a/drivers/input/keyboard/imx_sc_key.c > > > +++ b/drivers/input/keyboard/imx_sc_key.c > > > @@ -151,6 +151,8 @@ static int imx_sc_key_probe(struct > > platform_device *pdev) > > > priv->input = input; > > > platform_set_drvdata(pdev, priv); > > > > > > + device_init_wakeup(&pdev->dev, > > device_property_read_bool(&pdev->dev, "wakeup-source")); > > > + > > > > I wonder - could we move this to the device core? > > I see lots device drivers parse wakeup-source, so I also follow That. Not sure > whether could move this feature to device core, but anyway I could give a > try. Do you think it is feasible to move device_init_wakeup into device core part? Thanks, Peng. > > Thanks, > Peng. > > > > > error = imx_scu_irq_group_enable(SC_IRQ_GROUP_WAKE, > > SC_IRQ_BUTTON, > > > true); > > > if (error) { > > > -- > > > 2.37.1 > > > > > > > Thanks. > > > > -- > > Dmitry
On Wed, 12 Apr 2023 at 17:58, Peng Fan <peng.fan@nxp.com> wrote: > > +Ulf > > > Subject: RE: [PATCH 2/2] input: imx_sc_key: add wakeup support > > > > > Subject: Re: [PATCH 2/2] input: imx_sc_key: add wakeup support > > > > > > On Thu, Mar 23, 2023 at 05:31:41PM +0800, Peng Fan (OSS) wrote: > > > > From: Peng Fan <peng.fan@nxp.com> > > > > > > > > Add support for waking up from system wide suspend. > > > > > > > > Signed-off-by: Peng Fan <peng.fan@nxp.com> > > > > --- > > > > drivers/input/keyboard/imx_sc_key.c | 2 ++ > > > > 1 file changed, 2 insertions(+) > > > > > > > > diff --git a/drivers/input/keyboard/imx_sc_key.c > > > b/drivers/input/keyboard/imx_sc_key.c > > > > index d18839f1f4f6..234f23cf9990 100644 > > > > --- a/drivers/input/keyboard/imx_sc_key.c > > > > +++ b/drivers/input/keyboard/imx_sc_key.c > > > > @@ -151,6 +151,8 @@ static int imx_sc_key_probe(struct > > > platform_device *pdev) > > > > priv->input = input; > > > > platform_set_drvdata(pdev, priv); > > > > > > > > + device_init_wakeup(&pdev->dev, > > > device_property_read_bool(&pdev->dev, "wakeup-source")); > > > > + > > > > > > I wonder - could we move this to the device core? > > > > I see lots device drivers parse wakeup-source, so I also follow That. Not sure > > whether could move this feature to device core, but anyway I could give a > > try. > > Do you think it is feasible to move device_init_wakeup into device core > part? Not sure it would really improve things that much. Subsystems/drivers need to make additional configurations based upon whether this DT property is set anyway. Perhaps an option is to make this a part of the common input subsystem helper functions instead? Other subsystems do this, but I am not sure how feasible that would be in the input case. Kind regards Uffe
Dmitry,Ulf On 4/18/2023 4:32 PM, Ulf Hansson wrote: > On Wed, 12 Apr 2023 at 17:58, Peng Fan <peng.fan@nxp.com> wrote: >> >> +Ulf >> >>> Subject: RE: [PATCH 2/2] input: imx_sc_key: add wakeup support >>> >>>> Subject: Re: [PATCH 2/2] input: imx_sc_key: add wakeup support >>>> >>>> On Thu, Mar 23, 2023 at 05:31:41PM +0800, Peng Fan (OSS) wrote: >>>>> From: Peng Fan <peng.fan@nxp.com> >>>>> >>>>> Add support for waking up from system wide suspend. >>>>> >>>>> Signed-off-by: Peng Fan <peng.fan@nxp.com> >>>>> --- >>>>> drivers/input/keyboard/imx_sc_key.c | 2 ++ >>>>> 1 file changed, 2 insertions(+) >>>>> >>>>> diff --git a/drivers/input/keyboard/imx_sc_key.c >>>> b/drivers/input/keyboard/imx_sc_key.c >>>>> index d18839f1f4f6..234f23cf9990 100644 >>>>> --- a/drivers/input/keyboard/imx_sc_key.c >>>>> +++ b/drivers/input/keyboard/imx_sc_key.c >>>>> @@ -151,6 +151,8 @@ static int imx_sc_key_probe(struct >>>> platform_device *pdev) >>>>> priv->input = input; >>>>> platform_set_drvdata(pdev, priv); >>>>> >>>>> + device_init_wakeup(&pdev->dev, >>>> device_property_read_bool(&pdev->dev, "wakeup-source")); >>>>> + >>>> >>>> I wonder - could we move this to the device core? >>> >>> I see lots device drivers parse wakeup-source, so I also follow That. Not sure >>> whether could move this feature to device core, but anyway I could give a >>> try. >> >> Do you think it is feasible to move device_init_wakeup into device core >> part? > > Not sure it would really improve things that much. Subsystems/drivers > need to make additional configurations based upon whether this DT > property is set anyway. > > Perhaps an option is to make this a part of the common input subsystem > helper functions instead? Other subsystems do this, but I am not sure > how feasible that would be in the input case. How do you think of below patch? diff --git a/drivers/input/input.c b/drivers/input/input.c index 37e876d45eb9..a98a9f37e1f5 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -2402,6 +2402,10 @@ int input_register_device(struct input_dev *dev) __func__, dev_name(&dev->dev)); devres_add(dev->dev.parent, devres); } + + if (device_property_read_bool(input->dev.parent, "wakeup-source")) + device_init_wakeup(&pdev->dev, true); + return 0; err_device_del: Thanks, Peng. > > Kind regards > Uffe
On Thu, 20 Apr 2023 at 09:54, Peng Fan <peng.fan@oss.nxp.com> wrote: > > Dmitry,Ulf > > On 4/18/2023 4:32 PM, Ulf Hansson wrote: > > On Wed, 12 Apr 2023 at 17:58, Peng Fan <peng.fan@nxp.com> wrote: > >> > >> +Ulf > >> > >>> Subject: RE: [PATCH 2/2] input: imx_sc_key: add wakeup support > >>> > >>>> Subject: Re: [PATCH 2/2] input: imx_sc_key: add wakeup support > >>>> > >>>> On Thu, Mar 23, 2023 at 05:31:41PM +0800, Peng Fan (OSS) wrote: > >>>>> From: Peng Fan <peng.fan@nxp.com> > >>>>> > >>>>> Add support for waking up from system wide suspend. > >>>>> > >>>>> Signed-off-by: Peng Fan <peng.fan@nxp.com> > >>>>> --- > >>>>> drivers/input/keyboard/imx_sc_key.c | 2 ++ > >>>>> 1 file changed, 2 insertions(+) > >>>>> > >>>>> diff --git a/drivers/input/keyboard/imx_sc_key.c > >>>> b/drivers/input/keyboard/imx_sc_key.c > >>>>> index d18839f1f4f6..234f23cf9990 100644 > >>>>> --- a/drivers/input/keyboard/imx_sc_key.c > >>>>> +++ b/drivers/input/keyboard/imx_sc_key.c > >>>>> @@ -151,6 +151,8 @@ static int imx_sc_key_probe(struct > >>>> platform_device *pdev) > >>>>> priv->input = input; > >>>>> platform_set_drvdata(pdev, priv); > >>>>> > >>>>> + device_init_wakeup(&pdev->dev, > >>>> device_property_read_bool(&pdev->dev, "wakeup-source")); > >>>>> + > >>>> > >>>> I wonder - could we move this to the device core? > >>> > >>> I see lots device drivers parse wakeup-source, so I also follow That. Not sure > >>> whether could move this feature to device core, but anyway I could give a > >>> try. > >> > >> Do you think it is feasible to move device_init_wakeup into device core > >> part? > > > > Not sure it would really improve things that much. Subsystems/drivers > > need to make additional configurations based upon whether this DT > > property is set anyway. > > > > Perhaps an option is to make this a part of the common input subsystem > > helper functions instead? Other subsystems do this, but I am not sure > > how feasible that would be in the input case. > > How do you think of below patch? Seems reasonable to me, but I can't really tell if this makes sense for all input drivers. Dmitry? > > diff --git a/drivers/input/input.c b/drivers/input/input.c > index 37e876d45eb9..a98a9f37e1f5 100644 > --- a/drivers/input/input.c > +++ b/drivers/input/input.c > @@ -2402,6 +2402,10 @@ int input_register_device(struct input_dev *dev) > __func__, dev_name(&dev->dev)); > devres_add(dev->dev.parent, devres); > } > + > + if (device_property_read_bool(input->dev.parent, "wakeup-source")) > + device_init_wakeup(&pdev->dev, true); > + > return 0; > > err_device_del: > Kind regards Uffe
diff --git a/drivers/input/keyboard/imx_sc_key.c b/drivers/input/keyboard/imx_sc_key.c index d18839f1f4f6..234f23cf9990 100644 --- a/drivers/input/keyboard/imx_sc_key.c +++ b/drivers/input/keyboard/imx_sc_key.c @@ -151,6 +151,8 @@ static int imx_sc_key_probe(struct platform_device *pdev) priv->input = input; platform_set_drvdata(pdev, priv); + device_init_wakeup(&pdev->dev, device_property_read_bool(&pdev->dev, "wakeup-source")); + error = imx_scu_irq_group_enable(SC_IRQ_GROUP_WAKE, SC_IRQ_BUTTON, true); if (error) {