From patchwork Fri Apr 12 12:36:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10898149 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10967922 for ; Fri, 12 Apr 2019 12:37:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E308D28D12 for ; Fri, 12 Apr 2019 12:37:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D753D28D1B; Fri, 12 Apr 2019 12:37:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66CB528D12 for ; Fri, 12 Apr 2019 12:37:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728638AbfDLMg6 (ORCPT ); Fri, 12 Apr 2019 08:36:58 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:46934 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728565AbfDLMgw (ORCPT ); Fri, 12 Apr 2019 08:36:52 -0400 Received: by mail-wr1-f65.google.com with SMTP id t17so11691351wrw.13 for ; Fri, 12 Apr 2019 05:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h/Q4Spim9Fjjy6MSB+oYYlQqYCUhED1m+pmPurYYc2Y=; b=YG7aeotx3icHw05FTScZXtz6eI0WzRmPR9r6FmonoBSpKAOTJdRkCgx5hYrJ4ueMTy 5jFE2sXMf9uyzDRvuLEzYgDWkJ4kXk6M3eIPBacFPpfE3nrH+0PjH6fRHsxA6p8iUpq2 NsEBllK/RvsUb0h2tR79J0X3h5918f7qm3OUWmjN1jfK7aWhJD3CX9+u4OJogs44XfU9 gLQ5pXtlIVpuVend1DdiQ9as/umwvNamToRP/2cAPtLCpat2QWYQqAwSw4ZzvjazMVo9 XHELA+ILZQuO3XfWbLq1KSP/ag+jz9r+AXXwUKElxgOCphUpxpA3hs4B+GyVwUcAE8z4 76cg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=h/Q4Spim9Fjjy6MSB+oYYlQqYCUhED1m+pmPurYYc2Y=; b=FdNetkJ0equYcBrpofaTvYwj7f41sb9C755CYZxmIugbhWtuPxUXUXio+QO30JpION k/lxKgxPpRU78jNKYLsIw7I87ZxOynVrzfX9/KKn5sdwfXqZYMv1R+SK9wMD8KCehKAa ttuBG/tVqTkwJDLj5VtH6Rd9YojdOiJ6VaxhLwiFcVQPxxBkLqEKT+ieqvkyUijVPo+X UpWK1hXyBfdyIx76mBPvtt/D0pjlBY52C4Y8Pyx4DrOW1hIRKgYjDRtQdHLgMfQGuIlz 2xzjdpGjHq/AeAF5KLbTa1+p4IuseysgjVwtvsH/SV7ftLHq2cepZ9RrSb889i2JnPBb IvYA== X-Gm-Message-State: APjAAAVzjOYNf2/wOdrzV0bDB2D3+HOhgNgqEAXrA7vZgwUKuK4qTikP IhI12sPrcigcRepaqfvjXdbGwg== X-Google-Smtp-Source: APXvYqxUp4JTFAHxNl36SNcbXMkjwbVgonN366UairP79cquPxow05ayhQbaEoIG/Mmfw/Uo1FkIAA== X-Received: by 2002:adf:f1ce:: with SMTP id z14mr35525249wro.152.1555072610418; Fri, 12 Apr 2019 05:36:50 -0700 (PDT) Received: from localhost.localdomain (aputeaux-684-1-35-248.w90-86.abo.wanadoo.fr. [90.86.90.248]) by smtp.gmail.com with ESMTPSA id v190sm12384030wme.18.2019.04.12.05.36.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 05:36:49 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Alan Stern , Greg Kroah-Hartman Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v5 6/6] usb: ohci-da8xx: drop the vbus GPIO Date: Fri, 12 Apr 2019 14:36:40 +0200 Message-Id: <20190412123640.11437-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190412123640.11437-1-brgl@bgdev.pl> References: <20190412123640.11437-1-brgl@bgdev.pl> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski All users now setup a fixed regulator for the vbus supply. We can drop the vbus GPIO code. Signed-off-by: Bartosz Golaszewski Acked-by: Alan Stern --- drivers/usb/host/ohci-da8xx.c | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index f69b339d45e5..38183ac438c6 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c @@ -40,7 +40,6 @@ struct da8xx_ohci_hcd { struct phy *usb11_phy; struct regulator *vbus_reg; struct notifier_block nb; - struct gpio_desc *vbus_gpio; struct gpio_desc *oc_gpio; }; @@ -91,11 +90,6 @@ static int ohci_da8xx_set_power(struct usb_hcd *hcd, int on) struct device *dev = hcd->self.controller; int ret; - if (da8xx_ohci->vbus_gpio) { - gpiod_set_value_cansleep(da8xx_ohci->vbus_gpio, on); - return 0; - } - if (!da8xx_ohci->vbus_reg) return 0; @@ -120,9 +114,6 @@ static int ohci_da8xx_get_power(struct usb_hcd *hcd) { struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); - if (da8xx_ohci->vbus_gpio) - return gpiod_get_value_cansleep(da8xx_ohci->vbus_gpio); - if (da8xx_ohci->vbus_reg) return regulator_is_enabled(da8xx_ohci->vbus_reg); @@ -155,9 +146,6 @@ static int ohci_da8xx_has_set_power(struct usb_hcd *hcd) { struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); - if (da8xx_ohci->vbus_gpio) - return 1; - if (da8xx_ohci->vbus_reg) return 1; @@ -208,16 +196,11 @@ static irqreturn_t ohci_da8xx_oc_thread(int irq, void *data) struct device *dev = da8xx_ohci->hcd->self.controller; int ret; - if (gpiod_get_value_cansleep(da8xx_ohci->oc_gpio)) { - if (da8xx_ohci->vbus_gpio) { - gpiod_set_value_cansleep(da8xx_ohci->vbus_gpio, 0); - } else if (da8xx_ohci->vbus_reg) { - ret = regulator_disable(da8xx_ohci->vbus_reg); - if (ret) - dev_err(dev, - "Failed to disable regulator: %d\n", - ret); - } + if (gpiod_get_value_cansleep(da8xx_ohci->oc_gpio) && + da8xx_ohci->vbus_reg) { + ret = regulator_disable(da8xx_ohci->vbus_reg); + if (ret) + dev_err(dev, "Failed to disable regulator: %d\n", ret); } return IRQ_HANDLED; @@ -431,11 +414,6 @@ static int ohci_da8xx_probe(struct platform_device *pdev) } } - da8xx_ohci->vbus_gpio = devm_gpiod_get_optional(dev, "vbus", - GPIOD_OUT_HIGH); - if (IS_ERR(da8xx_ohci->vbus_gpio)) - goto err; - da8xx_ohci->oc_gpio = devm_gpiod_get_optional(dev, "oc", GPIOD_IN); if (IS_ERR(da8xx_ohci->oc_gpio)) goto err;