405 I2C

andrew may acmay at acmay.homeip.net
Thu May 23 05:53:24 EST 2002


On Wed, May 22, 2002 at 12:36:36PM +0200, Kenneth Johansson wrote:
> On Tue, 2002-05-21 at 20:00, andrew may wrote:
>
> > well i2c...read_byte_data is really a write of 1 byte followed by a read
> > of 1 byte. The scan is just a read of 1 byte.
>
> Yepp thats the difference.
>
> >
> > So you should be going through the combined xfer function.
>
> Yes your right I missed that. It dose look like it's the first write
> that never get an ack. This is the debug output from a one byte read
> from address 0 from a non existing device.
>
> kernel: iic_xfer: iic_xfer: Clearing status register
> kernel: iic_xfer: Waiting for any pending transfers to complete
> kernel: iic_xfer: Clearing master data buffer
> kernel: iic_xfer: Loading slave address
> kernel: iic_xfer: Call combined transaction
> kernel: Beginning combined transaction
> kernel: This one is a write
> kernel: iic_sendbytes: Waiting for interrupt
> kernel: iic_ibmocp_handler: in interrupt handler
> kernel: iic_ibmocp_handler: status = 26
> kernel: i2c-algo-ppc405.o: fail: only wrote -1 bytes.
>
> It dose look like I actually have to learn how this is supposed to work
> we seem to have more than one problem with the current code :(

Here is a patch to my latest working copy. The comments describe the new
iic_xfer function. The stuff is in the #if 1 section and it is about 280 lines
and it replaces the #else section which is about 470 lines. So if you are going
to work on it I would suggest starting with the new iic_xfer rather than the one
that is there now.

You will need to remove the ibm_gpio_out_timer calls in the IRQ handler I used
to trigger stuff.

There is still plenty of things to do with this, but it is in a works for me state,
and I am not planning on spending time on this stuff right now.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i2c-522.patch.gz
Type: application/octet-stream
Size: 5986 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20020522/76a03097/attachment.obj 


More information about the Linuxppc-embedded mailing list