All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: York Sun <yorksun-KZfg59tc24xl57MIdRCFDg@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 09:10:12 +0200	[thread overview]
Message-ID: <20130923071012.GD3051@katana> (raw)
In-Reply-To: <1379369185-14590-1-git-send-email-yorksun-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 636 bytes --]


> 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.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2013-09-23  7:10 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 [this message]
2013-09-23 21:44     ` York Sun
     [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=20130923071012.GD3051@katana \
    --to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=yorksun-KZfg59tc24xl57MIdRCFDg@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.