Hi,
I finally have fixed (at least I think so) all bugs in that *!:#x)
drivers/i2c/busses/i2c-jz47xx.c

1. i2c_transfer (resp. the platform specific driver i2c_jz_xfer) has
been completely reworked to do correctly:

* send multiple messages
* handle start, repeated start and stop conditions
* correctly handle 0-byte writes (which is used by i2cdetect to
   check device presence)
* should handle 10-bit adresses (not used/tested)
* should handle sending without repeated start condition (not tested)

With these changes, the rtc driver works for reading & writing
(hwclock) on the Letux 400.

And, i2cdetect also works. It finds these devices:

0x13    Audio
0x28    power controller (PIC)
0x51    this is the predefined RTC chip (reported as UU)

Making the driver work was quite tricky since there isn't much
documentation beyond:

        
http://www.amebasystems.com/downloads/hardware/datasheets/ben-nanonote/Ingenic-SOC-JZ4720/Jz4740-PM/Jz4740_18_i2c_spec.pdf

Especially how to handle timeouts and some special situations (before
handling that, i2cdetect either detected all addresses or none).

And, I did have to hunt a situation where the driver did work with
printk() commands at some lines, but failed without.


2. I have started a wrapper for the old, 2.4 style i2c driver to
correctly use i2c_transfer(). It just has one problem - the
initialization of the adapter reference.

i2c_get_adapter(0) should return the adapter, but it returns NULL.

Another observation is that the initialization of the i2c subsystem starts
well after the first call to i2c_open().

So the operations that write to the 0x13 device still fail.


3. a new kernel binary (and modules) is here:

        http://download.goldelico.com/letux-400/trunk/


4. source code changes can be inspected through:

        http://projects.goldelico.com/p/letux-400/source/changes/master/


Nikolaus
_______________________________________________
Mipsbook-devel mailing list
Mipsbook-devel@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/mipsbook-devel

Reply via email to