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: 482501 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C8348140295 for ; Wed, 10 Jun 2015 17:59:13 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933360AbbFJH6O (ORCPT ); Wed, 10 Jun 2015 03:58:14 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:34437 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933279AbbFJH6H (ORCPT ); Wed, 10 Jun 2015 03:58:07 -0400 Received: by wibut5 with SMTP id ut5so39647557wib.1 for ; Wed, 10 Jun 2015 00:58:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Zna5eCLFHDosP/HNTyQYx141f8gQMeKnygiMtssZQIQ=; b=mMRL5ZqDtqkKQhUloOm7WMGVck1XQKQudkjB6/9RoptKZoZAqNhl7PRiB31ODZ9LDq Mr/6FCFc2FloLga6r4DDrskySosGkU0Ku5Trq93QaJba0QvZkNPRi6gvRmKh7swO3K+6 jyD4QRO/7UryfkfL6IRPM8rZ0ei7fGeS32p+eBOZGf1Izhs5JNTKl/facbBpyvXQWfDX eXbuxbfgiFFR105//rWBy0n3v6XSNSNojHcrIebwXM6jBhSCIVbJ/bWPn3AeclEmfupv AKDaWB1+zXY8BrVMtqmpCbOAT0YT6nH07cwCfLQK9flTKxxh6yFQL5ktKbRDW5wIAwiX Jvwg== X-Gm-Message-State: ALoCoQlAKU71T5dsH6+7x2eGb8OiIGcaY17L3CPeD71mTjYuqlbAwN0eCfWzWjhQE11ShO8AKh5G 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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org * 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"; };