From: Romain Izard <romain.izard.pro@gmail.com>
To: Nicolas Ferre <nicolas.ferre@microchip.com>,
Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org,
Romain Izard <romain.izard.pro@gmail.com>
Subject: [1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
Date: Mon, 16 Apr 2018 11:34:03 +0200 [thread overview]
Message-ID: <20180416093405.16612-2-romain.izard.pro@gmail.com> (raw)
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 <romain.izard.pro@gmail.com>
---
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;
WARNING: multiple messages have this Message-ID (diff)
From: romain.izard.pro@gmail.com (Romain Izard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
Date: Mon, 16 Apr 2018 11:34:03 +0200 [thread overview]
Message-ID: <20180416093405.16612-2-romain.izard.pro@gmail.com> (raw)
In-Reply-To: <20180416093405.16612-1-romain.izard.pro@gmail.com>
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 <romain.izard.pro@gmail.com>
---
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
WARNING: multiple messages have this Message-ID (diff)
From: Romain Izard <romain.izard.pro@gmail.com>
To: Nicolas Ferre <nicolas.ferre@microchip.com>,
Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org,
Romain Izard <romain.izard.pro@gmail.com>
Subject: [PATCH 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
Date: Mon, 16 Apr 2018 11:34:03 +0200 [thread overview]
Message-ID: <20180416093405.16612-2-romain.izard.pro@gmail.com> (raw)
In-Reply-To: <20180416093405.16612-1-romain.izard.pro@gmail.com>
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 <romain.izard.pro@gmail.com>
---
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
next reply other threads:[~2018-04-16 9:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 9:34 Romain Izard [this message]
2018-04-16 9:34 ` [PATCH 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod Romain Izard
2018-04-16 9:34 ` Romain Izard
-- strict thread matches above, loose matches on Subject: below --
2018-04-25 9:53 [1/3] " Felipe Balbi
2018-04-25 9:53 ` [PATCH 1/3] " Felipe Balbi
2018-04-25 9:53 ` Felipe Balbi
2018-04-16 11:44 [3/3] usb: gadget: udc: atmel: Fix indenting Ludovic Desroches
2018-04-16 11:44 ` [PATCH 3/3] " Ludovic Desroches
2018-04-16 11:44 ` Ludovic Desroches
2018-04-16 11:44 [2/3] usb: gadget: udc: atmel: Remove obsolete include Ludovic Desroches
2018-04-16 11:44 ` [PATCH 2/3] " Ludovic Desroches
2018-04-16 11:44 ` Ludovic Desroches
2018-04-16 11:42 [1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod Ludovic Desroches
2018-04-16 11:42 ` [PATCH 1/3] " Ludovic Desroches
2018-04-16 11:42 ` Ludovic Desroches
2018-04-16 9:34 [3/3] usb: gadget: udc: atmel: Fix indenting Romain Izard
2018-04-16 9:34 ` [PATCH 3/3] " Romain Izard
2018-04-16 9:34 ` Romain Izard
2018-04-16 9:34 [2/3] usb: gadget: udc: atmel: Remove obsolete include Romain Izard
2018-04-16 9:34 ` [PATCH 2/3] " Romain Izard
2018-04-16 9:34 ` Romain Izard
2018-04-16 9:34 [PATCH 0/3] Fix an Atmel USBA UDC issue introducted in 4.17-rc1 Romain Izard
2018-04-16 9:34 ` Romain Izard
2018-04-17 8:24 ` Nicolas Ferre
2018-04-17 8:24 ` Nicolas Ferre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180416093405.16612-2-romain.izard.pro@gmail.com \
--to=romain.izard.pro@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
--cc=nicolas.ferre@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.