public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Troy Kisky <troy.kisky@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] mxc_i2c: remove setting speed at each start
Date: Sat, 05 May 2012 13:22:06 -0700	[thread overview]
Message-ID: <4FA58BEE.8030006@boundarydevices.com> (raw)
In-Reply-To: <201205051508.24784.marex@denx.de>

On 5/5/2012 6:08 AM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> On 4/24/2012 8:33 PM, Troy Kisky wrote:
>>> Other then being very weird, this code was also wrong.
>>> For example, say I set speed to 100K. I'll read back the speed
>>> as 85937. But the speed is really 85937.5, so we I reset
>>> the speed to 85937, I'll get 73660.7. After a couple of transactions
>>> my speed is now exactly 68750 so it will remain there.
>>>
>>> Signed-off-by: Troy Kisky<troy.kisky@boundarydevices.com>
>>> ---
>>>
>>>    drivers/i2c/mxc_i2c.c |    6 ------
>>>    1 files changed, 0 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
>>> index 416ffee..fc68062 100644
>>> --- a/drivers/i2c/mxc_i2c.c
>>> +++ b/drivers/i2c/mxc_i2c.c
>>> @@ -231,12 +231,6 @@ int i2c_imx_start(void)
>>>
>>>    	struct mxc_i2c_regs *i2c_regs = (struct mxc_i2c_regs *)I2C_BASE;
>>>    	unsigned int temp = 0;
>>>    	int result;
>>>
>>> -	int speed = i2c_get_bus_speed();
>>> -	u8 clk_idx = i2c_imx_get_clk(speed);
>>> -	u8 idx = i2c_clk_div[clk_idx][1];
>>> -
>>> -	/* Store divider value */
>>> -	writeb(idx,&i2c_regs->ifdr);
>>>
>>>    	/* Enable I2C controller */
>>>    	writeb(0,&i2c_regs->i2sr);
>> Marek would you care to ack/nak this? It is deleting code that you added.
> Ok, who will set the controller speed if you remove this?

i2c_init is the only function that writes the ifdr register after this 
patch.
This is fine because this register is not affected by a software reset.
If this register were affected by a software reset, then the current code
would not work either, as i2c_imx_start is reading from this register before
trying(and often failing) to set it to the same value.


>
>> Thanks
>> Troy
> Best regards,
> Marek Vasut
>

  reply	other threads:[~2012-05-05 20:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25  3:33 [U-Boot] [PATCH 1/3] mxc_i2c: specify i2c base address in config file Troy Kisky
2012-04-25  3:33 ` [U-Boot] [PATCH 2/3] mx6qsabrelite: add i2c support Troy Kisky
2012-05-06 15:24   ` Stefano Babic
2012-04-25  3:33 ` [U-Boot] [PATCH 3/3] mxc_i2c: remove setting speed at each start Troy Kisky
2012-05-04 22:52   ` Troy Kisky
2012-05-05 13:05     ` Marek Vasut
2012-05-05 13:08     ` Marek Vasut
2012-05-05 20:22       ` Troy Kisky [this message]
2012-05-05 21:36         ` Marek Vasut
2012-05-05 22:26           ` Troy Kisky
2012-05-05 23:06             ` Marek Vasut
2012-05-06 15:27               ` Stefano Babic
2012-07-11  6:27                 ` Dirk Behme
2012-07-13 10:38                   ` Marek Vasut
2012-07-13 11:56                     ` Wolfgang Denk
2012-07-13 12:11                       ` Marek Vasut
2012-07-16  9:39                     ` Stefano Babic
2012-05-06 15:27 ` [U-Boot] [PATCH 1/3] mxc_i2c: specify i2c base address in config file Stefano Babic
2012-07-11  6:25   ` Dirk Behme
2012-07-11  8:35     ` Heiko Schocher

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=4FA58BEE.8030006@boundarydevices.com \
    --to=troy.kisky@boundarydevices.com \
    --cc=u-boot@lists.denx.de \
    /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