• Andrea Merello's avatar
    iio: max31856: add option for setting mains filter rejection frequency · 76aa41c1
    Andrea Merello authored
    This sensor has an embedded notch filter for reducing interferences caused
    by the power mains. This filter can be tuned to reject either 50Hz or 60Hz
    (and harmonics).
    
    Currently the said setting is left alone (the sensor defaults to 60Hz).
    This patch introduces a IIO attribute that allows the user to set the said
    filter to the desired frequency.
    
    NOTE: this has been intentionally not tied to any DT property to allow
    the configuration of this setting from userspace, e.g. with a GUI or by
    reading a configuration file, or maybe reading a GPIO tied to a physical
    switch or accessing some device that can autodetect the line frequency.
    
    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: default avatarAndrea Merello <andrea.merello@gmail.com>
    Reviewed-by: default avatarMatt Ranostay <matt.ranostay@konsulko.com>
    Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    76aa41c1
max31856.c 10.2 KB