adc.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ADC device binding
  2. There are no mandatory properties for ADC. However, if Voltage info is required,
  3. then there are two options:
  4. - use microvolts constraint or
  5. - use regulator phandle to enable/read supply's Voltage
  6. Properties and constraints:
  7. *optional and always checked, Voltage polarity info:
  8. - vdd-polarity-negative: positive reference Voltage has a negative polarity
  9. - vss-polarity-negative: negative reference Voltage has a negative polarity
  10. Chose one option, for each supply (Vdd/Vss):
  11. *optional and always checked, supply Voltage constants:
  12. - vdd-supply: phandle to Vdd regulator's node
  13. - vss-supply: phandle to Vss regulator's node
  14. *optional and checked only if the above corresponding, doesn't exist:
  15. - vdd-microvolts: positive reference Voltage value [uV]
  16. - vss-microvolts: negative reference Voltage value [uV]
  17. Example with constant 'Vdd' value:
  18. adc@1000000 {
  19. compatible = "some-adc";
  20. reg = <0xaabb000 0x100>;
  21. status = "enabled";
  22. vdd-microvolts = <1800000>;
  23. };
  24. Example of supply phandle usage, for the ADC's VDD/VSS references as below:
  25. _______ _______
  26. |Sandbox| |Sandbox|
  27. : PMIC : : ADC :
  28. . . . .
  29. | | (Vdd) | AIN0|-->
  30. | BUCK2|-------|VDDref |
  31. | (3.3V)| _|VSSref |
  32. |_______| | |_______|
  33. _|_
  34. For the above PMIC, the node can be defined as follows:
  35. sandbox_pmic {
  36. compatible = "sandbox,pmic";
  37. ...
  38. buck2: buck2 {
  39. regulator-name = "SUPPLY_3.3V";
  40. regulator-min-microvolt = <3300000>;
  41. regulator-max-microvolt = <3300000>;
  42. };
  43. ...
  44. };
  45. For the above ADC, the node can be defined as follows:
  46. adc@0 {
  47. compatible = "sandbox,adc";
  48. vdd-supply = <&buck2>;
  49. vss-microvolts = <0>;
  50. };
  51. The ADC uclass code, will enable the supply before start of the conversion,
  52. but it will not configure the regulator settings.