From patchwork Tue Dec 31 17:48:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 182684 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp7840467ild; Tue, 31 Dec 2019 09:51:01 -0800 (PST) X-Google-Smtp-Source: APXvYqwpkOIP9IU90iyQWf6DKWdFXWDJS6R2/F8kQJEnyvs+HBuJf0bgrizWGAfmmuFSTk7Uq1qk X-Received: by 2002:a17:906:23e2:: with SMTP id j2mr78181434ejg.257.1577814660949; Tue, 31 Dec 2019 09:51:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577814660; cv=none; d=google.com; s=arc-20160816; b=EQO1egpY3qb46lPvFRVT/QiIHaGVBcrvUiuaxtiLJZlKAktUnFIxIx583cJU/Cl6ne cm/CcasxwyV/TVTxCs4/goeT98cy7GmJalpUoO2xPWDtGco9sspZ2g9kDI2xmJlUbP8z xYkqUS0VNSiIEqj0CKq5ZGllZmvsRXbHxeNtANBLjW7lsABWt2M5CGsUCZI+LhRPPRnA 1TZIvgKSxqcAMGrVrn4VmfKU1zLgePesNiYj0slv7083UaL6P1X4Zg7olNZfCmVBsc6C RtWRYiBei6VE+Lo6qMaUy+SsRIsGrVbxJMEXV6+wd2UUs5tlKCub1HfZRM5BCr80EjY3 6MYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7K4is6sTot0/1etjIcFQMjvHkYMZNanIhfzmbHHbql4=; b=Ref1ya35I+QAMnF5sPv7l9mn/NSEsCv6Eo0oSWTkXv1pPZ1U9GVKkl4YH9B2FKH+FF CWMhmRs7oQ8LIcy7N29gInKy2B4e4IFs7Fx9C2asT0epmQFtWAUayHerhqSyo6zPY5Zp XeNwMlA+87We8o81Mgu6HswS+6eqRvver8P8sDVM2HokhEkb5n6l62sP34O32pZ4soKX GeLHJnsLhnf3Uo5Y+5G32OTdfptJ3UAheH1ynnyHyZ7qy7bm/mtCrEKnGQQdygcroZVu 0VOdei76xIDc/3N1BxufHv5W0I37aaB1YTrYC/d8BIIRzoe6rxLusfDLH8MSalYxq+b9 Bvdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QVxAPaqS; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1si32297053ejj.63.2019.12.31.09.51.00; Tue, 31 Dec 2019 09:51:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QVxAPaqS; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727054AbfLaRu7 (ORCPT + 5 others); Tue, 31 Dec 2019 12:50:59 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:43737 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726060AbfLaRu7 (ORCPT ); Tue, 31 Dec 2019 12:50:59 -0500 Received: by mail-lf1-f68.google.com with SMTP id 9so27386860lfq.10 for ; Tue, 31 Dec 2019 09:50: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:mime-version :content-transfer-encoding; bh=7K4is6sTot0/1etjIcFQMjvHkYMZNanIhfzmbHHbql4=; b=QVxAPaqShna9fN498zTZxTV4Nf7XaNRqf3bwUJgNk/bEBC0zV7QYF5zzNE9hqlO0EF Th/Caip1cvM2WmDhok8TA7BgJq5nc7eXPUgB9WIpVBjW2NN1sbSZjDvQwamCP5a+KN5C ToXqs3tnw2f+lXIrlOS0+O9dZOSMlPCyKPweXjyorL/IQrBM80BFpE1kcQs919fNhTY7 z9+kWdzxpJIo5RoLxqFUYymidPujVl9iqs1VTqULme+4h4PhUqxdrTdF8flW8f9QY9vE p8crTjmXeiSVbA4tLXuLleT+sRqYvvAaz+So+eviTgyjjuZZsOLwWKzsNwgpohgQa/Vk 144Q== 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=7K4is6sTot0/1etjIcFQMjvHkYMZNanIhfzmbHHbql4=; b=otLwnYpGUZH86c3ARhPscQiTgOrK37L7I8l6/cLChVHyrTXSAbGPlOMAWTsrV+mVNc k/qGuzIS/KxyiTQvi+z0zaNFipP69PFx/Cs3b7TG/s4S49/nQjkPjbGV7FIp5icAR2gx kBdQAm15nlK5kgJm3qNEuh1IHD8SmwRiOPZCe8zXelesIDl8s7phoI7dypD2PlXq2KCY j5n6+wAMC4s2ZMZVce5KrbrSqVMuQRjH+RbKDTEvYViyjvoemDE0NYezGlA9X6jpFmBZ 8TkwcgrYOU4Bq15e0eM6GzEvaL3zg3BdvU8TFGLALtI6cwXb1Gvei2gPgTDjcDVQ9Ejp hiBw== X-Gm-Message-State: APjAAAU93edKqR1dpk8NgDY8cj2YWnrexOd1EI+99eK8ePfLmk5ev6Qt BSRfd1yGjoyTF9GPQ2+nFCsvcg== X-Received: by 2002:a19:2486:: with SMTP id k128mr41965914lfk.16.1577814654852; Tue, 31 Dec 2019 09:50:54 -0800 (PST) Received: from localhost.localdomain (c-5ac9225c.014-348-6c756e10.bbcust.telenor.se. [92.34.201.90]) by smtp.gmail.com with ESMTPSA id v7sm20474663lfa.10.2019.12.31.09.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Dec 2019 09:50:54 -0800 (PST) From: Linus Walleij To: Greg Kroah-Hartman , Felipe Balbi Cc: linux-usb@vger.kernel.org, Linus Walleij , Philipp Zabel , Sylwester Nawrocki , Robert Jarzmik , Daniel Mack , Haojian Zhuang Subject: [PATCH] usb: phy: phy-gpio-vbus-usb: Convert to GPIO descriptors Date: Tue, 31 Dec 2019 18:48:48 +0100 Message-Id: <20191231174848.741314-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: Philipp Zabel Cc: Sylwester Nawrocki Cc: Robert Jarzmik Cc: Daniel Mack Cc: Haojian Zhuang Signed-off-by: Linus Walleij --- This change hits arch/arm/mach-pxa/* and arch/arm/mach-s3c64* so I have CC to the most active maintainers. --- 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 | 95 +++++++++++++---------------- include/linux/usb/gpio_vbus.h | 33 ---------- 17 files changed, 188 insertions(+), 192 deletions(-) delete mode 100644 include/linux/usb/gpio_vbus.h -- 2.23.0 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