]> git.baikalelectronics.ru Git - kernel.git/commit
can: flexcan: add 2nd clock to support imx53 and newer
authorSteffen Trumtrar <s.trumtrar@pengutronix.de>
Tue, 17 Jul 2012 14:14:34 +0000 (16:14 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 20 Jul 2012 10:31:05 +0000 (12:31 +0200)
commit53537c562ce39927bbc390f9cddcec689394250f
tree4ff43bb4e81c80ee5e52f41e35ac94bd828bbe31
parent6e27c43f24a8e34299474fe81c37555747cea7be
can: flexcan: add 2nd clock to support imx53 and newer

This patch adds support for a second clock to the flexcan driver. On
modern freescale ARM cores like the imx53 and imx6q two clocks ("ipg"
and "per") must be enabled in order to access the CAN core.

In the original driver, the clock was requested without specifying the
connection id, further all mainline ARM archs with flexcan support
(imx28, imx25, imx35) register their flexcan clock without a
connection id, too.

This patch first renames the existing clk variable to clk_ipg and
converts it to devm for easier error handling. The connection id "ipg"
is added to the devm_clk_get() call. Then a second clock "per" is
requested. As all archs don't specify a connection id, both clk_get
return the same clock. This ensures compatibility to existing flexcan
support and adds support for imx53 at the same time.

After this patch hits mainline, the archs may give their existing
flexcan clock the "ipg" connection id and implement a dummy "per"
clock.

This patch has been tested on imx28 (unmodified clk tree) and on imx53
with a seperate "ipg" and "per" clock.

Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Acked-by: Hui Wang <jason77.wang@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan.c