mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-29 14:05:19 +08:00
6fdc6e23a7
This doesn't yet do anything in the tools, but make it explicit so we can check either 'unevaluatedProperties' or 'additionalProperties' is present in schemas. 'unevaluatedProperties' is appropriate when including another schema (via '$ref') and all possible properties and/or child nodes are not explicitly listed in the schema with the '$ref'. This is in preparation to add a meta-schema to check for missing 'unevaluatedProperties' or 'additionalProperties'. This has been a constant source of review issues. Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Wolfram Sang <wsa@kernel.org> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-By: Vinod Koul <vkoul@kernel.org> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://lore.kernel.org/r/20201005183830.486085-2-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org>
118 lines
3.1 KiB
YAML
118 lines
3.1 KiB
YAML
# 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 <lgirdwood@gmail.com>
|
|
- Mark Brown <broonie@kernel.org>
|
|
|
|
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.
|
|
$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.
|
|
$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.
|
|
$ref: /schemas/types.yaml#/definitions/string
|
|
enum:
|
|
- voltage
|
|
- current
|
|
default: voltage
|
|
|
|
required:
|
|
- compatible
|
|
- regulator-name
|
|
- gpios
|
|
- states
|
|
|
|
unevaluatedProperties: false
|
|
|
|
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;
|
|
};
|
|
...
|