From patchwork Mon Jul 8 14:11:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Konieczny X-Patchwork-Id: 11035183 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B3DC17EF for ; Mon, 8 Jul 2019 14:12:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF153285C9 for ; Mon, 8 Jul 2019 14:12:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECDFF284C9; Mon, 8 Jul 2019 14:12:17 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 6B83C285C9 for ; Mon, 8 Jul 2019 14:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731705AbfGHOMD (ORCPT ); Mon, 8 Jul 2019 10:12:03 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:50876 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731692AbfGHOMC (ORCPT ); Mon, 8 Jul 2019 10:12:02 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190708141200euoutp0230d3edff3de10045d170aafda8d69d6d~vc-vKy8sd2957129571euoutp02C for ; Mon, 8 Jul 2019 14:12:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190708141200euoutp0230d3edff3de10045d170aafda8d69d6d~vc-vKy8sd2957129571euoutp02C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1562595121; bh=os/t6E50bR1XYLSweFwdc4MuERNk7+i5wjswJXfr9q4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n9vdAZY0vtY8usJn8TOcucpfJ42kW1Rzg424YrV476sQZfYgI6uaCGaDUlqhnZ9rJ 7y2WRfit25ITwhnz/EGO5wfiiZoDHpbdcU8/Oov6JIccKXB0ZxbFvbgUYmMPTbkCID rqZc+Rj8QWLaJGuAZt+LI0TpMiqMyi7T4f6AQpJo= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190708141200eucas1p25a0b91036cfceef1fd330224c2ac57cb~vc-uVUUTk1502515025eucas1p2T; Mon, 8 Jul 2019 14:12:00 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 92.A2.04377.F2F432D5; Mon, 8 Jul 2019 15:11:59 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190708141159eucas1p1751506975ff96a436e14940916623722~vc-tbV9W_0589605896eucas1p1e; Mon, 8 Jul 2019 14:11:59 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190708141159eusmtrp2be6df2275f74fc9e54f0afa1b7e06dcb~vc-tal0f51954319543eusmtrp2Q; Mon, 8 Jul 2019 14:11:59 +0000 (GMT) X-AuditID: cbfec7f4-113ff70000001119-4d-5d234f2fea98 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E6.D4.04140.E2F432D5; Mon, 8 Jul 2019 15:11:59 +0100 (BST) Received: from AMDC3218.DIGITAL.local (unknown [106.120.51.18]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190708141158eusmtip2f27b39034436cb773a2fd293718d5259~vc-sprwv20438404384eusmtip2d; Mon, 8 Jul 2019 14:11:58 +0000 (GMT) From: k.konieczny@partner.samsung.com To: k.konieczny@partner.samsung.com Cc: Bartlomiej Zolnierkiewicz , Marek Szyprowski , Chanwoo Choi , Krzysztof Kozlowski , Kukjin Kim , Kyungmin Park , Mark Rutland , MyungJoo Ham , Nishanth Menon , Rob Herring , Stephen Boyd , Viresh Kumar , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 1/3] opp: core: add regulators enable and disable Date: Mon, 8 Jul 2019 16:11:38 +0200 Message-Id: <20190708141140.24379-2-k.konieczny@partner.samsung.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708141140.24379-1-k.konieczny@partner.samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02SeyyVcRjH+72X877UsddheRa6HOsPmk5abb+tVIp1tta6/1MTb7yhnMPO QdQKXYiNLhROjTRGKNeQyvXEGpFsSNNOncq6GaOhyem8563Vf5/n+zzf3/N8tx9LKkbpZWyE NkbQaflIpcyequ+c6/VW7fEIXFfe5o2rcytpPDQ9RuMCYy+NM5stCF8xfyVxX18Vg1+c/8bg GvMgjQeabsvwVIYR4dy+ZgLfN44yuHion8Bvkktl+NvsCwJfempk8MJgNYVrTZ2ybQp1RX4F UteUpcnUtUWJ6rbxJ4Q6s64MqbuGGwj1VM3yvcxh+82hQmREnKBTbQm2D39f8oyIHlwcf2My W5aE3tmlIzsWuA3QkzGJ0pE9q+BKEYzOfiKkYhpBQYWBkoopBN/7J2R/LfUZI0hkBVeC4O0v XmKrozJFLrKMWw11uZ8ZkZ05D8h6m0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BVwkVg9wQligbxE547dYDM5BVwljjyexwhi CwGVrLs8BewIXgFBiZMzn4DVMAPVN2+dzTyBUWAWktQsJKkFjEyrGEVSS4tz03OLjfSKE3OL S/PS9ZLzczcxAqNy27GfW3Ywdr0LPsQowMGoxMPLIacUK8SaWFZcmXuIUYKDWUmEd5+7cqwQ b0piZVVqUX58UWlOavEhRlOgHyYyS4km5wMTRl5JvKGpobmFpaG5sbmxmYWSOG+HwMEYIYH0 xJLU7NTUgtQimD4mDk6pBsaqG6o+aov5H/eGOu2PPPffwPa3hV7shh+vqiy+R/ysfeEX/Clg T2EBl3r0nG1HuXb//PLvcfULO/7lO/5nNjz+PDNS2GNffJytUzD79hdsJU5zP+42FNsfa+Xw vPTImr8H+bwfvz3Y47w84sZ8FdPyAz9d7Case79XttfC7rfsBMGdzWIba+qVWIozEg21mIuK EwGIHphj4AIAAA== X-CMS-MailID: 20190708141159eucas1p1751506975ff96a436e14940916623722 X-Msg-Generator: CA X-RootMTR: 20190708141159eucas1p1751506975ff96a436e14940916623722 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190708141159eucas1p1751506975ff96a436e14940916623722 References: <20190708141140.24379-1-k.konieczny@partner.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 From: Kamil Konieczny Add enable regulators to dev_pm_opp_set_regulators() and disable regulators to dev_pm_opp_put_regulators(). This prepares for converting exynos-bus devfreq driver to use dev_pm_opp_set_rate(). Signed-off-by: Kamil Konieczny Acked-by: Krzysztof Kozlowski --- drivers/opp/core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 0e7703fe733f..947cac452854 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1580,8 +1580,19 @@ struct opp_table *dev_pm_opp_set_regulators(struct device *dev, if (ret) goto free_regulators; + for (i = 0; i < opp_table->regulator_count; i++) { + ret = regulator_enable(opp_table->regulators[i]); + if (ret < 0) + goto disable; + } + return opp_table; +disable: + while (i != 0) + regulator_disable(opp_table->regulators[--i]); + + i = opp_table->regulator_count; free_regulators: while (i != 0) regulator_put(opp_table->regulators[--i]); @@ -1609,6 +1620,8 @@ void dev_pm_opp_put_regulators(struct opp_table *opp_table) /* Make sure there are no concurrent readers while updating opp_table */ WARN_ON(!list_empty(&opp_table->opp_list)); + for (i = opp_table->regulator_count - 1; i >= 0; i--) + regulator_disable(opp_table->regulators[i]); for (i = opp_table->regulator_count - 1; i >= 0; i--) regulator_put(opp_table->regulators[i]);