OSDN Git Service

can: flexcan: implement can Runtime PM
authorAisheng Dong <aisheng.dong@nxp.com>
Fri, 30 Nov 2018 08:53:26 +0000 (08:53 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 24 Jul 2019 08:31:55 +0000 (10:31 +0200)
commitca10989632d8820749fad37e13843750198e450a
tree024c445b7d8ba973154b704380b014b02e5ed26e
parent26bca9fe5f1dcd9093f5ed17fcb78d1f6fb32e5e
can: flexcan: implement can Runtime PM

Flexcan will be disabled during suspend if no wakeup function required and
enabled after resume accordingly. During this period, we could explicitly
disable clocks.
Since PM is optional, the clock is enabled at probe to guarante the
clock is running when PM is not enabled in the kernel.

Implement Runtime PM which will:
1) Without CONFIG_PM, clock is running whether Flexcan up or down.
2) With CONFIG_PM, clock enabled while Flexcan up and disabled when
   Flexcan down.
3) Disable clock when do system suspend and enable clock while system
   resume.
4) Make Power Domain framework be able to shutdown the corresponding
   power domain of this device.

Signed-off-by: Aisheng Dong <aisheng.dong@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan.c