Re: [PATCH] OMAP: I2C driver for TI OMAP boards #3

2006-12-06 Thread Tony Lindgren
Hi,

* Jean Delvare <[EMAIL PROTECTED]> [061204 09:49]:
> Hi Tony, all,
> 
> On Thu, 10 Aug 2006 16:19:26 +0300, Tony Lindgren wrote:
> > * Jean Delvare <[EMAIL PROTECTED]> [060810 11:30]:
> > > I've now taken Komal's patch (#4). Here is a proposed patch which brings
> > > the prescaler computation formula in line with your comment and table
> > > above. It could be applied on top of Komal's patch unless it causes a
> > > problem on some of the OMAP systems. For XOR = 13 MHz, it changes the
> > > prescaler from 0 to 1. For XOR = 19.2 MHz it changes the prescaler from
> > > 2 to 1.
> > 
> > OK cool. As far as I'm concerned, I'm fine with it too:
> > Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
> >  
> > > I don't have any hardware to test it, though. If it happens to be
> > > better to be slightly over 12 MHz than slightly below 7 MHz, the
> > > "> 1200" condition below can be replaced with "> 1400".
> > 
> > Thanks, we'll test it on various omaps and let you know if it works.
> 
> Any news on this? I still have this patch in my local tree. Should I
> push it into Linux 2.6.20?
> 
> i2c: Fix OMAP clock prescaler to match the comment
> 
> Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
> Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
> ---
>  drivers/i2c/busses/i2c-omap.c |4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- linux-2.6.18-rc4.orig/drivers/i2c/busses/i2c-omap.c   2006-08-10 
> 09:56:54.0 +0200
> +++ linux-2.6.18-rc4/drivers/i2c/busses/i2c-omap.c2006-08-10 
> 10:12:03.0 +0200
> @@ -231,8 +231,8 @@
>* 13   2   1
>* 19.2 2   1
>*/
> - if (fclk_rate > 1600)
> - psc = (fclk_rate + 800) / 1200;
> + if (fclk_rate > 1200)
> + psc = fclk_rate / 1200;
>   }
>  
>   /* Setup clock prescaler to obtain approx 12MHz I2C module clock: */

Sorry for the delay in replying. Yes, it's safe to push. When the original
code was done, the max limit of 12MHz was ignored.

Regards,

Tony
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] OMAP: I2C driver for TI OMAP boards #3

2006-12-04 Thread Jean Delvare
Hi Tony, all,

On Thu, 10 Aug 2006 16:19:26 +0300, Tony Lindgren wrote:
> * Jean Delvare <[EMAIL PROTECTED]> [060810 11:30]:
> > I've now taken Komal's patch (#4). Here is a proposed patch which brings
> > the prescaler computation formula in line with your comment and table
> > above. It could be applied on top of Komal's patch unless it causes a
> > problem on some of the OMAP systems. For XOR = 13 MHz, it changes the
> > prescaler from 0 to 1. For XOR = 19.2 MHz it changes the prescaler from
> > 2 to 1.
> 
> OK cool. As far as I'm concerned, I'm fine with it too:
> Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
>  
> > I don't have any hardware to test it, though. If it happens to be
> > better to be slightly over 12 MHz than slightly below 7 MHz, the
> > "> 1200" condition below can be replaced with "> 1400".
> 
> Thanks, we'll test it on various omaps and let you know if it works.

Any news on this? I still have this patch in my local tree. Should I
push it into Linux 2.6.20?

i2c: Fix OMAP clock prescaler to match the comment

Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 drivers/i2c/busses/i2c-omap.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.18-rc4.orig/drivers/i2c/busses/i2c-omap.c 2006-08-10 
09:56:54.0 +0200
+++ linux-2.6.18-rc4/drivers/i2c/busses/i2c-omap.c  2006-08-10 
10:12:03.0 +0200
@@ -231,8 +231,8 @@
 * 13   2   1
 * 19.2 2   1
 */
-   if (fclk_rate > 1600)
-   psc = (fclk_rate + 800) / 1200;
+   if (fclk_rate > 1200)
+   psc = fclk_rate / 1200;
}
 
/* Setup clock prescaler to obtain approx 12MHz I2C module clock: */


-- 
Jean Delvare
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/