From patchwork Wed Jun 10 07:57:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 49675 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F13A520C81 for ; Wed, 10 Jun 2015 07:58:28 +0000 (UTC) Received: by wgla2 with SMTP id a2sf10067816wgl.1 for ; Wed, 10 Jun 2015 00:58:28 -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=cw4QGGaYs++IEzKhsv0iIHCiBmRGqDdsztDp0PX/6v0=; b=CAKOmWZ4Ed0HLYadaNBmAKbRIn+G9ummjXcu8nCqJDpFQONQgDx9rUxtTNZYNlBR2s N8Isfa45kppigSwLgUBbR4kBvfojkRIMvDBwxK9PiWKMPYaU6HBy+dTZ2ytiQNas/cA9 cqQQxkVI2vbQHY0xj353OWj+vH6W7x9CPNqpOv6QTYaJUC4N3bP1JNjgVa/OHAkg43Me IpeSchF8HyQUzF+1XBC1biO3Rp1E2hLBgp6HW64NfiL1ZYts6XxhutudxOwhD7zLRujW 8VzbjH/CD0TnKsbzq7h+v9p0Ko4XkrqJqaqDG1SO6qYdPA1842xsVvxScSIDwQQym4zL kkcA== X-Gm-Message-State: ALoCoQnxjx8hWDJgwal3UA6wdYuXpb2YVb4D9sMCY49zE4A0mWP4JGYzrSMzKk/30fD8Ywe08vaI X-Received: by 10.180.83.72 with SMTP id o8mr20866294wiy.3.1433923108183; Wed, 10 Jun 2015 00:58:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.230 with SMTP id y6ls207174lae.20.gmail; Wed, 10 Jun 2015 00:58:28 -0700 (PDT) X-Received: by 10.112.158.103 with SMTP id wt7mr1918495lbb.5.1433923107994; Wed, 10 Jun 2015 00:58:27 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id re5si8056910lbb.150.2015.06.10.00.58.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jun 2015 00:58:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by laew7 with SMTP id w7so27284827lae.1 for ; Wed, 10 Jun 2015 00:58:27 -0700 (PDT) X-Received: by 10.152.4.137 with SMTP id k9mr1896756lak.29.1433923107703; Wed, 10 Jun 2015 00:58:27 -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 hn6csp3155739lbb; Wed, 10 Jun 2015 00:58:26 -0700 (PDT) X-Received: by 10.70.132.195 with SMTP id ow3mr3459289pdb.87.1433923105754; Wed, 10 Jun 2015 00:58:25 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bu7si12694154pdb.22.2015.06.10.00.58.24; Wed, 10 Jun 2015 00:58:25 -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 S933420AbbFJH6P (ORCPT + 28 others); Wed, 10 Jun 2015 03:58:15 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:36541 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933280AbbFJH6H (ORCPT ); Wed, 10 Jun 2015 03:58:07 -0400 Received: by wgbgq6 with SMTP id gq6so29278880wgb.3 for ; Wed, 10 Jun 2015 00:58:06 -0700 (PDT) X-Received: by 10.194.63.228 with SMTP id j4mr3888189wjs.38.1433923086027; Wed, 10 Jun 2015 00:58:06 -0700 (PDT) Received: from localhost.localdomain (host81-129-170-231.range81-129.btcentralplus.com. [81.129.170.231]) by mx.google.com with ESMTPSA id c3sm13135187wja.3.2015.06.10.00.58.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jun 2015 00:58:05 -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: [REBASED 4/5] dt: regulator: pwm-regulator: Re-write bindings Date: Wed, 10 Jun 2015 08:57:52 +0100 Message-Id: <1433923073-907-5-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433923073-907-1-git-send-email-lee.jones@linaro.org> References: <1433923073-907-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.52 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"; };