• Akinobu Mita's avatar
    iio: adc: ti-ads1015: add adequate wait time to get correct conversion · 4744d4e2
    Akinobu Mita authored
    This driver assumes that the device is operating in the continuous
    conversion mode which performs the conversion continuously.  So this driver
    inserts a wait time before reading the conversion register if the
    configuration is changed from a previous request.
    
    Currently, the wait time is only the period required for a single
    conversion that is calculated as the reciprocal of the sampling frequency.
    However we also need to wait for the the previous conversion to complete.
    Otherwise we probably get the conversion result for the previous
    configuration when the sampling frequency is lower.
    
    Cc: Daniel Baluta <daniel.baluta@gmail.com>
    Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    4744d4e2
ti-ads1015.c 18.7 KB