iio: adc: at91-sama5d2_adc: add runtime pm support
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Wed, 3 Aug 2022 10:28:55 +0000 (13:28 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 15 Aug 2022 21:29:59 +0000 (22:29 +0100)
commit75d7556ac0e4bff830f7f90ceaa8d35f4b6c346a
tree86aa3404cd108fb3bb46d01796d3962981acb037
parent0cf53f303a02f5c4560042e856035b995a457c1f
iio: adc: at91-sama5d2_adc: add runtime pm support

Add runtime PM support by disabling/enabling ADC's peripheral clock.
On simple conversion the ADC's clock is kept enabled just while the
conversion is in progress. This includes also temperature conversion.
For triggered buffers and touch conversions the ADC clock is kept enabled
while the triggered buffers or touch are enabled. Along with it removed
the __maybe_unused on suspend() and resume() ops as the dev_pm_ops
object members are now filled with SYSTEM_SLEEP_PM_OPS().

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20220803102855.2191070-20-claudiu.beznea@microchip.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/at91-sama5d2_adc.c