From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752005AbbEGSz3 (ORCPT ); Thu, 7 May 2015 14:55:29 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:45761 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751118AbbEGSz0 (ORCPT ); Thu, 7 May 2015 14:55:26 -0400 Date: Thu, 7 May 2015 13:53:42 -0500 From: Felipe Balbi To: Felipe Balbi CC: Heikki Krogerus , David Cohen , Greg Kroah-Hartman , Stephen Boyd , Baolu Lu , Paul Bolle , , Subject: Re: =?utf-8?B?W82EUEFUQ0h2?= =?utf-8?Q?4?= 09/12] usb: dwc3: pci: add quirk for Baytrails Message-ID: <20150507185342.GG29183@saruman.tx.rr.com> Reply-To: References: <1430979572-14768-1-git-send-email-heikki.krogerus@linux.intel.com> <1430979572-14768-10-git-send-email-heikki.krogerus@linux.intel.com> <20150507185234.GF29183@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KIzF6Cje4W/osXrF" Content-Disposition: inline In-Reply-To: <20150507185234.GF29183@saruman.tx.rr.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 --KIzF6Cje4W/osXrF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 07, 2015 at 01:52:34PM -0500, Felipe Balbi wrote: > On Thu, May 07, 2015 at 09:19:29AM +0300, Heikki Krogerus wrote: > > On some BYT platforms the USB2 PHY needs to be put into > > operational mode by the controller driver with GPIOs > > controlling the PHYs reset and cs signals. > >=20 > > Signed-off-by: Heikki Krogerus > > --- > > drivers/usb/dwc3/dwc3-pci.c | 36 ++++++++++++++++++++++++++++++++++++ > > 1 file changed, 36 insertions(+) > >=20 > > diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c > > index b773fb5..0235f46 100644 > > --- a/drivers/usb/dwc3/dwc3-pci.c > > +++ b/drivers/usb/dwc3/dwc3-pci.c > > @@ -21,6 +21,8 @@ > > #include > > #include > > #include > > +#include > > +#include > > =20 > > #include "platform_data.h" > > =20 > > @@ -31,6 +33,15 @@ > > #define PCI_DEVICE_ID_INTEL_SPTLP 0x9d30 > > #define PCI_DEVICE_ID_INTEL_SPTH 0xa130 > > =20 > > +static const struct acpi_gpio_params reset_gpios =3D { 0, 0, false }; > > +static const struct acpi_gpio_params cs_gpios =3D { 1, 0, false }; > > + > > +static const struct acpi_gpio_mapping acpi_dwc3_byt_gpios[] =3D { > > + { "reset-gpios", &reset_gpios, 1 }, > > + { "cs-gpios", &cs_gpios, 1 }, > > + { }, > > +}; > > + > > static int dwc3_pci_quirks(struct pci_dev *pdev) > > { > > if (pdev->vendor =3D=3D PCI_VENDOR_ID_AMD && > > @@ -65,6 +76,30 @@ static int dwc3_pci_quirks(struct pci_dev *pdev) > > sizeof(pdata)); > > } > > =20 > > + if (pdev->vendor =3D=3D PCI_VENDOR_ID_INTEL && > > + pdev->device =3D=3D PCI_DEVICE_ID_INTEL_BYT) { > > + struct gpio_desc *gpio; > > + > > + acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev), > > + acpi_dwc3_byt_gpios); > > + > > + /* These GPIOs will turn on the USB2 PHY */ > > + gpio =3D gpiod_get(&pdev->dev, "cs"); > > + if (!IS_ERR(gpio)) { > > + gpiod_direction_output(gpio, 0); > > + gpiod_set_value_cansleep(gpio, 1); > > + gpiod_put(gpio); > > + } > > + > > + gpio =3D gpiod_get(&pdev->dev, "reset"); > > + if (!IS_ERR(gpio)) { > > + gpiod_direction_output(gpio, 0); > > + gpiod_set_value_cansleep(gpio, 1); > > + gpiod_put(gpio); > > + msleep(10); >=20 > WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers= /timers-howto.txt > #76: FILE: drivers/usb/dwc3/dwc3-pci.c:99: > + msleep(10); >=20 > looks like usleep_range() is more desirable here. if this is the only problem, I'll fix while applying. --=20 balbi --KIzF6Cje4W/osXrF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVS7S2AAoJEIaOsuA1yqRE02oQAK/AJxV2RU5dX55nbsrDv2gA vF0er/vSN9ma00zojF2y0jy9FLzpQWoZDeB0EMpSSy5DmBpo2HXj/N5OXKMGiAiE owIQoQYoSOWlKBgeJgsgqbEe0rrApqEO1PChSzq7r7o5vyXvrCF2Dw8uJFpqToas dLvtI0DHDLFcsE/QB5VqBmdcvyvNpzDv4zdANrLvEA4aSqrbOeN27Oh9tEt3LLRr GxjvK5N8DFqLZ6KL0YpS5hhRtDHjTdorUa/JTk5BTVXtOX2x7c2IBIF3FbpCVKad kJnmQDjOGr+hxqn7vJwNAUrcezh1+OQbs2fjGMaK1zJcfd7eiLdBp/eXPAqUXgBA PZI8gFRGOc+X6n3oFjN2X2peLlm+zYxA1rOADCN4nhlvayjhcOgQd6bWj5swPPpU mOEskO25wJ96P9Ok9Mq4+pcgUoaN3CaNQ2h1E60zypsLh7WkJj7AakK+mXI+CTii E8NojISg7+ipc7d7e4e4caVQDEL2qAqDErFZhQW0N7/CycOOUck58fhFcJW2Li1y SzD/GqiBsRTdhHNkatflaGtMOgRWrcGwlMPDAzcknQVWFoaDBH+YBGzGbOQqCSDD eZ6Wh5TbBZu+E+YXFab7/Qv0e5zNHiympxgapVOe6uVjg3CPxUu8oPxY0yOHKbU9 NIsOJdP+aDWkt/UqzOPx =zk/t -----END PGP SIGNATURE----- --KIzF6Cje4W/osXrF--