Received: by 10.192.165.156 with SMTP id m28csp711171imm; Mon, 16 Apr 2018 07:32:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+ESOg6f9iFF8FxQL43g2PQcmfqayv7bwl2GkPssJGuSI7QwGowkCL+AdiA8P4p6/KK/wvp X-Received: by 2002:a17:902:2941:: with SMTP id g59-v6mr7907523plb.89.1523889124560; Mon, 16 Apr 2018 07:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523889124; cv=none; d=google.com; s=arc-20160816; b=b6lp31WGtK+cvDhsQJpKlklFiA4xPrucGYLNQE2HTnX6guQYQIxlHHrKWQAX2KDKOZ 6Rv5AAOb7gWOW1ZCDFTSGER9TfV5xC6GBfuXdwzlVAPbiHsmaCgoG3ojTZ2qjED8ufII Zv/XC8LpN17FloxSXG7HZPK3lb5pCqEMtSkqox5ZtZNnRIzKQfpabJ8BQ8sUPvO72gRW opOgq5F71om2PSrx9nIvV7YiQls3gP2iMHMGBWNsP5TRvlK7S+ra5dRnqKgQM3+EpEyG FcfThjQqgcolO0Kp/KXsfcTONSIzs+xoSibYFMJU02mvOjX1RA6Lkd6Glf6gfunZZdlS Qw4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=IP12nSApUmGOMxJU6HZtZiW05IjR53jTsJuUiuHC2hE=; b=Vtk43NroSxxYKwkJTs4zShXlv7GCV0Fcjt7bYL5WkYLW59subzY9vF3DcTHJCJqj7S J1pc4X3tbgeBVlrUUeGG0fgT3JvUp22b5LzBiDwBqvqECe8gAu6gc7k3yW2bSbnWiiCB o+MuYI1c6xWFs1pmNRNGK8zbbzobEcbJSNdaklQIjIVpsrBIPaWySzzTOZ+63y686B91 LNm4/ts6ZkPpEBTk4LDQfUQagA13S744CHfv7E7VFDL55tUI6BfI+rvBa+ZUUlcUrQiR VExUuq0s6bSc0v4iI84YUVexfI1DrZXr/l2tD1upNkRX9edFbZOWFc6Y0aAy0KXQ0gy9 KK8w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11si8532254pgf.490.2018.04.16.07.31.49; Mon, 16 Apr 2018 07:32:04 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755065AbeDPLnf (ORCPT + 99 others); Mon, 16 Apr 2018 07:43:35 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:37429 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751199AbeDPLne (ORCPT ); Mon, 16 Apr 2018 07:43:34 -0400 X-IronPort-AV: E=Sophos;i="5.48,459,1517900400"; d="scan'208";a="12954567" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Apr 2018 04:43:33 -0700 Received: from localhost (10.10.76.4) by chn-sv-exch05.mchp-main.com (10.10.76.106) with Microsoft SMTP Server id 14.3.352.0; Mon, 16 Apr 2018 04:43:32 -0700 Date: Mon, 16 Apr 2018 13:42:56 +0200 From: Ludovic Desroches To: Romain Izard CC: Nicolas Ferre , Felipe Balbi , Greg Kroah-Hartman , Alexandre Belloni , Ludovic Desroches , , , Subject: Re: [PATCH 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod Message-ID: <20180416114256.GC2750@rfolt0960.corp.atmel.com> Mail-Followup-To: Romain Izard , Nicolas Ferre , Felipe Balbi , Greg Kroah-Hartman , Alexandre Belloni , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org References: <20180416093405.16612-1-romain.izard.pro@gmail.com> <20180416093405.16612-2-romain.izard.pro@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180416093405.16612-2-romain.izard.pro@gmail.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 16, 2018 at 11:34:03AM +0200, Romain Izard wrote: > When converting to GPIO descriptors, gpiod_get_value automatically > handles the line inversion flags from the device tree. Thanks, I totally missed it. Regards > > 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; > -- > 2.14.1 >