All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix an Atmel USBA UDC issue introducted in 4.17-rc1
@ 2018-04-16  9:34 ` Romain Izard
  0 siblings, 0 replies; 25+ messages in thread
From: Romain Izard @ 2018-04-16  9:34 UTC (permalink / raw)
  To: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches
  Cc: linux-kernel, linux-arm-kernel, linux-usb, Romain Izard

The use of GPIO descriptors takes care of inversion flags declared in
the device tree. The conversion of the Atmel USBA UDC driver introduced
in 4.17-rc1 missed it, and as a result the inversion will not work.

In addition, cleanup the code to remove an include left behind after
the suppression of the support of platform_data to declare USBA
controllers.

These changes have not been tested on any hardware, as I do not have
a board that needs to use inverted GPIOs.

Romain Izard (3):
  usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
  usb: gadget: udc: atmel: Remove obsolete include
  usb: gadget: udc: atmel: Fix indenting

 drivers/usb/gadget/udc/atmel_usba_udc.c | 22 ++++++++++------------
 drivers/usb/gadget/udc/atmel_usba_udc.h |  1 -
 include/linux/usb/atmel_usba_udc.h      | 24 ------------------------
 3 files changed, 10 insertions(+), 37 deletions(-)
 delete mode 100644 include/linux/usb/atmel_usba_udc.h

-- 
2.14.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 0/3] Fix an Atmel USBA UDC issue introducted in 4.17-rc1
@ 2018-04-16  9:34 ` Romain Izard
  0 siblings, 0 replies; 25+ messages in thread
From: Romain Izard @ 2018-04-16  9:34 UTC (permalink / raw)
  To: linux-arm-kernel

The use of GPIO descriptors takes care of inversion flags declared in
the device tree. The conversion of the Atmel USBA UDC driver introduced
in 4.17-rc1 missed it, and as a result the inversion will not work.

In addition, cleanup the code to remove an include left behind after
the suppression of the support of platform_data to declare USBA
controllers.

These changes have not been tested on any hardware, as I do not have
a board that needs to use inverted GPIOs.

Romain Izard (3):
  usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
  usb: gadget: udc: atmel: Remove obsolete include
  usb: gadget: udc: atmel: Fix indenting

 drivers/usb/gadget/udc/atmel_usba_udc.c | 22 ++++++++++------------
 drivers/usb/gadget/udc/atmel_usba_udc.h |  1 -
 include/linux/usb/atmel_usba_udc.h      | 24 ------------------------
 3 files changed, 10 insertions(+), 37 deletions(-)
 delete mode 100644 include/linux/usb/atmel_usba_udc.h

-- 
2.14.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
@ 2018-04-16  9:34   ` Romain Izard
  0 siblings, 0 replies; 25+ messages in thread
From: Romain Izard @ 2018-04-16  9:34 UTC (permalink / raw)
  To: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches
  Cc: linux-kernel, linux-arm-kernel, linux-usb, Romain Izard

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


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
@ 2018-04-16  9:34   ` Romain Izard
  0 siblings, 0 replies; 25+ messages in thread
From: Romain Izard @ 2018-04-16  9:34 UTC (permalink / raw)
  To: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches
  Cc: linux-kernel, linux-arm-kernel, linux-usb, Romain Izard

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;

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
@ 2018-04-16  9:34   ` Romain Izard
  0 siblings, 0 replies; 25+ messages in thread
From: Romain Izard @ 2018-04-16  9:34 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 2/3] usb: gadget: udc: atmel: Remove obsolete include
@ 2018-04-16  9:34   ` Romain Izard
  0 siblings, 0 replies; 25+ messages in thread
From: Romain Izard @ 2018-04-16  9:34 UTC (permalink / raw)
  To: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches
  Cc: linux-kernel, linux-arm-kernel, linux-usb, Romain Izard

The include defines the private platform_data structure used with AVR
platforms. It has no user since 7c55984e191f. Remove it.

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
---
 drivers/usb/gadget/udc/atmel_usba_udc.c |  1 -
 include/linux/usb/atmel_usba_udc.h      | 24 ------------------------
 2 files changed, 25 deletions(-)
 delete mode 100644 include/linux/usb/atmel_usba_udc.h

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index 0fe3d0feb8f7..b9623e228609 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -20,7 +20,6 @@
 #include <linux/ctype.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
-#include <linux/usb/atmel_usba_udc.h>
 #include <linux/delay.h>
 #include <linux/of.h>
 #include <linux/irq.h>
diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h
deleted file mode 100644
index 9bb00df3b53f..000000000000
--- a/include/linux/usb/atmel_usba_udc.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Platform data definitions for Atmel USBA gadget driver.
- */
-#ifndef __LINUX_USB_USBA_H
-#define __LINUX_USB_USBA_H
-
-struct usba_ep_data {
-	char	*name;
-	int	index;
-	int	fifo_size;
-	int	nr_banks;
-	int	can_dma;
-	int	can_isoc;
-};
-
-struct usba_platform_data {
-	int			vbus_pin;
-	int			vbus_pin_inverted;
-	int			num_ep;
-	struct usba_ep_data	ep[0];
-};
-
-#endif /* __LINUX_USB_USBA_H */
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [2/3] usb: gadget: udc: atmel: Remove obsolete include
@ 2018-04-16  9:34   ` Romain Izard
  0 siblings, 0 replies; 25+ messages in thread
From: Romain Izard @ 2018-04-16  9:34 UTC (permalink / raw)
  To: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches
  Cc: linux-kernel, linux-arm-kernel, linux-usb, Romain Izard

The include defines the private platform_data structure used with AVR
platforms. It has no user since 7c55984e191f. Remove it.

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
---
 drivers/usb/gadget/udc/atmel_usba_udc.c |  1 -
 include/linux/usb/atmel_usba_udc.h      | 24 ------------------------
 2 files changed, 25 deletions(-)
 delete mode 100644 include/linux/usb/atmel_usba_udc.h

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index 0fe3d0feb8f7..b9623e228609 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -20,7 +20,6 @@
 #include <linux/ctype.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
-#include <linux/usb/atmel_usba_udc.h>
 #include <linux/delay.h>
 #include <linux/of.h>
 #include <linux/irq.h>
diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h
deleted file mode 100644
index 9bb00df3b53f..000000000000
--- a/include/linux/usb/atmel_usba_udc.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Platform data definitions for Atmel USBA gadget driver.
- */
-#ifndef __LINUX_USB_USBA_H
-#define __LINUX_USB_USBA_H
-
-struct usba_ep_data {
-	char	*name;
-	int	index;
-	int	fifo_size;
-	int	nr_banks;
-	int	can_dma;
-	int	can_isoc;
-};
-
-struct usba_platform_data {
-	int			vbus_pin;
-	int			vbus_pin_inverted;
-	int			num_ep;
-	struct usba_ep_data	ep[0];
-};
-
-#endif /* __LINUX_USB_USBA_H */

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 2/3] usb: gadget: udc: atmel: Remove obsolete include
@ 2018-04-16  9:34   ` Romain Izard
  0 siblings, 0 replies; 25+ messages in thread
From: Romain Izard @ 2018-04-16  9:34 UTC (permalink / raw)
  To: linux-arm-kernel

The include defines the private platform_data structure used with AVR
platforms. It has no user since 7c55984e191f. Remove it.

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
---
 drivers/usb/gadget/udc/atmel_usba_udc.c |  1 -
 include/linux/usb/atmel_usba_udc.h      | 24 ------------------------
 2 files changed, 25 deletions(-)
 delete mode 100644 include/linux/usb/atmel_usba_udc.h

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index 0fe3d0feb8f7..b9623e228609 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -20,7 +20,6 @@
 #include <linux/ctype.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
-#include <linux/usb/atmel_usba_udc.h>
 #include <linux/delay.h>
 #include <linux/of.h>
 #include <linux/irq.h>
diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h
deleted file mode 100644
index 9bb00df3b53f..000000000000
--- a/include/linux/usb/atmel_usba_udc.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Platform data definitions for Atmel USBA gadget driver.
- */
-#ifndef __LINUX_USB_USBA_H
-#define __LINUX_USB_USBA_H
-
-struct usba_ep_data {
-	char	*name;
-	int	index;
-	int	fifo_size;
-	int	nr_banks;
-	int	can_dma;
-	int	can_isoc;
-};
-
-struct usba_platform_data {
-	int			vbus_pin;
-	int			vbus_pin_inverted;
-	int			num_ep;
-	struct usba_ep_data	ep[0];
-};
-
-#endif /* __LINUX_USB_USBA_H */
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 3/3] usb: gadget: udc: atmel: Fix indenting
@ 2018-04-16  9:34   ` Romain Izard
  0 siblings, 0 replies; 25+ messages in thread
From: Romain Izard @ 2018-04-16  9:34 UTC (permalink / raw)
  To: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches
  Cc: linux-kernel, linux-arm-kernel, linux-usb, Romain Izard

Fix the fallout of the conversion to GPIO descriptors in 3df034081021.

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
---
 drivers/usb/gadget/udc/atmel_usba_udc.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index b9623e228609..2f586f2bda7e 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -2277,15 +2277,15 @@ static int usba_udc_probe(struct platform_device *pdev)
 	if (udc->vbus_pin) {
 		irq_set_status_flags(gpiod_to_irq(udc->vbus_pin), IRQ_NOAUTOEN);
 		ret = devm_request_threaded_irq(&pdev->dev,
-					gpiod_to_irq(udc->vbus_pin), NULL,
-					usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
-					"atmel_usba_udc", udc);
-			if (ret) {
-				udc->vbus_pin = NULL;
-				dev_warn(&udc->pdev->dev,
-					 "failed to request vbus irq; "
-					 "assuming always on\n");
-			}
+				gpiod_to_irq(udc->vbus_pin), NULL,
+				usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
+				"atmel_usba_udc", udc);
+		if (ret) {
+			udc->vbus_pin = NULL;
+			dev_warn(&udc->pdev->dev,
+				 "failed to request vbus irq; "
+				 "assuming always on\n");
+		}
 	}
 
 	ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [3/3] usb: gadget: udc: atmel: Fix indenting
@ 2018-04-16  9:34   ` Romain Izard
  0 siblings, 0 replies; 25+ messages in thread
From: Romain Izard @ 2018-04-16  9:34 UTC (permalink / raw)
  To: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches
  Cc: linux-kernel, linux-arm-kernel, linux-usb, Romain Izard

Fix the fallout of the conversion to GPIO descriptors in 3df034081021.

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
---
 drivers/usb/gadget/udc/atmel_usba_udc.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index b9623e228609..2f586f2bda7e 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -2277,15 +2277,15 @@ static int usba_udc_probe(struct platform_device *pdev)
 	if (udc->vbus_pin) {
 		irq_set_status_flags(gpiod_to_irq(udc->vbus_pin), IRQ_NOAUTOEN);
 		ret = devm_request_threaded_irq(&pdev->dev,
-					gpiod_to_irq(udc->vbus_pin), NULL,
-					usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
-					"atmel_usba_udc", udc);
-			if (ret) {
-				udc->vbus_pin = NULL;
-				dev_warn(&udc->pdev->dev,
-					 "failed to request vbus irq; "
-					 "assuming always on\n");
-			}
+				gpiod_to_irq(udc->vbus_pin), NULL,
+				usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
+				"atmel_usba_udc", udc);
+		if (ret) {
+			udc->vbus_pin = NULL;
+			dev_warn(&udc->pdev->dev,
+				 "failed to request vbus irq; "
+				 "assuming always on\n");
+		}
 	}
 
 	ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget);

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 3/3] usb: gadget: udc: atmel: Fix indenting
@ 2018-04-16  9:34   ` Romain Izard
  0 siblings, 0 replies; 25+ messages in thread
From: Romain Izard @ 2018-04-16  9:34 UTC (permalink / raw)
  To: linux-arm-kernel

Fix the fallout of the conversion to GPIO descriptors in 3df034081021.

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
---
 drivers/usb/gadget/udc/atmel_usba_udc.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index b9623e228609..2f586f2bda7e 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -2277,15 +2277,15 @@ static int usba_udc_probe(struct platform_device *pdev)
 	if (udc->vbus_pin) {
 		irq_set_status_flags(gpiod_to_irq(udc->vbus_pin), IRQ_NOAUTOEN);
 		ret = devm_request_threaded_irq(&pdev->dev,
-					gpiod_to_irq(udc->vbus_pin), NULL,
-					usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
-					"atmel_usba_udc", udc);
-			if (ret) {
-				udc->vbus_pin = NULL;
-				dev_warn(&udc->pdev->dev,
-					 "failed to request vbus irq; "
-					 "assuming always on\n");
-			}
+				gpiod_to_irq(udc->vbus_pin), NULL,
+				usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
+				"atmel_usba_udc", udc);
+		if (ret) {
+			udc->vbus_pin = NULL;
+			dev_warn(&udc->pdev->dev,
+				 "failed to request vbus irq; "
+				 "assuming always on\n");
+		}
 	}
 
 	ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
@ 2018-04-16 11:42     ` Ludovic Desroches
  0 siblings, 0 replies; 25+ messages in thread
From: Ludovic Desroches @ 2018-04-16 11:42 UTC (permalink / raw)
  To: Romain Izard
  Cc: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches, linux-kernel,
	linux-arm-kernel, linux-usb

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 <romain.izard.pro@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.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
> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
@ 2018-04-16 11:42     ` Ludovic Desroches
  0 siblings, 0 replies; 25+ messages in thread
From: Ludovic Desroches @ 2018-04-16 11:42 UTC (permalink / raw)
  To: Romain Izard
  Cc: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches, linux-kernel,
	linux-arm-kernel, linux-usb

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 <romain.izard.pro@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.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
>
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
@ 2018-04-16 11:42     ` Ludovic Desroches
  0 siblings, 0 replies; 25+ messages in thread
From: Ludovic Desroches @ 2018-04-16 11:42 UTC (permalink / raw)
  To: linux-arm-kernel

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 <romain.izard.pro@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.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
> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 2/3] usb: gadget: udc: atmel: Remove obsolete include
@ 2018-04-16 11:44     ` Ludovic Desroches
  0 siblings, 0 replies; 25+ messages in thread
From: Ludovic Desroches @ 2018-04-16 11:44 UTC (permalink / raw)
  To: Romain Izard
  Cc: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches, linux-kernel,
	linux-arm-kernel, linux-usb

On Mon, Apr 16, 2018 at 11:34:04AM +0200, Romain Izard wrote:
> The include defines the private platform_data structure used with AVR
> platforms. It has no user since 7c55984e191f. Remove it.
> 
> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
> ---
>  drivers/usb/gadget/udc/atmel_usba_udc.c |  1 -
>  include/linux/usb/atmel_usba_udc.h      | 24 ------------------------
>  2 files changed, 25 deletions(-)
>  delete mode 100644 include/linux/usb/atmel_usba_udc.h
> 
> diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
> index 0fe3d0feb8f7..b9623e228609 100644
> --- a/drivers/usb/gadget/udc/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
> @@ -20,7 +20,6 @@
>  #include <linux/ctype.h>
>  #include <linux/usb/ch9.h>
>  #include <linux/usb/gadget.h>
> -#include <linux/usb/atmel_usba_udc.h>
>  #include <linux/delay.h>
>  #include <linux/of.h>
>  #include <linux/irq.h>
> diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h
> deleted file mode 100644
> index 9bb00df3b53f..000000000000
> --- a/include/linux/usb/atmel_usba_udc.h
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -/*
> - * Platform data definitions for Atmel USBA gadget driver.
> - */
> -#ifndef __LINUX_USB_USBA_H
> -#define __LINUX_USB_USBA_H
> -
> -struct usba_ep_data {
> -	char	*name;
> -	int	index;
> -	int	fifo_size;
> -	int	nr_banks;
> -	int	can_dma;
> -	int	can_isoc;
> -};
> -
> -struct usba_platform_data {
> -	int			vbus_pin;
> -	int			vbus_pin_inverted;
> -	int			num_ep;
> -	struct usba_ep_data	ep[0];
> -};
> -
> -#endif /* __LINUX_USB_USBA_H */
> -- 
> 2.14.1
> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [2/3] usb: gadget: udc: atmel: Remove obsolete include
@ 2018-04-16 11:44     ` Ludovic Desroches
  0 siblings, 0 replies; 25+ messages in thread
From: Ludovic Desroches @ 2018-04-16 11:44 UTC (permalink / raw)
  To: Romain Izard
  Cc: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches, linux-kernel,
	linux-arm-kernel, linux-usb

On Mon, Apr 16, 2018 at 11:34:04AM +0200, Romain Izard wrote:
> The include defines the private platform_data structure used with AVR
> platforms. It has no user since 7c55984e191f. Remove it.
> 
> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
> ---
>  drivers/usb/gadget/udc/atmel_usba_udc.c |  1 -
>  include/linux/usb/atmel_usba_udc.h      | 24 ------------------------
>  2 files changed, 25 deletions(-)
>  delete mode 100644 include/linux/usb/atmel_usba_udc.h
> 
> diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
> index 0fe3d0feb8f7..b9623e228609 100644
> --- a/drivers/usb/gadget/udc/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
> @@ -20,7 +20,6 @@
>  #include <linux/ctype.h>
>  #include <linux/usb/ch9.h>
>  #include <linux/usb/gadget.h>
> -#include <linux/usb/atmel_usba_udc.h>
>  #include <linux/delay.h>
>  #include <linux/of.h>
>  #include <linux/irq.h>
> diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h
> deleted file mode 100644
> index 9bb00df3b53f..000000000000
> --- a/include/linux/usb/atmel_usba_udc.h
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -/*
> - * Platform data definitions for Atmel USBA gadget driver.
> - */
> -#ifndef __LINUX_USB_USBA_H
> -#define __LINUX_USB_USBA_H
> -
> -struct usba_ep_data {
> -	char	*name;
> -	int	index;
> -	int	fifo_size;
> -	int	nr_banks;
> -	int	can_dma;
> -	int	can_isoc;
> -};
> -
> -struct usba_platform_data {
> -	int			vbus_pin;
> -	int			vbus_pin_inverted;
> -	int			num_ep;
> -	struct usba_ep_data	ep[0];
> -};
> -
> -#endif /* __LINUX_USB_USBA_H */
> -- 
> 2.14.1
>
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 2/3] usb: gadget: udc: atmel: Remove obsolete include
@ 2018-04-16 11:44     ` Ludovic Desroches
  0 siblings, 0 replies; 25+ messages in thread
From: Ludovic Desroches @ 2018-04-16 11:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 16, 2018 at 11:34:04AM +0200, Romain Izard wrote:
> The include defines the private platform_data structure used with AVR
> platforms. It has no user since 7c55984e191f. Remove it.
> 
> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
> ---
>  drivers/usb/gadget/udc/atmel_usba_udc.c |  1 -
>  include/linux/usb/atmel_usba_udc.h      | 24 ------------------------
>  2 files changed, 25 deletions(-)
>  delete mode 100644 include/linux/usb/atmel_usba_udc.h
> 
> diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
> index 0fe3d0feb8f7..b9623e228609 100644
> --- a/drivers/usb/gadget/udc/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
> @@ -20,7 +20,6 @@
>  #include <linux/ctype.h>
>  #include <linux/usb/ch9.h>
>  #include <linux/usb/gadget.h>
> -#include <linux/usb/atmel_usba_udc.h>
>  #include <linux/delay.h>
>  #include <linux/of.h>
>  #include <linux/irq.h>
> diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h
> deleted file mode 100644
> index 9bb00df3b53f..000000000000
> --- a/include/linux/usb/atmel_usba_udc.h
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -/*
> - * Platform data definitions for Atmel USBA gadget driver.
> - */
> -#ifndef __LINUX_USB_USBA_H
> -#define __LINUX_USB_USBA_H
> -
> -struct usba_ep_data {
> -	char	*name;
> -	int	index;
> -	int	fifo_size;
> -	int	nr_banks;
> -	int	can_dma;
> -	int	can_isoc;
> -};
> -
> -struct usba_platform_data {
> -	int			vbus_pin;
> -	int			vbus_pin_inverted;
> -	int			num_ep;
> -	struct usba_ep_data	ep[0];
> -};
> -
> -#endif /* __LINUX_USB_USBA_H */
> -- 
> 2.14.1
> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 3/3] usb: gadget: udc: atmel: Fix indenting
@ 2018-04-16 11:44     ` Ludovic Desroches
  0 siblings, 0 replies; 25+ messages in thread
From: Ludovic Desroches @ 2018-04-16 11:44 UTC (permalink / raw)
  To: Romain Izard
  Cc: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches, linux-usb, linux-kernel,
	linux-arm-kernel

On Mon, Apr 16, 2018 at 11:34:05AM +0200, Romain Izard wrote:
> Fix the fallout of the conversion to GPIO descriptors in 3df034081021.
> 
> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
> ---
>  drivers/usb/gadget/udc/atmel_usba_udc.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
> index b9623e228609..2f586f2bda7e 100644
> --- a/drivers/usb/gadget/udc/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
> @@ -2277,15 +2277,15 @@ static int usba_udc_probe(struct platform_device *pdev)
>  	if (udc->vbus_pin) {
>  		irq_set_status_flags(gpiod_to_irq(udc->vbus_pin), IRQ_NOAUTOEN);
>  		ret = devm_request_threaded_irq(&pdev->dev,
> -					gpiod_to_irq(udc->vbus_pin), NULL,
> -					usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
> -					"atmel_usba_udc", udc);
> -			if (ret) {
> -				udc->vbus_pin = NULL;
> -				dev_warn(&udc->pdev->dev,
> -					 "failed to request vbus irq; "
> -					 "assuming always on\n");
> -			}
> +				gpiod_to_irq(udc->vbus_pin), NULL,
> +				usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
> +				"atmel_usba_udc", udc);
> +		if (ret) {
> +			udc->vbus_pin = NULL;
> +			dev_warn(&udc->pdev->dev,
> +				 "failed to request vbus irq; "
> +				 "assuming always on\n");
> +		}
>  	}
>  
>  	ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
> -- 
> 2.14.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [3/3] usb: gadget: udc: atmel: Fix indenting
@ 2018-04-16 11:44     ` Ludovic Desroches
  0 siblings, 0 replies; 25+ messages in thread
From: Ludovic Desroches @ 2018-04-16 11:44 UTC (permalink / raw)
  To: Romain Izard
  Cc: Nicolas Ferre, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches, linux-usb, linux-kernel,
	linux-arm-kernel

On Mon, Apr 16, 2018 at 11:34:05AM +0200, Romain Izard wrote:
> Fix the fallout of the conversion to GPIO descriptors in 3df034081021.
> 
> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
> ---
>  drivers/usb/gadget/udc/atmel_usba_udc.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
> index b9623e228609..2f586f2bda7e 100644
> --- a/drivers/usb/gadget/udc/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
> @@ -2277,15 +2277,15 @@ static int usba_udc_probe(struct platform_device *pdev)
>  	if (udc->vbus_pin) {
>  		irq_set_status_flags(gpiod_to_irq(udc->vbus_pin), IRQ_NOAUTOEN);
>  		ret = devm_request_threaded_irq(&pdev->dev,
> -					gpiod_to_irq(udc->vbus_pin), NULL,
> -					usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
> -					"atmel_usba_udc", udc);
> -			if (ret) {
> -				udc->vbus_pin = NULL;
> -				dev_warn(&udc->pdev->dev,
> -					 "failed to request vbus irq; "
> -					 "assuming always on\n");
> -			}
> +				gpiod_to_irq(udc->vbus_pin), NULL,
> +				usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
> +				"atmel_usba_udc", udc);
> +		if (ret) {
> +			udc->vbus_pin = NULL;
> +			dev_warn(&udc->pdev->dev,
> +				 "failed to request vbus irq; "
> +				 "assuming always on\n");
> +		}
>  	}
>  
>  	ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
> -- 
> 2.14.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 3/3] usb: gadget: udc: atmel: Fix indenting
@ 2018-04-16 11:44     ` Ludovic Desroches
  0 siblings, 0 replies; 25+ messages in thread
From: Ludovic Desroches @ 2018-04-16 11:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 16, 2018 at 11:34:05AM +0200, Romain Izard wrote:
> Fix the fallout of the conversion to GPIO descriptors in 3df034081021.
> 
> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
> ---
>  drivers/usb/gadget/udc/atmel_usba_udc.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
> index b9623e228609..2f586f2bda7e 100644
> --- a/drivers/usb/gadget/udc/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
> @@ -2277,15 +2277,15 @@ static int usba_udc_probe(struct platform_device *pdev)
>  	if (udc->vbus_pin) {
>  		irq_set_status_flags(gpiod_to_irq(udc->vbus_pin), IRQ_NOAUTOEN);
>  		ret = devm_request_threaded_irq(&pdev->dev,
> -					gpiod_to_irq(udc->vbus_pin), NULL,
> -					usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
> -					"atmel_usba_udc", udc);
> -			if (ret) {
> -				udc->vbus_pin = NULL;
> -				dev_warn(&udc->pdev->dev,
> -					 "failed to request vbus irq; "
> -					 "assuming always on\n");
> -			}
> +				gpiod_to_irq(udc->vbus_pin), NULL,
> +				usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
> +				"atmel_usba_udc", udc);
> +		if (ret) {
> +			udc->vbus_pin = NULL;
> +			dev_warn(&udc->pdev->dev,
> +				 "failed to request vbus irq; "
> +				 "assuming always on\n");
> +		}
>  	}
>  
>  	ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
> -- 
> 2.14.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 0/3] Fix an Atmel USBA UDC issue introducted in 4.17-rc1
  2018-04-16  9:34 ` Romain Izard
@ 2018-04-17  8:24   ` Nicolas Ferre
  -1 siblings, 0 replies; 25+ messages in thread
From: Nicolas Ferre @ 2018-04-17  8:24 UTC (permalink / raw)
  To: Romain Izard, Felipe Balbi, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches
  Cc: linux-kernel, linux-arm-kernel, linux-usb

On 16/04/2018 at 11:34, Romain Izard wrote:
> The use of GPIO descriptors takes care of inversion flags declared in
> the device tree. The conversion of the Atmel USBA UDC driver introduced
> in 4.17-rc1 missed it, and as a result the inversion will not work.
> 
> In addition, cleanup the code to remove an include left behind after
> the suppression of the support of platform_data to declare USBA
> controllers.
> 
> These changes have not been tested on any hardware, as I do not have
> a board that needs to use inverted GPIOs.
> 
> Romain Izard (3):
>    usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
>    usb: gadget: udc: atmel: Remove obsolete include
>    usb: gadget: udc: atmel: Fix indenting

To the whole series:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Thank you Romain.
Best regards,
   Nicolas

> 
>   drivers/usb/gadget/udc/atmel_usba_udc.c | 22 ++++++++++------------
>   drivers/usb/gadget/udc/atmel_usba_udc.h |  1 -
>   include/linux/usb/atmel_usba_udc.h      | 24 ------------------------
>   3 files changed, 10 insertions(+), 37 deletions(-)
>   delete mode 100644 include/linux/usb/atmel_usba_udc.h
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 0/3] Fix an Atmel USBA UDC issue introducted in 4.17-rc1
@ 2018-04-17  8:24   ` Nicolas Ferre
  0 siblings, 0 replies; 25+ messages in thread
From: Nicolas Ferre @ 2018-04-17  8:24 UTC (permalink / raw)
  To: linux-arm-kernel

On 16/04/2018 at 11:34, Romain Izard wrote:
> The use of GPIO descriptors takes care of inversion flags declared in
> the device tree. The conversion of the Atmel USBA UDC driver introduced
> in 4.17-rc1 missed it, and as a result the inversion will not work.
> 
> In addition, cleanup the code to remove an include left behind after
> the suppression of the support of platform_data to declare USBA
> controllers.
> 
> These changes have not been tested on any hardware, as I do not have
> a board that needs to use inverted GPIOs.
> 
> Romain Izard (3):
>    usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
>    usb: gadget: udc: atmel: Remove obsolete include
>    usb: gadget: udc: atmel: Fix indenting

To the whole series:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Thank you Romain.
Best regards,
   Nicolas

> 
>   drivers/usb/gadget/udc/atmel_usba_udc.c | 22 ++++++++++------------
>   drivers/usb/gadget/udc/atmel_usba_udc.h |  1 -
>   include/linux/usb/atmel_usba_udc.h      | 24 ------------------------
>   3 files changed, 10 insertions(+), 37 deletions(-)
>   delete mode 100644 include/linux/usb/atmel_usba_udc.h
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
@ 2018-04-25  9:53     ` Felipe Balbi
  0 siblings, 0 replies; 25+ messages in thread
From: Felipe Balbi @ 2018-04-25  9:53 UTC (permalink / raw)
  To: Romain Izard, Nicolas Ferre, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches
  Cc: linux-kernel, linux-arm-kernel, linux-usb, Romain Izard

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

Romain Izard <romain.izard.pro@gmail.com> writes:

> 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

your fixes line is incorrect. Please fix and resend. While at that,
please collect Acked-bys and Tested-bys, etc.

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
@ 2018-04-25  9:53     ` Felipe Balbi
  0 siblings, 0 replies; 25+ messages in thread
From: Felipe Balbi @ 2018-04-25  9:53 UTC (permalink / raw)
  To: Romain Izard, Nicolas Ferre, Greg Kroah-Hartman,
	Alexandre Belloni, Ludovic Desroches
  Cc: linux-kernel, linux-arm-kernel, linux-usb

Romain Izard <romain.izard.pro@gmail.com> writes:

> 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

your fixes line is incorrect. Please fix and resend. While at that,
please collect Acked-bys and Tested-bys, etc.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod
@ 2018-04-25  9:53     ` Felipe Balbi
  0 siblings, 0 replies; 25+ messages in thread
From: Felipe Balbi @ 2018-04-25  9:53 UTC (permalink / raw)
  To: linux-arm-kernel

Romain Izard <romain.izard.pro@gmail.com> writes:

> 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

your fixes line is incorrect. Please fix and resend. While at that,
please collect Acked-bys and Tested-bys, etc.

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180425/d7365672/attachment.sig>

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2018-04-25  9:53 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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-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
2018-04-16  9:34   ` [1/3] " Romain Izard
2018-04-16 11:42   ` [PATCH 1/3] " Ludovic Desroches
2018-04-16 11:42     ` Ludovic Desroches
2018-04-16 11:42     ` [1/3] " Ludovic Desroches
2018-04-25  9:53   ` [PATCH 1/3] " Felipe Balbi
2018-04-25  9:53     ` Felipe Balbi
2018-04-25  9:53     ` [1/3] " Felipe Balbi
2018-04-16  9:34 ` [PATCH 2/3] usb: gadget: udc: atmel: Remove obsolete include Romain Izard
2018-04-16  9:34   ` Romain Izard
2018-04-16  9:34   ` [2/3] " Romain Izard
2018-04-16 11:44   ` [PATCH 2/3] " Ludovic Desroches
2018-04-16 11:44     ` Ludovic Desroches
2018-04-16 11:44     ` [2/3] " Ludovic Desroches
2018-04-16  9:34 ` [PATCH 3/3] usb: gadget: udc: atmel: Fix indenting Romain Izard
2018-04-16  9:34   ` Romain Izard
2018-04-16  9:34   ` [3/3] " Romain Izard
2018-04-16 11:44   ` [PATCH 3/3] " Ludovic Desroches
2018-04-16 11:44     ` Ludovic Desroches
2018-04-16 11:44     ` [3/3] " Ludovic Desroches
2018-04-17  8:24 ` [PATCH 0/3] Fix an Atmel USBA UDC issue introducted in 4.17-rc1 Nicolas Ferre
2018-04-17  8:24   ` Nicolas Ferre

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.