From patchwork Thu Mar 23 08:03:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 95891 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp624598qgd; Thu, 23 Mar 2017 01:04:03 -0700 (PDT) X-Received: by 10.99.101.67 with SMTP id z64mr1469177pgb.78.1490256242945; Thu, 23 Mar 2017 01:04:02 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z12si3318934pfg.149.2017.03.23.01.04.02; Thu, 23 Mar 2017 01:04:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932370AbdCWIEA (ORCPT + 4 others); Thu, 23 Mar 2017 04:04:00 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:36951 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753575AbdCWID5 (ORCPT ); Thu, 23 Mar 2017 04:03:57 -0400 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 <0ON9004CHD2CLP50@mailout4.w1.samsung.com>; Thu, 23 Mar 2017 08:03:48 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170323080348eucas1p2fc6ad1be3c1e1145393a3b41928702a2~udCTSvERx2297922979eucas1p2U; Thu, 23 Mar 2017 08:03:48 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 7A.7C.30614.36183D85; Thu, 23 Mar 2017 08:03:47 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170323080347eucas1p2d0340709543b3ce128281e5a490216d4~udCSn16bd2295722957eucas1p2f; Thu, 23 Mar 2017 08:03:47 +0000 (GMT) X-AuditID: cbfec7f1-f793f6d000007796-ae-58d381630005 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 6C.A7.10233.27183D85; Thu, 23 Mar 2017 08:04:02 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON90067HD26AT60@eusync2.samsung.com>; Thu, 23 Mar 2017 08:03:47 +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 , Chanwoo Choi Subject: [PATCH v4 1/6] pinctrl: samsung: Ensure that pad retention is disabled on driver init Date: Thu, 23 Mar 2017 09:03:22 +0100 Message-id: <1490256207-10061-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490256207-10061-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGIsWRmVeSWpSXmKPExsWy7djPc7rJjZcjDOZtt7TYOGM9q8X1L89Z Lc6f38Bucf/rUUaLKX+WM1lsenyN1WLz/D+MFpd3zWGzmHF+H5PF2iN32S0Ov2lntVi16w+j A4/Hzll32T02repk87hzbQ+bx+Yl9R59W1Yxenz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ceHeerYuRi4OIYEljBITdt6AcpqYJCac380OUsUmYCjR9bYL LCEi0M4o8fr2NSaQBLPAHSaJDS9Tuhg5OIQFEiS2H9MHCbMIqEoc2tgNVsIr4CHx8s0eVoht chInj00GszkFPCWurjnIAmILAdVsuPOJfQIj7wJGhlWMIqmlxbnpucVGesWJucWleel6yfm5 mxiBcbDt2M8tOxi73gUfYhTgYFTi4d1QdylCiDWxrLgy9xCjBAezkgivbeHlCCHelMTKqtSi /Pii0pzU4kOMpkBHTWSWEk3OB8ZoXkm8oYmhuaWhkbGFhbmRkZI479QPV8KFBNITS1KzU1ML Uotg+pg4OKUaGBeJqrIUfY52OSzKv+5ad9SNXN+0vaf2P2DoZFA/ovD1hZK402JTiV9Ldq/s Oxe+oKpMdKd2ypsz9U5s7Lc3Hnf39kh2L3nYft1S4PYs9rR7ph1e9SfTNhckHzj489v9y7UH HnLHd9uw7xZ+sa2ILfJyi4EMX++aRV7XY7p7xO08TXlcTsezKbEUZyQaajEXFScCAMb2smWZ AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170323080347eucas1p2d0340709543b3ce128281e5a490216d4 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170323080347eucas1p2d0340709543b3ce128281e5a490216d4 X-RootMTR: 20170323080347eucas1p2d0340709543b3ce128281e5a490216d4 References: <1490256207-10061-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index f9b49967f512..fa8bdd9ae198 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; }