iio: max31856: add support for configuring the HW averaging
authorAndrea Merello <andrea.merello@gmail.com>
Wed, 20 Nov 2019 14:47:50 +0000 (15:47 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 23 Nov 2019 12:31:46 +0000 (12:31 +0000)
commit57a4274ce168d4e63a7b5f4a8a776f7bdd5666a9
treebc692f39c973bb71e4fa3c57086126e7b4b947c2
parent3f6bba19071eac393a7f39755e235b286a7bb09a
iio: max31856: add support for configuring the HW averaging

This sensor can perform samples averaging in hardware, but currently the
driver leaves this setting alone (default is no averaging).

This patch binds this HW setting to the "oversampling_ratio" IIO attribute
and allows the user to set the averaging as desired (the HW supports
averaging of 2, 5, 8 or 16 samples; in-between values are rounded up).

Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: Patrick Havelange <patrick.havelange@essensium.com>
Cc: Matt Weber <matthew.weber@rockwellcollins.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
Cc: Chuhong Yuan <hslester96@gmail.com>
Cc: Daniel Gomez <dagmcr@gmail.com>
Cc: linux-iio@vger.kernel.org
Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/temperature/max31856.c