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