From patchwork Wed Nov 23 03:46:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 83528 Delivered-To: patches@linaro.org Received: by 10.140.97.165 with SMTP id m34csp2443992qge; Tue, 22 Nov 2016 19:46:55 -0800 (PST) X-Received: by 10.84.216.26 with SMTP id m26mr2414268pli.22.1479872815463; Tue, 22 Nov 2016 19:46:55 -0800 (PST) Return-Path: Received: from mail-pg0-x233.google.com (mail-pg0-x233.google.com. [2607:f8b0:400e:c05::233]) by mx.google.com with ESMTPS id u21si31597148pgi.69.2016.11.22.19.46.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Nov 2016 19:46:55 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::233 as permitted sender) client-ip=2607:f8b0:400e:c05::233; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::233 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-pg0-x233.google.com with SMTP id p66so742560pga.2 for ; Tue, 22 Nov 2016 19:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bKPPlg0Vtx5+Daan3hZPEAJSRElbdy6y7DZ9Ffxrj0I=; b=kbIbSqwlaUBKCgYiU+Lz+rGGSrRiJ6eb5UApnfJjB7m7/sHCKrRBH1aCdmCcWzmkHc 4Um/XB7QxyLQ23yWB82UQPgezpS0h9eiQUThTlDay/Js0DpLgZ4vK5rGn/PD9B2DvUNh N/5XNWYUbd6qNc4K0h9rYa39uYBo9ogMTnOE4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bKPPlg0Vtx5+Daan3hZPEAJSRElbdy6y7DZ9Ffxrj0I=; b=AlRHC7ZnDfQ3gfZ1nrlpRrqA4RXkoh3slOC98fitcBTRyKdCOGlOfdzuRF5yyfW82k dA3w3D0tY2kDeYnLUWGfPeROEANjgProcBArAO7ws76kulOYJMVafI7ye0Xj5uTuHhQN pWRnX2fpGe2pgAdBMcfdFt/aCDN0Lhh+i12e4b9jJaaGLRz/8Ulm1sxwmG5X6bacBozM llEDCKpLkc8fkIIMmrQWO+0sicl23Pjk+GzHmeoh1cDTMfGggim01f9TgyKiJJu6vF+T /rhSecYgBiSbDKxZUF1N2V63cZDm4D9hvOQYOFsNHNK1PzwV0o6uQc+fRhLIEzjczfUs Joag== X-Gm-Message-State: AKaTC00dblfW+BJaEDkdM2r38Vm+yU02+Ej3IMg+GwvplLTMs2A4A9txoNSzweDsddXtRq2nw+U= X-Received: by 10.98.4.134 with SMTP id 128mr1029443pfe.156.1479872815178; Tue, 22 Nov 2016 19:46:55 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id l11sm48282533pfb.28.2016.11.22.19.46.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Nov 2016 19:46:54 -0800 (PST) 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> 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(-) -- 2.7.4 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);