From: York Sun <yorksun-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [Patch v2] power/mpc85xx: Add delay after enabling I2C master
Date: Mon, 23 Sep 2013 14:44:06 -0700 [thread overview]
Message-ID: <5240B626.9050904@freescale.com> (raw)
In-Reply-To: <20130923071012.GD3051@katana>
On 09/23/2013 12:10 AM, Wolfram Sang wrote:
>
>> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
>> index b80c768..55dce43 100644
>> --- a/drivers/i2c/busses/i2c-mpc.c
>> +++ b/drivers/i2c/busses/i2c-mpc.c
>> @@ -106,7 +106,12 @@ static irqreturn_t mpc_i2c_isr(int irq, void *dev_id)
>> static void mpc_i2c_fixup(struct mpc_i2c *i2c)
>> {
>> int k;
>> - u32 delay_val = 1000000 / i2c->real_clk + 1;
>> + u32 delay_val;
>> +#ifdef CONFIG_PPC_85xx
>> + delay_val = 65536 / (fsl_get_sys_freq() / 2000000); /* 64K cycle */
>> +#else
>> + delay_val = 1000000 / i2c->real_clk + 1;
>> +#endif
>
> Please, no unnecessary #ifdefs in code. We have 'struct mpc_i2c_data'
> already.
>
I am not pround of this change. Please elaborate how to use mpc_i2c_data
to separate the mpc85xx from the rest.
York
next prev parent reply other threads:[~2013-09-23 21:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-16 22:06 [Patch v2] power/mpc85xx: Add delay after enabling I2C master York Sun
[not found] ` <1379369185-14590-1-git-send-email-yorksun-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-09-16 23:40 ` [linuxppc-release] " York Sun
2013-09-23 7:10 ` Wolfram Sang
2013-09-23 21:44 ` York Sun [this message]
[not found] ` <5240B626.9050904-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-09-23 22:09 ` Wolfram Sang
2013-09-23 22:16 ` York Sun
[not found] ` <5240BDDA.3050206-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-09-23 22:32 ` Wolfram Sang
2013-09-23 22:38 ` York Sun
2013-09-24 7:36 ` Wolfram Sang
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=5240B626.9050904@freescale.com \
--to=yorksun-kzfg59tc24xl57midrcfdg@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@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.