From patchwork Fri Sep 11 12:02:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 53453 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id C4D90215BF for ; Fri, 11 Sep 2015 12:03:02 +0000 (UTC) Received: by wicuu12 with SMTP id uu12sf17750733wic.2 for ; Fri, 11 Sep 2015 05:03:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=14e/IKJBWaQ9pkoqe+Y1moHk7zgusBXK2wu/aikvlNo=; b=Z2JYw4SijvEL9I62QpxtIng6RHzGkFWO9M6TLXahy02Xdt7lS0c/GGnJIp9lHCRFKj 0CZ6Mc53NYM56DNY7fu3mMuNEWYJCZ9oZYQ0byTXvXv9epYznS+VLNObTg0cd71w3FQy ttZeiC9hNFwxOjA3jEEbHYrv0mNPc1xovspVeH9W1o+HaOcHvrvM1vbmbM/cgP6RfHzm yLfxAQGIACbKvBOeuCAPuKWcV2xdJ02AfRSsWhmY+eNXe6D00sW/JGXIdMZM0kjfJcKJ 6KwIyT4Bv8obmF40FKgAUp1RJ9vQTTXoEfIDIWrpIoR4dTJYxR1QLnk7vxYmmBlaqt1v 6ARA== X-Gm-Message-State: ALoCoQm2U7Z4RMN5OSBuHStRMhkWm3zhzwRiaYVbzTewuFqQZY7FVF0Gc7RwlT9srAQ7FAeUDZm+ X-Received: by 10.194.118.65 with SMTP id kk1mr11209305wjb.5.1441972982120; Fri, 11 Sep 2015 05:03:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.224.129 with SMTP id rc1ls319351lac.6.gmail; Fri, 11 Sep 2015 05:03:01 -0700 (PDT) X-Received: by 10.152.2.227 with SMTP id 3mr2241989lax.54.1441972981953; Fri, 11 Sep 2015 05:03:01 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id b8si12950lah.113.2015.09.11.05.03.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2015 05:03:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbmp1 with SMTP id mp1so38367946lbb.1 for ; Fri, 11 Sep 2015 05:03:01 -0700 (PDT) X-Received: by 10.152.7.210 with SMTP id l18mr6323427laa.86.1441972981809; Fri, 11 Sep 2015 05:03:01 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1544991lbq; Fri, 11 Sep 2015 05:03:00 -0700 (PDT) X-Received: by 10.107.137.162 with SMTP id t34mr3369395ioi.103.1441972979766; Fri, 11 Sep 2015 05:02:59 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mf6si246659igb.0.2015.09.11.05.02.59; Fri, 11 Sep 2015 05:02:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753048AbbIKMCy (ORCPT + 12 others); Fri, 11 Sep 2015 08:02:54 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34462 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752793AbbIKMCw (ORCPT ); Fri, 11 Sep 2015 08:02:52 -0400 Received: by padhy16 with SMTP id hy16so73623386pad.1 for ; Fri, 11 Sep 2015 05:02:52 -0700 (PDT) X-Received: by 10.68.139.226 with SMTP id rb2mr95826663pbb.49.1441972971735; Fri, 11 Sep 2015 05:02:51 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id pi9sm2358pbb.96.2015.09.11.05.02.50 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 11 Sep 2015 05:02:51 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , nm@ti.com, sboyd@codeaurora.org Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, rob.herring@linaro.org, lee.jones@linaro.org, Viresh Kumar , Bartlomiej Zolnierkiewicz , Dmitry Torokhov , Greg Kroah-Hartman , Len Brown , linux-kernel@vger.kernel.org (open list), Pavel Machek Subject: [PATCH 05/16] PM / OPP: Parse all power-supply related bindings together Date: Fri, 11 Sep 2015 17:32:01 +0530 Message-Id: <6269be0aac00ae0d1549db9be93472b951636ef6.1441972771.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Move all DT parsing for the power supplies to a single function, rather than keeping them at separate places. This will help manage things properly. Signed-off-by: Viresh Kumar --- drivers/base/power/opp/core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c index 6bebc503d727..463417b6838c 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -787,9 +787,10 @@ static int _opp_add_v1(struct device *dev, unsigned long freq, long u_volt, } /* TODO: Support multiple regulators */ -static int opp_get_microvolt(struct dev_pm_opp *opp, struct device *dev) +static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev) { u32 microvolt[3] = {0}; + u32 val; int count, ret; count = of_property_count_u32_elems(opp->np, "opp-microvolt"); @@ -815,6 +816,9 @@ static int opp_get_microvolt(struct dev_pm_opp *opp, struct device *dev) opp->u_volt_min = microvolt[1]; opp->u_volt_max = microvolt[2]; + if (!of_property_read_u32(opp->np, "opp-microamp", &val)) + opp->u_amp = val; + return 0; } @@ -879,13 +883,10 @@ static int _opp_add_static_v2(struct device *dev, struct device_node *np) if (!of_property_read_u32(np, "clock-latency-ns", &val)) new_opp->clock_latency_ns = val; - ret = opp_get_microvolt(new_opp, dev); + ret = opp_parse_supplies(new_opp, dev); if (ret) goto free_opp; - if (!of_property_read_u32(new_opp->np, "opp-microamp", &val)) - new_opp->u_amp = val; - ret = _opp_add(dev, new_opp, dev_opp); if (ret) goto free_opp;