lkml.org 
[lkml]   [2012]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/5] i2c: Convert i2c-octeon.c to use device tree.
On 03/26/2012 06:20 PM, Rob Herring wrote:
[...]
>> ---
>>
>> Should probably go via Ralf's linux-mips.org tree.
>>
>> arch/mips/cavium-octeon/octeon-irq.c | 2 -
>> arch/mips/cavium-octeon/octeon-platform.c | 84 -------------------------
>> arch/mips/include/asm/octeon/octeon.h | 5 --
>> drivers/i2c/busses/i2c-octeon.c | 94 ++++++++++++++++-------------
>> 4 files changed, 52 insertions(+), 133 deletions(-)
>
> snip
>
>>
>> - if (i2c_data == NULL) {
>> - dev_err(i2c->dev, "no I2C frequency data\n");
>> + /*
>> + * "clock-rate" is a legacy binding, the official binding is
>> + * "clock-frequency". Try the official one first and then
>> + * fall back if it doesn't exist.
>> + */
>> + data = of_get_property(pdev->dev.of_node, "clock-frequency",&len);
>> + if (!data || len != sizeof(*data))
>> + data = of_get_property(pdev->dev.of_node, "clock-rate",&len);
>> + if (data&& len == sizeof(*data)) {
>> + i2c->twsi_freq = be32_to_cpup(data);
>
> Can't you use of_property_read_u32?

I will investigate, and use it if possible.

>
> Does the legacy binding really exist as DT support is new?
>

Yes, unfortunately some bootloaders escaped into the wild with the
"clock-rate" binding.

> Otherwise,
>
> Acked-by: Rob Herring<rob.herring@calxeda.com>
>

Thanks,



\
 
 \ /
  Last update: 2012-03-27 03:33    [W:0.053 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site