From: mkl@pengutronix.de (Marc Kleine-Budde)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] can: flexcan: use correct clock as base for bit rate calculation
Date: Mon, 25 Nov 2013 22:15:20 +0100 [thread overview]
Message-ID: <1385414121-21493-2-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1385414121-21493-1-git-send-email-mkl@pengutronix.de>
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.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/flexcan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index ae08cf1..aaed97b 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1020,13 +1020,13 @@ static int flexcan_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "no ipg clock defined\n");
return PTR_ERR(clk_ipg);
}
- clock_freq = clk_get_rate(clk_ipg);
clk_per = devm_clk_get(&pdev->dev, "per");
if (IS_ERR(clk_per)) {
dev_err(&pdev->dev, "no per clock defined\n");
return PTR_ERR(clk_per);
}
+ clock_freq = clk_get_rate(clk_per);
}
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
--
1.8.4.2
next prev parent reply other threads:[~2013-11-25 21:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-25 21:15 [PATCH v2 1/2] can + ARM i.MX53: use 24 MHz clock parent on i.MX53 Marc Kleine-Budde
2013-11-25 21:15 ` Marc Kleine-Budde [this message]
2013-11-26 8:27 ` [PATCH v2 1/2] can: flexcan: use correct clock as base for bit rate calculation Marc Kleine-Budde
2013-11-26 8:35 ` Marc Kleine-Budde
2013-11-25 21:15 ` [PATCH v2 2/2] ARM i.MX5: set CAN peripheral clock to 24 MHz parent Marc Kleine-Budde
2013-11-26 4:53 ` [PATCH v2 1/2] can + ARM i.MX53: use 24 MHz clock parent on i.MX53 Shawn Guo
2013-11-26 8:26 ` Marc Kleine-Budde
2013-11-26 14:33 ` Shawn Guo
2013-11-26 14:35 ` Marc Kleine-Budde
2013-12-03 10:54 ` Marc Kleine-Budde
2013-12-03 11:46 ` Shawn Guo
2013-12-09 5:59 ` Shawn Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385414121-21493-2-git-send-email-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).