From patchwork Fri Jun 5 18:42:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 49595 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 705922462C for ; Fri, 5 Jun 2015 18:43:41 +0000 (UTC) Received: by labc7 with SMTP id c7sf21721408lab.1 for ; Fri, 05 Jun 2015 11:43:40 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=/qOrYjo5+nnuy3WUGERC5z5l6p530eYlxk12SMu3R9g=; b=f7ZsaQt4NiyU80dvlMfXF4xNqdT1yBKKkYNwG9EF/riCHIhiblSpBsq3+IKpwlqmrd Pszx9vMQ/jlMAE/YZxzA547XhwUD7Kg4FmjNv7LlxyzKoRtYHhArkhZpT7Dl9cJrDVag 9e+he2EEMn3HWxs5MEJk7CPhoB+yZzHssiL7TZaVA6dgcL2eQbnye79yHyUNTfi2g7Fc 1g9IVuMa5FEnyaCw+anviW23IKhbRaMZOYRB89MYzFbLDhIILGCp1UFG5lVsmOVyFuY/ DnnSyHK8uxDRehl3S/UlOfnD7xMDxPx60OLYIlU3jAXaNjWNE33zpXKe6Jo1SYGsZ2yg MbPg== X-Gm-Message-State: ALoCoQl6nWi4cG4A8d/eoAFCWPbAuIQE7ohlhImtAc/KH4RTRARULgOpkafFyW4dMu6SlW4IGjCp X-Received: by 10.112.97.210 with SMTP id ec18mr4354592lbb.15.1433529820411; Fri, 05 Jun 2015 11:43:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.8 with SMTP id u8ls416411laj.39.gmail; Fri, 05 Jun 2015 11:43:40 -0700 (PDT) X-Received: by 10.152.20.40 with SMTP id k8mr4539459lae.115.1433529820166; Fri, 05 Jun 2015 11:43:40 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id kz10si5467004lab.140.2015.06.05.11.43.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 11:43:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbcmx3 with SMTP id mx3so51185423lbc.1 for ; Fri, 05 Jun 2015 11:43:40 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr4638082lbb.76.1433529819932; Fri, 05 Jun 2015 11:43:39 -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.108.230 with SMTP id hn6csp70958lbb; Fri, 5 Jun 2015 11:43:38 -0700 (PDT) X-Received: by 10.68.167.162 with SMTP id zp2mr8020782pbb.105.1433529814495; Fri, 05 Jun 2015 11:43:34 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bm1si11870432pbd.212.2015.06.05.11.43.33; Fri, 05 Jun 2015 11:43:34 -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 S932863AbbFESnX (ORCPT + 28 others); Fri, 5 Jun 2015 14:43:23 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:32905 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932731AbbFESnR (ORCPT ); Fri, 5 Jun 2015 14:43:17 -0400 Received: by wgez8 with SMTP id z8so63128462wge.0 for ; Fri, 05 Jun 2015 11:43:15 -0700 (PDT) X-Received: by 10.180.76.8 with SMTP id g8mr63764851wiw.79.1433529795855; Fri, 05 Jun 2015 11:43:15 -0700 (PDT) Received: from localhost.localdomain ([213.205.253.199]) by mx.google.com with ESMTPSA id be3sm4473541wib.21.2015.06.05.11.43.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jun 2015 11:43:15 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, broonie@kernel.org, lgirdwood@gmail.com, Lee Jones Subject: [PATCH 8/8] dt: regulator: pwm-regulator: Re-write bindings Date: Fri, 5 Jun 2015 19:42:51 +0100 Message-Id: <1433529771-24496-9-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433529771-24496-1-git-send-email-lee.jones@linaro.org> References: <1433529771-24496-1-git-send-email-lee.jones@linaro.org> 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: lee.jones@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.175 as permitted sender) smtp.mail=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: , * Add support for continuous-voltage mode * Put more meat on the bones with regards to voltage-table mode * Sort out formatting for ease of consumption Signed-off-by: Lee Jones --- .../bindings/regulator/pwm-regulator.txt | 66 ++++++++++++++++++---- 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/regulator/pwm-regulator.txt b/Documentation/devicetree/bindings/regulator/pwm-regulator.txt index ce91f61..9a8269f 100644 --- a/Documentation/devicetree/bindings/regulator/pwm-regulator.txt +++ b/Documentation/devicetree/bindings/regulator/pwm-regulator.txt @@ -1,27 +1,69 @@ -pwm regulator bindings +Bindings for the Generic PWM Regulator +====================================== + +Currently supports 2 modes of operation: + +voltage-table: When in this mode, a voltage table (See below) of predefined + voltage <=> duty-cycle values must be provided via DT. + Limitations are that the regulator can only operate at the + voltages supplied in the table. Intermediary duty-cycle + values which would normally allow finer grained voltage + selection are ignored and rendered useless. Although more + control is given to the user if the assumptions made in + continuous-voltage mode do not reign true. + +continuous-voltage: This mode uses the regulator's maximum and minimum supplied + voltages specified in the regulator-{min,max}-microvolt + properties to calculate appropriate duty-cycle values. This + allows for a much more fine grained solution when compared + with voltage-table mode above. This solution does make an + assumption that a %50 duty-cycle value will cause the + regulator voltage to run at half way between the supplied + max_uV and min_uV values. Required properties: -- compatible: Should be "pwm-regulator" -- pwms: OF device-tree PWM specification (see PWM binding pwm.txt) -- voltage-table: voltage and duty table, include 2 members in each set of - brackets, first one is voltage(unit: uv), the next is duty(unit: percent) +-------------------- +- compatible: Should be "pwm-regulator" + +- pwms: PWM specification (See: ../pwm/pwm.txt) + +One of these must be provided: +- voltage-table: Voltage and Duty-Cycle table consisting of 2 cells + First cell is voltage in microvolts (uV) + Second cell is duty-cycle in percent (%) + +- max-duty-cycle: Maximum Duty-Cycle value -- this will normally be 255 (0xff) + for an 8 bit PMU device -Any property defined as part of the core regulator binding defined in -regulator.txt can also be used. +If both are provided, the current default is voltage-table mode. -Example: +Any property defined as part of the core regulator binding can also be used. +(See: ../regulator/regulator.txt) + +Continuous Voltage Example: pwm_regulator { compatible = "pwm-regulator; pwms = <&pwm1 0 8448 0>; + regulator-min-microvolt = <1016000>; + regulator-max-microvolt = <1114000>; + regulator-name = "vdd_logic"; + + max-duty-cycle = <255>; /* 8bit PWM */ + }; +Voltage Table Example: + pwm_regulator { + compatible = "pwm-regulator; + pwms = <&pwm1 0 8448 0>; + regulator-min-microvolt = <1016000>; + regulator-max-microvolt = <1114000>; + regulator-name = "vdd_logic"; + + /* Voltage Duty-Cycle */ voltage-table = <1114000 0>, <1095000 10>, <1076000 20>, <1056000 30>, <1036000 40>, <1016000 50>; - - regulator-min-microvolt = <1016000>; - regulator-max-microvolt = <1114000>; - regulator-name = "vdd_logic"; };