From patchwork Wed Jan 25 11:50:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92430 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2170076qgi; Wed, 25 Jan 2017 03:51:09 -0800 (PST) X-Received: by 10.99.152.65 with SMTP id l1mr17953327pgo.28.1485345069031; Wed, 25 Jan 2017 03:51:09 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si1319721pld.330.2017.01.25.03.51.08; Wed, 25 Jan 2017 03:51:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751421AbdAYLvH (ORCPT + 4 others); Wed, 25 Jan 2017 06:51:07 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:50191 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751386AbdAYLvG (ORCPT ); Wed, 25 Jan 2017 06:51:06 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKC00DCI3L3WO10@mailout1.w1.samsung.com>; Wed, 25 Jan 2017 11:51:03 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170125115103eucas1p2670672e1e6f4bbf5fdea15a589704596~dAXcpwxJp1534515345eucas1p2V; Wed, 25 Jan 2017 11:51:03 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 2C.BF.16908.92198885; Wed, 25 Jan 2017 11:51:05 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170125115102eucas1p180bbbdbcc09381051ab86bed6cfad5d0~dAXb9VYIy0874808748eucas1p1D; Wed, 25 Jan 2017 11:51:02 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-ee-58889129d1ec Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 85.8E.10233.32198885; Wed, 25 Jan 2017 11:50:59 +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 <0OKC00H7J3KW4970@eusync3.samsung.com>; Wed, 25 Jan 2017 11:51:02 +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 2/7] pinctrl: samsung: Ensure that pad retention is disabled on driver init Date: Wed, 25 Jan 2017 12:50:26 +0100 Message-id: <1485345031-2948-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485345031-2948-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHIsWRmVeSWpSXmKPExsWy7djPc7qaEzsiDD7MN7TYOGM9q8X58xvY Le5/PcpoMeXPciaLTY+vsVpsnv+H0eLyrjlsFjPO72OyWHvkLrvF4TftrBardv1hdOD22Dnr LrvHplWdbB53ru1h89i8pN6jb8sqRo/Pm+QC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gCaPE72dzmCCcJiaJVe+OMoJUsQkYSnS97QKrEhFo Z5R4ffsaWBWzwBYmia5NF9lBqoQFYiVO9s9mArFZBFQltl9fyQpi8wq4S7xomcMGsU9O4uSx yUBxDg5OAQ+JI29MQMJCQCVzmnuZJzDyLmBkWMUoklpanJueW2ykV5yYW1yal66XnJ+7iREY /tuO/dyyg7HrXfAhRgEORiUe3glJ7RFCrIllxZW5hxglOJiVRHgdWjoihHhTEiurUovy44tK c1KLDzGaAt00kVlKNDkfGJt5JfGGJobmloZGxhYW5kZGSuK8Uz9cCRcSSE8sSc1OTS1ILYLp Y+LglGpgPNoqb+cXO2Ni3NFZ2Z902SQmuFpv6Nv//sc/v3zHJebLBfJ55jK+8LASfjuHeUGp tjnnNT+u/5Ydtu3vX1/49rTDpMvwU0DK/ECFjXKXvh4+GKsaPsf6dVXx9OpTLRvfzxA0/Xmt 4FZIyYyZu+Qf2nGlO8xl37p2p3yqyLeTbgyN259siLuwR4mlOCPRUIu5qDgRAFecZt6VAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170125115102eucas1p180bbbdbcc09381051ab86bed6cfad5d0 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: 20170125115102eucas1p180bbbdbcc09381051ab86bed6cfad5d0 X-RootMTR: 20170125115102eucas1p180bbbdbcc09381051ab86bed6cfad5d0 References: <1485345031-2948-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 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 --- 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-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Krzysztof Kozlowski 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; }