128 lines · yaml
1# SPDX-License-Identifier: GPL-2.02%YAML 1.23---4$id: http://devicetree.org/schemas/regulator/pwm-regulator.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#6 7title: Generic PWM Regulator8 9maintainers:10 - Brian Norris <briannorris@chromium.org>11 - Lee Jones <lee@kernel.org>12 - Alexandre Courbot <acourbot@nvidia.com>13 14description: |15 Currently supports 2 modes of operation:16 17 Voltage Table:18 When in this mode, a voltage table (See below) of predefined voltage <=>19 duty-cycle values must be provided via DT. Limitations are that the20 regulator can only operate at the voltages supplied in the table.21 Intermediary duty-cycle values which would normally allow finer grained22 voltage selection are ignored and rendered useless. Although more control23 is given to the user if the assumptions made in continuous-voltage mode do24 not reign true.25 26 Continuous Voltage:27 This mode uses the regulator's maximum and minimum supplied voltages28 specified in the regulator-{min,max}-microvolt properties to calculate29 appropriate duty-cycle values. This allows for a much more fine grained30 solution when compared with voltage-table mode above. This solution does31 make an assumption that a %50 duty-cycle value will cause the regulator32 voltage to run at half way between the supplied max_uV and min_uV values.33 34 If voltage-table is provided, then the device will be used in Voltage Table35 Mode. If no voltage-table is provided, then the device will be used in36 Continuous Voltage Mode.37 38allOf:39 - $ref: regulator.yaml#40 41properties:42 compatible:43 const: pwm-regulator44 45 pwms:46 maxItems: 147 48 voltage-table:49 description: Voltage and Duty-Cycle table.50 $ref: /schemas/types.yaml#/definitions/uint32-matrix51 items:52 items:53 - description: voltage in microvolts (uV)54 - description: duty-cycle in percent (%)55 56 enable-gpios:57 description: Regulator enable GPIO58 maxItems: 159 60 # Optional properties for Continuous mode:61 pwm-dutycycle-unit:62 description:63 Integer value encoding the duty cycle unit. If not64 defined, <100> is assumed, meaning that65 pwm-dutycycle-range contains values expressed in66 percent.67 $ref: /schemas/types.yaml#/definitions/uint3268 default: 10069 70 pwm-dutycycle-range:71 description:72 Should contain 2 entries. The first entry is encoding73 the dutycycle for regulator-min-microvolt and the74 second one the dutycycle for regulator-max-microvolt.75 Duty cycle values are expressed in pwm-dutycycle-unit.76 If not defined, <0 100> is assumed.77 $ref: /schemas/types.yaml#/definitions/uint32-array78 items:79 - description: the dutycycle for regulator-min-microvolt80 - description: the dutycycle for regulator-max-microvolt81 default: [ 0 100 ]82 83required:84 - compatible85 - pwms86 87unevaluatedProperties: false88 89examples:90 - |91 #include <dt-bindings/gpio/gpio.h>92 93 // Continuous Voltage With Enable GPIO Example:94 regulator {95 compatible = "pwm-regulator";96 pwms = <&pwm1 0 8448 0>;97 enable-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;98 regulator-min-microvolt = <1016000>;99 regulator-max-microvolt = <1114000>;100 regulator-name = "vdd_logic";101 /* unit == per-mille */102 pwm-dutycycle-unit = <1000>;103 /*104 * Inverted PWM logic, and the duty cycle range is limited105 * to 30%-70%.106 */107 pwm-dutycycle-range = <700 300>; /* */108 };109 110 - |111 // Voltage Table Example:112 regulator {113 compatible = "pwm-regulator";114 pwms = <&pwm1 0 8448 0>;115 regulator-min-microvolt = <1016000>;116 regulator-max-microvolt = <1114000>;117 regulator-name = "vdd_logic";118 119 /* Voltage Duty-Cycle */120 voltage-table = <1114000 0>,121 <1095000 10>,122 <1076000 20>,123 <1056000 30>,124 <1036000 40>,125 <1016000 50>;126 };127...128