From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from devils.ext.ti.com ([198.47.26.153]:42120 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750868AbbJBCGV (ORCPT ); Thu, 1 Oct 2015 22:06:21 -0400 Date: Thu, 1 Oct 2015 21:06:19 -0500 From: Felipe Balbi To: John Youn CC: , , , Subject: Re: [PATCH 5/6] usb: dwc3: Add dis_enblslpm_quirk Message-ID: <20151002020619.GC2534@saruman.tx.rr.com> Reply-To: References: <70fc2a4db129c44cc8ed7f1597d4501927683b52.1443748471.git.johnyoun@synopsys.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ghzN8eJ9Qlbqn3iT" Content-Disposition: inline In-Reply-To: <70fc2a4db129c44cc8ed7f1597d4501927683b52.1443748471.git.johnyoun@synopsys.com> Sender: stable-owner@vger.kernel.org List-ID: --ghzN8eJ9Qlbqn3iT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 26, 2015 at 12:31:08AM -0700, John Youn wrote: > Add a quirk to clear the GUSB2PHYCFG.ENBLSLPM bit, which controls > whether the PHY receives the suspend signal from the controller. >=20 > Certain Synopsys prototyping PHY boards are not able to meet timings > constraints for LPM. This allows the PHY to meet those timings by > leaving the PHY clock running during suspend. >=20 > Cc: # v3.18+ > Signed-off-by: John Youn let's split this patch up. First we add the flag, and on a separate patch y= ou use it in dwc3-pci.c > --- > Documentation/devicetree/bindings/usb/dwc3.txt | 2 ++ > drivers/usb/dwc3/core.c | 6 ++++++ > drivers/usb/dwc3/core.h | 4 ++++ > drivers/usb/dwc3/dwc3-pci.c | 1 + > drivers/usb/dwc3/platform_data.h | 1 + > 5 files changed, 14 insertions(+) >=20 > diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentati= on/devicetree/bindings/usb/dwc3.txt > index 8c7d585..9ff48e0 100644 > --- a/Documentation/devicetree/bindings/usb/dwc3.txt > +++ b/Documentation/devicetree/bindings/usb/dwc3.txt > @@ -35,6 +35,8 @@ Optional properties: > LTSSM during USB3 Compliance mode. > - snps,dis_u3_susphy_quirk: when set core will disable USB3 suspend phy. > - snps,dis_u2_susphy_quirk: when set core will disable USB2 suspend phy. > + - snps,dis_enblslpm_quirk: when set clears the enblslpm in GUSB2PHYCFG, > + disabling the suspend signal to the PHY. > - 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 > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > index 566cca1..ca19027 100644 > --- a/drivers/usb/dwc3/core.c > +++ b/drivers/usb/dwc3/core.c > @@ -515,6 +515,9 @@ static int dwc3_phy_setup(struct dwc3 *dwc) > if (dwc->dis_u2_susphy_quirk) > reg &=3D ~DWC3_GUSB2PHYCFG_SUSPHY; > =20 > + if (dwc->dis_enblslpm_quirk) > + reg &=3D ~DWC3_GUSB2PHYCFG_ENBLSLPM; > + > dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); > =20 > return 0; > @@ -911,6 +914,8 @@ static int dwc3_probe(struct platform_device *pdev) > "snps,dis_u3_susphy_quirk"); > dwc->dis_u2_susphy_quirk =3D device_property_read_bool(dev, > "snps,dis_u2_susphy_quirk"); > + dwc->dis_enblslpm_quirk =3D device_property_read_bool(dev, > + "snps,dis_enblslpm_quirk"); > =20 > dwc->tx_de_emphasis_quirk =3D device_property_read_bool(dev, > "snps,tx_de_emphasis_quirk"); > @@ -944,6 +949,7 @@ static int dwc3_probe(struct platform_device *pdev) > dwc->rx_detect_poll_quirk =3D pdata->rx_detect_poll_quirk; > dwc->dis_u3_susphy_quirk =3D pdata->dis_u3_susphy_quirk; > dwc->dis_u2_susphy_quirk =3D pdata->dis_u2_susphy_quirk; > + dwc->dis_enblslpm_quirk =3D pdata->dis_enblslpm_quirk; > =20 > dwc->tx_de_emphasis_quirk =3D pdata->tx_de_emphasis_quirk; > if (pdata->tx_de_emphasis) > diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h > index 7446467..a87ef34 100644 > --- a/drivers/usb/dwc3/core.h > +++ b/drivers/usb/dwc3/core.h > @@ -179,6 +179,7 @@ > #define DWC3_GUSB2PHYCFG_PHYSOFTRST (1 << 31) > #define DWC3_GUSB2PHYCFG_SUSPHY (1 << 6) > #define DWC3_GUSB2PHYCFG_ULPI_UTMI (1 << 4) > +#define DWC3_GUSB2PHYCFG_ENBLSLPM (1 << 8) > =20 > /* Global USB2 PHY Vendor Control Register */ > #define DWC3_GUSB2PHYACC_NEWREGREQ (1 << 25) > @@ -721,6 +722,8 @@ struct dwc3_scratchpad_array { > * @rx_detect_poll_quirk: set if we enable rx_detect to polling lfps qui= rk > * @dis_u3_susphy_quirk: set if we disable usb3 suspend phy > * @dis_u2_susphy_quirk: set if we disable usb2 suspend phy > + * @dis_enblslpm_quirk: set if we clear enblslpm in GUSB2PHYCFG, > + * disabling the suspend signal to the PHY. > * @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk > * @tx_de_emphasis: Tx de-emphasis value > * 0 - -6dB de-emphasis > @@ -862,6 +865,7 @@ struct dwc3 { > unsigned rx_detect_poll_quirk:1; > unsigned dis_u3_susphy_quirk:1; > unsigned dis_u2_susphy_quirk:1; > + unsigned dis_enblslpm_quirk:1; > =20 > unsigned tx_de_emphasis_quirk:1; > unsigned tx_de_emphasis:2; > diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c > index 4479a41..b34bd79 100644 > --- a/drivers/usb/dwc3/dwc3-pci.c > +++ b/drivers/usb/dwc3/dwc3-pci.c > @@ -118,6 +118,7 @@ static int dwc3_pci_quirks(struct pci_dev *pdev) > memset(&pdata, 0, sizeof(pdata)); > pdata.usb3_lpm_capable =3D true; > pdata.has_lpm_erratum =3D true; > + pdata.dis_enblslpm_quirk =3D true; > =20 > return platform_device_add_data(pci_get_drvdata(pdev), &pdata, > sizeof(pdata)); > diff --git a/drivers/usb/dwc3/platform_data.h b/drivers/usb/dwc3/platform= _data.h > index 400b197..2bb4d3a 100644 > --- a/drivers/usb/dwc3/platform_data.h > +++ b/drivers/usb/dwc3/platform_data.h > @@ -42,6 +42,7 @@ struct dwc3_platform_data { > unsigned rx_detect_poll_quirk:1; > unsigned dis_u3_susphy_quirk:1; > unsigned dis_u2_susphy_quirk:1; > + unsigned dis_enblslpm_quirk:1; > =20 > unsigned tx_de_emphasis_quirk:1; > unsigned tx_de_emphasis:2; > --=20 > 2.5.0.GIT >=20 --=20 balbi --ghzN8eJ9Qlbqn3iT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWDeabAAoJEIaOsuA1yqREl48P/iS8gM5JXWU5OUZ/tcOXVjfC 0t8YjbSaiyt0isZTYNRnOuWx7+zp8YS2IdOTpARwUMgz/q+fjplrwGnLtZltWhUV QMkP/X5zmyLcvWeFyKNxT6q6p9ZUdhzLyW/7gUYq9M3ZzTnUO0VM8Qujo2ps0eL1 n4MRcs15oZ2Ky/DEeQN7bGLWhFCaU1QFadOqi8Gt+9NdgUdyZ5yZM2ye0sNtGWAS 8peY/iragj1SnVRwrlB8ll65qU7NEFJH4s4YCI7OsFTHysKpzRXKWqy6/IFcutkS e8uXpxRWMHUqEzXatobuSOMa3VpBjTzn/KRu8VewaHfyGBDhfES6dX1MbGw2RJBf 7lBavr/xCZoFB5efDBug4AX+F40oiPCMgcdhw4vXo182XwFNw92un9c1/S+9N9ud jCD7d6aEnF4g6xJPqhLjZymiVkItnfSMYSH+4wLGylpRrPzIrvaWvytdpU+LceyE 0Xz4/6KUI+R0XhdaVFdiFkJ4cD0SHNrHSmSVVsegxMjvzJ5Q9LCndqDBheYuhgE8 2HkCUwvAE1fMtqHGt0sveaDr6fp36a61F0/ftj+xCvnhN8gtVD++c+uyP18WADRW pVMrhD7Xz7AVRxguHZajEbRsXgnfyVpBD2biou/LTKrLldhAABex1JuJ2Y7FS/3o KzoU5TcMzdpLICEhZZFj =zujL -----END PGP SIGNATURE----- --ghzN8eJ9Qlbqn3iT--