iio: adc: ad799x: add pm_ops to disable the device completely
authorMarco Felsch <m.felsch@pengutronix.de>
Fri, 29 Nov 2019 16:53:14 +0000 (17:53 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 15 Dec 2019 11:42:14 +0000 (11:42 +0000)
commitd93813520df0ff6e0aec7c8859c56a659417f9b7
treeaa411049881e5ac79552b9b1d5d5d3ed8c301f24
parent52241a082d6c08f4993180752ed5a12b39712f03
iio: adc: ad799x: add pm_ops to disable the device completely

The device is always in a low-power state due to the hardware design. It
wakes up upon a conversion request and goes back into the low-power
state. The pm ops are added to disable the device completely and to free
the regulator. Disbaling the device completely should be not that
notable but freeing the regulator is important. Because if it is a shared
power-rail the regulator won't be disabled during suspend-to-ram/disk
and so all devices connected to that rail keeps on.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad799x.c