From patchwork Fri May 11 10:19:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Izard X-Patchwork-Id: 10393861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CEA5D60153 for ; Fri, 11 May 2018 10:21:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 99E6D28AD4 for ; Fri, 11 May 2018 10:21:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E42928DE7; Fri, 11 May 2018 10:21:05 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 07C2F28AD4 for ; Fri, 11 May 2018 10:21:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752895AbeEKKUg (ORCPT ); Fri, 11 May 2018 06:20:36 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:38059 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752841AbeEKKUd (ORCPT ); Fri, 11 May 2018 06:20:33 -0400 Received: by mail-wr0-f194.google.com with SMTP id 94-v6so4805939wrf.5; Fri, 11 May 2018 03:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7nfgAVNNILpuUn1alEX5GKsSO18owNakLEZbGj0RYT0=; b=sjZebSZd2tm27ErdIIRPJhb0K8Wh5HubiPeXyax/zcXcx7O3thPKaTK/Zi1W0t1m7F Sky9PW5yCgcvV8koZxXAYWZQKcoDkmlDPQHDCFl+tKYhhObw9tV0ET1Y6+bBVYPYfsHn 4obIBXiFGjqTcafUB40P9nJpMMY068CPirJSeF8VjNiEHMWsyFGeFZGAOtW3vYod4+SR sjQ9mL/KBSJDnT5FB3qeXZCUy1ZC0TC7suR/jeJa7Kjorirwg31VuMeiE2GFZtLu4Zn2 UoyuUyIdeflXin+6IysjdtAppRtf8Vu7wUJPDy7YXa/MQDGTVFHkD3BTc+QUtnHWerP5 QmGQ== 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; bh=7nfgAVNNILpuUn1alEX5GKsSO18owNakLEZbGj0RYT0=; b=H/f0894TFnvx9qSuMk+dziHN7kGU1Tcps9/kfkQRL3pNpqWFW9hfZHAgyGRG7rUVg6 fZLicij6VaQi3Vxo3VnPMqkRRM6UE1Z/A33J7Nw1gF2oy1ljok6oKlu+jpITjFPbAX5e zom411aEbJp4dJJJH6V8HF+PTYfL1wjptAmCFY/zgQFmX5G/SRX1V+z0wOT+2UBVd9IL UwGcErToB+Vxp8qMY+q4SPpXzo1El5vd7uQ9nG++wfIDMjuCteRY+2W/OMnZxUbMLd1+ cJd/j6Ld0NBaZDdG9dJ8dUrpk+uqWXxywisrouBe5UUoPnlN6YdKNkk0zL5YOI8bjNoo mUKQ== X-Gm-Message-State: ALKqPwcjlf9e9LvpSElWvPspB7wNspwlSOCwGzXXkY2NcPEu3EWyoZCz QQTDqTyZv8zCofFMaYDCiGQ= X-Google-Smtp-Source: AB8JxZpYftRL+rpxKmfI+FRdiOt1dx0E9fTGTrHpH5nL9NroL/WjhOtkBx97UvUpmTajBsJeI9B0sQ== X-Received: by 2002:adf:ae59:: with SMTP id u25-v6mr4008138wrd.157.1526034032059; Fri, 11 May 2018 03:20:32 -0700 (PDT) Received: from localhost.localdomain (ram94-11-88-187-113-157.fbx.proxad.net. [88.187.113.157]) by smtp.gmail.com with ESMTPSA id 33-v6sm3036418wrs.5.2018.05.11.03.20.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 03:20:31 -0700 (PDT) From: Romain Izard To: Nicolas Ferre , Felipe Balbi , Greg Kroah-Hartman , Alexandre Belloni , Ludovic Desroches Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, Romain Izard Subject: [PATCH v2 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod Date: Fri, 11 May 2018 12:19:54 +0200 Message-Id: <20180511101956.11782-2-romain.izard.pro@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180511101956.11782-1-romain.izard.pro@gmail.com> References: <20180511101956.11782-1-romain.izard.pro@gmail.com> 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 When converting to GPIO descriptors, gpiod_get_value automatically handles the line inversion flags from the device tree. Do not invert the line twice. Fixes: 3df034081021 ("usb: gadget: udc: atmel: convert to use GPIO descriptors") Acked-by: Ludovic Desroches Acked-by: Nicolas Ferre Signed-off-by: Romain Izard --- drivers/usb/gadget/udc/atmel_usba_udc.c | 3 +-- drivers/usb/gadget/udc/atmel_usba_udc.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 27c16399c7e8..0fe3d0feb8f7 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -417,7 +417,7 @@ static inline void usba_int_enb_set(struct usba_udc *udc, u32 val) static int vbus_is_present(struct usba_udc *udc) { if (udc->vbus_pin) - return gpiod_get_value(udc->vbus_pin) ^ udc->vbus_pin_inverted; + return gpiod_get_value(udc->vbus_pin); /* No Vbus detection: Assume always present */ return 1; @@ -2076,7 +2076,6 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, udc->vbus_pin = devm_gpiod_get_optional(&pdev->dev, "atmel,vbus", GPIOD_IN); - udc->vbus_pin_inverted = gpiod_is_active_low(udc->vbus_pin); if (fifo_mode == 0) { pp = NULL; diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h index 969ce8f3c3e2..d7eb7cf4fd5c 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.h +++ b/drivers/usb/gadget/udc/atmel_usba_udc.h @@ -326,7 +326,6 @@ struct usba_udc { const struct usba_udc_errata *errata; int irq; struct gpio_desc *vbus_pin; - int vbus_pin_inverted; int num_ep; int configured_ep; struct usba_fifo_cfg *fifo_cfg;