Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp301460rwi; Wed, 26 Oct 2022 00:45:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NXnnu8Zr6h1HPlBjBeWT1ftbMHRNdV9Ag/QczjYHOVH609B32cjirLU9dndstj8gAH2sE X-Received: by 2002:a17:907:7251:b0:7a5:a8f5:b86e with SMTP id ds17-20020a170907725100b007a5a8f5b86emr14981585ejc.761.1666770319466; Wed, 26 Oct 2022 00:45:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666770319; cv=pass; d=google.com; s=arc-20160816; b=Swm6fqreLZ/z7vQ9+YqPFm0sjr1wDX3DfnOWGFt5kDrHsD4Aymvqb9tLA2i5AQPm4c W5tzAExn6eFq1ymPzRkzIrlNPbsrhQAtH1SOFujmTEkHdXMFSgBsDmceVAAXxB0I7xZR ztPIlW2LOAUtnt+GDAvFV0Aqs+wdgg6UZwo09URrf+PKYbHcj1S0Fjpv2WunU1pOTLU3 ojS9/cUYGNARUs78a6azibIv88QoDfmDq+j8yXjhwT7fM7IKlh+b6aoKOlPe8aQevimt 0soIz4w6zULk1W+P368bxbjf4VhmQzlLHd5HcPo0Pb3lpb/+CxG6UIgLCI99nrvOp71h RXeg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CURNi133/YCRMXdiHCI7veFYzUvVu/5i8InKrVl5XFE=; b=SX1eX/NWDwrcXi0o+eNxAeaU4LVII59yPiyjgnTy0GtAM/meLTDMzTxTG6BYs5eLK2 dvjje37YjuDec116tqmlsk6DSvlH6lF9LsiLns0dTVxAcUWt0bbRNBsfsjja43d69981 DmoJLiNA9rTBE9WcKLWepFFCBdqO0Sr8DkwRhaVpcijtZsqvdNrpWzJGEwzgZg8SGx0g //4ZcWuzaoUaAVBo76EtudiW7OaPwhomPx4R6JuYfKPaga2jvqo0qTW8xaAOMszvBXyj 4bPHkJh7KBYd4t/OZhGdRyNFlKn7zwnc7qaPs8fu5Qe60KYUTbB9DNhgiQ9oU0Rx/nmO 6bXw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=QhA1NhPw; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=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=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z13-20020a056402274d00b0045cfa0b1f46si6260692edd.11.2022.10.26.00.44.54; Wed, 26 Oct 2022 00:45:19 -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=@nxp.com header.s=selector2 header.b=QhA1NhPw; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=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=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233192AbiJZHfc (ORCPT + 99 others); Wed, 26 Oct 2022 03:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233150AbiJZHf3 (ORCPT ); Wed, 26 Oct 2022 03:35:29 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2048.outbound.protection.outlook.com [40.107.105.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC9172B190; Wed, 26 Oct 2022 00:35:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AxK/FvGuINc/9dCzLB2y/hA8Q5fFr8VDWA1Ip3Sm3fJ9h/dnzYbvWpTh1C46GYvCpkUEf5l1+7vcS81STyyt9YyE0R07hO+zEM0qOBVgvxgX42tLItyDlISBwa5dSECErBJVUMURRayIFt9P3hBB11A5rnZCH7TRAtCe4qGJTb5UVDy6/9624I6xE+HM+voODtMxllqTV8WxKQECv1qYVJwjk/1i1bktSTdHvz2X34LBvTati5gfmqHJpKphxXhgihDcVno34TQ7C0bwXvBqOmnH44RZRvmCEORrzU3lsmOwIyqwZbpPHBCq73MmizrcW/iR0Pz0sNAp4tFL7ObpTA== 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=CURNi133/YCRMXdiHCI7veFYzUvVu/5i8InKrVl5XFE=; b=EPUtQghFat79XJY+OhZwI3RnFO31/OkTksQT6csiHRhHG5TD9Xp0cclrEnJrJDVO51CerRlJBVRxgOpERxo3ftHGMdwkrCmrl+xN14d/DUrKPXTpJZCDn+f4BBP5VrA8PNyZGSFvMRGKtvY/qSnx3UEYJjCBPwgYCR2RRtOThAzj/Ep+vCHSX7KlaFYhaTKOvHtHg6S1olFTK0yfD8LxknmZlEZJR4VzQJKFk30130bT4WoNw5E368o8PI3TnTDFnHAZdraIxnTW57TIgUu8RSDtsk3Ca9vHPnbhB2cwSgtFlQnjnimLxqv82VnhX2OkOB0sP4e1lIa+5f/YcDBfPQ== 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=CURNi133/YCRMXdiHCI7veFYzUvVu/5i8InKrVl5XFE=; b=QhA1NhPwMcdPp1n3cAjMFhozsNymyGzURRWPJYEAcgtk8yCz/FCLZWfjbvyJ0y9rJ9P2uBbTLmGCvhBfszoe4LsdEGUbY2NIEb85f3WLb2E370AywQWztqpq+LCoXUsefAq7m8WWSXGLrRxe31lm8gTHMbjJvtCbBiTlhp/ieNY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by AM8PR04MB7409.eurprd04.prod.outlook.com (2603:10a6:20b:1c5::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Wed, 26 Oct 2022 07:35:26 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::1587:379:da06:2f18]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::1587:379:da06:2f18%5]) with mapi id 15.20.5746.028; Wed, 26 Oct 2022 07:35:26 +0000 Date: Wed, 26 Oct 2022 16:21:39 +0800 From: Peng Fan To: Shenwei Wang Cc: Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Linus Walleij , Bartosz Golaszewski , Dong Aisheng , Jacky Bai , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: Re: [PATCH v3 4/5] pinctrl: freescale: add pad wakeup config Message-ID: <20221026082139.GB18160@linux-1xn6> References: <20221025183244.615318-1-shenwei.wang@nxp.com> <20221025183244.615318-5-shenwei.wang@nxp.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221025183244.615318-5-shenwei.wang@nxp.com> X-ClientProxiedBy: SI2PR01CA0007.apcprd01.prod.exchangelabs.com (2603:1096:4:191::11) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|AM8PR04MB7409:EE_ X-MS-Office365-Filtering-Correlation-Id: e7bf4b77-fc25-445b-4453-08dab724a64c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rsNxmMdaw4PM/wM4p/EnLwimnirzJjgqY1z9UEF6rhOBXtC/MZG2QDTTltonhyiA4uHTU81EAXVU9BcQ6zSDo8Ic28sG608yzzJZA8qWj7deAikj90LctiYHb7AJ5kANA4COSms/3Ssag2J841FRrF7UOjnNNjFKzkd0zc1tyIzHPmpm4AK8bTNRl7I7WuCGbm5GQMaqynvbu+K3shzFdYSVcdvTNeceDehZ5Ra86QXozCZUEPDoE88eUrqe8/qK++dA7g1SOd3xp92Pk5VVkk98//HdBA+1bdUWLmhBwvcC9ZPHTywy/rNe8PgN+lOOpsidPIqyOgfQ+pmQz4cuB4MBs++TpPIlRRTshyec7MuNWwy4aLDY9a7fzstKDLMR6mTbshGUpDp3ah6Hrdklf6WSgHEMG7atb8aJBVaSRWEksSE9v1u12tzXgOCntjYb1KVh/EggM51Jz/AkoCjW7TK8FoYuE7AoqOS8urNbHR+mUYOZzBY6/oVhHQH7xaFybbrnqxy8QyNIAz4U2HvsShD+UZAbzYDXW5awvV0I/vgocB1S0t+DtOxJqj7xNhaq/Zm9EPdVaE61wBTrHYBYywJMbKnI3z24psNumlN+zug9HTfxmCvi7wBYHuj9g1j1YXByWYbujz5MaSfG/QSJXO9kicz5hJc6Vov2Pgai/uU4pzvR87zNpgoL3/R8TZgOrO0cmAlG7QlI1IWRQo+5tKMaR0xk2Kv78w3+D1zCBTHhmlKL0TlKbJVL/r52azLMCdfBBA/ZQBqyxAIC0I91bQ== 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:(13230022)(7916004)(4636009)(396003)(366004)(346002)(39860400002)(376002)(136003)(451199015)(316002)(6512007)(6862004)(52116002)(9686003)(54906003)(44832011)(8676002)(7416002)(33656002)(6636002)(66476007)(41300700001)(4326008)(86362001)(26005)(66946007)(66556008)(2906002)(8936002)(186003)(5660300002)(478600001)(6666004)(6486002)(1076003)(6506007)(33716001)(38100700002)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?cYM7ZcQvqBt/229D7CCUHEGyYOijAHoLV3wQxLdLpvjr355UVUTlVDnFw/eZ?= =?us-ascii?Q?mG+3kT76rgucOuV2d6psf15xj8tjksDwXIYegl6du7rgKqqH+W8iLn0IL5zP?= =?us-ascii?Q?8WF8aRhW5VMXpglqT01ZKCTlM1MClsMY3cydA2+cA6dkogYFGQHFjFmr3gN8?= =?us-ascii?Q?vaz14noDuKipoNIPi5wL3VSpwR06zXs3OjF3rYeZaU5fJEIzHj6UsqpLRhHG?= =?us-ascii?Q?AbankSl2KZIYCDDClmFTqwIe7pfvL4KW7dCVJ/3s4VA1lGMuntlEE/diYMPA?= =?us-ascii?Q?RVOSypzAmRYRRp2DGzD2PZwBJVSTQKyMk/f28472ii+llTWLMYSVTLqjTUdg?= =?us-ascii?Q?+aLgiMBaYAifjaIIj7GDi8JbqdevdH9UpGEJJOvCyZD/0VOhlw/bLKKd0D8y?= =?us-ascii?Q?MCOfRJf5vPi7VTa6zKahDU5WETRPDw4Q9xXZOJEei7gjV9FN+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71B9VVuw9uD10a9oAQIbX/qLGGtlHVZM0HbleYIk4o5VIw71s2vVDz?= =?us-ascii?Q?kP4BWoU96VtrPqI0JFshlwmt94HB/DcZt2awSUnxiM/CZsaLhQc8UUnYH2+1?= =?us-ascii?Q?H+qHWQnApovGwiQTebJp+4FVvnVoQLhQLmxo63p8XDihN3DL79yAmvxXrlEL?= =?us-ascii?Q?xUt3ZjounZWZdSRV/qCaDZg8kBPhLRRy4x8uRRCRpU9+D7StuNwSK7nZ4wNz?= =?us-ascii?Q?RMw3wJ6YERN4TxEM0aaqKmBMj1uEpPKcBOejdC5k?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7bf4b77-fc25-445b-4453-08dab724a64c X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2022 07:35:26.4630 (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: ITobXiArzeY36ogS+hiDDVIsVioSDOeIFnbOETW0HfDx2sxGfClCemJ+UxuvbxfnH3zfveTmnRP/aCIJMUYvGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7409 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 25, 2022 at 01:32:43PM -0500, Shenwei Wang wrote: >add the logic to configure the pad wakeup function via >the pin_config_set handler. > >Signed-off-by: Shenwei Wang >--- > drivers/pinctrl/freescale/pinctrl-scu.c | 30 +++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > >diff --git a/drivers/pinctrl/freescale/pinctrl-scu.c b/drivers/pinctrl/freescale/pinctrl-scu.c >index 59b5f8a35111..0b172f7e7261 100644 >--- a/drivers/pinctrl/freescale/pinctrl-scu.c >+++ b/drivers/pinctrl/freescale/pinctrl-scu.c >@@ -15,6 +15,11 @@ > #include "../core.h" > #include "pinctrl-imx.h" > >+#define IMX_SC_PAD_FUNC_GET_WAKEUP 9 >+#define IMX_SC_PAD_FUNC_SET_WAKEUP 4 >+#define IMX_SC_IRQ_GROUP_WAKE 3 /* Wakeup interrupts */ >+#define IMX_SC_IRQ_PAD 2 /* Pad wakeup */ >+ > enum pad_func_e { > IMX_SC_PAD_FUNC_SET = 15, > IMX_SC_PAD_FUNC_GET = 16, >@@ -36,10 +41,18 @@ struct imx_sc_msg_resp_pad_get { > u32 val; > } __packed; > >+struct imx_sc_msg_gpio_set_pad_wakeup { >+ struct imx_sc_rpc_msg hdr; >+ u16 pad; >+ u8 wakeup; >+} __packed __aligned(4); >+ > static struct imx_sc_ipc *pinctrl_ipc_handle; > > int imx_pinctrl_sc_ipc_init(struct platform_device *pdev) > { >+ imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_WAKE, >+ IMX_SC_IRQ_PAD, true); > return imx_scu_get_handle(&pinctrl_ipc_handle); > } > EXPORT_SYMBOL_GPL(imx_pinctrl_sc_ipc_init); >@@ -81,6 +94,23 @@ int imx_pinconf_set_scu(struct pinctrl_dev *pctldev, unsigned pin_id, > unsigned int val; > int ret; > >+ if (num_configs == 1) { >+ struct imx_sc_msg_gpio_set_pad_wakeup wmsg; >+ >+ hdr = &wmsg.hdr; >+ hdr->ver = IMX_SC_RPC_VERSION; >+ hdr->svc = IMX_SC_RPC_SVC_PAD; >+ hdr->func = IMX_SC_PAD_FUNC_SET_WAKEUP; >+ hdr->size = 2; >+ wmsg.pad = pin_id; >+ wmsg.wakeup = *configs; >+ ret = imx_scu_call_rpc(pinctrl_ipc_handle, &wmsg, true); >+ >+ dev_dbg(ipctl->dev, "wakeup pin_id: %d type: %d\n", >+ pin_id, *configs); Format issue, and configs should be unsigned long type. Otherwise, looks good to me. Regards, Peng. >+ return ret; >+ } >+ > /* > * Set mux and conf together in one IPC call > */ >-- >2.34.1 > --