I can't seem to figure out how to connect a generic phy device
to the usb UDC logic, as the dwc2 code seems to exclusively work
with either generic phys or usb-phys.

So to try to make this work with the phy-hi6220-usb driver, tweak
the dwc2 logic to support call hooks to both phy and uphy devices.

I realize this is likely wrong, but without a good pointer as to
how this should be done, I'm a bit wandering around in the dark.

Cc: Wei Xu <xuw...@hisilicon.com>
Cc: Guodong Xu <guodong...@linaro.org>
Cc: Amit Pundir <amit.pun...@linaro.org>
Cc: Rob Herring <robh...@kernel.org>
Cc: John Youn <johny...@synopsys.com>
Cc: Douglas Anderson <diand...@chromium.org>
Cc: Chen Yu <cheny...@huawei.com>
Cc: Kishon Vijay Abraham I <kis...@ti.com>
Cc: Felipe Balbi <felipe.ba...@linux.intel.com>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Signed-off-by: John Stultz <john.stu...@linaro.org>
---
 drivers/usb/dwc2/platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 8e1728b..8fb2f4d 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -297,7 +297,7 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg 
*hsotg)
 
        if (hsotg->uphy)
                ret = usb_phy_init(hsotg->uphy);
-       else if (hsotg->plat && hsotg->plat->phy_init)
+       if (hsotg->plat && hsotg->plat->phy_init)
                ret = hsotg->plat->phy_init(pdev, hsotg->plat->phy_type);
        else {
                ret = phy_power_on(hsotg->phy);
@@ -411,7 +411,7 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
                }
        }
 
-       if (!hsotg->phy) {
+       if (1 || !hsotg->phy) {
                hsotg->uphy = devm_usb_get_phy(hsotg->dev, USB_PHY_TYPE_USB2);
                if (IS_ERR(hsotg->uphy)) {
                        ret = PTR_ERR(hsotg->uphy);
-- 
2.7.4

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

Reply via email to