On Mon, Mar 20, 2017 at 04:54:07PM +0000, De Vos, Bart (EXT - BE/Antwerp) wrote: > Hi, > > I'm trying to backport the hdc100x driver to v3.10. > > Can you elaborate on the temperature offset, especially here: > http://lxr.linux.no/linux+v4.10/drivers/iio/humidity/hdc100x.c#L239 > > I see the goal is to have millidegrees, and as such I would expect an offset of -40000. I don't understand the numbers used here and the relationship between the two. > If I read out the offset in runtime I got the value specified to 'val' on line 240. > > Thanks for your feedback. > > Kr, > Bart. Hi Bart, Copying Matt Ranostay as he is the author/expert on this driver. hdc100x temperature is calculated as: (raw + offset) * scale / 1000 Here's a sample reading: raw: 25443 scale: 2.517700195 offset: -15887.515151 resolution: 0.006350 Temperature 24057.846068 Hope that helps, alisons -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html