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