Lines Matching defs: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)
150 /* voc = 500 / (1 + e^x) */
152 *voc = 500 * ((1 << (SGP40_CALC_POWER * 2)) / ((1<<SGP40_CALC_POWER) + exp));
154 dev_dbg(data->dev, "raw: %d res_calibbias: %d x: %d exp: %d voc: %d\n",
155 resistance_raw, data->res_calibbias, x, exp, *voc);
215 int ret, voc;
246 ret = sgp40_calc_voc(data, resistance_raw, &voc);
250 *val = voc / (1 << SGP40_CALC_POWER);
253 * voc <= (500 * 2^SGP40_CALC_POWER) = 8192000
256 *val2 = ((voc % (1 << SGP40_CALC_POWER)) * 244) / (1 << (SGP40_CALC_POWER - 12));
257 dev_dbg(data->dev, "voc: %d val: %d.%06d\n", voc, *val, *val2);
337 data->res_calibbias = 30000; /* resistance raw value for voc index of 250 */