]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: flexcan: fix transition from and to low power mode in chip_{en,dis}able
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 28 Feb 2014 14:30:18 +0000 (15:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Mar 2014 04:44:17 +0000 (21:44 -0700)
commit6754f4b6cf48c0d67c21cc7a03cf29b2067d63b3
treeac5d0d76bba38b499b1b4d8d3fde3523edbc0db8
parent2f264c30e4663b93717501391eb218a33ec57ed8
can: flexcan: fix transition from and to low power mode in chip_{en,dis}able

commit 9b00b300e7bce032c467c36ca47fe2a776887fc2 upstream.

In flexcan_chip_enable() and flexcan_chip_disable() fixed delays are used.
Experiments have shown that the transition from and to low power mode may take
several microseconds.

This patch adds a while loop which polls the Low Power Mode ACK bit (LPM_ACK)
that indicates a successfull mode change. If the function runs into a timeout a
error value is returned.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/flexcan.c