• Lars-Peter Clausen's avatar
    iio: xilinx-xadc: Fix clearing interrupt when enabling trigger · f954b098
    Lars-Peter Clausen authored
    When enabling the trigger and unmasking the end-of-sequence (EOS) interrupt
    the EOS interrupt should be cleared from the status register. Otherwise it
    is possible that it was still set from a previous capture. If that is the
    case the interrupt would fire immediately even though no conversion has
    been done yet and stale data is being read from the device.
    
    The old code only clears the interrupt if the interrupt was previously
    unmasked. Which does not make much sense since the interrupt is always
    masked at this point and in addition masking the interrupt does not clear
    the interrupt from the status register. So the clearing needs to be done
    unconditionally.
    Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
    Fixes: bdc8cda1 ("iio:adc: Add Xilinx XADC driver")
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    f954b098
xilinx-xadc-core.c 33.8 KB