Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp588941imm; Fri, 11 May 2018 03:21:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr93+tr2B5z1qAyNTFQaiuLMILYs0MRsXGzDg5Nk7V3Flg3ovbJIpL6CCHhFHd8XEo7tQHa X-Received: by 2002:a17:902:6505:: with SMTP id b5-v6mr4916458plk.147.1526034089571; Fri, 11 May 2018 03:21:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526034089; cv=none; d=google.com; s=arc-20160816; b=NQMnEbVjb2pAc+MkNBqD0EcXLSpn2wjAUruhxlgrpSxYkHi4Ea1YjKvhovwzygrvDV Khmu+brqiMnK1LQpgSJT5NJk4hgc+wIF4AqqPiAuuJ9MXze6+axvBmmVZtgP3rKJiJlT RYJsFEnhzSaCuWTbLdZi8u7vKUfJbhpOyDV0QkDz1ChNcROnWzuZAMLlIFp8mSzo/8az aBIyUzNPu6PuKgSmrD9SQv28dfnz8B5Cs3+JUQNsPbQYqo+deFlnfM7mSG8jjEk2XfBM nvjlBrByLr1kKrt5vZZgXuGrK5w3016Vlkwk2jJKdDtTkeoJD/D2ieWO9cf9akHoSTSp ygvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=7nfgAVNNILpuUn1alEX5GKsSO18owNakLEZbGj0RYT0=; b=iiS9rckCxPIOu8sObNkR080IeUx1myKeUbf7r6lhFg2/ylXlY0YhvJ/FJmPnThZcBk bc/6EcAWhXmCY45lm/hLSGr6B12LqMtvSa73grDOq/AstarqW+xg8X0hVXaaTiXyGcIb 1nVxWVLowDIi3+XYRgni1DZHhY1Pe6Vh30PRCx9VXIkqkS4Cg+dFCgx3aTSPdqxSyIWQ OuaXcLjORRNUMX14K5+idrFhNEJ9enKgcFo9aT1zQUGMDL198mnwBtM/HAU0Fvg4aXIn 0wTA7m/uD8QnPftxvCVuy4cnZ8mBOya/VqhsFSkVzCxXfCiKGjykvMih2YzhzG+itPDW rJLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sjZebSZd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si2906327pli.269.2018.05.11.03.21.15; Fri, 11 May 2018 03:21:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@gmail.com header.s=20161025 header.b=sjZebSZd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752915AbeEKKUg (ORCPT + 99 others); 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-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.14.1