OSDN Git Service

iio: light: gp2ap002: Take runtime PM reference on light read
authorJonathan Bakker <xc-racer2@live.ca>
Sun, 10 May 2020 15:58:18 +0000 (08:58 -0700)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 22 May 2020 16:19:41 +0000 (17:19 +0100)
commitf6dbf83c17cb223ceabd7c42d441414f3e0e8a86
tree5d3f353239aa37b094f8ab72bff6b10fc556619b
parent1ecca8a9a4989b693f2f6d349bf54c0fdfc10e8e
iio: light: gp2ap002: Take runtime PM reference on light read

The light sensor needs the regulators to be enabled which means
the runtime PM needs to be on.  This only happened when the
proximity part of the chip was enabled.

As fallout from this change, only report changes to the prox
state in the interrupt handler when it is explicitly enabled.

Fixes: 97d642e23037 ("iio: light: Add a driver for Sharp GP2AP002x00F")
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/gp2ap002.c