linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mattias@vmlinux.org (Mattias Walstrom)
To: linux-arm-kernel@lists.infradead.org
Subject: imx27: I2C clock frequency
Date: Tue, 09 Nov 2010 20:37:12 +0100	[thread overview]
Message-ID: <4CD9A2E8.2040002@vmlinux.org> (raw)

Hi!
When investigating the i2c clock frequency on our custom imx27-board (running 2.6.32) we discovered that it was not correct, instead of 100khz we got 40khz. When looking at the code we noticed a possible problem with get_rate_ipg. With the following patch we get an i2c clock at 100khz (as expected).

Is this the right way to solve the problem? I am unsure if I can use the AHB divider directly for the ipgclock-rate.

--- linux-2.6.32.23.orig/arch/arm/mach-mx2/clock_imx27.c
+++ linux-2.6.32.23/arch/arm/mach-mx2/clock_imx27.c
@@ -401,7 +401,7 @@ static unsigned long get_rate_ipg(struct
 	unsigned long rate, ipg_pdf;
 
 	if (mx27_revision() >= CHIP_REV_2_0)
-		return clk_get_rate(clk->parent);
+		ipg_pdf = (__raw_readl(CCM_CSCR) >> 8) & 3;
 	else
 		ipg_pdf = (__raw_readl(CCM_CSCR) >> 8) & 1;

Best regards

Mattias Walstr?m

                 reply	other threads:[~2010-11-09 19:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4CD9A2E8.2040002@vmlinux.org \
    --to=mattias@vmlinux.org \
    --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).