From patchwork Mon Apr 16 09:34:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Izard X-Patchwork-Id: 10342457 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 23358601C2 for ; Mon, 16 Apr 2018 09:35:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 127FE285B5 for ; Mon, 16 Apr 2018 09:35:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0752E285E0; Mon, 16 Apr 2018 09:35:46 +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 68BC5285B5 for ; Mon, 16 Apr 2018 09:35:45 +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=B4h7zChhSTsMOqG0cdtaN/l6WW9bEX2+yVvpiPVhexw=; b=rAl13CSkRTFimaxDl93pLlvMlm hfp77n/CPRDCUEq9Ng5M2dGkZpF7uNb12d6DOG0+jEI6bYPET+OzKZ+nqv7mfAr2PvECrVjBlgsun 6d7Ws5/IAZri8kWTC2AWPK1JSbbREoqRdQQFlS8enNS0xGnnhT+ePuUR/rj4P9p0F+3V9QP3fNo0z 47jHOf2I9L83FwOg6nGYst6y3NBqGTy7VuN7cbnBC4CcF2n87E3HHFd75ziTK/UpnP7uPJu5qNIkk 8qpiXMsNwqhXYlHG1Nmc+vcNLO2U7blRO7qSYEEe95jdfA+WwjnmDPMa12RwtgZDsmug6TNE4CjDG JL9jhk/w==; 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 1f80Xv-0002xP-Sf; Mon, 16 Apr 2018 09:35:35 +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 1f80XZ-0001OA-RR for linux-arm-kernel@lists.infradead.org; Mon, 16 Apr 2018 09:35:15 +0000 Received: by mail-wr0-x242.google.com with SMTP id w3so7371101wrg.2 for ; Mon, 16 Apr 2018 02:35:03 -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=/KP/UP0LBtw7LQ6E68oujILqD59RGiaI4HY1zpETehw=; b=uRS9qd0rQTm9MlFCWbKRQXB6B3VFj0QpR6O//72Uhm8QhviUnpM7S1eUgaKsbGRRGf +wPSZ5DBpFiHXo/XbB3/6OvpDKqsy5Z4JoRoMH9Qe1mRt7f/3NM1rdXoqVU7d6zTZh+8 sxsCxiW0HTLPrLqyXNZQO7z1bmfTZWldRI6aYfqjZ59Wn1zkYJ2l6PBH0AHn+l5oLDyz HdeHNXMFEEA1a7NG5rrlVQsTop9dOSYU649WRYvinGXvPGXqVQx1gJrVKUS0DTD7IzQo nGEDGZBVpdBM+CcWJIwrXPwOy08p2b4kBPppt4oJA/MZyvVCKIUWyI7EZ2fCNX/SCJ3H 1E1A== 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=/KP/UP0LBtw7LQ6E68oujILqD59RGiaI4HY1zpETehw=; b=BdWVhK+IsLxSYcFvR1alQb10pHS7ctukppiL0cnFqOsd4qlPejYZf6K81yw5E9RMne ZgTTRsjQXcP4BGE4EMYi7XU44pq2Fw+WAyaoqPa4PDLBYXOAi+6/3BePLvRYZy27XBXc BLtn7W3TQJnrB+IoyJCav18KPGHcr5cQLYMXcYjNTNuGHJtqdqawTDvzq9nO8HGtycZG 1d1TU95LCJ3gO0HHb4jtvlgLfJK8o67J526kIVluuqO5OqGor5oXRIzGaflOmWUgcpV3 rss86GM2VWkEexzEmDjbX/7sAywiECagYrJbyZvWlWVtKvrglv5LCNW/7gzZ6o2gmAuz A1kA== X-Gm-Message-State: ALQs6tAg3giSTzb4WZusal9tNsBOb5Tns3iE5Jr9yERMa/FCiD2+DnFt BMnj5i+tePoao7BW/kE6LdQ= X-Google-Smtp-Source: AIpwx4/gkdZkJvoRn+zqTRS0v4dpKL5xIb8rYaDRu/tdjjckGmf0gQCiVO2TKI6Tp0vSMl31RzK8Jw== X-Received: by 10.28.16.85 with SMTP id 82mr9173429wmq.4.1523871301899; Mon, 16 Apr 2018 02:35:01 -0700 (PDT) Received: from localhost.localdomain (146.187.3.109.rev.sfr.net. [109.3.187.146]) by smtp.gmail.com with ESMTPSA id t6sm2705335wre.32.2018.04.16.02.34.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 02:35:01 -0700 (PDT) From: Romain Izard To: Nicolas Ferre , Felipe Balbi , Greg Kroah-Hartman , Alexandre Belloni , Ludovic Desroches Subject: [PATCH 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod Date: Mon, 16 Apr 2018 11:34:03 +0200 Message-Id: <20180416093405.16612-2-romain.izard.pro@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180416093405.16612-1-romain.izard.pro@gmail.com> References: <20180416093405.16612-1-romain.izard.pro@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180416_023514_068738_04200445 X-CRM114-Status: GOOD ( 15.32 ) 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: 3df034081021fa4b6967ce3364bc7d867ec1c870 Signed-off-by: Romain Izard Acked-by: Ludovic Desroches --- 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;