From: Richard Zhao <linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Richard Zhao <linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 2/4] i2c: imx: only imx1 needs disable delay
Date: Wed, 30 Sep 2009 13:55:04 +0800 [thread overview]
Message-ID: <1254290106-29272-2-git-send-email-linuxzsc@gmail.com> (raw)
In-Reply-To: <1254290106-29272-1-git-send-email-linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
check cpu_is_mx1() when set disable_delay.
Signed-off-by: Richard Zhao <linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 156cc95..c1e541c 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -254,14 +254,16 @@ static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx,
/* Write divider value to register */
writeb(i2c_clk_div[i][1], i2c_imx->base + IMX_I2C_IFDR);
- /*
- * There dummy delay is calculated.
- * It should be about one I2C clock period long.
- * This delay is used in I2C bus disable function
- * to fix chip hardware bug.
- */
- i2c_imx->disable_delay = (500000U * i2c_clk_div[i][0]
- + (i2c_clk_rate / 2) - 1) / (i2c_clk_rate / 2);
+ if (cpu_is_mx1()) {
+ /*
+ * There dummy delay is calculated.
+ * It should be about one I2C clock period long.
+ * This delay is used in I2C bus disable function
+ * to fix chip hardware bug.
+ */
+ i2c_imx->disable_delay = (500000U * i2c_clk_div[i][0]
+ + (i2c_clk_rate / 2) - 1) / (i2c_clk_rate / 2);
+ }
/* dev_dbg() can't be used, because adapter is not yet registered */
#ifdef CONFIG_I2C_DEBUG_BUS
--
1.6.0.4
next prev parent reply other threads:[~2009-09-30 5:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-30 5:55 [PATCH 1/4] i2c: imx: check busy bit when START/STOP Richard Zhao
[not found] ` <1254290106-29272-1-git-send-email-linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-09-30 5:55 ` Richard Zhao [this message]
[not found] ` <1254290106-29272-2-git-send-email-linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-09-30 5:55 ` [PATCH 3/4] i2c: imx: add macros and printk to make debug easy Richard Zhao
[not found] ` <1254290106-29272-3-git-send-email-linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-09-30 5:55 ` [PATCH 4/4] i2c: imx: disable clock when it's possible to save power Richard Zhao
2009-10-01 1:13 [PATCH 1/4] i2c: imx: check busy bit when START/STOP Richard Zhao
[not found] ` <1254359613-21210-1-git-send-email-linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-10-01 1:13 ` [PATCH 2/4] i2c: imx: only imx1 needs disable delay Richard Zhao
2009-10-01 1:13 ` Richard Zhao
[not found] ` <1254359613-21210-2-git-send-email-linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-10-01 7:26 ` Sascha Hauer
2009-10-01 7:26 ` Sascha Hauer
2009-10-01 7:52 ` Richard Zhao
2009-10-01 7:52 ` Richard Zhao
[not found] ` <4e090d470910010052k37a0a4eep6d436e45e6524234-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-10-01 7:57 ` Sascha Hauer
2009-10-01 7:57 ` Sascha Hauer
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=1254290106-29272-2-git-send-email-linuxzsc@gmail.com \
--to=linuxzsc-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.