regulator.txt 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Voltage/Current regulator
  2. Binding:
  3. The regulator devices don't use the "compatible" property. The binding is done
  4. by the prefix of regulator node's name, or, if this fails, by the prefix of the
  5. regulator's "regulator-name" property. Usually the pmic I/O driver will provide
  6. the array of 'struct pmic_child_info' with the prefixes and compatible drivers.
  7. The bind is done by calling function: pmic_bind_childs().
  8. Example drivers:
  9. pmic: drivers/power/pmic/max77686.c
  10. regulator: drivers/power/regulator/max77686.c
  11. For the node name e.g.: "prefix[:alpha:]num { ... }":
  12. - the driver prefix should be: "prefix" - case sensitive
  13. - the node name's "num" is set as "dev->driver_data" on bind
  14. Example the prefix "ldo" will pass for: "ldo1", "ldo@1", "ldoreg@1, ...
  15. Binding by means of the node's name is preferred. However if the node names
  16. would produce ambiguous prefixes (like "regulator@1" and "regualtor@11") and you
  17. can't or do not want to change them then binding against the "regulator-name"
  18. property is possible. The syntax for the prefix of the "regulator-name" property
  19. is the same as the one for the regulator's node name.
  20. Use case: a regulator named "regulator@1" to be bound to a driver named
  21. "LDO_DRV" and a regulator named "regualator@11" to be bound to an other driver
  22. named "BOOST_DRV". Using prefix "regualtor@1" for driver matching would load
  23. the same driver for both regulators, hence the prefix is ambiguous.
  24. Optional properties:
  25. - regulator-name: a string, required by the regulator uclass, used for driver
  26. binding if binding by node's name prefix fails
  27. - regulator-min-microvolt: a minimum allowed Voltage value
  28. - regulator-max-microvolt: a maximum allowed Voltage value
  29. - regulator-min-microamp: a minimum allowed Current value
  30. - regulator-max-microamp: a maximum allowed Current value
  31. - regulator-always-on: regulator should never be disabled
  32. - regulator-boot-on: enabled by bootloader/firmware
  33. - regulator-ramp-delay: ramp delay for regulator (in uV/us)
  34. - regulator-force-boot-off: disabled during the boot stage
  35. - regulator-init-microvolt: a init allowed Voltage value
  36. - regulator-state-(standby|mem|disk)
  37. type: object
  38. description:
  39. sub-nodes for regulator state in Standby, Suspend-to-RAM, and
  40. Suspend-to-DISK modes. Equivalent with standby, mem, and disk Linux
  41. sleep states.
  42. properties:
  43. regulator-on-in-suspend:
  44. description: regulator should be on in suspend state.
  45. type: boolean
  46. regulator-off-in-suspend:
  47. description: regulator should be off in suspend state.
  48. type: boolean
  49. regulator-suspend-microvolt:
  50. description: the default voltage which regulator would be set in
  51. suspend. This property is now deprecated, instead setting voltage
  52. for suspend mode via the API which regulator driver provides is
  53. recommended.
  54. Note
  55. The "regulator-name" constraint is used for setting the device's uclass
  56. platform data '.name' field. And the regulator device name is set from
  57. it's node name. If "regulator-name" is not provided in dts, node name
  58. is chosen for setting the device's uclass platform data '.name' field.
  59. Other kernel-style properties, are currently not used.
  60. Note:
  61. For the regulator autoset from constraints, the framework expects that:
  62. - regulator-min-microvolt is equal to regulator-max-microvolt
  63. - regulator-min-microamp is equal to regulator-max-microamp
  64. - regulator-always-on or regulator-boot-on is set
  65. Example:
  66. ldo0 {
  67. /* Optional */
  68. regulator-name = "VDDQ_EMMC_1.8V";
  69. regulator-min-microvolt = <1800000>;
  70. regulator-max-microvolt = <1800000>;
  71. regulator-min-microamp = <100000>;
  72. regulator-max-microamp = <100000>;
  73. regulator-init-microvolt = <1800000>;
  74. regulator-always-on;
  75. regulator-boot-on;
  76. regulator-ramp-delay = <12000>;
  77. regulator-state-mem {
  78. regulator-on-in-suspend;
  79. regulator-suspend-microvolt = <1800000>;
  80. };
  81. };