On Fri, Sep 10, 2010 at 09:54:57PM +0200, Dr. H. Nikolaus Schaller wrote:
> 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?).

- arch_initcall causes jz_platform_init to be executed
- it registers a platform device with id 0
- module_init later causes i2c_adap_jz_init to be called
- it registers a platform driver
- during registration the list of devices is scanned and all devices
  with the correct name "jz_i2c" are probed
- this causes i2c_jz_probe to be called
- it takes the id from the platform_device structure and puts it into
  the adapter's nr field.
- then the adapter is registered, giving it that number

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

The problem is that module_init is way too late for an i2c adapter.
Try subsys_initcall instead.

  Daniel

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

Reply via email to