Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mistake the i2c_bitbang direction



kiyohara%kk.iij4u.or.jp@localhost wrote:

> I see this message on evbppc(OPENBLOCKS266) since i2c_bitbang.c,v 1.11.
> arch/powerpc/ibm4xx/dev/gpiic_bitbang.c is very severe and a bit noisy.
> X-<
> 
>   mountroot: trying ffs...
>   root file system type: ffs
>   gpiic_read_bits: Read in output mode
>   gpiic_read_bits: Read in output mode
>   gpiic_read_bits: Read in output mode
>   gpiic_read_bits: Read in output mode
>   gpiic_read_bits: Read in output mode
>   gpiic_read_bits: Read in output mode
>   gpiic_read_bits: Read in output mode
>   gpiic_read_bits: Read in output mode
>   gpiic_read_bits: Read in output mode
>   gpiic_set_bits: SDA low with no output enable
>   gpiic_set_bits: SDA low with no output enable
>   :
>   :
> 
> I think mistake to set the direction.  We necessary DIR(INPUT) before READ,
> and DIR(OUTPUT) before SETBITS().

No.

DIR() should be used only for SDA, not for SCL.
As I noted in the log message, using DIR(INPUT) to read SCL
in i2c_wait_for_scl() causes unexpected stop condition
in SCL=H, SDA=L and DIR(OUTPUT) case.

> Please fix.

Fix MD drivers as sys/arch/evbarm/nslu2/nslu2_iic.c instead.

> Attached patch provide very quiet and peace for world on OPENBLOCKS266. ;-)

But it breaks other drivers, like tl(4).
---
Izumi Tsustui


Home | Main Index | Thread Index | Old Index