pwm-regulator.txt 3.1 KB

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