All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
To: balbi-l0cyMroinI0@public.gmane.org
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/2] musb: musb: dsps: determine the number of instances at runtime
Date: Tue, 18 Jun 2013 11:24:40 +0200	[thread overview]
Message-ID: <51C02758.70501@linutronix.de> (raw)
In-Reply-To: <20130618085409.GO5461-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>

On 06/18/2013 10:54 AM, Felipe Balbi wrote:
> Hi,

Hi Felipe,

>> This isn't exactly a child node, is it? There is
>> of_get_child_count() but this isn't a child, it is one property.
> 
> is it because we haven't added DTS support for musb core ?
> Eventually we can/should add and convert this to
> of_get_child_count() then. For now, we can go ahead with your
> approach.

 mother {
  	 child1 {
	 };
	 child1 {
	 };
 };

That would be a child imho.
For counting of phandles (for the number of assigned gpios for instance)
you would use
  of_count_phandle_with_args(node, "gpios", "#gpio-cell-size");

We don't have an equivalent for "#gpio-cell-size". In our case it would
be the sum of "#address-cells" and "#size-cells" minus 1 because we
don't have a phandle and abuse a function :)
Counting the number of "addresses" is special since bother its
members (address and size) can be either 32bit or 64bit in size.

> We have such a large amount of function pointers to sort out anyway
> :-(

If you want get the while() loop replaced by something else I have a
few suggestions:
- check for iomem(2). If it is there we have two instances. If not,
  just 1. This includes also the hope that we don't get a third port.

- loop over of_address_to_resource(). This is what of_device_alloc() is
  doing:
   if (of_can_translate_address(np))
         while (of_address_to_resource(np, num_reg, &temp_res) == 0)
                    num_reg++;
  So it is different.

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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:[~2013-06-18  9:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17 15:13 [RFC] Add support for am33xx which has two musb ports Sebastian Andrzej Siewior
     [not found] ` <1371482014-5244-1-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2013-06-17 15:13   ` [PATCH 1/2] musb: musb: dsps: support multiple instances Sebastian Andrzej Siewior
2013-06-18  8:27     ` Felipe Balbi
     [not found]       ` <20130618082725.GG5461-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-06-18  8:34         ` Sebastian Andrzej Siewior
     [not found]           ` <51C01BA1.6040009-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2013-06-18  8:38             ` Felipe Balbi
2013-06-19 17:27       ` Sebastian Andrzej Siewior
2013-06-17 15:13 ` [PATCH 2/2] musb: musb: dsps: determine the number of instances at runtime Sebastian Andrzej Siewior
     [not found]   ` <1371482014-5244-3-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2013-06-18  8:31     ` Felipe Balbi
     [not found]       ` <20130618083108.GH5461-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-06-18  8:43         ` Sebastian Andrzej Siewior
2013-06-18  8:54           ` Felipe Balbi
     [not found]             ` <20130618085409.GO5461-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-06-18  9:24               ` Sebastian Andrzej Siewior [this message]
2013-06-18  9:52                 ` Felipe Balbi

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=51C02758.70501@linutronix.de \
    --to=bigeasy-hfztesqfncyowbw4kg4ksq@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@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.