iio: humidity: hdc3020: add power management
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Sun, 3 Mar 2024 21:54:20 +0000 (22:54 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Mar 2024 20:10:13 +0000 (20:10 +0000)
commitf764c293a1f8a4ee849d377a804e3940a208ad0b
treed60c517547885d6ba19962ebcc3805b4bf6a204b
parentd1efcf8871db514ae349a24790afd1632ba31030
iio: humidity: hdc3020: add power management

The HDC3020 sensor carries out periodic measurements during normal
operation, but as long as the power supply is enabled, it will carry on
in low-power modes. In order to avoid that and reduce power consumption,
the device can be switched to Trigger-on Demand mode, and if possible,
turn off its regulator.

According to the datasheet, the maximum "Power Up Ready" is 5 ms.

Add resume/suspend pm operations to manage measurement mode and
regulator state.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240303-hdc3020-pm-v3-1-48bc02b5241b@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/humidity/hdc3020.c