mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 02/18] usb: gadget: drop gadget_chips.h
Date: Mon, 20 Mar 2023 16:29:25 +0100	[thread overview]
Message-ID: <20230320152941.3155428-3-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20230320152941.3155428-1-s.hauer@pengutronix.de>

gadget_chips.h is mostly unused and no longer present in upstream Linux,
so drop it from barebox as well. The only thing we still need is
gadget_is_pxa() which is added to epautoconf.c directly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/gadget/epautoconf.c   | 42 +----------------------
 drivers/usb/gadget/f_acm.c        |  1 -
 drivers/usb/gadget/f_serial.c     |  1 -
 drivers/usb/gadget/gadget_chips.h | 56 -------------------------------
 drivers/usb/gadget/serial.c       |  1 -
 5 files changed, 1 insertion(+), 100 deletions(-)
 delete mode 100644 drivers/usb/gadget/gadget_chips.h

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index e9f13f4262..2f1b9d1a0b 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -14,7 +14,7 @@
 #include <usb/ch9.h>
 #include <usb/gadget.h>
 
-#include "gadget_chips.h"
+#define gadget_is_pxa(g)                (!strcmp("pxa25x_udc", (g)->name))
 
 /*
  * This should work with endpoints from controller drivers sharing the
@@ -182,18 +182,6 @@ ep_matches (
 	return 1;
 }
 
-static struct usb_ep *
-find_ep (struct usb_gadget *gadget, const char *name)
-{
-	struct usb_ep	*ep;
-
-	list_for_each_entry (ep, &gadget->ep_list, ep_list) {
-		if (0 == strcmp (ep->name, name))
-			return ep;
-	}
-	return NULL;
-}
-
 /**
  * usb_ep_autoconfig_ss() - choose an endpoint matching the ep
  * descriptor and ep companion descriptor
@@ -249,34 +237,6 @@ struct usb_ep *usb_ep_autoconfig_ss(
 
 	type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
 
-	/* First, apply chip-specific "best usage" knowledge.
-	 * This might make a good usb_gadget_ops hook ...
-	 */
-	if (gadget_is_net2280 (gadget) && type == USB_ENDPOINT_XFER_INT) {
-		/* ep-e, ep-f are PIO with only 64 byte fifos */
-		ep = find_ep (gadget, "ep-e");
-		if (ep && ep_matches(gadget, ep, desc, ep_comp))
-			goto found_ep;
-		ep = find_ep (gadget, "ep-f");
-		if (ep && ep_matches(gadget, ep, desc, ep_comp))
-			goto found_ep;
-
-	} else if (gadget_is_goku (gadget)) {
-		if (USB_ENDPOINT_XFER_INT == type) {
-			/* single buffering is enough */
-			ep = find_ep(gadget, "ep3-bulk");
-			if (ep && ep_matches(gadget, ep, desc, ep_comp))
-				goto found_ep;
-		} else if (USB_ENDPOINT_XFER_BULK == type
-				&& (USB_DIR_IN & desc->bEndpointAddress)) {
-			/* DMA may be available */
-			ep = find_ep(gadget, "ep2-bulk");
-			if (ep && ep_matches(gadget, ep, desc,
-					      ep_comp))
-				goto found_ep;
-		}
-	}
-
 	/* Second, look at endpoints until an unclaimed one looks usable */
 	list_for_each_entry (ep, &gadget->ep_list, ep_list) {
 		if (ep_matches(gadget, ep, desc, ep_comp))
diff --git a/drivers/usb/gadget/f_acm.c b/drivers/usb/gadget/f_acm.c
index 42438947c1..3d2595edd7 100644
--- a/drivers/usb/gadget/f_acm.c
+++ b/drivers/usb/gadget/f_acm.c
@@ -19,7 +19,6 @@
 #include <usb/composite.h>
 
 #include "u_serial.h"
-#include "gadget_chips.h"
 
 
 /*
diff --git a/drivers/usb/gadget/f_serial.c b/drivers/usb/gadget/f_serial.c
index 33cf54dc1c..494f6c872e 100644
--- a/drivers/usb/gadget/f_serial.c
+++ b/drivers/usb/gadget/f_serial.c
@@ -12,7 +12,6 @@
 #include <linux/err.h>
 
 #include "u_serial.h"
-#include "gadget_chips.h"
 
 
 /*
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
deleted file mode 100644
index 78e0601027..0000000000
--- a/drivers/usb/gadget/gadget_chips.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * USB device controllers have lots of quirks.  Use these macros in
- * gadget drivers or other code that needs to deal with them, and which
- * autoconfigures instead of using early binding to the hardware.
- *
- * This SHOULD eventually work like the ARM mach_is_*() stuff, driven by
- * some config file that gets updated as new hardware is supported.
- * (And avoiding all runtime comparisons in typical one-choice configs!)
- *
- * NOTE:  some of these controller drivers may not be available yet.
- * Some are available on 2.4 kernels; several are available, but not
- * yet pushed in the 2.6 mainline tree.
- */
-
-#ifndef __GADGET_CHIPS_H
-#define __GADGET_CHIPS_H
-
-#include <usb/gadget.h>
-
-/*
- * NOTICE: the entries below are alphabetical and should be kept
- * that way.
- *
- * Always be sure to add new entries to the correct position or
- * accept the bashing later.
- *
- * If you have forgotten the alphabetical order let VIM/EMACS
- * do that for you.
- */
-#define gadget_is_at91(g)		(!strcmp("at91_udc", (g)->name))
-#define gadget_is_goku(g)		(!strcmp("goku_udc", (g)->name))
-#define gadget_is_musbhdrc(g)		(!strcmp("musb-hdrc", (g)->name))
-#define gadget_is_net2280(g)		(!strcmp("net2280", (g)->name))
-#define gadget_is_pxa(g)		(!strcmp("pxa25x_udc", (g)->name))
-#define gadget_is_pxa27x(g)		(!strcmp("pxa27x_udc", (g)->name))
-
-/**
- * gadget_supports_altsettings - return true if altsettings work
- * @gadget: the gadget in question
- */
-static inline bool gadget_supports_altsettings(struct usb_gadget *gadget)
-{
-	/* PXA 21x/25x/26x has no altsettings at all */
-	if (gadget_is_pxa(gadget))
-		return false;
-
-	/* PXA 27x and 3xx have *broken* altsetting support */
-	if (gadget_is_pxa27x(gadget))
-		return false;
-
-	/* Everything else is *presumably* fine ... */
-	return true;
-}
-
-#endif /* __GADGET_CHIPS_H */
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index 0ef2665b69..6321f3f207 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -18,7 +18,6 @@
 #include <asm/byteorder.h>
 
 #include "u_serial.h"
-#include "gadget_chips.h"
 
 
 /* Defines */
-- 
2.30.2




  parent reply	other threads:[~2023-03-20 15:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 15:29 [PATCH 00/18] USB gadget overhaul Sascha Hauer
2023-03-20 15:29 ` [PATCH 01/18] usb: gadget: fastboot: Allocate IN requests when needed Sascha Hauer
2023-03-20 15:29 ` Sascha Hauer [this message]
2023-03-20 15:29 ` [PATCH 03/18] usb: gadget: move files to place where Linux has them Sascha Hauer
2023-03-20 15:29 ` [PATCH 04/18] usb: move include " Sascha Hauer
2023-03-20 15:29 ` [PATCH 05/18] usb: ch9: Update from Linux Kernel Sascha Hauer
2023-03-20 15:29 ` [PATCH 06/18] phy: Add mode setting support Sascha Hauer
2023-03-20 15:29 ` [PATCH 07/18] driver: Add unregister_driver() Sascha Hauer
2023-03-20 15:43   ` Ahmad Fatoum
2023-03-21  8:07     ` Sascha Hauer
2023-03-20 15:29 ` [PATCH 08/18] usb: gadget: Update core to Linux-6.3-rc2 Sascha Hauer
2023-03-20 15:29 ` [PATCH 09/18] uuid.h: sync with Linux-6.3-rc2 Sascha Hauer
2023-03-20 15:29 ` [PATCH 10/18] usb: gadget: Add super-speed-plus descriptors Sascha Hauer
2023-03-20 15:29 ` [PATCH 11/18] usb: gadget: update composite.c from Linux-6.3-rc2 Sascha Hauer
2023-03-20 15:29 ` [PATCH 12/18] Add dev_WARN_ONCE() Sascha Hauer
2023-03-20 15:29 ` [PATCH 13/18] usb: dwc3: sync with Linux-6.3-rc2 Sascha Hauer
2023-03-20 15:29 ` [PATCH 14/18] usb: gadget: dfu: Assign super speed descriptors Sascha Hauer
2023-03-20 15:29 ` [PATCH 15/18] usb: gadget: fastboot: Add " Sascha Hauer
2023-03-22  8:28   ` Johannes Zink
2023-03-20 15:29 ` [PATCH 16/18] usb: gadget: mass storage: " Sascha Hauer
2023-03-20 15:29 ` [PATCH 17/18] usb: gadget: u_serial: Put back to list if shutdown Sascha Hauer
2023-03-20 15:29 ` [PATCH 18/18] usb: gadget multi: support USB Super Speed Sascha Hauer

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=20230320152941.3155428-3-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox