From patchwork Mon Mar 25 13:48:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 10869173 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 B1FB71390 for ; Mon, 25 Mar 2019 13:49:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9509229311 for ; Mon, 25 Mar 2019 13:49:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85E4A2931B; Mon, 25 Mar 2019 13:49:10 +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 E4C8E29311 for ; Mon, 25 Mar 2019 13:49:09 +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=UNfSAuAoKuRJ5ZU9hJXfIivDrQQARMev3rWqYitBQYI=; b=sdQHf64Mgho8v0 OF5HmbxLkzi65fMTCHimSy2J1rBcykqY9yYZNM1xRgOL7E07d+DNk2PPPNHVY5UapG8rQIqrTSRY4 uEfkDuOvi6a2ZWlu3ku+a/jj2LAM9k50iYhwrRRX5m/eOIDxw0/MZtLy+CJTnMMadQfpdwEU2quW/ Ng+iq7Ub2M7VBQP1dcy67D+Lzc3UdMhzAzFLY4gqvvu79klr4heafEPnl2G821ycv72pXN0Sy6nEp v9qksjyeLeIsA0FIrP9huW7xobtn3ptfmDLFnmTI6d3j2oddpE80ctJ5bp3PX/POMh8U5f9sUKx5o c4NRhgspwj7ZVNI45QqA==; 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 1h8PyH-0003J4-VB; Mon, 25 Mar 2019 13:49:01 +0000 Received: from mail-eopbgr40073.outbound.protection.outlook.com ([40.107.4.73] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8PyE-0003HK-84 for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2019 13:49:00 +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=tyvOG3qdSShuQxeiLD1HrKePK8DQCchjIjUGrmtWseg=; b=e5DB+k8oJDQm2SHV+0zHWYAkYmlsG0thCLZSJD32l680Kjs6HZ3cqC8HOLWdpWbxf4Qvzk1pMACGYihgRiNj95LNDhIR8qyGu7frVh7q2tbWLUtqshbgLGyEJAZ4oCeKcroi55dqoPcDeGMe5hCrxeHTUx1lKznWjHsMaD6hu2c= Received: from AM0PR04MB5779.eurprd04.prod.outlook.com (20.178.202.151) by AM0PR04MB5779.eurprd04.prod.outlook.com (20.178.202.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.18; Mon, 25 Mar 2019 13:48:50 +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:48:50 +0000 From: Abel Vesa To: Aisheng Dong , Fabio Estevam , Shawn Guo , Stefan Agner , Linus Walleij , Sascha Hauer Subject: [PATCH 1/2] pinctrl: pinctrl-imx: Add suspend/resume for LPSR Thread-Topic: [PATCH 1/2] pinctrl: pinctrl-imx: Add suspend/resume for LPSR Thread-Index: AQHU4xF5dEldeuWdf0qD0BEcN/OvIA== Date: Mon, 25 Mar 2019 13:48:49 +0000 Message-ID: <1553521721-12061-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: VI1PR0501CA0024.eurprd05.prod.outlook.com (2603:10a6:800:92::34) 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: 6e8292cc-cc23-49a4-acfc-08d6b1289c2f 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:AM0PR04MB5779; x-ms-traffictypediagnostic: AM0PR04MB5779: x-ld-processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0987ACA2E2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(136003)(376002)(346002)(396003)(199004)(189003)(316002)(71200400001)(4326008)(110136005)(53936002)(14454004)(36756003)(102836004)(186003)(105586002)(106356001)(71190400001)(2906002)(81166006)(3846002)(81156014)(54906003)(68736007)(8676002)(6116002)(26005)(6506007)(386003)(52116002)(97736004)(256004)(8936002)(6486002)(50226002)(15650500001)(66066001)(5660300002)(7736002)(86362001)(6436002)(99286004)(305945005)(25786009)(6512007)(2616005)(44832011)(478600001)(476003)(14444005)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5779; H:AM0PR04MB5779.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: It7onICsc1p1h+fEqo2X7rEj4Xdj5E6tbnq2Wwi66RtdPOvu9JCkG9ls9d7lprMMKqRNHcbqX63zhpjUJH4aliJJkxdGU5oILAtkrWxmaIcNXudU8AXfpw2+5ZD4zbAdiMXqJvsyqzX9Yj+O5igGDlNyd0IB0/XH9kKczLK1W/DzBd4sLdFU9KUHIziSJ51LpZ0ICENxDQQsmEiQoStUmsq0dC1i+HuXe5SZdq187XSBNgBQUAFIeoklHmR1p4U4rP8xDXZ0sTicW0QSaNDLcQGriamhj9bK9QKlxUZWqvblUfwFsF1Pfi9tp0bUmadb9XDNByRJtn7t4sKOXytPIZywrx763QN5OzLpWuyHMM2hF57puhxdNIFm52iKwDxbATJFL5SoFhwAakiL4UXDBPG4YlcHD/XRAcD7Uxzocrc= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e8292cc-cc23-49a4-acfc-08d6b1289c2f X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Mar 2019 13:48:50.2055 (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: AM0PR04MB5779 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190325_064858_284616_03D4D89E X-CRM114-Status: GOOD ( 10.68 ) 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: Abel Vesa , "b38343@freescale.com" , Linux Kernel Mailing List , "linux-gpio@vger.kernel.org" , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" 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 --- 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)