RE: How to get related device pointer via DT?

2017-02-16 Thread Yoshihiro Shimoda
Hi Peter,

> From: Peter Chen
> Sent: Wednesday, February 15, 2017 7:02 PM
> 
> On Wed, Feb 15, 2017 at 02:21:55AM +, Yoshihiro Shimoda wrote:
< snip >
> > If my idea A), ehci0 will have companion = <>;
> > 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
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: How to get related device pointer via DT?

2017-02-15 Thread Peter Chen
On Wed, Feb 15, 2017 at 02:21:55AM +, 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=14865351421=1=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 = ;
>   clocks = < CPG_MOD 703>;
>   phys = <_phy0>;
>   phy-names = "usb";
>   power-domains = < R8A7795_PD_ALWAYS_ON>;
>   status = "disabled";
>   };
> 
>   ohci0: usb@ee08 {
>   compatible = "generic-ohci";
>   reg = <0 0xee08 0 0x100>;
>   interrupts = ;
>   clocks = < CPG_MOD 703>;
>   phys = <_phy0>;
>   phy-names = "usb";
>   power-domains = < R8A7795_PD_ALWAYS_ON>;
>   status = "disabled";
>   };
> 
> If my idea A), ehci0 will have companion = <>;
> 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 linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


How to get related device pointer via DT?

2017-02-14 Thread Yoshihiro Shimoda
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=14865351421=1=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 = ;
clocks = < CPG_MOD 703>;
phys = <_phy0>;
phy-names = "usb";
power-domains = < R8A7795_PD_ALWAYS_ON>;
status = "disabled";
};

ohci0: usb@ee08 {
compatible = "generic-ohci";
reg = <0 0xee08 0 0x100>;
interrupts = ;
clocks = < CPG_MOD 703>;
phys = <_phy0>;
phy-names = "usb";
power-domains = < R8A7795_PD_ALWAYS_ON>;
status = "disabled";
};

If my idea A), ehci0 will have companion = <>;
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 linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html