From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030594AbbD1RPJ (ORCPT ); Tue, 28 Apr 2015 13:15:09 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:36309 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030388AbbD1RPC (ORCPT ); Tue, 28 Apr 2015 13:15:02 -0400 Date: Tue, 28 Apr 2015 12:13:26 -0500 From: Felipe Balbi To: Heikki Krogerus CC: Felipe Balbi , David Cohen , Greg Kroah-Hartman , Stephen Boyd , Baolu Lu , Paul Bolle , , Subject: Re: [PATCHv3 08/11] usb: dwc3: add hsphy_interface property Message-ID: <20150428171326.GM18263@saruman.tx.rr.com> Reply-To: References: <1430227486-225197-1-git-send-email-heikki.krogerus@linux.intel.com> <1430227486-225197-9-git-send-email-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="prC3/KjdfqNV7evK" Content-Disposition: inline In-Reply-To: <1430227486-225197-9-git-send-email-heikki.krogerus@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --prC3/KjdfqNV7evK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 28, 2015 at 04:24:43PM +0300, Heikki Krogerus wrote: > Platforms that have configured DWC_USB3_HSPHY_INTERFACE with > value 3, i.e. UTMI+ and ULPI, need to inform the driver of > the actual HSPHY interface type with the property. "utmi" if > the interface is UTMI+ or "ulpi" if the interface is ULPI. >=20 > Signed-off-by: Heikki Krogerus > Acked-by: David Cohen > --- > Documentation/devicetree/bindings/usb/dwc3.txt | 2 ++ > drivers/usb/dwc3/core.c | 29 ++++++++++++++++++++= ++++-- > drivers/usb/dwc3/core.h | 3 +++ > drivers/usb/dwc3/platform_data.h | 2 ++ > 4 files changed, 34 insertions(+), 2 deletions(-) >=20 > diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentati= on/devicetree/bindings/usb/dwc3.txt > index 5cc3643..0815eac 100644 > --- a/Documentation/devicetree/bindings/usb/dwc3.txt > +++ b/Documentation/devicetree/bindings/usb/dwc3.txt > @@ -38,6 +38,8 @@ Optional properties: > - snps,is-utmi-l1-suspend: true when DWC3 asserts output signal > utmi_l1_suspend_n, false when asserts utmi_sleep_n > - snps,hird-threshold: HIRD threshold > + - snps,hsphy_interface: High-Speed PHY interface selection between "utm= i" for > + UTMI+ and "ulpi" for ULPI when the DWC_USB3_HSPHY_INTERFACE has value= 3. > =20 > This is usually a subnode to DWC3 glue to which it is connected. > =20 > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > index 6b02e12..b229ba1 100644 > --- a/drivers/usb/dwc3/core.c > +++ b/drivers/usb/dwc3/core.c > @@ -395,9 +395,10 @@ static void dwc3_cache_hwparams(struct dwc3 *dwc) > * dwc3_phy_setup - Configure USB PHY Interface of DWC3 Core > * @dwc: Pointer to our controller context structure > */ > -static void dwc3_phy_setup(struct dwc3 *dwc) > +static int dwc3_phy_setup(struct dwc3 *dwc) > { > u32 reg; > + int ret; > =20 > reg =3D dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); > =20 > @@ -438,6 +439,22 @@ static void dwc3_phy_setup(struct dwc3 *dwc) > =20 > reg =3D dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); > =20 > + /* Select the HS PHY interface */ > + switch (DWC3_GHWPARAMS3_HSPHY_IFC(dwc->hwparams.hwparams3)) { > + case DWC3_GHWPARAMS3_HSPHY_IFC_UTMI_ULPI: > + if (!strncmp(dwc->hsphy_interface, "utmi", 4)) { > + reg &=3D ~DWC3_GUSB2PHYCFG_ULPI_UTMI; > + } else if (!strncmp(dwc->hsphy_interface, "ulpi", 4)) { > + reg |=3D DWC3_GUSB2PHYCFG_ULPI_UTMI; > + } else { > + dev_err(dwc->dev, "HSPHY Interface not defined\n"); > + return -EINVAL; instead of erroring out, just leave default value and convert this to a dev_warn() or something similar. That way, older DTS will continue to work. --=20 balbi --prC3/KjdfqNV7evK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVP7+2AAoJEIaOsuA1yqREBgsP/jM4NUsZWlpu6OktvWEeuppI jbiNK9J227h8z+lLgK4Ci4PiryF9snEyssC+JTSygkjbKYwxTHLnA56vE8Lw2mF+ dYdhUPLGLRIDzSi/rmmopCi0nMK2yZ6kR7lJ4v9mZo947Nz75L+nYjeG7Rh/HoXe rNLGXS3MzO3L8XficvfvgMNOlIhT41wwU73/ge87e9Slf/CkK9PhRUNdjblLuhcc a7IJvupzLKzUrnKtW7dFItIuAW9LZa5JmCHcT2yIEBlBP3nBX5RktV7FlSfo4Tpu 4pT15r81peAlo1v4040qZM8PRUxxSuBDvn9R+97h4YcvwOZ2K/RvA0yuUwG0j4dG JdQ1+C+AJlMYqFzErS3vDZsqX0WdbkhbR5GImEEFa71Inh8b9HN5JY/1PwMoib3A 0+bndJgiYxcksMeGWPApIBLa+jjuYYs6hRaRSuk4G+WX0FrvjX3QJlJ8pSsOD8TZ SHgo9N9wm+6NLd4EHdFW/cjKsA/q+kGZ7jQei1DHQwklfHCQ8k4r0Tattyp9TGaT h/asIUZNbD6hqx3xR4EuInPip8yIxbPL69lY7+nt7HqTLC0W7zqdNkjyQ4cgzRaY rqgLmeZcEpuH6J06vhpkzucTqC2Ihe+cMeh3Fij+qfvBaLSMrszjEb+YXAH9kuwx 1rKBuYlb19lozZVY5mip =Fh/b -----END PGP SIGNATURE----- --prC3/KjdfqNV7evK--