From: Pavan Kondeti <pkondeti@codeaurora.org>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: "linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
devicetree-discuss@lists.ozlabs.org
Subject: Re: USB support for device tree
Date: Sat, 05 Nov 2011 13:42:46 +0530 [thread overview]
Message-ID: <4EB4EFFE.8070308@codeaurora.org> (raw)
In-Reply-To: <CACxGe6tgXc0kWnHM1FrbnJO3NU1xdzPaZ2x2ZXCgoG1crEwxcA@mail.gmail.com>
Hi
On 11/5/2011 9:22 AM, Grant Likely wrote:
> On Nov 4, 2011 11:08 PM, "Pavan Kondeti" <pkondeti@codeaurora.org> wrote:
>>
>> Hi
>>
>> On 11/4/2011 11:42 PM, Grant Likely wrote:
>>> It is not legal for two device nodes to have overlapping 'reg' regions
>>> (unless one is a child of the other), so by extension it is not okay
>>> for two nodes to have the same 'name@addr'. However, it is perfectly
>>> acceptable and encouraged for two nodes at different addresses to
>>> start with the same value for 'name@'. This is called the generic
>>> names recommended practice, and it can also be found in the ePAPR
>>> documentation on node names.
>>>
>>> If you want to have both host and device drivers bound to a single
>>> device for OTG mode, then you should use a wrapper driver in Linux
>>> that binds to the single node and instantiates each of the interfaces
>>> as a child device. For an example take a look at
>>> drivers/usb/host/fsl-mph-dr-of.c.
>>
>> Currently we have two platform devices one for OTG and one for host,
>> corresponding drivers for them. If I would like to keep it this way, the
>> device tree becomes something like below
>>
>> hsusb0-otg: usb-otg@0xa6000000 {
>> compatible = "qcom,hsusb-otg";
>> ---
>> };
>>
>> hsusb0-device: usb-gadget@0xa6000000 {
>> compatible = "qcom,hsusb-device";
>> ---
>> };
>>
>> hsusb0-host: usb@0xa6000000 {
>> compatible = "qcom,hsusb-host", "usb-ehci";
>> ---
>> };
>
> No, you don't need three nodes. Only one node for the whole thing since
> from the hardware perspective it is still a single device. The driver for
> that node should create the child otg and gadget platform_devices so that
> you can preserve the existing driver structure.
>
Okay. I got it. Thanks for pointing me to
drivers/usb/host/fsl-mph-dr-of.c. I can have one device node for otg and
create host and/or gadget based on the operational mode.
> There does not need to be a device tree node for every struct device in the
> kernel.
>
Agreed.
Thanks,
Pavan
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
prev parent reply other threads:[~2011-11-05 8:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-04 8:25 USB support for device tree Pavan Kondeti
[not found] ` <4EB3A165.8060300-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2011-11-04 15:43 ` Greg KH
2011-11-04 16:08 ` Grant Likely
2011-11-04 16:17 ` Grant Likely
2011-11-04 17:51 ` Pavan Kondeti
2011-11-04 16:45 ` Grant Likely
2011-11-04 17:46 ` Pavan Kondeti
[not found] ` <4EB424DD.4090609-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2011-11-04 18:12 ` Grant Likely
[not found] ` <CACxGe6sYkCSnFvybGcjrkh4cNvtjS=t6fr456be4KFDc3Gre2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-05 3:08 ` Pavan Kondeti
[not found] ` <4EB4A897.8020305-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2011-11-05 3:52 ` Grant Likely
2011-11-05 8:12 ` Pavan Kondeti [this message]
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=4EB4EFFE.8070308@codeaurora.org \
--to=pkondeti@codeaurora.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-usb@vger.kernel.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 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).