From patchwork Tue Jul 7 15:06:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 50826 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 ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AC919229FC for ; Tue, 7 Jul 2015 15:07:56 +0000 (UTC) Received: by widjy10 with SMTP id jy10sf63354185wid.3 for ; Tue, 07 Jul 2015 08:07:56 -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=yjaU7Evss5FUGGpJ0+t8ahQGc1oFUWgCgM0j/yM/QoQ=; b=m60LeZciGOf22+d1wvskYUu3jnuuzQtddcGwXuYjsd6pZqIyJtcmt6R/zlcIP3eMTJ hcGLAnpmWue0M3EC9ACdCE72B3xRFudQgmwwG3MvbUUr+eUuyB5kiFBLvFhraAufN/VF VHmEq8ACwWjsp5h0FOzpbF32cbtoWGkJBr4Gsb0kS0aoElEV48JIUBMCqIT2pGk6rNZO yhPSbVXN+Ha+r261pPhlz2yWVaufk5mfkUGQah061APnLt2noFxBmuinIJMX6s8bbIM0 AimTeUtIlzzsOvs9vYZ0TlEC/77qaGJCxuDERJ73rIJsNjsSNF2EYDxbmicnyn0zFRhZ EB/A== X-Gm-Message-State: ALoCoQlrmVRxWnx/moS2D3OMgOzNYpFQDBOhaWx5ENaMeo7STkH73N94xFnguUIZcCLQr/2v0EaF X-Received: by 10.112.189.131 with SMTP id gi3mr2322137lbc.6.1436281675977; Tue, 07 Jul 2015 08:07:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.7 with SMTP id bc7ls807979lab.74.gmail; Tue, 07 Jul 2015 08:07:55 -0700 (PDT) X-Received: by 10.112.134.167 with SMTP id pl7mr4497369lbb.50.1436281675796; Tue, 07 Jul 2015 08:07:55 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id pa1si5308671lbb.148.2015.07.07.08.07.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2015 08:07:55 -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 lagc2 with SMTP id c2so197181818lag.3 for ; Tue, 07 Jul 2015 08:07:55 -0700 (PDT) X-Received: by 10.112.42.50 with SMTP id k18mr4143870lbl.76.1436281674255; Tue, 07 Jul 2015 08:07:54 -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 hn6csp2452712lbb; Tue, 7 Jul 2015 08:07:52 -0700 (PDT) X-Received: by 10.66.66.172 with SMTP id g12mr9737218pat.77.1436281670725; Tue, 07 Jul 2015 08:07:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hv1si23159851pad.212.2015.07.07.08.07.49; Tue, 07 Jul 2015 08:07:50 -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 S932478AbbGGPHn (ORCPT + 29 others); Tue, 7 Jul 2015 11:07:43 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:34945 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932311AbbGGPHJ (ORCPT ); Tue, 7 Jul 2015 11:07:09 -0400 Received: by wgjx7 with SMTP id x7so170635626wgj.2 for ; Tue, 07 Jul 2015 08:07:07 -0700 (PDT) X-Received: by 10.180.98.134 with SMTP id ei6mr97797128wib.49.1436281627559; Tue, 07 Jul 2015 08:07:07 -0700 (PDT) Received: from localhost.localdomain (host86-178-207-130.range86-178.btcentralplus.com. [86.178.207.130]) by mx.google.com with ESMTPSA id x5sm1360101wif.21.2015.07.07.08.07.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Jul 2015 08:07:06 -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 , devicetree@vger.kernel.org Subject: [PATCH v2 6/9] regulator: pwm-regulator: Re-write bindings Date: Tue, 7 Jul 2015 16:06:50 +0100 Message-Id: <1436281613-899-7-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436281613-899-1-git-send-email-lee.jones@linaro.org> References: <1436281613-899-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.215.42 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 Cc: devicetree@vger.kernel.org Signed-off-by: Lee Jones --- .../bindings/regulator/pwm-regulator.txt | 68 ++++++++++++++++++---- 1 file changed, 56 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/regulator/pwm-regulator.txt b/Documentation/devicetree/bindings/regulator/pwm-regulator.txt index ce91f61..892b366 100644 --- a/Documentation/devicetree/bindings/regulator/pwm-regulator.txt +++ b/Documentation/devicetree/bindings/regulator/pwm-regulator.txt @@ -1,27 +1,71 @@ -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 PWM 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"; };