From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 11 May 2017 13:55:56 +0200 Subject: [U-Boot] [PATCH v5 10/14] usb: extend generic EHCI with PHY In-Reply-To: References: <1494432599-17924-1-git-send-email-patrice.chotard@st.com> <1494432599-17924-11-git-send-email-patrice.chotard@st.com> <3c947c62-5b6b-5071-1cfb-2f2a80314710@denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 05/11/2017 09:19 AM, Patrice CHOTARD wrote: > Hi Marek > > On 05/10/2017 11:18 PM, Marek Vasut wrote: >> On 05/10/2017 06:09 PM, patrice.chotard at st.com wrote: >>> From: Patrice Chotard >> >> Commit message missing. > > ok i will fix it > >> >> You should also break this patchset up into smaller pieces. > > You mean, extract the update of generic OHCI and >EHCI driver from this > series ? Yes, split the patchset into independent pieces so it's not such a massive drop of code. >>> Signed-off-by: Patrice Chotard >>> --- >>> >>> v5: _ add support of new generic PHY UCLASS >>> >>> drivers/usb/host/ehci-generic.c | 13 +++++++++++++ >>> 1 file changed, 13 insertions(+) >>> >>> diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c >>> index 2190adb..3c2f5a7 100644 >>> --- a/drivers/usb/host/ehci-generic.c >>> +++ b/drivers/usb/host/ehci-generic.c >>> @@ -6,6 +6,8 @@ >>> >>> #include >>> #include >>> +#include >>> +#include >>> #include >>> #include >>> #include >>> @@ -50,6 +52,17 @@ static int ehci_usb_probe(struct udevice *dev) >>> reset_free(&reset); >>> } >>> >>> + for (i = 0; ; i++) { >>> + struct phy usb_phy; >>> + int ret; >>> + >>> + ret = generic_phy_get_by_index(dev, i, &usb_phy); >>> + if (ret < 0) >>> + break; >>> + if (generic_phy_init(&usb_phy)) >>> + printf("failed to init usb phy %d\n", i); >> >> How does this whole block work ? What is this about ? > > It allows to retrieve any present USB phys node and call the associated > init callback. see patch 4 of this series ([PATCH v5 04/14] usb: phy: > Add STi USB2 PHY) > > FYI, in dm next branch, there is a new generic PHY framework implementation. > See 0ace7fe60d5c258324ef4b2caaa556616b96d1d9 drivers: phy: add generic > PHY framework And why do you need to iterate over indexes ? Why don't you just parse a phandle ? -- Best regards, Marek Vasut