From patchwork Mon Mar 25 13:59:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 10869237 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A0941390 for ; Mon, 25 Mar 2019 13:59:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC1C6285B3 for ; Mon, 25 Mar 2019 13:59:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D05C329148; Mon, 25 Mar 2019 13:59:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A2940285B3 for ; Mon, 25 Mar 2019 13:59:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject: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=A6tHfgVs/XZGygXqyUd/CMRnR8fhW00UdFJx4NKI/Jc=; b=FQYv0/tZ29J9A+ hvgiC3x1Jslwojjw9QPhCheY1p1sR2l8oY1FJ6NQyLCEn6tdGnQlvLTZbqYWW4/3it04sNJJEzmgs 84gam+pfv9lLMiGfaxzeTBkWtasugs1T7KXk5Lz7j7B3AhpOzH4lxGcDSXr3B1i5FKa081vD3WiTj Cn9Deeijm+V/XnHvr/BhgsdJ0PiEXDL9jhF4QzxA3Mq6FXdQHmMGUN+5SVUbcpb+i/UTSKb2+d5Zx IN6eaXSeCC+MUoxWAmY4dPhPyxkhq9fT3ZQnUb1xYmwFZxmMcNhe7UxNBZK2QXA7K0oa7Md1ZWIR0 8AH589U4+ztPWFk6SIWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8Q8i-0005TF-Hq; Mon, 25 Mar 2019 13:59:48 +0000 Received: from mail-eopbgr40059.outbound.protection.outlook.com ([40.107.4.59] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8Q8T-0005EC-7M for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2019 13:59:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q/7aeUajcxNXhUyIoOlHIMqlyxEZUkf7E0NGCmOoAuI=; b=xoL6n4+4POnwBDu/37Y7E32/ZZkBAFG1zw4oF7ywx5GyZkfBbity6tGfrv+jB7T214Ey8I16+l2UrOfkcV3POo5Mrgw/7lCB7UXGm+HRGm91wG1Ui5ryJ2Rvdh9gXLBXq9apJsB2XazCMGmqB4ewzQUqCgE9XHmQP0JKhHKnW5c= Received: from AM0PR04MB5779.eurprd04.prod.outlook.com (20.178.202.151) by AM0PR04MB3970.eurprd04.prod.outlook.com (52.134.92.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.15; Mon, 25 Mar 2019 13:59:29 +0000 Received: from AM0PR04MB5779.eurprd04.prod.outlook.com ([fe80::9579:32ab:898e:6769]) by AM0PR04MB5779.eurprd04.prod.outlook.com ([fe80::9579:32ab:898e:6769%2]) with mapi id 15.20.1730.019; Mon, 25 Mar 2019 13:59:29 +0000 From: Abel Vesa To: Robin Gong , Aisheng Dong , Fabio Estevam , Shawn Guo , Stefan Agner , Linus Walleij , Sascha Hauer Subject: [PATCH v2 1/2] pinctrl: pinctrl-imx: Add suspend/resume for LPSR Thread-Topic: [PATCH v2 1/2] pinctrl: pinctrl-imx: Add suspend/resume for LPSR Thread-Index: AQHU4xL2kxTfcBAwA0CY0U8rwSXJYw== Date: Mon, 25 Mar 2019 13:59:29 +0000 Message-ID: <1553522352-20214-1-git-send-email-abel.vesa@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VE1PR03CA0051.eurprd03.prod.outlook.com (2603:10a6:803:118::40) To AM0PR04MB5779.eurprd04.prod.outlook.com (2603:10a6:208:131::23) x-originating-ip: [212.146.100.6] authentication-results: spf=none (sender IP is ) smtp.mailfrom=abel.vesa@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 45b2e862-945e-48b6-ce15-08d6b12a193d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB3970; x-ms-traffictypediagnostic: AM0PR04MB3970: x-microsoft-antispam-prvs: x-forefront-prvs: 0987ACA2E2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(366004)(396003)(136003)(346002)(189003)(199004)(99286004)(86362001)(4326008)(53936002)(106356001)(97736004)(105586002)(14454004)(486006)(68736007)(81166006)(8676002)(36756003)(81156014)(6486002)(15650500001)(7736002)(305945005)(50226002)(476003)(478600001)(2616005)(14444005)(8936002)(256004)(6436002)(66066001)(6512007)(5660300002)(25786009)(71200400001)(71190400001)(316002)(44832011)(386003)(6506007)(102836004)(26005)(6116002)(186003)(3846002)(54906003)(110136005)(2906002)(52116002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB3970; H:AM0PR04MB5779.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: OyK6usfWwJe8ZTEBkyvCQD6/Mt3WfCGhZ5+dAF+ki+OaP89XXBkeFhKNnCUk5z+BQKk4//zL3G0y0UmR4BS8fFkHKOwAHLEwgCaKZiCtRMHh4bziqDMSYEvFzuF9BQaHHaZva333fMCE4ZAE/ZH5QOojxeH6xf9QcF0sgL4zQaAUCizPcX5q42pvCt5pslnBGOKJCGtTX9+fYipJgXQsQzhpW+57RAOWYt0BDCBcLq8oHGvgrQK06B6IiLr29K3TIeC1IxxRxamDP9JCEn358C5KqyfrsiCO1MnpGvbUAlZIZIS6XjHS2LAEcodhtwbZpXoZLuFtXdgewczN5sz7OAoCEsG5nesUhvcCb+Qa7NGDXYL2cEiyq/MTKM58C/hg3yaaiZEqFZYlFEgRUA3AViXaaZncpIGHiyviqkDySFQ= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45b2e862-945e-48b6-ce15-08d6b12a193d X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Mar 2019 13:59:29.3209 (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-Transport-CrossTenantHeadersStamped: AM0PR04MB3970 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190325_065933_261506_6C83DCD4 X-CRM114-Status: GOOD ( 10.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-gpio@vger.kernel.org" , Abel Vesa , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Robin Gong To support pinctl hog restore after LPSR resume back, add suspend/resume in pinctrl driver. Signed-off-by: Robin Gong Signed-off-by: Abel Vesa --- Changes since v1: * fixed Robin's email drivers/pinctrl/freescale/pinctrl-imx.c | 20 ++++++++++++++++++++ drivers/pinctrl/freescale/pinctrl-imx.h | 3 +++ 2 files changed, 23 insertions(+) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 188001b..93c0253 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -887,3 +887,23 @@ int imx_pinctrl_probe(struct platform_device *pdev, return ret; } + +int imx_pinctrl_suspend(struct device *dev) +{ + struct imx_pinctrl *ipctl = dev_get_drvdata(dev); + + if (!ipctl) + return -EINVAL; + + return pinctrl_force_sleep(ipctl->pctl); +} + +int imx_pinctrl_resume(struct device *dev) +{ + struct imx_pinctrl *ipctl = dev_get_drvdata(dev); + + if (!ipctl) + return -EINVAL; + + return pinctrl_force_default(ipctl->pctl); +} diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h index 98a4889..795669c 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.h +++ b/drivers/pinctrl/freescale/pinctrl-imx.h @@ -136,6 +136,9 @@ struct imx_pinctrl { int imx_pinctrl_probe(struct platform_device *pdev, const struct imx_pinctrl_soc_info *info); +int imx_pinctrl_suspend(struct device *dev); +int imx_pinctrl_resume(struct device *dev); + #ifdef CONFIG_PINCTRL_IMX_SCU #define BM_PAD_CTL_GP_ENABLE BIT(30) #define BM_PAD_CTL_IFMUX_ENABLE BIT(31)