Am 07.09.2010 um 19:28 schrieb Dr. H. Nikolaus Schaller:

> 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.

Does anyone have an idea or knowledge how initialization of the
i2c subsystem really works in the 2.6.24 kernel?

As far as I did understand, the platform initialization file just registers
a i2c adapter in some list but does not touch it.

The function i2c_get_adapter() should search this list to identify the driver
according to some "id" value (which one is this? How is it related to
the initialization structure in the platform file?).

Then, the first device that is probed initializes the i2c adapter.
But that is far beyond the first call to the old-style i2c_open(), i.e.
the adapter is not initialized.

So, there are two questions:
1. how can I make i2c_get_adapter return the adapter?
2. how can I initialize the adapter directly (not from probing a new style i2c 
device)?

> 
> 
> 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


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

Reply via email to