public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] i2c_reg_read() on 8xx
@ 2008-10-22 19:36 Timur Tabi
  0 siblings, 0 replies; 2+ messages in thread
From: Timur Tabi @ 2008-10-22 19:36 UTC (permalink / raw)
  To: u-boot

Wolfgang,

Mike Frysinger helped me resolve the problem with i2c_reg_read() on Blackfin, so
I'll be posting a new patch soon.  However, I noticed that 8xx has a problem, too:

uchar
i2c_reg_read(uchar i2c_addr, uchar reg)
{
        uchar buf;

        i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);

        i2c_read(i2c_addr, reg, 1, &buf, 1);

        return (buf);
}

Is the call to i2c_init() necessary on 8xx boards?  Shouldn't I2C have already
been initialized?

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot] i2c_reg_read() on 8xx
       [not found] <48FF7F40.1010205@freescale.com>
@ 2008-10-22 20:19 ` Wolfgang Denk
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2008-10-22 20:19 UTC (permalink / raw)
  To: u-boot

Dear Timur,

In message <48FF7F40.1010205@freescale.com> you wrote:
> Wolfgang,
> 
> Mike Frysinger helped me resolve the problem with i2c_reg_read() on Blackfin, so
> I'll be posting a new patch soon.  However, I noticed that 8xx has a problem, too:
> 
> uchar
> i2c_reg_read(uchar i2c_addr, uchar reg)
> {
>         uchar buf;
> 
>         i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
> 
>         i2c_read(i2c_addr, reg, 1, &buf, 1);
> 
>         return (buf);
> }
> 
> Is the call to i2c_init() necessary on 8xx boards?  Shouldn't I2C have already
> been initialized?

There are some 8xx boards where I2C is used very early so it might be
necessary. I have to admit that I don't remember - that code is more
than 6 years old.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
No one may kill a man.  Not for any purpose.  It cannot be condoned.
	-- Kirk, "Spock's Brain", stardate 5431.6

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-22 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-22 19:36 [U-Boot] i2c_reg_read() on 8xx Timur Tabi
     [not found] <48FF7F40.1010205@freescale.com>
2008-10-22 20:19 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox