Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756577AbcKWDzu (ORCPT ); Tue, 22 Nov 2016 22:55:50 -0500 Received: from mail-pg0-f44.google.com ([74.125.83.44]:35085 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756124AbcKWDzt (ORCPT ); Tue, 22 Nov 2016 22:55:49 -0500 From: John Stultz To: lkml Cc: John Stultz , Wei Xu , Guodong Xu , Amit Pundir , Rob Herring , John Youn , Douglas Anderson , Chen Yu , Kishon Vijay Abraham I , Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: [RFC][PATCH 2/3] HACK: dwc2: force dual use of uphy and phy Date: Tue, 22 Nov 2016 19:46:48 -0800 Message-Id: <1479872809-11958-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479872809-11958-1-git-send-email-john.stultz@linaro.org> References: <1479872809-11958-1-git-send-email-john.stultz@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1799 Lines: 50 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 Cc: Guodong Xu Cc: Amit Pundir Cc: Rob Herring Cc: John Youn Cc: Douglas Anderson Cc: Chen Yu Cc: Kishon Vijay Abraham I Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Signed-off-by: John Stultz --- 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