]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: mv64xxx: Add runtime PM support
authorSamuel Holland <samuel@sholland.org>
Sun, 3 Jan 2021 10:51:46 +0000 (04:51 -0600)
committerWolfram Sang <wsa@kernel.org>
Mon, 1 Feb 2021 22:05:29 +0000 (23:05 +0100)
commit268f79ae806668f3733a2e4b17bfa652160fc9bf
tree671d17aecbc269e7587380061d56e24e1e83cd9c
parenteb34a2b697cd0274f4c3d14efc8c0c1a899fecf0
i2c: mv64xxx: Add runtime PM support

To save power, gate the clock when the bus is inactive, during system
sleep, and during shutdown. On some platforms, specifically Allwinner
A13/A20, gating the clock implicitly resets the module as well. Since
the module already needs to be reset after some suspend/resume cycles,
it is simple enough to reset it during every runtime suspend/resume.

Because the bus may be used by wakeup source IRQ threads, it needs to
be functional as soon as IRQs are enabled. Thus, its system PM hooks
need to run in the noirq phase.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Tested-by: Ondrej Jirman <megous@megous.com>
Acked-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-mv64xxx.c