]> git.baikalelectronics.ru Git - kernel.git/commit
spi: Provide core support for runtime PM during transfers
authorMark Brown <broonie@linaro.org>
Sun, 28 Jul 2013 13:47:02 +0000 (14:47 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 29 Jul 2013 16:59:20 +0000 (17:59 +0100)
commit91a2ad473629ea4d5b79d53fb9327162e9b8e043
tree5a8563efa8626d982039a3fe9b570b7e61edf7bc
parentd19e1420e0261ecf6d4d57d39e014150e50437b9
spi: Provide core support for runtime PM during transfers

Most SPI drivers that implement runtime PM support use identical code to
do so: they acquire a runtime PM lock in prepare_transfer_hardware() and
then they release it in unprepare_transfer_hardware(). The variations in
this are mostly missing error checking and the choice to use autosuspend.

Since these runtime PM calls are normally the only thing in the prepare
and unprepare callbacks and the autosuspend API transparently does the
right thing on devices with autosuspend disabled factor all of this out
into the core with a flag to enable the behaviour.

Signed-off-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
drivers/spi/spi.c
include/linux/spi/spi.h