Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6773012ybi; Mon, 8 Jul 2019 08:25:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzopkxKC/x09SB1cpYOQo11GgColsN74E2psKKTiitPbljfcv3BCroz4og0n2tRv0on8dwF X-Received: by 2002:a63:1d55:: with SMTP id d21mr19163619pgm.418.1562599547569; Mon, 08 Jul 2019 08:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562599547; cv=none; d=google.com; s=arc-20160816; b=uFUJb34Z8H4d463bvp2rAiHYzb9ypP54aEuIRcAKQRlg/xnCV0JJ4jVlkbKzvR6KDb 5yLxRxKqcrvSdHDbTBdcDhh89qe+bB/DiLjG9/nI6+6MihNA3WXcXvBJ69Xz57CRa6gF j3LZN1HapcgM4JHxdp8T95hKf+MLEqcU12RYO5L0R76DSPfqW0bLPmtS2UyNbFw0eGAg Lzlg6+N8z/d3fBahY6uaQOMZvdlFBxIS+T2hjryqeaWF0Pc/9vX4vDxoNwp7H3ww7T++ 4AE/RF4CUwx+NgoucC18C52bI7CJEUsUkghbgVAERMTKIJx3U0J78eMQbXemp44KGRF5 BFJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:mime-version:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=os/t6E50bR1XYLSweFwdc4MuERNk7+i5wjswJXfr9q4=; b=jVimbgoEZSrXwK/tqLB0cElpTq7mSXJnSzHrKhTzHHH0ovHAvtw+d78hr5aYPVmMsM QEVE8OiN0KHWIk2NFgTl9xjdwnypIthcNs/vqlgY7OEtCM0r1ST1Ws7P1EIG9ijmcaTz OBFrJl0bWsJTgXL4y6gXzWTnblZcWH64Uox7DQWI5fDp0thcM1YJfiVEgD+RN0h/ubRX vQIifW85hC5B6SzAMVB5hoVgpnwXSFKYSVeS9AzOSm6e06UD0tkAXRdd700jnFgrDnWR ZcmX6IBgFBOZ/mT/7uBxPM9H+wgTS8Qf4/Fsdh6f+lsavuoPQvk4rsfixlK4NJNVoxC7 X0rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=g6rvMLBA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j62si18617754pgd.170.2019.07.08.08.25.32; Mon, 08 Jul 2019 08:25:47 -0700 (PDT) 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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=g6rvMLBA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731707AbfGHOMD (ORCPT + 99 others); Mon, 8 Jul 2019 10:12:03 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:60329 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731688AbfGHOMC (ORCPT ); Mon, 8 Jul 2019 10:12:02 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190708141200euoutp018997ebb9b6519a63dc83e15858975d59~vc-vGLZgt2342323423euoutp01X for ; Mon, 8 Jul 2019 14:12:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190708141200euoutp018997ebb9b6519a63dc83e15858975d59~vc-vGLZgt2342323423euoutp01X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1562595120; bh=os/t6E50bR1XYLSweFwdc4MuERNk7+i5wjswJXfr9q4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g6rvMLBAIG02GP0iXIZySEJ9Rna6j7fdGVt9fPIndh++TDnmZQ1e8xyZG3sgeBfn8 KXXDYagacqMS368ZaR0/pxs0khgHWjwZfpxOw37if1Phl//Z2d+iSTWfoxDY7Q7zvX h/HdbhZkxjEdXdR8wW7QaIXCiFcVHOApqB9KFcAA= 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 Content-Transfer-Encoding: 8bit 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 XmKrozJFLrKMWw11uZ8ZkZ05D8h6m0OKD5HcHAVVA9W2hhPnB1lJT2mRKathNO+alVlWzvlD +dXt0q4VkNb4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VMAPVN2+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 Content-Type: text/plain; charset="utf-8" X-RootMTR: 20190708141159eucas1p1751506975ff96a436e14940916623722 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190708141159eucas1p1751506975ff96a436e14940916623722 References: <20190708141140.24379-1-k.konieczny@partner.samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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]); -- 2.22.0