iio: accel: kxsd9: Deploy system and runtime PM
This deploys runtime and system PM in the KXSD9 driver: - Use the force_runtime_suspend/resume callbacks as system PM operations. - Add buffer prepare/unprepare callbacks to grab the runtime PM while we're using buffered reads and put get/put_autosuspend in these. - Insert get/put_autosuspend calls anywhere the IO is used from the raw read/write callbacks. - Move the fullscale setting to be cached in the state container so we can restore it properly when coming back from system/runtime suspend. - Set the autosuspend delay to two orders of magnitude that of the sensor start-up time (20ms) so we will autosuspend after 2s. - Register the callbacks in both the SPI and I2C subdrivers. Tested with the I2C KXSD9 on the Qualcomm APQ8060 Dragonboard. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:

gecommit door
Jonathan Cameron

bovenliggende
79383aaec4
commit
9a9a369d61
@@ -43,6 +43,7 @@ MODULE_DEVICE_TABLE(spi, kxsd9_spi_id);
|
||||
static struct spi_driver kxsd9_spi_driver = {
|
||||
.driver = {
|
||||
.name = "kxsd9",
|
||||
.pm = &kxsd9_dev_pm_ops,
|
||||
},
|
||||
.probe = kxsd9_spi_probe,
|
||||
.remove = kxsd9_spi_remove,
|
||||
|
Verwijs in nieuw issue
Block a user