Device probe order (i2c regulator vs. platform device)

Marek Szyprowski m.szyprowski at samsung.com
Wed Mar 24 07:02:30 EDT 2010


Hello,

On Wednesday, March 24, 2010 11:22 AM Mark Brown wrote:

> On Wed, Mar 24, 2010 at 08:10:38AM +0100, Marek Szyprowski wrote:
> 
> > I've encountered a problem with regulator framework and the device
> > probe order. In my system there is a pmic chip connected thought i2c bus
> > and a platform device (let's call it A) that depends on the regulator
> > device (for proper probing pmic chip must enable voltage to the device
> > A). In the current configuration the i2c driver is also a platform
> > device. However during the system initialization the device A is probed
> > before the i2c driver would register pmic chip and its regulators.
> 
> This is (if I'm parsing what you say above correctly) a very common case
> - if you look at most of the existing PMIC core and regulator drivers
> you'll see that their initcalls are subsys_initcall(), and similarly for
> the I2C controller drivers they use.  This means that at boot the PMICs
> come up before pretty much any other device.

Ok, I get this idea, but this requires to move the i2c bus initialization
also to subsys_initcall. We use generic i2c-gpio driver. I suspect there
might be some unpredicted consequences on some other systems if we push
the patch that changes it init to subsys_initcall. I have no idea if the
gpiolib calls are available on all systems during the subsys_initcall.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center




More information about the linux-arm-kernel mailing list