linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Scott Wood <scottwood@freescale.com>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] powerpc/85xx: don't call of_platform_bus_probe() twice
Date: Mon, 19 Mar 2012 13:43:29 -0500	[thread overview]
Message-ID: <4F677E51.8030905@freescale.com> (raw)
In-Reply-To: <20120319160452.B57D13E05A5@localhost>

Grant Likely wrote:
> The problem is that you want to create devices for grandchildren
> nodes when the bus ids passed in don't match any of the child nodes so
> the of_platform_bus_probe() doesn't iterate down to that level.  This
> is correct and expected behaviour.

Well, I'm not still not 100% sure on what I'm supposed to do, so I tried this:

static struct of_device_id __initdata p1022_ds_ids[] = {
	/* The audio driver probes the SSI DMA channels individually */
	{ .compatible = "fsl,ssi-dma-channel", },
	{},
};

static int __init p1022_ds_publish_devices(void)
{
	struct device_node *np;
	int ret;

	mpc85xx_common_publish_devices();

	for_each_compatible_node(np, NULL, "fsl,eloplus-dma") {
		ret = of_platform_bus_probe(np, p1022_ds_ids, NULL);
		if (ret)
			return ret;
	}

	return 0;
}

It works, but it looks clunky.

For the record, this is what the DMA controller node looks like.  It's a
child of the SOC node.  The SSI driver probes on the "fsl,ssi-dma-channel"
nodes directly.

dma@c300 {
        cell-index = <0x1>;
        ranges = <0x0 0xc100 0x200>;
        reg = <0xc300 0x4>;
        compatible = "fsl,eloplus-dma";
        #size-cells = <0x1>;
        #address-cells = <0x1>;

        dma-channel@180 {
                interrupts = <0x4f 0x2 0x0 0x0>;
                cell-index = <0x3>;
                reg = <0x180 0x80>;
                compatible = "fsl,eloplus-dma-channel";
        };

        dma-channel@100 {
                interrupts = <0x4e 0x2 0x0 0x0>;
                cell-index = <0x2>;
                reg = <0x100 0x80>;
                compatible = "fsl,eloplus-dma-channel";
        };

        dma-channel@80 {
                phandle = <0x4>;
                linux,phandle = <0x4>;
                interrupts = <0x4d 0x2 0x0 0x0>;
                cell-index = <0x1>;
                reg = <0x80 0x80>;
                compatible = "fsl,ssi-dma-channel";
        };

        dma-channel@0 {
                phandle = <0x3>;
                linux,phandle = <0x3>;
                interrupts = <0x4c 0x2 0x0 0x0>;
                cell-index = <0x0>;
                reg = <0x0 0x80>;
                compatible = "fsl,ssi-dma-channel";
        };
};

-- 
Timur Tabi
Linux kernel developer at Freescale

  reply	other threads:[~2012-03-19 18:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30 16:19 [PATCH] powerpc/85xx: don't call of_platform_bus_probe() twice Timur Tabi
2012-03-07 21:41 ` Timur Tabi
2012-03-16 20:46 ` Kumar Gala
2012-03-16 20:50   ` Timur Tabi
2012-03-19 16:04     ` Grant Likely
2012-03-19 18:43       ` Timur Tabi [this message]
2012-03-20 17:09         ` Grant Likely
2012-03-20 17:25           ` Timur Tabi
2012-03-21 15:15             ` Timur Tabi
2012-03-27 18:18               ` Timur Tabi
2012-03-28  5:01                 ` Grant Likely
2012-03-21 15:08       ` Kumar Gala
2012-04-19 20:15 ` Kumar Gala

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=4F677E51.8030905@freescale.com \
    --to=timur@freescale.com \
    --cc=dbaryshkov@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=scottwood@freescale.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).