devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to get related device pointer via DT?
@ 2017-02-15  2:21 Yoshihiro Shimoda
       [not found] ` <HK2PR06MB054824526D2975ADE8EA0405D85B0-jAC1QCBx2F3DOGFS7+tQZW0DtJ1/0DrXvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Yoshihiro Shimoda @ 2017-02-15  2:21 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
  Cc: linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Hi,

I would like to get a related device pointer on usb EHCI drivers (or USB framework)
because related device (e.g. OHCI or UHCI, called "companion controllers") has to
finish resuming. I discussed this topic with Alan:
http://marc.info/?t=148653514200001&r=1&w=2

In PCI bus, USB framework already has such a feature in drivers/usb/core/hcd-pci.c.
However, in platform devices, we don't have it for now. So, I would like to add it.

Then, I have 2 ideas to get the related device pointer:

A) We add a new property "companion" as usb-generic.txt and EHCI node(s) have
   such a property to bind a companion controller.
B) We assume EHCI controller binds a companion controller if some resources
   (irq or clock) are the same and it has a compatible strings as "generic-[uo]hci"
   for instance.

My environment is R-Car H3, and it has 3 EHCI and 3 OHCI controllers.
For example (I only wrote channel 0 of EHCI and OHCI):
		ehci0: usb@ee080100 {
			compatible = "generic-ehci";
			reg = <0 0xee080100 0 0x100>;
			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&cpg CPG_MOD 703>;
			phys = <&usb2_phy0>;
			phy-names = "usb";
			power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
			status = "disabled";
		};

		ohci0: usb@ee080000 {
			compatible = "generic-ohci";
			reg = <0 0xee080000 0 0x100>;
			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&cpg CPG_MOD 703>;
			phys = <&usb2_phy0>;
			phy-names = "usb";
			power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
			status = "disabled";
		};

If my idea A), ehci0 will have companion = <&ohci>;
If my idea B), no need to add any property.

What do you think?
Anyway, I will start to study DT programming :)

Best regards,
Yoshihiro Shimoda

--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to get related device pointer via DT?
       [not found] ` <HK2PR06MB054824526D2975ADE8EA0405D85B0-jAC1QCBx2F3DOGFS7+tQZW0DtJ1/0DrXvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-02-15 10:01   ` Peter Chen
  2017-02-16 10:26     ` Yoshihiro Shimoda
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Chen @ 2017-02-15 10:01 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Wed, Feb 15, 2017 at 02:21:55AM +0000, Yoshihiro Shimoda wrote:
> Hi,
> 
> I would like to get a related device pointer on usb EHCI drivers (or USB framework)
> because related device (e.g. OHCI or UHCI, called "companion controllers") has to
> finish resuming. I discussed this topic with Alan:
> http://marc.info/?t=148653514200001&r=1&w=2
> 
> In PCI bus, USB framework already has such a feature in drivers/usb/core/hcd-pci.c.
> However, in platform devices, we don't have it for now. So, I would like to add it.
> 
> Then, I have 2 ideas to get the related device pointer:
> 
> A) We add a new property "companion" as usb-generic.txt and EHCI node(s) have
>    such a property to bind a companion controller.
> B) We assume EHCI controller binds a companion controller if some resources
>    (irq or clock) are the same and it has a compatible strings as "generic-[uo]hci"
>    for instance.
> 
> My environment is R-Car H3, and it has 3 EHCI and 3 OHCI controllers.
> For example (I only wrote channel 0 of EHCI and OHCI):
> 		ehci0: usb@ee080100 {
> 			compatible = "generic-ehci";
> 			reg = <0 0xee080100 0 0x100>;
> 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
> 			clocks = <&cpg CPG_MOD 703>;
> 			phys = <&usb2_phy0>;
> 			phy-names = "usb";
> 			power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
> 			status = "disabled";
> 		};
> 
> 		ohci0: usb@ee080000 {
> 			compatible = "generic-ohci";
> 			reg = <0 0xee080000 0 0x100>;
> 			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
> 			clocks = <&cpg CPG_MOD 703>;
> 			phys = <&usb2_phy0>;
> 			phy-names = "usb";
> 			power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
> 			status = "disabled";
> 		};
> 
> If my idea A), ehci0 will have companion = <&ohci>;
> If my idea B), no need to add any property.
> 
> What do you think?
> Anyway, I will start to study DT programming :)
> 

>From my point, idea A is better. It seems you have similar idea when you
tried Dual-role framework before. [1]

[1] https://patchwork.kernel.org/patch/9169745/

-- 

Best Regards,
Peter Chen
--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: How to get related device pointer via DT?
  2017-02-15 10:01   ` Peter Chen
@ 2017-02-16 10:26     ` Yoshihiro Shimoda
  0 siblings, 0 replies; 3+ messages in thread
From: Yoshihiro Shimoda @ 2017-02-16 10:26 UTC (permalink / raw)
  To: Peter Chen
  Cc: devicetree@vger.kernel.org, robh+dt@kernel.org,
	frowand.list@gmail.com, linux-renesas-soc@vger.kernel.org,
	linux-usb@vger.kernel.org

Hi Peter,

> From: Peter Chen
> Sent: Wednesday, February 15, 2017 7:02 PM
> 
> On Wed, Feb 15, 2017 at 02:21:55AM +0000, Yoshihiro Shimoda wrote:
< snip >
> > If my idea A), ehci0 will have companion = <&ohci>;
> > If my idea B), no need to add any property.
> >
> > What do you think?
> > Anyway, I will start to study DT programming :)
> >
> 
> From my point, idea A is better. It seems you have similar idea when you
> tried Dual-role framework before. [1]
> 
> [1] https://patchwork.kernel.org/patch/9169745/

Thank you for the comment!
Yes, I remember this. So, I will make patches using idea A.

Best regards,
Yoshihiro Shimoda

> --
> 
> Best Regards,
> Peter Chen

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-16 10:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-15  2:21 How to get related device pointer via DT? Yoshihiro Shimoda
     [not found] ` <HK2PR06MB054824526D2975ADE8EA0405D85B0-jAC1QCBx2F3DOGFS7+tQZW0DtJ1/0DrXvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-02-15 10:01   ` Peter Chen
2017-02-16 10:26     ` Yoshihiro Shimoda

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).