Skip to content
  • Eugen Hristev's avatar
    iio: adc: at91-sama5d2_adc: add support for suspend/resume functionality · 500a2eef
    Eugen Hristev authored
    
    
    Added support for suspend/resume functionality for the ADC IP
    in sama5d2 SoC.
    In order to enter Suspend to ram mode (backup + self refresh mode for
    memory), in which the ADC IP is no longer powered, we need to reset the
    pins to default state, for the scenario when they are also used for I2C
    bus to communicate with the PMIC.
    On resume, we need to reconfigure the ADC IP registers and reconfigure the
    trigger registers in the case when the suspend procedure is done while
    sysfs has the buffer and trigger enabled.
    In the case the suspend happens exactly during a software triggered
    conversion, the request will time out, because we reset and power down
    the ADC.
    
    Signed-off-by: default avatarEugen Hristev <eugen.hristev@microchip.com>
    Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
    500a2eef