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: 9538443 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 CAC976046A for ; Thu, 26 Jan 2017 08:34:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD9C12818E for ; Thu, 26 Jan 2017 08:34:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0312281F9; Thu, 26 Jan 2017 08:34:59 +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 36D9E2818E for ; Thu, 26 Jan 2017 08:34:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753006AbdAZIeM (ORCPT ); Thu, 26 Jan 2017 03:34:12 -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+NgFnrCIsWRmVeSWpSXmKPExsWy7djP87pVWzojDK58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JBfAFuVmk5GamJJapJCal5yfkpmXbqsU GuKma6GkkJeYm2qrFKHrGxKkpFCWmFMK5BkZoAEH5wD3YCV9uwS3jJZlGQVfuSpOn65tYJzJ 2cXIySEhYCJx6vxCNghbTOLCvfVANheHkMASRomm/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?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: 20170126083401eucas1p289b69e3694b91e83983cd6e09aa7053c X-RootMTR: 20170126083401eucas1p289b69e3694b91e83983cd6e09aa7053c References: <1485419634-28331-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; }