Subject: Re: [PATCH] powerpc: i2c-mpc: make speed registers configurable via FDT

From: Wolfgang Grandegger <[email-masked]>
Date: Thu, 31 Jul 2008 22:20:50 +0200

Grant Likely wrote:
> On Thu, Jul 31, 2008 at 09:54:48PM +0200, Wolfgang Grandegger wrote:
>> Thinking more about it, it would be best to add the property  
>> "i2c-clock-divider" to the soc node and implement fsl_get_i2c_freq() in  
>> a similar way:
>>
>>         soc8541@e0000000 {
>>                 #address-cells = <1>;
>>                 #size-cells = <1>;
>>                 device_type = "soc";
>>                 ranges = <0x0 0xe0000000 0x100000>;
>>                 reg = <0xe0000000 0x1000>;      // CCSRBAR 1M
>>                 bus-frequency = <0>;
>>                 i2c-clock-divider = <2>;
>>
>> U-Boot could then fixup that value like bus-frequency() and the i2c-mpc  
>> driver simply calls fsl_get_i2c_freq().
> 
> Ugh.  This is specifically related to the i2c device, so please place
> the property in the i2c device.  Remember, device tree design is not
> about what will make the implementation simplest, but rather about what
> describes the hardware in the best way.
> 
> Now, if you can argue that i2c-clock-frequency is actually a separate
> clock domain defined at the SoC level, not the i2c device level, then I
> will change my opinion.

Is it not exactly that? For me it's not a per I2C device property, at least.

Wolfgang.