All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cousson, Benoit" <b-cousson@ti.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
	"tony@atomide.com" <tony@atomide.com>,
	"G, Manjunath Kondaiah" <manjugk@ti.com>,
	"devicetree-discuss@lists.ozlabs.org"
	<devicetree-discuss@lists.ozlabs.org>,
	"grant.likely@secretlab.ca" <grant.likely@secretlab.ca>,
	Graeme Gregory <gg@slimlogic.co.uk>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"Krishnamoorthy, Balaji T" <balajitk@ti.com>
Subject: Re: [PATCH 04/13] mfd: twl-core: Add initial DT support for twl4030/twl6030
Date: Mon, 5 Sep 2011 18:05:23 +0200	[thread overview]
Message-ID: <4E64F343.7030701@ti.com> (raw)
In-Reply-To: <4690440.pddZTpGgxd@wuerfel>

On 9/1/2011 8:27 PM, Arnd Bergmann wrote:
> On Thursday 01 September 2011 19:21:20 Benoit Cousson wrote:
>> +#ifdef CONFIG_OF
>> +#define MODALIAS_SIZE 32
>> +
>> +static int add_of_children(struct i2c_client *client, unsigned long features)
>> +{
>> +       u32 reg;
>> +       struct device *child, *dev =&client->dev;
>> +       struct device_node *node, *parent = client->dev.of_node;
>> +       int irq;
>> +       char alias[MODALIAS_SIZE];
>> +
>> +       for_each_child_of_node(parent, node) {
>> +               if (of_property_read_u32(node, "reg",&reg)) {
>> +                       dev_err(dev, "%s(): invalid reg on %s\n", __func__,
>> +                               node->full_name);
>> +                       continue;
>> +               }
>> +
>
> Have you tried just calling calling of_platform_bus_probe on the
> parent? If all child devices are in the device tree, I think that
> should work, too. It probably requires some tweaking in the
> child drivers though.

Good point. That should indeed work for the current children since the 
add_numbered_child is just creating a platform_device.
On top of that, this function is filling some IRQ resources, but DT will 
do that for free and in a much better way thanks to the irq_domain.

I had some concern with the regulator devices that does require some 
custom pdata for the moment, but that should disappear as soon as the 
proper regulator binding will be there.

Since the idea is to move all the children to DT, this is definitively 
the best approach. I'll update the driver to support the DT binding too.

Thanks for the suggestion. I'll try that and repost if it works as 
expected. But it should... at least for the twl_rtc.

Benoit

WARNING: multiple messages have this Message-ID (diff)
From: b-cousson@ti.com (Cousson, Benoit)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/13] mfd: twl-core: Add initial DT support for twl4030/twl6030
Date: Mon, 5 Sep 2011 18:05:23 +0200	[thread overview]
Message-ID: <4E64F343.7030701@ti.com> (raw)
In-Reply-To: <4690440.pddZTpGgxd@wuerfel>

On 9/1/2011 8:27 PM, Arnd Bergmann wrote:
> On Thursday 01 September 2011 19:21:20 Benoit Cousson wrote:
>> +#ifdef CONFIG_OF
>> +#define MODALIAS_SIZE 32
>> +
>> +static int add_of_children(struct i2c_client *client, unsigned long features)
>> +{
>> +       u32 reg;
>> +       struct device *child, *dev =&client->dev;
>> +       struct device_node *node, *parent = client->dev.of_node;
>> +       int irq;
>> +       char alias[MODALIAS_SIZE];
>> +
>> +       for_each_child_of_node(parent, node) {
>> +               if (of_property_read_u32(node, "reg",&reg)) {
>> +                       dev_err(dev, "%s(): invalid reg on %s\n", __func__,
>> +                               node->full_name);
>> +                       continue;
>> +               }
>> +
>
> Have you tried just calling calling of_platform_bus_probe on the
> parent? If all child devices are in the device tree, I think that
> should work, too. It probably requires some tweaking in the
> child drivers though.

Good point. That should indeed work for the current children since the 
add_numbered_child is just creating a platform_device.
On top of that, this function is filling some IRQ resources, but DT will 
do that for free and in a much better way thanks to the irq_domain.

I had some concern with the regulator devices that does require some 
custom pdata for the moment, but that should disappear as soon as the 
proper regulator binding will be there.

Since the idea is to move all the children to DT, this is definitively 
the best approach. I'll update the driver to support the DT binding too.

Thanks for the suggestion. I'll try that and repost if it works as 
expected. But it should... at least for the twl_rtc.

Benoit

  reply	other threads:[~2011-09-05 16:05 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-01 17:21 [PATCH 00/13] OMAP4: Add DT support for i2c and twl6030 Benoit Cousson
2011-09-01 17:21 ` Benoit Cousson
2011-09-01 17:21 ` [PATCH 01/13] irq: Add stub for none DT build in irqdomain.h Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 17:21 ` [PATCH 02/13] i2c: OMAP: Add DT support for i2c controller Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 17:21 ` [PATCH 03/13] documentation/dt: Add OMAP i2c bindings documentation Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 17:21 ` [PATCH 04/13] mfd: twl-core: Add initial DT support for twl4030/twl6030 Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 18:27   ` Arnd Bergmann
2011-09-01 18:27     ` Arnd Bergmann
2011-09-05 16:05     ` Cousson, Benoit [this message]
2011-09-05 16:05       ` Cousson, Benoit
2011-09-01 17:21 ` [PATCH 05/13] documentation/dt: Add TWL4030 and TWL6030 bindings Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 17:21 ` [PATCH 06/13] arm/dts: OMAP4: Add i2c controller nodes Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 17:21 ` [PATCH 07/13] arm/dts: omap4-sdp: Set clock freq for i2c controllers Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 17:21 ` [PATCH 08/13] arm/dts: omap4-panda: " Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 17:21 ` [PATCH 09/13] arm/dts: omap4-sdp: Add twl6030 node Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 17:21 ` [PATCH 10/13] arm/dts: omap4-panda: " Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 17:21 ` [PATCH 11/13] OMAP4: board-dt: Remove static i2c init Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 17:21 ` [PATCH 12/13] arm/dts: omap4-sdp: Add i2c3 & i2c4 devices Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 17:21 ` [PATCH 13/13] arm/dts: omap4-panda: Add EEPROM entry in i2c3 Benoit Cousson
2011-09-01 17:21   ` Benoit Cousson
2011-09-01 19:14 ` [PATCH 00/13] OMAP4: Add DT support for i2c and twl6030 Arnd Bergmann
2011-09-01 19:14   ` Arnd Bergmann

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=4E64F343.7030701@ti.com \
    --to=b-cousson@ti.com \
    --cc=arnd@arndb.de \
    --cc=balajitk@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=gg@slimlogic.co.uk \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=manjugk@ti.com \
    --cc=sameo@linux.intel.com \
    --cc=tony@atomide.com \
    /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.