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: 10393867 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 D520060153 for ; Fri, 11 May 2018 10:21:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A100928AD4 for ; Fri, 11 May 2018 10:21:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 949EB28DE7; Fri, 11 May 2018 10:21:53 +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=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1350E28AD4 for ; Fri, 11 May 2018 10:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MEKEzuNod4khCgbNVbmoAeXnPdFX2vXSwsGNUYGK9kM=; b=VoE82Y/I4fwZPJ4pnHOQNNCPu8 6QNTOaOTC2ZR1OHRbjkJdyLlUok+22tr5Hq3o/ckoMOiHo0sIP2AS8VC11Zp1VJpOEG2C99S4ZJ3J nmLyynHGn8uIk2gsKfnb4HUEmGcbP+jGY96bXSL9rwGTRYmtVyZmJXIOXi4P15PSiyi2FtCW9lBrz Q7MveC7KzgYyqEmNM9HqO/1trCdct4+/iO0rDOsuDZCTyeEx3NtZM0YITdGpzHdPNo8cHjO2knpEw Ffv51eXjOHBKYZEwYQQlwhfMFXodWNjvjvrm5XOcB7XCEYyxIw0DmuQbTvMpp7szJYlWCM/Fmkxjc vJEx3qJg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fH5BG-0004IU-IZ; Fri, 11 May 2018 10:21:42 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fH5AK-0003oD-LC for linux-arm-kernel@lists.infradead.org; Fri, 11 May 2018 10:20:46 +0000 Received: by mail-wr0-x242.google.com with SMTP id q3-v6so4813377wrj.6 for ; Fri, 11 May 2018 03:20:33 -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=RXb8LGzT8zJC320hTGjzCiiKGI2pEd3T0ZnuMT3SD55NRLLNmznq0hq8v00y0h/2IH 1g4K+DlbicCwgfQEgraUlfJs9vBPbfnzrZ+dnPHIfVRBJH/iNw9EhbZiD9FDYsFbk/Ke H/EbzjeMXdB0xz3Letuzu0cGBanfOAdLnUvG3/sdDOMWAeE+j7VXHD/eE64I7sFoYXTZ vVm6rXy6IzEsULwVqut/AZsHFiUY+3VfBOUGz72QFygiapd0vs/vrgP0DsvmU4XeJagt umx4lQwbrPfiTxSZmmxesGeWmhHk4IJRm2ddPIaSTGK8iB4AL4ZMWpVzjKKGU8twhsEL y89A== X-Gm-Message-State: ALKqPwfGrKv2wHGyAaOUd02WAosgH6mv9cZSh0+7GH8Q6Y5u38s5fJ41 xrRkUHrtZL+Zvnbti7jPmio= 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180511_032044_745151_3B0591D7 X-CRM114-Status: GOOD ( 15.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Izard , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;