From patchwork Mon Jan 30 12:38:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9545199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B22F6604CC for ; Mon, 30 Jan 2017 12:51:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BF1626CFF for ; Mon, 30 Jan 2017 12:51:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90B6E27CF3; Mon, 30 Jan 2017 12:51:39 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37FAE26E4C for ; Mon, 30 Jan 2017 12:51:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753510AbdA3Mvf (ORCPT ); Mon, 30 Jan 2017 07:51:35 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:43702 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753508AbdA3MvM (ORCPT ); Mon, 30 Jan 2017 07:51:12 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKL00588F4FA560@mailout4.w1.samsung.com>; Mon, 30 Jan 2017 12:38:39 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170130123838eucas1p2767cad82712506cbfc998f5e680d504e~ejPbYOF2i2038020380eucas1p2w; Mon, 30 Jan 2017 12:38:38 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id FB.93.16908.1D33F885; Mon, 30 Jan 2017 12:38:41 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170130123838eucas1p12953af1e9af22e17ed9ca9c49dbd1e9d~ejPapzAGE2024520245eucas1p1k; Mon, 30 Jan 2017 12:38:38 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-d6-588f33d138c4 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 2F.C6.06687.1143F885; Mon, 30 Jan 2017 12:39:45 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKL0038AF49F510@eusync3.samsung.com>; Mon, 30 Jan 2017 12:38:38 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Lee Jones , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 2/7] pinctrl: samsung: Ensure that pad retention is disabled on driver init Date: Mon, 30 Jan 2017 13:38:23 +0100 Message-id: <1485779908-32147-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485779908-32147-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAIsWRmVeSWpSXmKPExsWy7djPc7oXjfsjDOYuFbLYOGM9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l hbzE3FRbpQhd35AgJYWyxJxSIM/IAA04OAe4Byvp2yW4ZbQsyyj4ylVx+nRtA+NMzi5GTg4J AROJ3bdXsEPYYhIX7q1n62Lk4hASWMIocfNRCzuE08QkcWXpIRaQKjYBQ4mut11gVSIC7YwS r29fYwJxmAW2MEl0bboINktYIEFi67tHYB0sAqoSr/cdZwOxeQU8JFZe2AG1T07i5LHJrCA2 p4CnxJanh5hBbCGgmvM3/rNMYORdwMiwilEktbQ4Nz232FCvODG3uDQvXS85P3cTIzD4tx37 uXkH46WNwYcYBTgYlXh4bwj3RQixJpYVV+YeYpTgYFYS4T2p2h8hxJuSWFmVWpQfX1Sak1p8 iNEU6KiJzFKiyfnAyMwriTc0MTS3NDQytrAwNzJSEuct+XAlXEggPbEkNTs1tSC1CKaPiYNT qoGx2c7+6YI5/gv+xZzIOf7/0t37JSuZG+pd+ATF7zJzvrqrX/qn+r7uFMGV7+riY9bO2vz0 IVNM58EAPfulE9jXxdhvslx96stdnVurjN7kK9eLXO9YFL295EjpvXczPqVf1Y2a3h+27eyF x3OUe02Ol014e7rDKnNBlOIN5xMaK6dsk/wbxsykocRSnJFoqMVcVJwIAAsK2rCUAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170130123838eucas1p12953af1e9af22e17ed9ca9c49dbd1e9d X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170130123838eucas1p12953af1e9af22e17ed9ca9c49dbd1e9d X-RootMTR: 20170130123838eucas1p12953af1e9af22e17ed9ca9c49dbd1e9d References: <1485779908-32147-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When pin controller device is a part of power domain, there is no guarantee that the power domain was not turned off and then on during boot process before probing of the pin control driver. If it happened, then pin control driver should ensure that pad retention is turned off during its probe call. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski --- drivers/pinctrl/samsung/pinctrl-exynos.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 63e51b56a22a..fa3802970570 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -777,6 +777,7 @@ static void exynos_retention_disable(struct samsung_pinctrl_drv_data *drvdata) { struct samsung_retention_ctrl *ctrl; struct regmap *pmu_regs; + int i; ctrl = devm_kzalloc(drvdata->dev, sizeof(*ctrl), GFP_KERNEL); if (!ctrl) @@ -794,6 +795,10 @@ static void exynos_retention_disable(struct samsung_pinctrl_drv_data *drvdata) ctrl->enable = exynos_retention_enable; ctrl->disable = exynos_retention_disable; + /* Ensure that retention is disabled on driver init */ + for (i = 0; i < ctrl->nr_regs; i++) + regmap_write(pmu_regs, ctrl->regs[i], ctrl->value); + return ctrl; }