18c2ecf20Sopenharmony_ciBindings for the Generic PWM Regulator
28c2ecf20Sopenharmony_ci======================================
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ciCurrently supports 2 modes of operation:
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ciVoltage Table:		When in this mode, a voltage table (See below) of
78c2ecf20Sopenharmony_ci			predefined voltage <=> duty-cycle values must be
88c2ecf20Sopenharmony_ci			provided via DT. Limitations are that the regulator can
98c2ecf20Sopenharmony_ci			only operate at the voltages supplied in the table.
108c2ecf20Sopenharmony_ci			Intermediary duty-cycle values which would normally
118c2ecf20Sopenharmony_ci			allow finer grained voltage selection are ignored and
128c2ecf20Sopenharmony_ci			rendered useless.  Although more control is given to
138c2ecf20Sopenharmony_ci			the user if the assumptions made in continuous-voltage
148c2ecf20Sopenharmony_ci			mode do not reign true.
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciContinuous Voltage:	This mode uses the regulator's maximum and minimum
178c2ecf20Sopenharmony_ci			supplied voltages specified in the
188c2ecf20Sopenharmony_ci			regulator-{min,max}-microvolt properties to calculate
198c2ecf20Sopenharmony_ci			appropriate duty-cycle values.  This allows for a much
208c2ecf20Sopenharmony_ci			more fine grained solution when compared with
218c2ecf20Sopenharmony_ci			voltage-table mode above.  This solution does make an
228c2ecf20Sopenharmony_ci			assumption that a %50 duty-cycle value will cause the
238c2ecf20Sopenharmony_ci			regulator voltage to run at half way between the
248c2ecf20Sopenharmony_ci			supplied max_uV and min_uV values.
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciRequired properties:
278c2ecf20Sopenharmony_ci--------------------
288c2ecf20Sopenharmony_ci- compatible:		Should be "pwm-regulator"
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci- pwms:			PWM specification (See: ../pwm/pwm.txt)
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciOnly required for Voltage Table Mode:
338c2ecf20Sopenharmony_ci- voltage-table: 	Voltage and Duty-Cycle table consisting of 2 cells
348c2ecf20Sopenharmony_ci			    First cell is voltage in microvolts (uV)
358c2ecf20Sopenharmony_ci			    Second cell is duty-cycle in percent (%)
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ciOptional properties for Continuous mode:
388c2ecf20Sopenharmony_ci- pwm-dutycycle-unit:	Integer value encoding the duty cycle unit. If not
398c2ecf20Sopenharmony_ci			defined, <100> is assumed, meaning that
408c2ecf20Sopenharmony_ci			pwm-dutycycle-range contains values expressed in
418c2ecf20Sopenharmony_ci			percent.
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci- pwm-dutycycle-range:	Should contain 2 entries. The first entry is encoding
448c2ecf20Sopenharmony_ci			the dutycycle for regulator-min-microvolt and the
458c2ecf20Sopenharmony_ci			second one the dutycycle for regulator-max-microvolt.
468c2ecf20Sopenharmony_ci			Duty cycle values are expressed in pwm-dutycycle-unit.
478c2ecf20Sopenharmony_ci			If not defined, <0 100> is assumed.
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ciNB: To be clear, if voltage-table is provided, then the device will be used
508c2ecf20Sopenharmony_ciin Voltage Table Mode.  If no voltage-table is provided, then the device will
518c2ecf20Sopenharmony_cibe used in Continuous Voltage Mode.
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ciOptional properties:
548c2ecf20Sopenharmony_ci--------------------
558c2ecf20Sopenharmony_ci- enable-gpios:		GPIO to use to enable/disable the regulator
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ciAny property defined as part of the core regulator binding can also be used.
588c2ecf20Sopenharmony_ci(See: ../regulator/regulator.txt)
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ciContinuous Voltage With Enable GPIO Example:
618c2ecf20Sopenharmony_ci	pwm_regulator {
628c2ecf20Sopenharmony_ci		compatible = "pwm-regulator";
638c2ecf20Sopenharmony_ci		pwms = <&pwm1 0 8448 0>;
648c2ecf20Sopenharmony_ci		enable-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
658c2ecf20Sopenharmony_ci		regulator-min-microvolt = <1016000>;
668c2ecf20Sopenharmony_ci		regulator-max-microvolt = <1114000>;
678c2ecf20Sopenharmony_ci		regulator-name = "vdd_logic";
688c2ecf20Sopenharmony_ci		/* unit == per-mille */
698c2ecf20Sopenharmony_ci		pwm-dutycycle-unit = <1000>;
708c2ecf20Sopenharmony_ci		/*
718c2ecf20Sopenharmony_ci		 * Inverted PWM logic, and the duty cycle range is limited
728c2ecf20Sopenharmony_ci		 * to 30%-70%.
738c2ecf20Sopenharmony_ci		 */
748c2ecf20Sopenharmony_ci		pwm-dutycycle-range = <700 300>; /* */
758c2ecf20Sopenharmony_ci	};
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ciVoltage Table Example:
788c2ecf20Sopenharmony_ci	pwm_regulator {
798c2ecf20Sopenharmony_ci		compatible = "pwm-regulator";
808c2ecf20Sopenharmony_ci		pwms = <&pwm1 0 8448 0>;
818c2ecf20Sopenharmony_ci		regulator-min-microvolt = <1016000>;
828c2ecf20Sopenharmony_ci		regulator-max-microvolt = <1114000>;
838c2ecf20Sopenharmony_ci		regulator-name = "vdd_logic";
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci			      /* Voltage Duty-Cycle */
868c2ecf20Sopenharmony_ci		voltage-table = <1114000 0>,
878c2ecf20Sopenharmony_ci				<1095000 10>,
888c2ecf20Sopenharmony_ci				<1076000 20>,
898c2ecf20Sopenharmony_ci				<1056000 30>,
908c2ecf20Sopenharmony_ci				<1036000 40>,
918c2ecf20Sopenharmony_ci				<1016000 50>;
928c2ecf20Sopenharmony_ci	};
93