[PATCH RESEND] i2c: Add support for device-tree based chip initialization

David Daney ddaney.cavm at gmail.com
Tue Nov 27 11:26:39 EST 2012


On 11/26/2012 12:13 PM, Grant Likely wrote:
> On Sun, 25 Nov 2012 20:53:56 -0800, Guenter Roeck <linux at roeck-us.net> wrote:
>> Some I2C devices are not or not correctly initialized by the firmware.
>> Configuration would be possible via platform data, but that would require
>> per-driver platform data and a lot of code, and changing it would not be
>> possible without re-compiling the kernel. It is more elegant to do it
>> generically via devicetree properties.
>>
>> Add a generic I2C devicetree property named "reg-init". This property provides
>> a sequence of device initialization commands to be executed prior to calling
>> the probe function for a given device.
>>
>> Signed-off-by: Guenter Roeck <linux at roeck-us.net>
>
> This is a very similar problem to the power sequences series that was
> recently posted to this list. I would like that feature and this
> mechanism use the same approach.


I haven't fully studied the power sequencing thing, but just to play 
Devil's Advocate, there is precedence for the "reg-init" style in some 
of the Ethernet PHY drivers.

Perhaps the "reg-init" should be used as one of the steps in the 
sequence, and if there was only a single step it would be functionally 
equivalent to the "reg-init" proposal.


David Daney


>
> g.
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
>
>



More information about the devicetree-discuss mailing list