1*c66ec88fSEmmanuel VadotBindings for the Generic PWM Regulator 2*c66ec88fSEmmanuel Vadot====================================== 3*c66ec88fSEmmanuel Vadot 4*c66ec88fSEmmanuel VadotCurrently supports 2 modes of operation: 5*c66ec88fSEmmanuel Vadot 6*c66ec88fSEmmanuel VadotVoltage Table: When in this mode, a voltage table (See below) of 7*c66ec88fSEmmanuel Vadot predefined voltage <=> duty-cycle values must be 8*c66ec88fSEmmanuel Vadot provided via DT. Limitations are that the regulator can 9*c66ec88fSEmmanuel Vadot only operate at the voltages supplied in the table. 10*c66ec88fSEmmanuel Vadot Intermediary duty-cycle values which would normally 11*c66ec88fSEmmanuel Vadot allow finer grained voltage selection are ignored and 12*c66ec88fSEmmanuel Vadot rendered useless. Although more control is given to 13*c66ec88fSEmmanuel Vadot the user if the assumptions made in continuous-voltage 14*c66ec88fSEmmanuel Vadot mode do not reign true. 15*c66ec88fSEmmanuel Vadot 16*c66ec88fSEmmanuel VadotContinuous Voltage: This mode uses the regulator's maximum and minimum 17*c66ec88fSEmmanuel Vadot supplied voltages specified in the 18*c66ec88fSEmmanuel Vadot regulator-{min,max}-microvolt properties to calculate 19*c66ec88fSEmmanuel Vadot appropriate duty-cycle values. This allows for a much 20*c66ec88fSEmmanuel Vadot more fine grained solution when compared with 21*c66ec88fSEmmanuel Vadot voltage-table mode above. This solution does make an 22*c66ec88fSEmmanuel Vadot assumption that a %50 duty-cycle value will cause the 23*c66ec88fSEmmanuel Vadot regulator voltage to run at half way between the 24*c66ec88fSEmmanuel Vadot supplied max_uV and min_uV values. 25*c66ec88fSEmmanuel Vadot 26*c66ec88fSEmmanuel VadotRequired properties: 27*c66ec88fSEmmanuel Vadot-------------------- 28*c66ec88fSEmmanuel Vadot- compatible: Should be "pwm-regulator" 29*c66ec88fSEmmanuel Vadot 30*c66ec88fSEmmanuel Vadot- pwms: PWM specification (See: ../pwm/pwm.txt) 31*c66ec88fSEmmanuel Vadot 32*c66ec88fSEmmanuel VadotOnly required for Voltage Table Mode: 33*c66ec88fSEmmanuel Vadot- voltage-table: Voltage and Duty-Cycle table consisting of 2 cells 34*c66ec88fSEmmanuel Vadot First cell is voltage in microvolts (uV) 35*c66ec88fSEmmanuel Vadot Second cell is duty-cycle in percent (%) 36*c66ec88fSEmmanuel Vadot 37*c66ec88fSEmmanuel VadotOptional properties for Continuous mode: 38*c66ec88fSEmmanuel Vadot- pwm-dutycycle-unit: Integer value encoding the duty cycle unit. If not 39*c66ec88fSEmmanuel Vadot defined, <100> is assumed, meaning that 40*c66ec88fSEmmanuel Vadot pwm-dutycycle-range contains values expressed in 41*c66ec88fSEmmanuel Vadot percent. 42*c66ec88fSEmmanuel Vadot 43*c66ec88fSEmmanuel Vadot- pwm-dutycycle-range: Should contain 2 entries. The first entry is encoding 44*c66ec88fSEmmanuel Vadot the dutycycle for regulator-min-microvolt and the 45*c66ec88fSEmmanuel Vadot second one the dutycycle for regulator-max-microvolt. 46*c66ec88fSEmmanuel Vadot Duty cycle values are expressed in pwm-dutycycle-unit. 47*c66ec88fSEmmanuel Vadot If not defined, <0 100> is assumed. 48*c66ec88fSEmmanuel Vadot 49*c66ec88fSEmmanuel VadotNB: To be clear, if voltage-table is provided, then the device will be used 50*c66ec88fSEmmanuel Vadotin Voltage Table Mode. If no voltage-table is provided, then the device will 51*c66ec88fSEmmanuel Vadotbe used in Continuous Voltage Mode. 52*c66ec88fSEmmanuel Vadot 53*c66ec88fSEmmanuel VadotOptional properties: 54*c66ec88fSEmmanuel Vadot-------------------- 55*c66ec88fSEmmanuel Vadot- enable-gpios: GPIO to use to enable/disable the regulator 56*c66ec88fSEmmanuel Vadot 57*c66ec88fSEmmanuel VadotAny property defined as part of the core regulator binding can also be used. 58*c66ec88fSEmmanuel Vadot(See: ../regulator/regulator.txt) 59*c66ec88fSEmmanuel Vadot 60*c66ec88fSEmmanuel VadotContinuous Voltage With Enable GPIO Example: 61*c66ec88fSEmmanuel Vadot pwm_regulator { 62*c66ec88fSEmmanuel Vadot compatible = "pwm-regulator"; 63*c66ec88fSEmmanuel Vadot pwms = <&pwm1 0 8448 0>; 64*c66ec88fSEmmanuel Vadot enable-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; 65*c66ec88fSEmmanuel Vadot regulator-min-microvolt = <1016000>; 66*c66ec88fSEmmanuel Vadot regulator-max-microvolt = <1114000>; 67*c66ec88fSEmmanuel Vadot regulator-name = "vdd_logic"; 68*c66ec88fSEmmanuel Vadot /* unit == per-mille */ 69*c66ec88fSEmmanuel Vadot pwm-dutycycle-unit = <1000>; 70*c66ec88fSEmmanuel Vadot /* 71*c66ec88fSEmmanuel Vadot * Inverted PWM logic, and the duty cycle range is limited 72*c66ec88fSEmmanuel Vadot * to 30%-70%. 73*c66ec88fSEmmanuel Vadot */ 74*c66ec88fSEmmanuel Vadot pwm-dutycycle-range = <700 300>; /* */ 75*c66ec88fSEmmanuel Vadot }; 76*c66ec88fSEmmanuel Vadot 77*c66ec88fSEmmanuel VadotVoltage Table Example: 78*c66ec88fSEmmanuel Vadot pwm_regulator { 79*c66ec88fSEmmanuel Vadot compatible = "pwm-regulator"; 80*c66ec88fSEmmanuel Vadot pwms = <&pwm1 0 8448 0>; 81*c66ec88fSEmmanuel Vadot regulator-min-microvolt = <1016000>; 82*c66ec88fSEmmanuel Vadot regulator-max-microvolt = <1114000>; 83*c66ec88fSEmmanuel Vadot regulator-name = "vdd_logic"; 84*c66ec88fSEmmanuel Vadot 85*c66ec88fSEmmanuel Vadot /* Voltage Duty-Cycle */ 86*c66ec88fSEmmanuel Vadot voltage-table = <1114000 0>, 87*c66ec88fSEmmanuel Vadot <1095000 10>, 88*c66ec88fSEmmanuel Vadot <1076000 20>, 89*c66ec88fSEmmanuel Vadot <1056000 30>, 90*c66ec88fSEmmanuel Vadot <1036000 40>, 91*c66ec88fSEmmanuel Vadot <1016000 50>; 92*c66ec88fSEmmanuel Vadot }; 93