can: flexcan: add LPSR mode support
authorJoakim Zhang <qiangqing.zhang@nxp.com>
Wed, 4 Dec 2019 11:36:19 +0000 (11:36 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 22 Sep 2020 14:52:50 +0000 (16:52 +0200)
commit1434d04349626d7b4da49b99f79d6391b9a67f16
treec7527b1545393c7d5421733fb01cd36172fce837
parent02f71c6605e1f8259c07f16178330db766189a74
can: flexcan: add LPSR mode support

On the i.MX7D in LPSR mode, the controller will be powered off and the
configuration state is lost after system resume. Upcoming i.MX8QM/QXP
will also completely power off the domain, the controller state is lost
and needs restore, too. So we need to set the pinctrl state again and
re-start chip to re-configuration after resume.

For the wakeup case, it should not set pinctrl to sleep state by
pinctrl_pm_select_sleep_state.

If the interface is down before suspend, we don't need to re-configure
it as it will be configured if the interface is brought up later.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Link: https://lore.kernel.org/r/20191204113249.3381-7-qiangqing.zhang@nxp.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan.c