From patchwork Tue May 21 21:20:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 164751 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp56775ili; Tue, 21 May 2019 14:20:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWubFQ7xZKFly47F7/9RFQPXscI51UxG8lKzifgWDhWJWbbNq3soNrXlFi7DKVS31qqIwV X-Received: by 2002:a65:450b:: with SMTP id n11mr43346330pgq.174.1558473637486; Tue, 21 May 2019 14:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558473637; cv=none; d=google.com; s=arc-20160816; b=q+Zrv4eWj9wVLkuEM5V4hJxyTHO2M3egKJwzLAfIE+sA3RcsbctOYvLMFeOXivJbny 4IERrFPhehRhRjwpnidFsSfak6isRIj6CfyztFORwevK0rt/bkOvKDJN4YEZtYGVF4nK kf/s6h0DYQ6OwEmzt+OK5BPEeWK5qRcF5NPxvF1jzpk+wrKfJ7PqmtJTz4GD9Z4G0x+R yKIbBY4Vh+teagk4IMQTpLXSZQ1lewif3XgcvDBDs0nclv4Mvsi4dMqLrLyT/cj5U3Lh yUUmIhr0oV2LANn5FnQG3lRzICtdufmMgn8QPxBmOFiGcem/QXn9en6O0E1vsYK7/Z3Y VjFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ohQFTgMMLwtzJyoURDl0Jg9MM3ofsM/G0HILwpPhwVs=; b=wTcXsSwmATyt3soCCxwe0K1zf/icOCrNchvEKBA6fn1M6UvkmA7arYrF8etkwiAGnf nYLuonwIDoBp5ti3rIdgBywXMrFVfRdZ8rGOSLE6WqD5KloWeBD0qJh4AJFLCHPfUJ4k VN0cxLpXpyE7XGQpt1V7GkVpf5JRPlJlzdjg6q7HlQ5+0ocfbptBoUs5g1mvJFltj3fQ 041W1yNjQHXSNmWydiLAjkkBD29mK1KBr02Bjs9fwgCU9JuSr16WKsEJaSC2Mow0KKtp UnwNIamvB0fPhnCLfFoBkwNnBV7Qu+5u5Rf56DToPoin8C20ooMJL2xRPKrnAYN9tGI9 hZSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w27si21739044pgl.277.2019.05.21.14.20.37; Tue, 21 May 2019 14:20:37 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727963AbfEUVUg (ORCPT + 30 others); Tue, 21 May 2019 17:20:36 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:42205 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727156AbfEUVUf (ORCPT ); Tue, 21 May 2019 17:20:35 -0400 Received: by mail-oi1-f194.google.com with SMTP id w9so12156196oic.9; Tue, 21 May 2019 14:20:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ohQFTgMMLwtzJyoURDl0Jg9MM3ofsM/G0HILwpPhwVs=; b=mDYIP3YxPmnQy1/uDtUNvIZOXpld8tF05bFqegwgJU6gduQhVyQva1QXOMuvkr511L kwMp3CB0gtlX37bX13NM5O5g2bFTsPhOEW0T+b4QqI915ggwNDZlZG8u2If+V4879RjW +3faNrpQv5mUO005ureOUv/r8LgsOs8/Y7Ms2t2fUc09hLsjjMvLRF2fbUyTUja+vitQ gxLk+KeuaIIlhHMk6h/MhbviFyfCRBL+yPgy/a/kyL2UARu1Z6PKryrynLvhziXTq1M8 Psrf8Zb9qnySI/X72JkO/+1GuKk/48UA6fEGWrcGoWtwrxyuBfFp26ti0WPVQpdm0zpT ib7Q== X-Gm-Message-State: APjAAAWHMxQRpZewXW+vZE8C3R/y3ESzfHHrsBe1AQ6y41Ytl1dIOzkp dszdYaBuQtDCZAvcqcsjngZks+g= X-Received: by 2002:aca:d6d0:: with SMTP id n199mr4713837oig.51.1558473634575; Tue, 21 May 2019 14:20:34 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id y3sm7510534oto.58.2019.05.21.14.20.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 21 May 2019 14:20:33 -0700 (PDT) From: Rob Herring To: Mark Brown Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Liam Girdwood Subject: [PATCH 2/3] dt-bindings: regulator: Convert gpio-regulator to json-schema Date: Tue, 21 May 2019 16:20:30 -0500 Message-Id: <20190521212031.12982-2-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190521212031.12982-1-robh@kernel.org> References: <20190521212031.12982-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the gpio-regulator binding to DT schema format using json-schema. Cc: Liam Girdwood Cc: Mark Brown Signed-off-by: Rob Herring --- .../bindings/regulator/gpio-regulator.txt | 57 --------- .../bindings/regulator/gpio-regulator.yaml | 118 ++++++++++++++++++ 2 files changed, 118 insertions(+), 57 deletions(-) delete mode 100644 Documentation/devicetree/bindings/regulator/gpio-regulator.txt create mode 100644 Documentation/devicetree/bindings/regulator/gpio-regulator.yaml -- 2.20.1 diff --git a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt deleted file mode 100644 index dd25e73b5d79..000000000000 --- a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt +++ /dev/null @@ -1,57 +0,0 @@ -GPIO controlled regulators - -Required properties: -- compatible : Must be "regulator-gpio". -- regulator-name : Defined in regulator.txt as optional, but required - here. -- gpios : Array of one or more GPIO pins used to select the - regulator voltage/current listed in "states". -- states : Selection of available voltages/currents provided by - this regulator and matching GPIO configurations to - achieve them. If there are no states in the "states" - array, use a fixed regulator instead. - -Optional properties: -- enable-gpios : GPIO used to enable/disable the regulator. - Warning, the GPIO phandle flags are ignored and the - GPIO polarity is controlled solely by the presence - of "enable-active-high" DT property. This is due to - compatibility with old DTs. -- enable-active-high : Polarity of "enable-gpio" GPIO is active HIGH. - Default is active LOW. -- gpios-states : On operating systems, that don't support reading back - gpio values in output mode (most notably linux), this - array provides the state of GPIO pins set when - requesting them from the gpio controller. Systems, - that are capable of preserving state when requesting - the lines, are free to ignore this property. - 0: LOW, 1: HIGH. Default is LOW if nothing else - is specified. -- startup-delay-us : Startup time in microseconds. -- regulator-type : Specifies what is being regulated, must be either - "voltage" or "current", defaults to voltage. - -Any property defined as part of the core regulator binding defined in -regulator.txt can also be used. - -Example: - - mmciv: gpio-regulator { - compatible = "regulator-gpio"; - - regulator-name = "mmci-gpio-supply"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <2600000>; - regulator-boot-on; - - enable-gpios = <&gpio0 23 0x4>; - gpios = <&gpio0 24 0x4 - &gpio0 25 0x4>; - states = <1800000 0x3 - 2200000 0x2 - 2600000 0x1 - 2900000 0x0>; - - startup-delay-us = <100000>; - enable-active-high; - }; diff --git a/Documentation/devicetree/bindings/regulator/gpio-regulator.yaml b/Documentation/devicetree/bindings/regulator/gpio-regulator.yaml new file mode 100644 index 000000000000..9d3b28417fb6 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/gpio-regulator.yaml @@ -0,0 +1,118 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/gpio-regulator.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: GPIO controlled regulators + +maintainers: + - Liam Girdwood + - Mark Brown + +description: + Any property defined as part of the core regulator binding, defined in + regulator.txt, can also be used. + +allOf: + - $ref: "regulator.yaml#" + +properties: + compatible: + const: regulator-gpio + + regulator-name: true + + enable-gpios: + description: GPIO to use to enable/disable the regulator. + Warning, the GPIO phandle flags are ignored and the GPIO polarity is + controlled solely by the presence of "enable-active-high" DT property. + This is due to compatibility with old DTs. + maxItems: 1 + + gpios: + description: Array of one or more GPIO pins used to select the regulator + voltage/current listed in "states". + minItems: 1 + maxItems: 8 # Should be enough... + + gpios-states: + description: | + On operating systems, that don't support reading back gpio values in + output mode (most notably linux), this array provides the state of GPIO + pins set when requesting them from the gpio controller. Systems, that are + capable of preserving state when requesting the lines, are free to ignore + this property. + 0: LOW + 1: HIGH + Default is LOW if nothing else is specified. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32-array + - maxItems: 8 + items: + enum: [ 0, 1 ] + default: 0 + + states: + description: Selection of available voltages/currents provided by this + regulator and matching GPIO configurations to achieve them. If there are + no states in the "states" array, use a fixed regulator instead. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32-matrix + - maxItems: 8 + items: + items: + - description: Voltage in microvolts + - description: GPIO group state value + + startup-delay-us: + description: startup time in microseconds + + enable-active-high: + description: Polarity of "enable-gpio" GPIO is active HIGH. Default is + active LOW. + type: boolean + + gpio-open-drain: + description: + GPIO is open drain type. If this property is missing then default + assumption is false. + type: boolean + + regulator-type: + description: Specifies what is being regulated. + allOf: + - $ref: /schemas/types.yaml#/definitions/string + - enum: + - voltage + - current + default: voltage + +required: + - compatible + - regulator-name + - gpios + - states + +examples: + - | + gpio-regulator { + compatible = "regulator-gpio"; + + regulator-name = "mmci-gpio-supply"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <2600000>; + regulator-boot-on; + + enable-gpios = <&gpio0 23 0x4>; + gpios = <&gpio0 24 0x4 + &gpio0 25 0x4>; + states = <1800000 0x3>, + <2200000 0x2>, + <2600000 0x1>, + <2900000 0x0>; + + startup-delay-us = <100000>; + enable-active-high; + }; +... From patchwork Tue May 21 21:20:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 164752 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp56817ili; Tue, 21 May 2019 14:20:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7CDji+xpJDTUeH0DGp8mjeyqRHwFTuXMK2sHMa0QATtb44UrpwxaAYD3PhL/J6cDmQ5yi X-Received: by 2002:a17:902:5a4f:: with SMTP id f15mr51710861plm.1.1558473639756; Tue, 21 May 2019 14:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558473639; cv=none; d=google.com; s=arc-20160816; b=LYomF4r0Kihgul3TZviedTC6wQuI2CjJqJeGCdmK1Dq/E4BTDv1AMrtvj/P8ccp/Ix sSgLiTbHHl7ZgRWypzq/rGJpgXcw9Vl6mxl4+oiMiDFlJd8sZBdHqOezh7JcPnP3vodU J5y4hUz16eqZAjn8287hvpz7dg1A3MxubA98I8qAQdLtSC7gdiNNubuNVABv0tfjnjF4 h/zloAihGOGnwnbeB+GqTZj2hG/OvLmDzMTe69DyX+YUXBKLD2zcdxzD7Nmob1MVtMhw SGv8gQvKVoKuaAqIWfLwQGsMxauOJrJH+XU89QaKrbF7q1y/Q3HdHvS15sQE2edwAn0f GC7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=apsoYF5amNns5etmn4zujNCoRo5NDmvzuAIXQhJvm/E=; b=SMV0Y3wAEme5ddnYRHcmBmrcDpa5VgJZ/e0OEp9H5QQJyf5KMHO39h9hlCpXOdEBla AFoOBiX1HYrBL2YtGdvrMZgtvqdO6OkOtznzTF74KB3M8goU89qUmn0WqCNrTKtdjZkd tnfd86hxbiOfzbc239qFx+QCxfAUUYGiIunfMn+ijURcR9A2ep1ht2A8rzUZVZwsrw9T NAGBci7se014wpCzlGNAXlrlODgXQQgXDuXxA7YAwbkD7DkKO7emdqmey0rPQAUo0IRa unihxJ7Hw80dwpOoTWDNSCgehChklhWlOOMycdB/JGsX5xQQWnZGd7YA5cVVdyerJb6c COUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k185si12274643pge.229.2019.05.21.14.20.39; Tue, 21 May 2019 14:20:39 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728074AbfEUVUi (ORCPT + 30 others); Tue, 21 May 2019 17:20:38 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:40078 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727959AbfEUVUg (ORCPT ); Tue, 21 May 2019 17:20:36 -0400 Received: by mail-ot1-f65.google.com with SMTP id u11so132422otq.7; Tue, 21 May 2019 14:20:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=apsoYF5amNns5etmn4zujNCoRo5NDmvzuAIXQhJvm/E=; b=KjWR2dJyFJNsz5TAfVsaT0nXK0ij8pSscu1oxE9+llbcyVGoz9f3WhL0ECLVkl/cvJ ru1HlrsdxW+0czqdHo3Y2E43OeJSWlnQvTujUBkvBVvSALis64hRew4HyWus7OpUWO0/ ieTsnNljU+xnNe8lHW+dVy5MfNuye3ksVYDzZDxLLZWPOdix+btjymeZjwKDR2gg969D v+lhRhjPn/JluS2vnvOaPCblxotnWdj9Nwy9uZLERxmX4xheOrnGzMaSGjq5as8kywq9 o3A2CEmViqGkxHcWoLZJm4c941o9cy42Q2l3136Q+QIuuqD8ANFN1HQ7Ij8NBdl2agcU qCFA== X-Gm-Message-State: APjAAAUNi4g56ZxUI18rI9o14P73llaurYN4J0ohTPhlfsm3ksWzbBQb FZX/2rQ70M/h+PcwWvUseHJqbl8= X-Received: by 2002:a9d:224c:: with SMTP id o70mr5753190ota.261.1558473635981; Tue, 21 May 2019 14:20:35 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id y3sm7510534oto.58.2019.05.21.14.20.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 21 May 2019 14:20:35 -0700 (PDT) From: Rob Herring To: Mark Brown Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Mack , Liam Girdwood Subject: [PATCH 3/3] dt-bindings: regulator: Convert max8660 binding to json-schema Date: Tue, 21 May 2019 16:20:31 -0500 Message-Id: <20190521212031.12982-3-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190521212031.12982-1-robh@kernel.org> References: <20190521212031.12982-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the max8660 binding to DT schema format using json-schema. Cc: Daniel Mack Cc: Liam Girdwood Cc: Mark Brown Signed-off-by: Rob Herring --- .../devicetree/bindings/regulator/max8660.txt | 47 ----------- .../bindings/regulator/max8660.yaml | 77 +++++++++++++++++++ 2 files changed, 77 insertions(+), 47 deletions(-) delete mode 100644 Documentation/devicetree/bindings/regulator/max8660.txt create mode 100644 Documentation/devicetree/bindings/regulator/max8660.yaml -- 2.20.1 diff --git a/Documentation/devicetree/bindings/regulator/max8660.txt b/Documentation/devicetree/bindings/regulator/max8660.txt deleted file mode 100644 index 8ba994d8a142..000000000000 --- a/Documentation/devicetree/bindings/regulator/max8660.txt +++ /dev/null @@ -1,47 +0,0 @@ -Maxim MAX8660 voltage regulator - -Required properties: -- compatible: must be one of "maxim,max8660", "maxim,max8661" -- reg: I2C slave address, usually 0x34 -- any required generic properties defined in regulator.txt - -Example: - - i2c_master { - max8660@34 { - compatible = "maxim,max8660"; - reg = <0x34>; - - regulators { - regulator@0 { - regulator-compatible= "V3(DCDC)"; - regulator-min-microvolt = <725000>; - regulator-max-microvolt = <1800000>; - }; - - regulator@1 { - regulator-compatible= "V4(DCDC)"; - regulator-min-microvolt = <725000>; - regulator-max-microvolt = <1800000>; - }; - - regulator@2 { - regulator-compatible= "V5(LDO)"; - regulator-min-microvolt = <1700000>; - regulator-max-microvolt = <2000000>; - }; - - regulator@3 { - regulator-compatible= "V6(LDO)"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; - }; - - regulator@4 { - regulator-compatible= "V7(LDO)"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; - }; - }; - }; - }; diff --git a/Documentation/devicetree/bindings/regulator/max8660.yaml b/Documentation/devicetree/bindings/regulator/max8660.yaml new file mode 100644 index 000000000000..9c038698f880 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/max8660.yaml @@ -0,0 +1,77 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/max8660.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Maxim MAX8660 voltage regulator + +maintainers: + - Daniel Mack + +properties: + $nodename: + pattern: "pmic@[0-9a-f]{1,2}" + compatible: + enum: + - maxim,max8660 + - maxim,max8661 + + reg: + maxItems: 1 + + regulators: + type: object + + patternProperties: + "regulator-.+": + $ref: "regulator.yaml#" + + additionalProperties: false + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + pmic@34 { + compatible = "maxim,max8660"; + reg = <0x34>; + + regulators { + regulator-V3 { + regulator-compatible= "V3(DCDC)"; + regulator-min-microvolt = <725000>; + regulator-max-microvolt = <1800000>; + }; + + regulator-V4 { + regulator-compatible= "V4(DCDC)"; + regulator-min-microvolt = <725000>; + regulator-max-microvolt = <1800000>; + }; + + regulator-V5 { + regulator-compatible= "V5(LDO)"; + regulator-min-microvolt = <1700000>; + regulator-max-microvolt = <2000000>; + }; + + regulator-V6 { + regulator-compatible= "V6(LDO)"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + }; + + regulator-V7 { + regulator-compatible= "V7(LDO)"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + }; + }; + }; + }; +...