Commit graph

1137 commits

Author SHA1 Message Date
Arun Sharma
60063497a9 atomic: use <linux/atomic.h>
This allows us to move duplicated code in <asm/atomic.h>
(atomic_inc_not_zero() for now) to <linux/atomic.h>

Signed-off-by: Arun Sharma <asharma@fb.com>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-26 16:49:47 -07:00
Linus Torvalds
f549953c15 Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (115 commits)
  EHCI: fix direction handling for interrupt data toggles
  USB: serial: add IDs for WinChipHead USB->RS232 adapter
  USB: OHCI: fix another regression for NVIDIA controllers
  usb: gadget: m66592-udc: add pullup function
  usb: gadget: m66592-udc: add function for external controller
  usb: gadget: r8a66597-udc: add pullup function
  usb: renesas_usbhs: support multi driver
  usb: renesas_usbhs: inaccessible pipe is not an error
  usb: renesas_usbhs: care buff alignment when dma handler
  USB: PL2303: correctly handle baudrates above 115200
  usb: r8a66597-hcd: fixup USB_PORT_STAT_C_SUSPEND shift
  usb: renesas_usbhs: compile/config are rescued
  usb: renesas_usbhs: fixup comment-out
  usb: update email address in ohci-sh and r8a66597-hcd
  usb: r8a66597-hcd: add function for external controller
  EHCI: only power off port if over-current is active
  USB: mon: Allow to use usbmon without debugfs
  USB: EHCI: go back to using the system clock for QH unlinks
  ehci: add pci quirk for Ordissimo and RM Slate 100 too
  ehci: refactor pci quirk to use standard dmi_check_system method
  ...

Fix up trivial conflicts in Documentation/feature-removal-schedule.txt
2011-07-25 23:08:32 -07:00
Linus Torvalds
d3ec4844d4 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
  fs: Merge split strings
  treewide: fix potentially dangerous trailing ';' in #defined values/expressions
  uwb: Fix misspelling of neighbourhood in comment
  net, netfilter: Remove redundant goto in ebt_ulog_packet
  trivial: don't touch files that are removed in the staging tree
  lib/vsprintf: replace link to Draft by final RFC number
  doc: Kconfig: `to be' -> `be'
  doc: Kconfig: Typo: square -> squared
  doc: Konfig: Documentation/power/{pm => apm-acpi}.txt
  drivers/net: static should be at beginning of declaration
  drivers/media: static should be at beginning of declaration
  drivers/i2c: static should be at beginning of declaration
  XTENSA: static should be at beginning of declaration
  SH: static should be at beginning of declaration
  MIPS: static should be at beginning of declaration
  ARM: static should be at beginning of declaration
  rcu: treewide: Do not use rcu_read_lock_held when calling rcu_dereference_check
  Update my e-mail address
  PCIe ASPM: forcedly -> forcibly
  gma500: push through device driver tree
  ...

Fix up trivial conflicts:
 - arch/arm/mach-ep93xx/dma-m2p.c (deleted)
 - drivers/gpio/gpio-ep93xx.c (renamed and context nearby)
 - drivers/net/r8169.c (just context changes)
2011-07-25 13:56:39 -07:00
Linus Torvalds
bbd9d6f7fb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits)
  vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp
  isofs: Remove global fs lock
  jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory
  fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.
  mm/truncate.c: fix build for CONFIG_BLOCK not enabled
  fs:update the NOTE of the file_operations structure
  Remove dead code in dget_parent()
  AFS: Fix silly characters in a comment
  switch d_add_ci() to d_splice_alias() in "found negative" case as well
  simplify gfs2_lookup()
  jfs_lookup(): don't bother with . or ..
  get rid of useless dget_parent() in btrfs rename() and link()
  get rid of useless dget_parent() in fs/btrfs/ioctl.c
  fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
  drivers: fix up various ->llseek() implementations
  fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
  Ext4: handle SEEK_HOLE/SEEK_DATA generically
  Btrfs: implement our own ->llseek
  fs: add SEEK_HOLE and SEEK_DATA flags
  reiserfs: make reiserfs default to barrier=flush
  ...

Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new
shrinker callout for the inode cache, that clashed with the xfs code to
start the periodic workers later.
2011-07-22 19:02:39 -07:00
Josef Bacik
02c24a8218 fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
Btrfs needs to be able to control how filemap_write_and_wait_range() is called
in fsync to make it less of a painful operation, so push down taking i_mutex and
the calling of filemap_write_and_wait() down into the ->fsync() handlers.  Some
file systems can drop taking the i_mutex altogether it seems, like ext3 and
ocfs2.  For correctness sake I just pushed everything down in all cases to make
sure that we keep the current behavior the same for everybody, and then each
individual fs maintainer can make up their mind about what to do from there.
Thanks,

Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2011-07-20 20:47:59 -04:00
David S. Miller
6a7ebdf2fd Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	net/bluetooth/l2cap_core.c
2011-07-14 07:56:40 -07:00
Jiri Kosina
b7e9c223be Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply pending patches that
are based on newer code already present upstream.
2011-07-11 14:15:55 +02:00
Greg Kroah-Hartman
18fbb93fbe Merge branch 'for-next' of master.kernel.org:/pub/scm/linux/kernel/git/balbi/usb into usb-next
* 'for-next' of master.kernel.org:/pub/scm/linux/kernel/git/balbi/usb:
  usb: gadget: m66592-udc: add pullup function
  usb: gadget: m66592-udc: add function for external controller
  usb: gadget: r8a66597-udc: add pullup function
  usb: gadget: zero: add superspeed support
  usb: gadget: add SS descriptors to Ethernet gadget
  usb: gadget: r8a66597-udc: add support for TEST_MODE
  usb: gadget: m66592-udc: add support for TEST_MODE
  usb: gadget: r8a66597-udc: Make BUSWAIT configurable through platform data
  usb: gadget: r8a66597-udc: fix cannot connect after rmmod gadget driver
  usb: update email address in r8a66597-udc and m66592-udc
  usb: musb: restore INDEX register in resume path
  usb: gadget: fix up depencies
  usb: gadget: fusb300_udc: fix compile warnings
  usb: gadget: ci13xx_udc.c: fix compile warning
  usb: gadget: net2272: fix compile warnings
  usb: gadget: langwell_udc: fix compile warnings
  usb: gadget: fusb300_udc: drop dead code
2011-07-08 15:30:55 -07:00
Yoshihiro Shimoda
7eff1d83a3 usb: gadget: m66592-udc: add pullup function
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-09 01:08:40 +03:00
Yoshihiro Shimoda
bb59dbff4e usb: gadget: m66592-udc: add function for external controller
M66592 has the pin of WR0 and WR1. So, if one write-pin of CPU
connects to the pins, we have to change the setting of FIFOSEL
register in the controller. If we don't change the setting,
the controller cannot send the data of odd length.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-09 01:08:39 +03:00
Yoshihiro Shimoda
8ca137562a usb: gadget: r8a66597-udc: add pullup function
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-09 01:08:38 +03:00
Kuninori Morimoto
030ed1fcb0 usb: renesas_usbhs: compile/config are rescued
This patch rescues renesas_usbhs compile from
commit 193ab2a (usb: gadget: allow multiple gadgets to be built)

CONFIG_USB_RENESAS_USBHS compile renesas_usbhs main code which
is shared between Host/Gadget.
CONFIG_USB_RENESAS_USBHS_UDC add mod_gadget to it.

It had lost USB_GADGET_DUALSPEED

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:57:12 -07:00
Amit Blay
57c97c02de usb: gadget: zero: add superspeed support
This patch adds SuperSpeed descriptors to the
g_zero gadget.

The SuperSpeed descriptors were added both for
f_soursesink and f_loopback function drivers.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Amit Blay <ablay@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-08 13:57:54 +03:00
Paul Zimmerman
04617db7aa usb: gadget: add SS descriptors to Ethernet gadget
Add SuperSpeed descriptors to the Network USB
function drivers.

This has been lightly tested using a Linux host.
I was able to ssh from device to host and host to
device, no obvious problems seen.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-08 13:55:30 +03:00
Yoshihiro Shimoda
96fe53ef54 usb: gadget: r8a66597-udc: add support for TEST_MODE
The USB high speed device must support the TEST_MODE, but the driver
didn't support it. When we sent the SET_FEATURE for TEST_MODE to
the driver, the request was successful, but the module didn't enter
the TEST_MODE.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-08 12:50:57 +03:00
Yoshihiro Shimoda
ceaa0a6eea usb: gadget: m66592-udc: add support for TEST_MODE
The USB high speed device must support the TEST_MODE, but the driver
didn't support it. When we sent the SET_FEATURE for TEST_MODE to
the driver, the request was successful, but the module didn't enter
the TEST_MODE.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-08 12:47:47 +03:00
Yoshihiro Shimoda
5154e9f126 usb: gadget: r8a66597-udc: Make BUSWAIT configurable through platform data
BUSWAIT is a 4-bit-wide value that controls the number of access waits
from the CPU to on-chip USB module. b'0000 inserts 0 wait (2 access
cycles) and b'1111 inserts 15 waits (17 access cycles, hardware
initial value), respectively.

BUSWAIT value depends on peripheral clock frequency supplied to on-chip
of each CPU, hence should be configurable through platform data.

Note that this patch assumes that b'0000 (0 wait, 2 access cycles) is
rerely used and considered as invalid. If valid 'buswait' data is not
provided by platform, initial b'1111 (15 waits, 17 access cycles) will
be applied as a safe default.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-08 12:47:42 +03:00
Yoshihiro Shimoda
deafeb24e8 usb: gadget: r8a66597-udc: fix cannot connect after rmmod gadget driver
When we run rmmod a gadget driver, the driver will call
disable_controller(). Then, because the bit of USBE in SYSCFG0 was
cleared in on_chip=1 mode, we could not connect the usb when we run
insmod a gadget driver next time.
This patch also cleans up probe() and ->stop() about unnecessary
init_controller().

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-08 12:47:37 +03:00
Yoshihiro Shimoda
5db05c09ac usb: update email address in r8a66597-udc and m66592-udc
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-08 12:47:27 +03:00
Sebastian Andrzej Siewior
ac17317d20 usb: gadget: fix up depencies
Both fusb300 and langwell udcs seem to only
work with 32-bit address space.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-05 16:41:17 +03:00
Sebastian Andrzej Siewior
1425b80e0d usb: gadget: fusb300_udc: fix compile warnings
- remove pointer u32 abuse in fusb300_fill_idma_prdtbl().
  It is assigned the dma_addr to a pointer and then back.
  Poor families may have to recycle variables but we don't

- don't free req.buf in error case. We don't do it in the
  ok case so it is probably wrong to do it in error case.

- return in error case. There is no reason to continue
  without data and performing ops on an invalid pointer.

- The if (d) statement is bogus since an invalid DMA pointer
  is ~0 on some architecutres. And since we return for the
  invalid case we don't need it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-05 16:41:15 +03:00
Sebastian Andrzej Siewior
c2b65f8422 usb: gadget: ci13xx_udc.c: fix compile warning
Fix the following compile warning:

| usb/gadget/ci13xxx_udc.c: In function 'show_registers':
| usb/gadget/ci13xxx_udc.c:1242:1: warning: the frame size of 2064 bytes is larger than 1024 bytes

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-05 16:41:14 +03:00
Felipe Balbi
7b30d19a57 usb: gadget: net2272: fix compile warnings
This patch fixes the following compile warnings:

drivers/usb/gadget/net2272.c: In function ‘net2272_kick_dma’:
drivers/usb/gadget/net2272.c:740:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
drivers/usb/gadget/net2272.c: In function ‘net2272_queue’:
drivers/usb/gadget/net2272.c:859:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 8 has type ‘dma_addr_t’ [-Wformat]

Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-05 16:41:13 +03:00
Felipe Balbi
b9af9ea45a usb: gadget: langwell_udc: fix compile warnings
This patch fixes the following compile warnings:

drivers/usb/gadget/langwell_udc.c: In function ‘queue_dtd’:
drivers/usb/gadget/langwell_udc.c:596:2: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
drivers/usb/gadget/langwell_udc.c: In function ‘langwell_udc_probe’:
drivers/usb/gadget/langwell_udc.c:3274:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]
drivers/usb/gadget/langwell_udc.c:3289:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]
drivers/usb/gadget/langwell_udc.c: In function ‘langwell_udc_resume’:
drivers/usb/gadget/langwell_udc.c:3473:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]
drivers/usb/gadget/langwell_udc.c:3487:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]

Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-05 16:41:12 +03:00
Felipe Balbi
4dbafd3dce usb: gadget: fusb300_udc: drop dead code
that code has been dead forever. Since the
first commit (0fe6f1d1) the use of that code
has been commented out. Let's drop the dead
code already and fix the following compile
warning:

| drivers/usb/gadget/fusb300_udc.c: At top level:
| drivers/usb/gadget/fusb300_udc.c:771:13: warning: ‘fusb300_wrfifo’ defined but not used [-Wunused-function]
| drivers/usb/gadget/fusb300_udc.c:1027:13: warning: ‘fusb300_set_ep_bycnt’ defined but not used [-Wunused-function]

Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-07-05 16:41:12 +03:00
Viliam Mateicka
5b8261385c USB: s3c2410_udc: fix custom UDC command handling
There is a bug in Samsung's UDC driver, which is completely disabling
the USB device when a custom UDC command is used.
Following patch seems to get the right behavior (e.g. enabling pull-up
instead of disabling then Vcc is applied).

Signed-off-by: Viliam Mateicka <viliam.mateicka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:51:43 -07:00
Tatyana Brokhman
bc8687db89 usb: gadget: Compilation warning fix
A compilation warning was added by the patch
"usb: gadget: use config_ep_by_speed() instead of ep_choose()".
This patch fixed it.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:45:44 -07:00
Jassi Brar
28f75f4db1 USB: Gadget: Webcam: Return correct result of bind
The config bind was reported success even if usb_add_function
failed. Fix the return value.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:45:42 -07:00
Bob Liu
5030ec7302 USB: gadget: fix req length in sourcesink_setup()
The recent commit 2edb11cbac fixed req->length in the composite_setup()
function, but that will cause all g_zero tests to fail like:

root#> ./testusb -D /proc/bus/usb/002/021 -t14 -c 15000 -s 256 -v 1
unknown speed   /proc/bus/usb/002/021
/proc/bus/usb/002/021 test 14 --> 32 (Broken pipe)

We need to fix req->length in sourcesink_setup() as well to avoid this.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:44:58 -07:00
Sebastian Andrzej Siewior
019f976e8f usb: gadget: udc-core: wire up sysfs files
This was somehow forgotten.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:14 -07:00
Sebastian Andrzej Siewior
aa07473943 usb: gadget: dummy_hcd: convert to new-style udc-probe
bind() and pull is moved to udc core, call callbacks are verified by the
upper layer.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:14 -07:00
Sebastian Andrzej Siewior
352c2dc8b0 usb: gadget: udc-core: add "new-style" registration interface
udc_start() should only trigger the internal state machine and make
minimal house keeping. Before that call udc-core calls the bind()
callback and after the callback the pullup().

udc_stop() is simillar, udc-core calls pullup(), unbind() and finally
udc_stop().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:13 -07:00
Sebastian Andrzej Siewior
b5738413c9 usb: gadget: dummy_hcd: move selection of speed into ->pullup()
The configuration is static however we only know the speed after we have
connected with the other side.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:13 -07:00
Sebastian Andrzej Siewior
f8744d40ca usb: gadget: dummy_hcd: init is_otg in init_dummy_udc_hw()
This value is now assigned during bind(). The configuration depends on
static values assigned by dummy driver itself. So there is no need to
defer this assigment until one know the actuall speed since the
configuration is static and known early.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:13 -07:00
Sebastian Andrzej Siewior
0fb5759952 usb: gadget: dummy_hcd: move ep initialisation HW setup
This is only required to be done once. There is no counter part to this
in ->stop() so there is no need to re-do it next time. While here also
init the max_stream size to 0 on SS speed.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:12 -07:00
Sebastian Andrzej Siewior
765f5b830e usb: gadget: defer setting maxpacket till ->setup()
maxpacket is set by the udc driver for ep0 very early. This value is
copied by the function gadget used later for the USB_DT_DEVICE and
USB_DT_DEVICE_QUALIFIER query. This seems to work fine so far. For USB3
we need set a different value here. In SS speed it is 2^x with x=9 and
in HS we set something <= 64. If the UDC starts in SS and continues in
HS after the cable has been plugged it will report a too small value.
There setting of this value is defered and taken automaticly from the
ep0 pointer where the UDC driver can update it according to the speed it
detected _after_ a cable has been plugged.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:12 -07:00
Felipe Balbi
193ab2a607 usb: gadget: allow multiple gadgets to be built
now that we have the udc class, we can allow
multiple gadget controller drivers to be
compiled as modules. This will allow for
distro-like kernels for embedded devices.

With this patch, I managed to build an x86
kernel with support for many of the controllers
enabled:

CONFIG_USB_FUSB300=m
CONFIG_USB_R8A66597=m
CONFIG_USB_M66592=m
CONFIG_USB_AMD5536UDC=m
CONFIG_USB_CI13XXX_PCI=m
CONFIG_USB_NET2272=m
CONFIG_USB_NET2280=m
CONFIG_USB_GOKU=m
CONFIG_USB_LANGWELL=m
CONFIG_USB_EG20T=m

Also an ARM kernel with support for many controllers:

CONFIG_USB_FUSB300=m
CONFIG_USB_OMAP=m
CONFIG_USB_R8A66597=m
CONFIG_USB_GADGET_MUSB_HDRC=m
CONFIG_USB_M66592=m
CONFIG_USB_NET2272=m
CONFIG_USB_DUMMY_HCD=m

The next step would be to get rid of the
direct access to arch/ and mach/ directories
on some gadget controllers so that we can
build all of them without depending on their
respective ARCH_* symbols.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:11 -07:00
Sebastian Andrzej Siewior
fc0b721f27 usb: gadget: dummy_hcd: move common bits of suspend/resume into one function
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:09 -07:00
Sebastian Andrzej Siewior
4baa74fe32 usb: gadget: remove net2280_set_fifo_mode()
This function has no user in my tree. It looks like it belongs to
net2280 but it somehow morphed into the dummy_hcd. So I remove it
before it spreads into more drivers.
After some digging I figured out that the only user was removed in

|commit 9079e91b5b
|Author: David Brownell <david-b@pacbell.net>
|Date:   Wed May 7 16:00:36 2008 -0700
|
|    USB: serial gadget: cleanup/reorg

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:08 -07:00
Sebastian Andrzej Siewior
d8a14a85c7 usb: gadget: dummy_hcd: use less checks for USB_SPEED_SUPER
Taking the correct struct once avoids doing the speed dance.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:08 -07:00
Sebastian Andrzej Siewior
719e52cbc7 usb: gadget: dummy_hcd: use gadget_to_dummy_hcd() where possible
gadget_to_dummy_hcd() already does the speed check, so
it's unnecessary to unroll that all the time.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:07 -07:00
Sebastian Andrzej Siewior
99fd14080e usb: gadget: dummy_hcd: set gadget.is_otg before calling bind()
Before commit 53832daea ("usb: gadget: dummy_hcd: use the shared_hcd
infrastructure") the is_otg field was set in dummy_udc_probe(). It seems
to me that this field is used in gadget's bind function. Therefore I'm
moving it before the bind() callback is called.

Cc: Tatyana Brokhman <tlinder@codeaurora.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:07 -07:00
Sebastian Andrzej Siewior
2542787430 usb: gadget: dummy_hcd: use dummy_pullup() instead of open coding
The removed code does the same thing as dummy_pullup(). The only
difference is that in dummy_udc_stop() the first dummy_pullup()
did not call usb_hcd_poll_rh_status().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:06 -07:00
Felipe Balbi
199e7edbb1 usb: gadget: chips: remove ifdef trickery
the gadget controller number is only used
during bind() to update descriptors and/or
check that a particular controller can support
a particular gadget driver.

Because of that, we can remove the ifdef
trickery as it's a rather small optimization
anyway.

While at that, also sort the entries
alphabetically and add a comment stating we
want to keep the list ordered alphabetically.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:31:05 -07:00
Felipe Balbi
877c1f5408 usb: gadget: ci13xx_udc: fix usb_ep_enable() call
commit 72c973d (usb: gadget: add usb_endpoint_descriptor
to struct usb_ep) has introduced a compile error to
ci13xxx_udc. Fix it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:27:08 -07:00
Sebastian Andrzej Siewior
513385a3cf usb: gadget: s3c2410_udc: use platform ids instead
This also fixes the error path: If the second device fails to register
we never remove the first one.
This is compile-tested only. I don't see any difference between those
two. Maybe we should just use one name instead?

Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:27:08 -07:00
Sebastian Andrzej Siewior
86081d7be3 usb: gadget: add platform module alias where it is missing
Without it udev won't be able to load the driver once it notices the
device unbound.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:27:07 -07:00
Sebastian Andrzej Siewior
e4fe056ed3 usb: gadget: net2272: cleanup pci_register_driver() error path
In case pci_register_driver() fails it error will be 0 in case
platform_driver_register() was fine. Also without PCI
pci_register_driver() evaluates to 1 which is well, special. If
platform_driver_register() returns EINVAL or EBUSY we end up with 0.

Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:27:07 -07:00
Tatyana Brokhman
7eca4c5a8b usb: gadget: dummy_hcd: add 'is_high_speed' parameter
This patch adds a new module parameter to dummy_hcd
called is_high_speed.

When set to false the connected device will be forced
to operate in full-speed mode. By default, this parameter
is set to 'true'.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:27:06 -07:00
Tatyana Brokhman
1cd8fd2887 usb: gadget: dummy_hcd: add SuperSpeed support
This patch adds SS support to the dummy hcd module.
It may be used to test SS device when no (SS) HW is
available.

USB 3.0 hub includes 2 hubs - one HS and one SS. This
patch adds support for a SS root hub in the dummy_hcd
module.

A new module parameter was added: is_super_speed. When
set to true, a SS root hub will also be registered and
the connected device will be enumerated over the SS
root hub. The default of this parameter is false.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

[ balbi@ti.com : slight change to commit log
		 fixed one coding style issue ]

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:27:06 -07:00