Lines Matching refs:adc
114 * adc = 10bit ADC value read back from registers
118 #define SMM665_VMON_ADC_TO_VOLTS(adc) ((adc) * vref / 256)
121 #define SMM665_12VIN_ADC_TO_VOLTS(adc) ((adc) * vref * 3 / 256)
124 #define SMM665_AIN_ADC_TO_VOLTS(adc) ((adc) * vref / 512)
127 #define SMM665_TEMP_ADC_TO_CELSIUS(adc) ((adc) <= 511) ? \
128 ((int)(adc) * 1000 / 4) : \
129 (((int)(adc) - 0x400) * 1000 / 4)
146 u16 adc[SMM665_NUM_ADC]; /* adc values (raw) */
177 * Read adc value.
179 static int smm665_read_adc(struct smm665_data *data, int adc)
198 rv = i2c_smbus_read_byte_data(client, adc << 3);
227 * Validate/verify readback adc channel (in bit 11..14).
231 if (radc != adc) {
233 adc, radc);
267 /* Read adc registers */
274 data->adc[i] = val;
284 /* Return converted value from given adc */
375 int adc = attr->index;
381 val = smm665_convert(data->adc[adc], adc);