From patchwork Thu Oct 15 16:12:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 55056 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lf0-f69.google.com (mail-lf0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id BBEA923069 for ; Thu, 15 Oct 2015 16:13:54 +0000 (UTC) Received: by lffv3 with SMTP id v3sf4898824lff.1 for ; Thu, 15 Oct 2015 09:13:53 -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=cxN3BPSsGUT3O5r0IyrgkLIrtU6N7KwFSEYWE8BM3zk=; b=mcNRnIZLvBwU/diYeRfPvsRiFKOeyetFSaDdTm4CrLPzJRewP2yxLWX3gwO/2CvcBd uVn6+Dghwtfr98WDD77Epy0+127+0S+1BjEKB+6Y036Wq7FYTxuM9H4XmuqCeUWWLsJb msgpxXbJHK85OaiJT4vIK+/vrFYsGB+luxoAB3uUr+ydONbKyWWaPTJU5q6aKb9mhN7r NwrysDisjriC6A/XCUYyT0LQlaw1M5Ts3BC3KjGG/BnW7Z4VPtubZNAqPUEZFKAbWYKX n1aRwM1rafdEnWJV7tgDfOri0jk5hnl3KvK6EDoffFcv+iYnW5oyv4MTn7/cKgUukDU6 RMPw== X-Gm-Message-State: ALoCoQl5wVtYaGi+6kwRsl8gKG7POKeTRECjj+doIDO3bTAYIICWbHEoqGx+AnmLwjDRuGiFhEyR X-Received: by 10.180.9.104 with SMTP id y8mr7128064wia.7.1444925633667; Thu, 15 Oct 2015 09:13:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.167.140 with SMTP id q134ls192177lfe.23.gmail; Thu, 15 Oct 2015 09:13:53 -0700 (PDT) X-Received: by 10.112.171.132 with SMTP id au4mr5120568lbc.6.1444925633488; Thu, 15 Oct 2015 09:13:53 -0700 (PDT) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id a7si9624060lfb.32.2015.10.15.09.13.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 09:13:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lfeh64 with SMTP id h64so33818308lfe.3 for ; Thu, 15 Oct 2015 09:13:53 -0700 (PDT) X-Received: by 10.25.205.198 with SMTP id d189mr3316618lfg.72.1444925631131; Thu, 15 Oct 2015 09:13:51 -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 w3csp726502lbq; Thu, 15 Oct 2015 09:13:50 -0700 (PDT) X-Received: by 10.107.163.17 with SMTP id m17mr7749072ioe.79.1444925629968; Thu, 15 Oct 2015 09:13:49 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kd7si12216540igb.42.2015.10.15.09.13.45; Thu, 15 Oct 2015 09:13:49 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753865AbbJOQNd (ORCPT + 30 others); Thu, 15 Oct 2015 12:13:33 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:35927 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753320AbbJOQNa (ORCPT ); Thu, 15 Oct 2015 12:13:30 -0400 Received: by padcn9 with SMTP id cn9so10259952pad.3 for ; Thu, 15 Oct 2015 09:13:29 -0700 (PDT) X-Received: by 10.68.181.34 with SMTP id dt2mr10780971pbc.7.1444925609520; Thu, 15 Oct 2015 09:13:29 -0700 (PDT) Received: from localhost ([223.227.130.246]) by smtp.gmail.com with ESMTPSA id iu2sm13863292pbd.16.2015.10.15.09.13.27 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Oct 2015 09:13:29 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, sboyd@codeaurora.org, nm@ti.com, Viresh Kumar , Bartlomiej Zolnierkiewicz , Dmitry Torokhov , Greg Kroah-Hartman , Len Brown , linux-kernel@vger.kernel.org (open list), Pavel Machek Subject: [PATCH V2 3/4] PM / OPP: Parse all power-supply related bindings together Date: Thu, 15 Oct 2015 21:42:45 +0530 Message-Id: <10b3f112bb2863098a0ab21bcb9e951f0a8da51c.1444925400.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@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.215.42 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 63b0f57601b8..8fa522f41226 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -772,9 +772,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; /* Missing property isn't a problem, but an invalid entry is */ @@ -807,6 +808,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; } @@ -871,13 +875,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;