Skip to content

Commit ceb8036

Browse files
Seth Levygregkh
authored andcommitted
USB: net2272: driver for PLX NET2272 USB device controller
This is based on the last release from PLX: http://www.plxtech.com/files/products/net2000/software/selectiontool/RE061204-net2272-linux2.6.18.tgz I've managed to contact them and they've confirmed that this driver was wholly written by PLX (Seth Levy). While they have no problem with it being merged (and they've already licensed it as GPL), they don't have any interest in doing so themselves as this is an old part for them. ADI has long had an add-on card which has this part on it, so we've been keeping it up-to-date out of tree. But now that PLX has confirmed the source of the driver, we can can take the next step of cleaning it up and getting it merged. So here we are! I've done quite a large clean up of the driver and attempted to address all the common issues. Hopefully in the process, I haven't broken anything. While it seems to still work with the board that I have access to, it is not a PCI variant. So I have not tested any of the PCI logic myself (beyond clean compile). Perhaps someone who actually has a card and cares can do so. I'll try to address further feedback, but don't expect miracles. I'm not really familiar with the part itself, just the platform glue. Signed-off-by: Seth Levy <seth.levy@plxtech.com> Signed-off-by: Ash Aziz <ash.aziz@plxtech.com> Signed-off-by: Roy Huang <roy.huang@analog.com> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent c4fc234 commit ceb8036

File tree

5 files changed

+3357
-0
lines changed

5 files changed

+3357
-0
lines changed

drivers/usb/gadget/Kconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,35 @@ config USB_CI13XXX_PCI
480480
default USB_GADGET
481481
select USB_GADGET_SELECTED
482482

483+
config USB_GADGET_NET2272
484+
boolean "PLX NET2272"
485+
select USB_GADGET_DUALSPEED
486+
help
487+
PLX NET2272 is a USB peripheral controller which supports
488+
both full and high speed USB 2.0 data transfers.
489+
490+
It has three configurable endpoints, as well as endpoint zero
491+
(for control transfer).
492+
Say "y" to link the driver statically, or "m" to build a
493+
dynamically linked module called "net2272" and force all
494+
gadget drivers to also be dynamically linked.
495+
496+
config USB_GADGET_NET2272_DMA
497+
boolean "Support external DMA controller"
498+
depends on USB_GADGET_NET2272
499+
help
500+
The NET2272 part can optionally support an external DMA
501+
controller, but your board has to have support in the
502+
driver itself.
503+
504+
If unsure, say "N" here. The driver works fine in PIO mode.
505+
506+
config USB_NET2272
507+
tristate
508+
depends on USB_GADGET_NET2272
509+
default USB_GADGET
510+
select USB_GADGET_SELECTED
511+
483512
config USB_GADGET_NET2280
484513
boolean "NetChip 228x"
485514
depends on PCI

drivers/usb/gadget/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
ccflags-$(CONFIG_USB_GADGET_DEBUG) := -DDEBUG
55

66
obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o
7+
obj-$(CONFIG_USB_NET2272) += net2272.o
78
obj-$(CONFIG_USB_NET2280) += net2280.o
89
obj-$(CONFIG_USB_AMD5536UDC) += amd5536udc.o
910
obj-$(CONFIG_USB_PXA25X) += pxa25x_udc.o

drivers/usb/gadget/gadget_chips.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#ifndef __GADGET_CHIPS_H
1616
#define __GADGET_CHIPS_H
1717

18+
#ifdef CONFIG_USB_GADGET_NET2272
19+
#define gadget_is_net2272(g) !strcmp("net2272", (g)->name)
20+
#else
21+
#define gadget_is_net2272(g) 0
22+
#endif
23+
1824
#ifdef CONFIG_USB_GADGET_NET2280
1925
#define gadget_is_net2280(g) !strcmp("net2280", (g)->name)
2026
#else
@@ -223,6 +229,8 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
223229
return 0x29;
224230
else if (gadget_is_s3c_hsudc(gadget))
225231
return 0x30;
232+
else if (gadget_is_net2272(gadget))
233+
return 0x31;
226234

227235
return -ENOENT;
228236
}

0 commit comments

Comments
 (0)