From patchwork Fri Sep 11 12:01:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 53449 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 1B8DC215BF for ; Fri, 11 Sep 2015 12:02:30 +0000 (UTC) Received: by wicuu12 with SMTP id uu12sf17741401wic.2 for ; Fri, 11 Sep 2015 05:02:29 -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=sWT8X2xqHMnttJLRqTyK5FlSH2KnhR8JbwfyvBUFsxE=; b=BZvGYNgxjr4pwVZSIRPK3wtmPV4zUbVa4n013TRlhLkVacZJTw63JsZJAtuYSoMk4K eEHq8oZC/ggp5BoDFOgJUbc6SY0O2DFZ6tcAzZjCJGDdj5qkhwJYf48y6qCrMJzVhzJa DqVseB61Fxc8ptY/wdSXN2cKFX9wlg2r2nULyawGxfUXeAXvHxKnZAlIhY69FzsXdm/U YNVXOjE5BpLgDESqgeEe8QrST1YfeK6oxGKCOZ9se6J5k+Y3QQv2UtvKImCDcUmJCEz3 e0rXNzLWg9LI72ju9nHB6nubMfsNGsC5uUD+NUodgdE/s9+Z+VE8f+YTKOqoOHVOCElT ZkUQ== X-Gm-Message-State: ALoCoQmOKUNB7RYa4QTvjzlv4+LmL0xhn9VDsK74boYOdq5Y17rFx/yM8VeTmkKYFFK6W+ezSJ48 X-Received: by 10.112.199.5 with SMTP id jg5mr11071266lbc.14.1441972949393; Fri, 11 Sep 2015 05:02:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.100 with SMTP id l4ls334619lam.80.gmail; Fri, 11 Sep 2015 05:02:29 -0700 (PDT) X-Received: by 10.112.160.73 with SMTP id xi9mr40752604lbb.92.1441972949242; Fri, 11 Sep 2015 05:02:29 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id ap9si4893lbc.133.2015.09.11.05.02.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2015 05:02:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by lahg1 with SMTP id g1so16290672lah.1 for ; Fri, 11 Sep 2015 05:02:29 -0700 (PDT) X-Received: by 10.152.170.230 with SMTP id ap6mr41508038lac.73.1441972949009; Fri, 11 Sep 2015 05:02:29 -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 w3csp1544604lbq; Fri, 11 Sep 2015 05:02:27 -0700 (PDT) X-Received: by 10.107.136.88 with SMTP id k85mr2882691iod.135.1441972947639; Fri, 11 Sep 2015 05:02:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f201si145155iof.103.2015.09.11.05.02.26; Fri, 11 Sep 2015 05:02:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 S1752043AbbIKMC0 (ORCPT + 7 others); Fri, 11 Sep 2015 08:02:26 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:34053 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986AbbIKMCZ (ORCPT ); Fri, 11 Sep 2015 08:02:25 -0400 Received: by padhy16 with SMTP id hy16so73613481pad.1 for ; Fri, 11 Sep 2015 05:02:24 -0700 (PDT) X-Received: by 10.66.157.137 with SMTP id wm9mr37075451pab.30.1441972944445; Fri, 11 Sep 2015 05:02:24 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id xi1sm2013909pac.48.2015.09.11.05.02.23 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 11 Sep 2015 05:02:23 -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 , Mark Brown , devicetree@vger.kernel.org, Ian Campbell , Kumar Gala , linux-kernel@vger.kernel.org (open list), Mark Rutland , Pawel Moll , "Rafael J. Wysocki" , Rob Herring Subject: [PATCH 01/16] PM / OPP: Add 'supply-names' binding Date: Fri, 11 Sep 2015 17:31:57 +0530 Message-Id: <2b87b162eabd1570ae2311e1ef8655acda72f678.1441972771.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@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.44 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: , Regulators already have stable DT bindings, wherein the consumer (of supplies) will have following for each regulator/supply. -supply: ; Current OPP bindings extend above, by transforming it into a list of phandles. But we missed the string, which is used to identify the regulator. And looking from regulators perspective, having two different ways of specifying regulators doesn't seem like a step forward, it also means we have to update every single device binding. And things will become complex. Another way to support multiple regulators per device (in OPP V2 bindings) is to leave regulator consumer bindings as is, and create a 'supply-names' property in the opp-table node, which will contain a list of strings. The names in this list shall match 'name' from the '-supply' strings present in the device node. The strings in this list also specify the order in which values must be present in 'opp-microvolt' and 'opp-microamp' properties. Cc: Mark Brown Cc: devicetree@vger.kernel.org Signed-off-by: Viresh Kumar --- Documentation/devicetree/bindings/opp/opp.txt | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index 0cb44dc21f97..8759bc4783ed 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -69,6 +69,13 @@ This describes the OPPs belonging to a device. This node can have following - compatible: Allow OPPs to express their compatibility. It should be: "operating-points-v2". +- supply-names: This is a required property, only if multiple supplies are + available for the device. Otherwise it is optional. + + This list is used to pass names of all the device supplies. The order of names + present here is important, as that should match the order in which values are + present in 'opp-microvolt' and 'opp-microamp' properties. + - OPP nodes: One or more OPP nodes describing voltage-current-frequency combinations. Their name isn't significant but their phandle can be used to reference an OPP. @@ -97,8 +104,8 @@ properties. Single entry is for target voltage and three entries are for voltages. - Entries for multiple regulators must be present in the same order as - regulators are specified in device's DT node. + Entries for multiple regulators must be present in the same order as their + names are present in 'supply-names' property of the opp-table. - opp-microamp: The maximum current drawn by the device in microamperes considering system specific parameters (such as transients, process, aging, @@ -107,10 +114,12 @@ properties. Should only be set if opp-microvolt is set for the OPP. - Entries for multiple regulators must be present in the same order as - regulators are specified in device's DT node. If this property isn't required - for few regulators, then this should be marked as zero for them. If it isn't - required for any regulator, then this property need not be present. + Entries for multiple regulators must be present in the same order as their + names are present in 'supply-names' property of the opp-table. + + If this property isn't required for few regulators, then this should be marked + as zero for them. If it isn't required for any regulator, then this property + need not be present. - clock-latency-ns: Specifies the maximum possible transition latency (in nanoseconds) for switching to this OPP from any other OPP. @@ -369,13 +378,16 @@ Example 4: Handling multiple regulators compatible = "arm,cortex-a7"; ... - cpu-supply = <&cpu_supply0>, <&cpu_supply1>, <&cpu_supply2>; + vcc0-supply = <&cpu_supply0>; + vcc1-supply = <&cpu_supply1>; + vcc2-supply = <&cpu_supply2>; operating-points-v2 = <&cpu0_opp_table>; }; }; cpu0_opp_table: opp_table0 { compatible = "operating-points-v2"; + supply-names = "vcc0", "vcc1", "vcc2"; opp-shared; opp00 {