Lines Matching full:voc
18 * 2) calculate an estimated absolute voc index (0 - 500 index points) for
20 * For this purpose the value of the resistance for which the voc index
35 * floating point calculation of voc is done as integer
140 static int sgp40_calc_voc(struct sgp40_data *data, u16 resistance_raw, int *voc) in sgp40_calc_voc() argument
150 /* voc = 500 / (1 + e^x) */ in sgp40_calc_voc()
152 *voc = 500 * ((1 << (SGP40_CALC_POWER * 2)) / ((1<<SGP40_CALC_POWER) + exp)); in sgp40_calc_voc()
154 dev_dbg(data->dev, "raw: %d res_calibbias: %d x: %d exp: %d voc: %d\n", in sgp40_calc_voc()
155 resistance_raw, data->res_calibbias, x, exp, *voc); in sgp40_calc_voc()
215 int ret, voc; in sgp40_read_raw() local
246 ret = sgp40_calc_voc(data, resistance_raw, &voc); in sgp40_read_raw()
250 *val = voc / (1 << SGP40_CALC_POWER); in sgp40_read_raw()
253 * voc <= (500 * 2^SGP40_CALC_POWER) = 8192000 in sgp40_read_raw()
256 *val2 = ((voc % (1 << SGP40_CALC_POWER)) * 244) / (1 << (SGP40_CALC_POWER - 12)); in sgp40_read_raw()
257 dev_dbg(data->dev, "voc: %d val: %d.%06d\n", voc, *val, *val2); in sgp40_read_raw()
337 data->res_calibbias = 30000; /* resistance raw value for voc index of 250 */ in sgp40_probe()