From patchwork Thu Jan 26 08:33:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92490 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp79434qgi; Thu, 26 Jan 2017 00:34:42 -0800 (PST) X-Received: by 10.98.93.152 with SMTP id n24mr1772371pfj.107.1485419682165; Thu, 26 Jan 2017 00:34:42 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x26si25863883pge.197.2017.01.26.00.34.41; Thu, 26 Jan 2017 00:34:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753062AbdAZIeQ (ORCPT + 25 others); Thu, 26 Jan 2017 03:34:16 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:30686 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752894AbdAZIeG (ORCPT ); Thu, 26 Jan 2017 03:34:06 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKD006CUP4R4M50@mailout2.w1.samsung.com>; Thu, 26 Jan 2017 08:34:03 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170126083402eucas1p19fffb82a70c8ed7534bc34f6ba3dc16f~dRUuA9qQ_2231922319eucas1p16; Thu, 26 Jan 2017 08:34:02 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3.samsung.com (EUCPMTA) with SMTP id 45.30.09557.A74B9885; Thu, 26 Jan 2017 08:34:02 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126083401eucas1p289b69e3694b91e83983cd6e09aa7053c~dRUtMsj463144931449eucas1p2Z; Thu, 26 Jan 2017 08:34:01 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-0d-5889b47afd97 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id F5.34.06687.9B4B9885; Thu, 26 Jan 2017 08:35:05 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD000KKP4KMO50@eusync1.samsung.com>; Thu, 26 Jan 2017 08:34:01 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@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 v2 2/8] pinctrl: samsung: Ensure that pad retention is disabled on driver init Date: Thu, 26 Jan 2017 09:33:48 +0100 Message-id: <1485419634-28331-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485419634-28331-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCIsWRmVeSWpSXmKPExsWy7djP87pVWzojDK58l7LYOGM9q8X8I+dY Lc6f38Bucf/rUUaLKX+WM1lsenyN1WLz/D+MFpd3zWGzmHF+H5PF2iN32S0Ov2lntVi16w+j A4/Hzll32T02repk87hzbQ+bx+Yl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Jx6vxCNghbTOLCvfVANheHkMASRomm/nesEE4Tk0TvziVMIFVsAoYSXW+7wKpE BJYySvxf+ZkdxGEW2MIk0bXpIjtIlbBAgsTe/rtANgcHi4CqxPFGPpAwr4CHxOvjk1gh1slJ nDw2GczmFPCUOP30FVirEFDNposL2Scw8i5gZFjFKJJaWpybnltsqFecmFtcmpeul5yfu4kR GAXbjv3cvIPx0sbgQ4wCHIxKPLwHdnRECLEmlhVX5h5ilOBgVhLhPb+6M0KINyWxsiq1KD++ qDQntfgQoynQTROZpUST84ERmlcSb2hiaG5paGRsYWFuZKQkzlvy4Uq4kEB6YklqdmpqQWoR TB8TB6dUA2NCA3//7Cq+w7afp+SssH997H1563bGHU8y9zj/rjNhFUnda9D71u9D8Lzo/4lK 06YrZxbO0jRbns54ISj3wMFeXq2dLKoXjs29tdtu1svPASJFDmf1jVl+HopUKJyv+sld/15R +YGkjdLH3r/88kHS57QGW8mmNw0cGz+fi//pZH0lxclv5iMlluKMREMt5qLiRACw4liBmAIA AA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126083401eucas1p289b69e3694b91e83983cd6e09aa7053c X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 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: 20170126083401eucas1p289b69e3694b91e83983cd6e09aa7053c X-RootMTR: 20170126083401eucas1p289b69e3694b91e83983cd6e09aa7053c References: <1485419634-28331-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 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; }