From: David Daney <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
To: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: David Daney <ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org"
<linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>,
"ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org"
<ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>,
"devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"Ben Dooks (embedded platforms)"
<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
"Jean Delvare (PC drivers,
core)" <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Subject: Re: [PATCH 1/5] i2c: Convert i2c-octeon.c to use device tree.
Date: Mon, 26 Mar 2012 18:29:33 -0700 [thread overview]
Message-ID: <4F7117FD.7000700@cavium.com> (raw)
In-Reply-To: <4F7115FA.6080507-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
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-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
>
Thanks,
WARNING: multiple messages have this Message-ID (diff)
From: David Daney <david.daney@cavium.com>
To: Rob Herring <robherring2@gmail.com>
Cc: David Daney <ddaney.cavm@gmail.com>,
"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
"ralf@linux-mips.org" <ralf@linux-mips.org>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>,
Grant Likely <grant.likely@secretlab.ca>,
Rob Herring <rob.herring@calxeda.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"Ben Dooks (embedded platforms)" <ben-linux@fluff.org>,
"Jean Delvare (PC drivers, core)" <khali@linux-fr.org>
Subject: Re: [PATCH 1/5] i2c: Convert i2c-octeon.c to use device tree.
Date: Mon, 26 Mar 2012 18:29:33 -0700 [thread overview]
Message-ID: <4F7117FD.7000700@cavium.com> (raw)
In-Reply-To: <4F7115FA.6080507@gmail.com>
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,
next prev parent reply other threads:[~2012-03-27 1:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-27 0:27 [PATCH 0/5] MIPS: OCTEON: Convert some device to use Device Tree David Daney
2012-03-27 0:27 ` [PATCH 1/5] i2c: Convert i2c-octeon.c to use device tree David Daney
[not found] ` <1332808075-8333-2-git-send-email-ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-03-27 1:20 ` Rob Herring
2012-03-27 1:20 ` Rob Herring
2012-03-27 1:20 ` Rob Herring
[not found] ` <4F7115FA.6080507-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-03-27 1:22 ` Rob Herring
2012-03-27 1:22 ` Rob Herring
2012-03-27 1:22 ` Rob Herring
2012-03-27 1:29 ` David Daney [this message]
2012-03-27 1:29 ` David Daney
2012-04-18 15:16 ` Wolfram Sang
[not found] ` <20120418151621.GF19802-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-04-18 16:20 ` David Daney
2012-04-18 16:20 ` David Daney
2012-03-27 0:27 ` [PATCH 2/5] netdev: mdio-octeon.c: Convert " David Daney
2012-03-27 0:27 ` [PATCH 3/5] netdev: octeon_mgmt: " David Daney
2012-03-27 0:27 ` [PATCH 4/5] staging: octeon_ethernet: " David Daney
2012-04-10 16:43 ` Greg Kroah-Hartman
2012-03-27 0:27 ` [PATCH 5/5] MIPS: Octeon: Use device tree to register serial ports David Daney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F7117FD.7000700@cavium.com \
--to=david.daney-ygcgfspz5w/qt0dzr+alfa@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
--cc=ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.