/* As per section 4.3 of the data sheet.  */
static int sht15_calc_temp(struct sht15_data *data)
/* As per section 4.3 of the data sheet.  */
static int sht15_calc_temp(struct sht15_data *data)
{
	int d1 = 0;
	int i;
	for (i = 1; i < ARRAY_SIZE(temppoints); i++)
		if (data->supply_uV > temppoints[i - 1].vdd) {
			d1 = (data->supply_uV/1000 - temppoints[i - 1].vdd)
				* (temppoints[i].d1 - temppoints[i - 1].d1)
				/ (temppoints[i].vdd - temppoints[i - 1].vdd)
				+ temppoints[i - 1].d1;
			break;
		}
	return data->val_temp*10 + d1;
}