From patchwork Mon Jul 6 08:58:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 50694 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B9DF3229FC for ; Mon, 6 Jul 2015 08:59:03 +0000 (UTC) Received: by wipp2 with SMTP id p2sf29530286wip.2 for ; Mon, 06 Jul 2015 01:59:03 -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=v2IwdPGQzaDXz0YpheyAGEFMQYC/DwnVJQ+E9LHJkY0=; b=ixQ3mkaQ8wMGV8ueDBtVFwB5U58KtwS6y0YlC6JkrDJjUJ718ywOXXWozAvJNHo+xW o/uY8GyNT9CWQsFha74GjIfDhzTVp9+GQfv05AMW+crDzjEGal25ngTy4jFGbbVm4dd9 vl2LQ6WsI6UiuiZvaW6h7qqF2eLD/58rNke/id7gyrDpj+eY6pmFN7jgQEj3D7ex/ads DLnAx47CgArAtJnIEwkEh5OZGcF7CjuLFq3EsfNFkW+yRZl2c2UXFcCpXr8yWmypFbI9 ADhBSdGoC6kJoLTeG8dza7A6XUxz5k3M1GoFgrwmCvkRhHoVE2YHzaQ5ksoKEE9yPEgb GDKA== X-Gm-Message-State: ALoCoQmwO9pTmncX1ZjihQEuVA6I44Bi5VxXOZC/QZdVUQ7ox5alHsB+BC7ojuJVJzVNklix950W X-Received: by 10.194.175.36 with SMTP id bx4mr30005437wjc.1.1436173143080; Mon, 06 Jul 2015 01:59:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.25.134 with SMTP id c6ls669854lag.54.gmail; Mon, 06 Jul 2015 01:59:02 -0700 (PDT) X-Received: by 10.112.10.166 with SMTP id j6mr43588356lbb.120.1436173142793; Mon, 06 Jul 2015 01:59:02 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id gk6si14686144lbc.173.2015.07.06.01.59.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 01:59:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by lagx9 with SMTP id x9so146161790lag.1 for ; Mon, 06 Jul 2015 01:59:02 -0700 (PDT) X-Received: by 10.112.131.98 with SMTP id ol2mr48968611lbb.56.1436173142268; Mon, 06 Jul 2015 01:59:02 -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 hn6csp1581711lbb; Mon, 6 Jul 2015 01:59:01 -0700 (PDT) X-Received: by 10.66.55.66 with SMTP id q2mr102977363pap.94.1436173140099; Mon, 06 Jul 2015 01:59:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qa10si27921044pbc.83.2015.07.06.01.58.59; Mon, 06 Jul 2015 01:59:00 -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 S1755012AbbGFI6v (ORCPT + 8 others); Mon, 6 Jul 2015 04:58:51 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:34051 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754975AbbGFI6q (ORCPT ); Mon, 6 Jul 2015 04:58:46 -0400 Received: by wifm2 with SMTP id m2so22966648wif.1 for ; Mon, 06 Jul 2015 01:58:45 -0700 (PDT) X-Received: by 10.194.93.198 with SMTP id cw6mr96978156wjb.113.1436173125731; Mon, 06 Jul 2015 01:58:45 -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 d7sm18085910wij.0.2015.07.06.01.58.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Jul 2015 01:58:45 -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: [RESEND 06/10] dt: regulator: pwm-regulator: Re-write bindings Date: Mon, 6 Jul 2015 09:58:28 +0100 Message-Id: <1436173112-21397-7-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436173112-21397-1-git-send-email-lee.jones@linaro.org> References: <1436173112-21397-1-git-send-email-lee.jones@linaro.org> 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: 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.51 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 | 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..0ae7895 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 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"; };