All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thor Thayer <tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
To: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: Device Tree Child Node Parsing Question
Date: Mon, 5 Jan 2015 08:48:33 -0600	[thread overview]
Message-ID: <54AAA441.2060607@opensource.altera.com> (raw)
In-Reply-To: <CAL_JsqLzbEuQgNZoBbzr4R=Nj9_Qs=60uLhzENbZzTaaTgxnZg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 12/26/2014 01:40 PM, Rob Herring wrote:
> On Tue, Dec 23, 2014 at 10:34 AM, Thor Thayer
> <tthayer-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org> wrote:
>> Hi,
>>
>> What is the best way to queue devicetree child nodes so the node is passed
>> in the platform_device pointer to the probe() function?
>>
>> Documentation/devicetree/usage-model.txt has the following:
>>
>> "For Linux DT support, the generic behaviour is for child devices to be
>> registered by the parent's device driver at driver .probe() time."
>>
>> "Actually, it turns out that registering children of some platform_devices
>> as more platform_devices is a common pattern, and the
>> device tree support code reflects that and makes the above example
>> simpler.  The second argument to of_platform_populate() is an
>> of_device_id table, and any node that matches an entry in that table
>> will also get its child nodes registered."
>>
>>
>> I tried calling of_platform_populate() in the probe of the a10_sysctl node
>> but it doesn't appear to setup the platform device data properly for the
>> sub-child nodes.
>>

<snip>
>
> This should work. There are quite a few users already including unit
> tests. Can you tell what you are doing differently from those users?
>
> Rob
>
>>

<snip>

Just to tie up this conversation in case anyone else has an issue, it 
ended up being my debug issue. The of_platform_populate() was working 
properly. The issue was that I was also calling a mfd_add_devices() 
using a devices table and I was watching the mfd_add_devices() probe. 
Simply removing the mfd_add_devices() and the table and using 
of_platform_populate() as below worked.

of_platform_populate(spi->dev.of_node, a10sycon_spi_of_match,
		     NULL, &spi->dev);

Thanks!
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-01-05 14:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 16:34 Device Tree Child Node Parsing Question Thor Thayer
     [not found] ` <549999A7.2010608-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>
2014-12-26 19:40   ` Rob Herring
     [not found]     ` <CAL_JsqLzbEuQgNZoBbzr4R=Nj9_Qs=60uLhzENbZzTaaTgxnZg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-05 14:48       ` Thor Thayer [this message]
2014-12-27  4:15   ` He YunLei

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=54AAA441.2060607@opensource.altera.com \
    --to=tthayer-yzvpicuk2abmcg4ihk0kfoh6mc4mb0vx@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@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.