summaryrefslogtreecommitdiffstats
path: root/target/linux/imx6/patches-3.10/0061-can-flexcan-use-correct-clock-as-base-for-bit-rate-c.patch
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2013-12-11 10:56:09 +0000
committerLuka Perkov <luka@openwrt.org>2013-12-11 10:56:09 +0000
commit2bbd43d065dabbd3b8824680a793db8464cf0a2e (patch)
tree4d2826c2679ee29936fa7c472c64b04172a14950 /target/linux/imx6/patches-3.10/0061-can-flexcan-use-correct-clock-as-base-for-bit-rate-c.patch
parentbda5d4072148c5ceab6190d5c96cbcae61247949 (diff)
downloadmaster-31e0f0ae-2bbd43d065dabbd3b8824680a793db8464cf0a2e.tar.gz
master-31e0f0ae-2bbd43d065dabbd3b8824680a793db8464cf0a2e.tar.bz2
master-31e0f0ae-2bbd43d065dabbd3b8824680a793db8464cf0a2e.zip
imx6: add flexcan support
backport upstream changes to 3.10: - 0060-flexcan.patch: - add flexcan pinctrl and devicetree config - 0061-can-flexcan-use-correct-clock-as-base-for-bit-rate-c.patch - fix a clock issue - 0062-ARM-i.MX6q-fix-the-wrong-parent-of-can_root-clock.patch - fix a clock issue Signed-off-by: Tim Harvey <tharvey@gateworks.com> SVN-Revision: 39033
Diffstat (limited to 'target/linux/imx6/patches-3.10/0061-can-flexcan-use-correct-clock-as-base-for-bit-rate-c.patch')
-rw-r--r--target/linux/imx6/patches-3.10/0061-can-flexcan-use-correct-clock-as-base-for-bit-rate-c.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/target/linux/imx6/patches-3.10/0061-can-flexcan-use-correct-clock-as-base-for-bit-rate-c.patch b/target/linux/imx6/patches-3.10/0061-can-flexcan-use-correct-clock-as-base-for-bit-rate-c.patch
new file mode 100644
index 0000000000..c35d7c90c2
--- /dev/null
+++ b/target/linux/imx6/patches-3.10/0061-can-flexcan-use-correct-clock-as-base-for-bit-rate-c.patch
@@ -0,0 +1,37 @@
+From 1a3e5173f5e72cbf7f0c8927b33082e361c16d72 Mon Sep 17 00:00:00 2001
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Date: Mon, 25 Nov 2013 22:15:20 +0100
+Subject: [PATCH] can: flexcan: use correct clock as base for bit rate
+ calculation
+
+The flexcan IP core uses the peripheral clock ("per") as basic clock for the
+bit timing calculation. However the driver uses the the wrong clock ("ipg").
+This leads to wrong bit rates if the rates on both clock are different.
+
+This patch fixes the problem by using the correct clock for the bit rate
+calculation.
+
+Cc: linux-stable <stable@vger.kernel.org>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ drivers/net/can/flexcan.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/can/flexcan.c
++++ b/drivers/net/can/flexcan.c
+@@ -1025,7 +1025,6 @@ static int flexcan_probe(struct platform
+ err = PTR_ERR(clk_ipg);
+ goto failed_clock;
+ }
+- clock_freq = clk_get_rate(clk_ipg);
+
+ clk_per = devm_clk_get(&pdev->dev, "per");
+ if (IS_ERR(clk_per)) {
+@@ -1033,6 +1032,7 @@ static int flexcan_probe(struct platform
+ err = PTR_ERR(clk_per);
+ goto failed_clock;
+ }
++ clock_freq = clk_get_rate(clk_per);
+ }
+
+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);