• Aisheng Dong's avatar
    can: flexcan: implement can Runtime PM · ca109896
    Aisheng Dong authored
    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: default avatarAisheng Dong <aisheng.dong@nxp.com>
    Signed-off-by: default avatarJoakim Zhang <qiangqing.zhang@nxp.com>
    Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
    ca109896
flexcan.c 47.2 KB