From patchwork Thu Jan 23 15:50:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11348513 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7E29B13A4 for ; Thu, 23 Jan 2020 15:50:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D44C22522 for ; Thu, 23 Jan 2020 15:50:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mHze0ilB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728792AbgAWPuT (ORCPT ); Thu, 23 Jan 2020 10:50:19 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:45299 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726231AbgAWPuT (ORCPT ); Thu, 23 Jan 2020 10:50:19 -0500 Received: by mail-lj1-f195.google.com with SMTP id j26so3969760ljc.12 for ; Thu, 23 Jan 2020 07:50:16 -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:mime-version :content-transfer-encoding; bh=6+9cuxpuO+rUldc3JUvQfdc2tpxPpfRg7i5O5JSt230=; b=mHze0ilBGFCeN/+cHezQFPAIWKOAtOz33UhRg2H7Du1gYYVcRrFsMe7cSbbsR1N1ph h/A3yG4VMqTtTPlHsbbL/0fdl5sAyAClucK0EFrNdQ5RKm7t0Abf8tfneqNVx8QAAR7U MIp9D9Tl85PDc43w1Kcr98kuXhOAnMqdI7o68fvuZQzc/wg7KRAZH08Rnz7wGrl8W8wR cZ2q/3LlNA4vMr+VUoOs/7EaYpuYX/oB9RMCv0QeI1dhYvu8cL7EUDQmXbZaXFGurY1r MkYRe9YnljITzNZRB12OwXYIQ6EVQYygl2aTmKh0RFpvK1Oo4MAxqjvGwzOn3h9FwK1R XFdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6+9cuxpuO+rUldc3JUvQfdc2tpxPpfRg7i5O5JSt230=; b=lQg5XjwWk56lviHuqVopFLJQS3z/gK76vtmS96GrrVHTfyRfvuN0QvE5rruD/r4+fa zQScPh6FgMfoaxx4/R/IIaRLuFOQIBXH0j02wziHABBKJIkMa9Z4O3jAbtKbL1Rjffyc 6dhwY95gP+Sl2jWbev7HehMoBooOTwNlDehc+cDvKvb7WonSmwexjHrx1/2ljfn8INwr P/Nky1E2dBmDcv3jaA7poQiXejso5l+3N4we7/nat21pGL7/iW0T3BA6Zoa7nEwbyQEL sk2N3zJHD9oT2lI++AmH0thcFKiNQbtBYbXGNp/ATArClJh+voyKY/CTIG3CxMaWtKPH tdnQ== X-Gm-Message-State: APjAAAVDy4JEQSDSQsXV2n3q5uLYhplrBF9kjm9Of8jBduX66uv25AHO Vohrj4851LAIROS6+NVDu0/o6w== X-Google-Smtp-Source: APXvYqy3V7O6kZRoUw/i9MBE8YqnsrgX5jDZLV52+yp763sDA2TMzDF0KMGPegms9d8Qxiy6O9lkjQ== X-Received: by 2002:a2e:9b9a:: with SMTP id z26mr21105593lji.181.1579794615464; Thu, 23 Jan 2020 07:50:15 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id d4sm1254012lfn.42.2020.01.23.07.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 07:50:14 -0800 (PST) From: Linus Walleij To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Linus Walleij , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Felipe Balbi , Sylwester Nawrocki , Philipp Zabel Subject: [PATCH v3] usb: phy: phy-gpio-vbus-usb: Convert to GPIO descriptors Date: Thu, 23 Jan 2020 16:50:13 +0100 Message-Id: <20200123155013.93249-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Instead of using the legacy GPIO API and keeping track on polarity inversion semantics in the driver, switch to use GPIO descriptors for this driver and change all consumers in the process. This makes it possible to retire platform data completely: the only remaining platform data member was "wakeup" which was intended to make the vbus interrupt wakeup capable, but was not set by any users and thus remained unused. VBUS was not waking any devices up. Leave a comment about it so later developers using the platform can consider setting it to always enabled so plugging in USB wakes up the platform. Cc: Daniel Mack Cc: Haojian Zhuang Acked-by: Robert Jarzmik Acked-by: Felipe Balbi Acked-by: Sylwester Nawrocki Acked-by: Philipp Zabel Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Drop two local unused variables yielding warnings. - Collect Robert's ACK. ChangeLog v1->v2: - Fix a chip label typo in mach-s3c64xx - Collect the ACKs! --- arch/arm/mach-pxa/colibri-pxa320.c | 16 ++--- arch/arm/mach-pxa/eseries.c | 40 +++++++----- arch/arm/mach-pxa/gumstix.c | 18 +++--- arch/arm/mach-pxa/hx4700.c | 22 ++++--- arch/arm/mach-pxa/magician.c | 22 ++++--- arch/arm/mach-pxa/mioa701.c | 15 +++-- arch/arm/mach-pxa/palm27x.c | 34 +++++----- arch/arm/mach-pxa/palmt5.c | 1 - arch/arm/mach-pxa/palmtc.c | 18 +++--- arch/arm/mach-pxa/palmte2.c | 18 +++--- arch/arm/mach-pxa/palmtx.c | 1 - arch/arm/mach-pxa/palmz72.c | 1 - arch/arm/mach-pxa/tosa.c | 18 +++--- arch/arm/mach-pxa/vpac270.c | 15 ++--- arch/arm/mach-s3c64xx/mach-smartq.c | 13 ++-- drivers/usb/phy/phy-gpio-vbus-usb.c | 96 +++++++++++++---------------- include/linux/usb/gpio_vbus.h | 33 ---------- 17 files changed, 188 insertions(+), 193 deletions(-) delete mode 100644 include/linux/usb/gpio_vbus.h diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c index eba917d69c0a..35dd3adb7712 100644 --- a/arch/arm/mach-pxa/colibri-pxa320.c +++ b/arch/arm/mach-pxa/colibri-pxa320.c @@ -11,9 +11,9 @@ #include #include #include +#include #include #include -#include #include #include @@ -144,17 +144,18 @@ static inline void __init colibri_pxa320_init_eth(void) {} #endif /* CONFIG_AX88796 */ #if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE) -static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { - .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), - .gpio_pullup = -1, +static struct gpiod_lookup_table gpio_vbus_gpiod_table = { + .dev_id = "gpio-vbus", + .table = { + GPIO_LOOKUP("gpio-pxa", MFP_PIN_GPIO96, + "vbus", GPIO_ACTIVE_HIGH), + { }, + }, }; static struct platform_device colibri_pxa320_gpio_vbus = { .name = "gpio-vbus", .id = -1, - .dev = { - .platform_data = &colibri_pxa320_gpio_vbus_info, - }, }; static void colibri_pxa320_udc_command(int cmd) @@ -173,6 +174,7 @@ static struct pxa2xx_udc_mach_info colibri_pxa320_udc_info __initdata = { static void __init colibri_pxa320_init_udc(void) { pxa_set_udc_info(&colibri_pxa320_udc_info); + gpiod_add_lookup_table(&gpio_vbus_gpiod_table); platform_device_register(&colibri_pxa320_gpio_vbus); } #else diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c index 91f7c3e40065..f37c44b6139d 100644 --- a/arch/arm/mach-pxa/eseries.c +++ b/arch/arm/mach-pxa/eseries.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -22,7 +23,6 @@ #include #include #include -#include #include #include