iio: pressure: bmp280: fix relative humidity unit
authorTomasz Duszynski <tduszyns@gmail.com>
Mon, 28 May 2018 15:38:59 +0000 (17:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:12:31 +0000 (13:12 +0200)
commitb4164f8c69cf6cd11e6859dd0065826fed4cb779
treef5197e5861c62f2bbf01b84b6c96937bad4bd77c
parent6c500d00cc7b1ca915a10dc771073d962eb7bdea
iio: pressure: bmp280: fix relative humidity unit

[ Upstream commit 13399ff25f179811ce9c1df1523eb39f9e4a4772 ]

According to IIO ABI relative humidity reading should be
returned in milli percent.

This patch addresses that by applying proper scaling and
returning integer instead of fractional format type specifier.

Note that the fixes tag is before the driver was heavily refactored
to introduce spi support, so the patch won't apply that far back.

Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com>
Fixes: 14beaa8f5ab1 ("iio: pressure: bmp280: add humidity support")
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/pressure/bmp280-core.c