]> git.baikalelectronics.ru Git - kernel.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)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 3 Mar 2014 11:41:27 +0000 (12:41 +0100)
commit0e641076efdf0831172f80f7ee360ce52359b079
treed66a93171f6a33c6e7000f731d7b58f368b5bcd2
parent96ddbe6824d9b4220bd31222e8e507b9ba08288d
can: flexcan: fix transition from and to low power mode in chip_{en,dis}able

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.

Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan.c