dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

353 Commits

Author SHA1 Message Date
Li Yang 185e3dead3 USB: fsl_usb2_udc: fix recursive lock
UDC needs to release lock before calling out to gadget driver, since
it may need to reenter.  The change fixes kernel BUG observed on rt
kernel.

> kernel BUG at kernel/rtmutex.c:683!
> stopped custom tracer.
> Oops: Exception in kernel mode, sig: 5 [#1]
> PREEMPT MPC834x ITX
> NIP: c021629c LR: c0216270 CTR: 00000000
> REGS: df761d70 TRAP: 0700   Not tainted  (2.6.23.9-rt13)
> MSR: 00021032 <ME,IR,DR>  CR: 28000022  XER: 00000000
> TASK = df632080[241] 'IRQ-38' THREAD: df760000
> GPR00: 00000001 df761e20 df632080 00000000 11111111 00000000 df761e6c
> 00000000
> GPR08: df761e48 00000000 df761e50 00000000 80000000 ede5cdde 1fffd000
> 00800000
> GPR16: ffffffff 00000000 007fff00 00000040 00000000 007ffeb0 00000000
> 1fff8b08
> GPR24: 00000000 00000026 00000000 df79a320 c026b2e8 c02240bc 00009032
> df79a320
> NIP [c021629c] rt_spin_lock_slowlock+0x9c/0x200
> LR [c0216270] rt_spin_lock_slowlock+0x70/0x200
> Call Trace:
> [df761e20] [c0216270] rt_spin_lock_slowlock+0x70/0x200 (unreliable)
> [df761e90] [c0182828] fsl_ep_disable+0xcc/0x154
> [df761eb0] [c0184d30] eth_reset_config+0x88/0x1d0
> [df761ed0] [c0184ec0] eth_disconnect+0x48/0x64
> [df761ef0] [c01831a4] reset_queues+0x60/0x78
> [df761f00] [c0183b74] fsl_udc_irq+0x9b8/0xa58
> [df761f50] [c003ef30] handle_IRQ_event+0x64/0x100
> [df761f80] [c003f758] thread_simple_irq+0x6c/0xc8
> [df761fa0] [c003f888] do_irqd+0xd4/0x2e4
> [df761fd0] [c0032284] kthread+0x50/0x8c
> [df761ff0] [c000f9b4] kernel_thread+0x44/0x60

Signed-off-by: Li Yang <leoli@freescale.com>
Cc: Eugene T. Bordenkircher <Eugene_Bordenkircher@selinc.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-29 13:59:06 -07:00
karl beldan 3f88662074 USB: pxa27x_udc - Fix Oops
udc_disable oopses dereferencing udc_command.

Signed-off-by: Karl Beldan <karl.beldan@gmail.com>
Acked-by: Robert Jarzmik <rjarzmik@free.fr>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-20 14:14:14 -07:00
David Brownell 4051770706 USB: atmel_usba_udc fixes, mostly disconnect()
Various fixes to Atmel's high speed UDC driver.

  * Issue some missing disconnect() calls.  Currently they are only made
    when VBUS power goes away (on boards where the driver can sense such
    changes), but that's not enough for gadget drivers to clean out all
    the state that's needed.  Missing calls were:

      - After USB reset, before starting enumeration.
      - When unregistering a gadget driver, before unbind().

  * Don't assume gadget drivers provide disconnect callbacks; make sure
    to not call through a null pointer!

  * When the driver doesn't provide an unbind() callback, refuse to
    unregister it.

Also remove two bogus "error" messages:

  * Related to mis-handling of disconnect() ... don't emit error messages
    for disconnect() handlers that disable endpoints.  All of them should
    be doing that; the problem is (unfixed) oddness in atmel_usba_udc.

  * Don't emit a diagnostic for a curious and transient nonfatal error
    that shows up sometimes with EP0.

Those messages spammed syslog, for no good reason.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-14 10:00:30 -07:00
Robert Jarzmik 5a59bc544d USB: pxa27x_udc: minor fixes
Minor fixes to pxa27x udc driver :
 - don't clobber driver model bus_id field
 - wrong endianess fix (no functional change; cpu is little-endian)
 - double udc disable fix
 - resume/suspend fix (OTG hold bit)
 - make driver pxa27x dependant (check cpu at runtime)

Signed-off-by: Robert Jarzmik <rjarzmik@free.fr>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-14 10:00:29 -07:00
David Brownell b9370332f4 USB: serial gadget: descriptor cleanup
Bugfix some serial gadget descriptors:

 - Stop mangling the low bits (controller type ID) of bcdDevice;
   just use the high bits for a driver revision code.

 - Serial numbers that aren't specific to individual devices
   are useless; stop reporting "0" for this.

 - Since it's not part of a CDC-conformant function, the "bulk only"
   configuration shouldn't be using "CDC Data" as its interface class.
   Switch over to using CLASS_VENDOR_SPEC (different value, 0xff).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Al Borchers <alborchers@steinerpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-14 10:00:28 -07:00
David Brownell 734d37c654 USB: serial gadget: simplify endpoint handling
Switch serial gadget away from a *very* old idiom:  just remember
the endpoints we'll be using, instead of looking them up by name
each time.  This is a net code and data (globals) shrink.

Also fix a small memory leak in the rmmod path, by working the
same as the disconnect code.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Al Borchers <alborchers@steinerpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-14 10:00:28 -07:00
David Brownell 2c2d28a015 USB: serial gadget: remove needless data structure
This removes a needless data structure from the serial gadget code;
it's a small code shrink, and a larger data shrink.

Since "struct usb_request" already has a "struct list_head" reserved
for use by gadget drivers, the serial gadget code doesn't need to
allocate wrapper structs to hold that list ... it can (and should!)
just use the list_head provided for that exact use.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Al Borchers <alborchers@steinerpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-14 10:00:28 -07:00
David Brownell 9079e91b5b USB: serial gadget: cleanup/reorg
Some cleanup/reorg of g_serial ... simplifying it, and disentangling
its structure so morphing it into a "function" driver (combinable with
other interfaces) should be less painful.

 - Remove most forward declarations
     * put tty and gadget driver structs after their contents
     * snug module init/exit decls next to their functions
     * reordered some functions

 - Other cleanup:
     * convert a funky macro to an inline function
     * snug up module params next to their declarations
     * add missing driver.owner
     * add separator lines between major driver sections

 - Add comments re potential parameter/#define changes:
     * only supports one port (shrank GS_NUM_PORTS)
     * changing from 9600-8-N-1 affects multiple sites

 - Remove net2280-specific optimization ... it was being done
   way too late, can be done by net2280 module options, and in
   any case doesn't matter at any sane serial data rates.

There are no behavioral changes, but the macro thing saves I-space.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Al Borchers <alborchers@steinerpoint.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-14 10:00:28 -07:00
Harvey Harrison af3d305ca7 usb: fix integer as NULL pointer warnings found by sparse
drivers/usb/host/ohci-sm501.c:93:24: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3254:9: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3267:9: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3277:9: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3285:9: warning: Using plain integer as NULL pointer
drivers/usb/gadget/amd5536udc.c:3293:9: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-14 10:00:26 -07:00
David Lopo 62fd2cac5b USB GADGET/PERIPHERAL: g_file_storage Bulk-Only Transport compliance, clear-feature ignore
Gadget tells controller driver to ignore Clear-Feature(HALT_ENDPOINT)

Signed-off-by: David Lopo <lopo.david@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
2008-05-02 10:25:58 -07:00
David Lopo 7a6ad1dd86 usb: gadget zero timer init fix
Initialize timer earlier so if an error occurs allocating USB request
or buffer request (zero_bind) Gadget Zero will not hang trying to
delete an uninitialized timer (zero_unbind).

Signed-off-by: David Lopo <lopo.david@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-02 10:25:54 -07:00
David Brownell 7472f38b10 usb: gadget zero style fixups (mostly whitespace)
Minor updates to "Gadget Zero".

 - Primarily these are whitespace updates to address the fact that since
   this was written, Documentation/CodingStyle was changed to disapprove
   of parts of the original coding style.

 - Update a few comments that weren't quite correct, notably mentioning
   the "autoresume" module parameter.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-02 10:25:54 -07:00
David Brownell f371e750c9 usb serial gadget: CDC ACM fixes
Based on a patch from <Aurel.Thomi@ruag.com>, this makes the
CDC-ACM support in the serial gadget handle the SET_LINE_CODING
and SET_CONTROL_LINE_STATE requests ... which should improve
interop with at least MS-Windows "usbser.sys" if not some other
ACM host drivers.

It also adds a few REVISIT comments where this code plays a bit
loose with the CDC ACM spec.  If this were used to hook up to a
real RS232 or modem link, those places would need a bit of work.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-02 10:25:53 -07:00
Robert Jarzmik d75379a538 usb: pxa27x_udc driver
Adds pxa27x udc driver to support USB peripherals on pxa27x chips.

The driver is compatible with: Gadget Zero, the File Storage
gadget, and the Ethernet gadget (only in CDC subset mode).

The driver can't properly support multiple interfaces, because
of hardware bugs without possible workaround.  That means no
RNDIS support from g_ether, and no CDC ACM support in g_serial.

Signed-off-by: Robert Jarzmik <rjarzmik@free.fr>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-02 10:25:53 -07:00
Alan Cox 4cd55ab1f9 usb gadget: switch to put_char returning int
Signed-off-by: Alan Cox <alan@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-30 08:29:45 -07:00
Harvey Harrison a5abdeafed usb: use get/put_unaligned_* helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:28 -07:00
Denis V. Lunev cdefa185dd usb: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:21 -07:00
Al Viro fd05e72009 drivers/usb annotations and fixes
* endianness annotations
* endianness fixes
* missing get_unaligned/put_unaligned

It's pretty much all over the place, changes to different files are independent.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Serial-parts-Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-28 10:03:31 -07:00
Harvey Harrison 441b62c1ed USB: replace remaining __FUNCTION__ occurrences
__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:55 -07:00
Alan Stern b950bdbc67 USB: g_file_storage: ignore bulk-out data after invalid CBW
This patch (as1061) makes g_file_storage more compliant with the
Bulk-Only Transport specification.  After an invalid CBW is received,
the gadget must ignore any further bulk-OUT data until it is reset.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:52 -07:00
David Brownell 3cf2723432 USB: at91_udc can prefetch data
The at91sam9 chip are ARMv5 so they support preload instructions.
Use preloading to load the FIFO a bit faster.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:49 -07:00
Alan Stern a89a2cd396 USB: dummy-hcd: use dynamic allocation for platform_devices
This patch (as1075) changes dummy-hcd to dynamically allocate its
platform_device structures, using the core platform_device_alloc()
interface.  This is what it should have done all along, because the
dynamically-allocated structures have a release method in the driver
core and are therefore immune to being released after the module has
been unloaded.

Thanks to Richard Purdie for pointing out the need for this change.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:49 -07:00
David Brownell 0e530b4578 USB: gadget section fixes
Restore some section annotations:  they were switched to "__devinit"
while they should have been "__init", because of bogus warnings.  The
warnings are now fixed, so the runtime footprint of various drivers
can now shrink a bit.  On ARMv5, it's about 600 bytes except for the
Ethernet gadget, where it can save a bit more.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:48 -07:00
Ingo van Lil 9063ff44f0 USB: gadget: dummy_hcd.c: fix nested switch statements
Fix a messed up combination of two nested switch statements in
drivers/usb/gadget/dummy_hcd.c.

According to the USB spec (section 5.8.3) the maximum packet size for bulk
endpoints can be 512 for high-speed devices and 8, 16, 32 or 64 for full-speed
devices.  Low-speed devices must not have bulk endpoints.

Signed-off-by: Ingo van Lil <inguin@gmx.de>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:47 -07:00
Jesper Juhl 73d79aaba9 USB: mem leak fixes for AMD 5536 UDC high/full speed USB device controller driver
In drivers/usb/gadget/amd5536udc.c::udc_pci_probe(), sizeof(struct udc)
storage is allocated for 'dev'.

There are many exit points from the function where 'dev' is not free'd but has
also not yet been used for anything.  The following patch free's 'dev' at the
return points where it has not yet been used.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:47 -07:00
Craig W. Nadler cc901bbb2e USB: g_printer bugfixes
G_PRINTER: Bug fix for blocking reads and a fix for a memory leak.

This fixes bugs in blocking IO calls. When the poll() entry point
is called receive transfers will be setup if they have not already
been. Another bug fix is that the poll() entry point now checks the
current receive buffer for data when reporting if any data had been
received. A memory leak was fixed that could have occurred when a
USB reset happened.

Signed-off-by: Craig W. Nadler <craig@nadler.us>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:45 -07:00
Robert P. J. Day afd0e0f2d4 USB: Remove EXPERIMENTAL tags from some USB gadget Kconfig entries.
Based on a recent discussion on the Linux USB mailing list, remove the
designation of EXPERIMENTAL from some USB gadget entries, and tag some
of them as DEVELOPMENT.

just for fun, i added a bit of help for gadgetfs, explaining the
race condition.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
2008-04-24 21:16:42 -07:00
Alan Stern 70a1c9e086 USB: remove dev->power.power_state
power.power_state is scheduled for removal.  This patch (as1053)
removes all uses of that field from drivers/usb.  Almost all of them
were write-only, the most significant exceptions being sl811-hcd.c and
u132-hcd.c.

Part of this patch was written by Pavel Machek.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:41 -07:00
Savin Zlobec 4208978ec4 USB: gadget: Hangup tty on g_serial disconnect
On USB cable disconnect g_serial doesn't hangup the port tty,
which results in an endless read on the tty device. With the
following patch the read and select behave correctly when
the cable is unplugged.

Tested on at91rm9200

Signed-off-by: Savin Zlobec <savin@epiko.si>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:35 -07:00
Paul Mundt 96f9bc373c USB: m66592-udc: reduce size of data structure.
Poking around with pahole, we see that m66592 handily shoves a u16 in
between larger types on 2 separate occasions leaving us with 2 2-byte
holes:

struct m66592 {
	...

	/* size: 1196, cachelines: 38 */
	/* sum members: 1192, holes: 2, sum holes: 4 */
	/* last cacheline: 12 bytes */
};	/* definitions: 1 */

Pairing them gets back 4-bytes:

struct m66592 {
	...

	/* size: 1192, cachelines: 38 */
	/* last cacheline: 8 bytes */
};	/* definitions: 1 */

Unfortunately it's not enough to save a cacheline with this massive
structure, but every byte helps.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24 21:16:35 -07:00
Haavard Skinnemoen e1c25dc638 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/usba-2.6.26 into base 2008-04-19 20:38:41 -04:00
Kay Sievers f34c32f13c usb gadget: fix platform driver hotplug/coldplug
Since 43cc71eed1, the platform modalias is
prefixed with "platform:".  Add MODULE_ALIAS() to the hotpluggable usb
peripheral drivers, to re-eable module auto loading.

[dbrownell@users.sourceforge.net: registration fixes]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-11 08:06:43 -07:00
Stelian Pop 16a45bc82e atmel_usba_udc: Add support for AT91CAP9 UDPHS
This patch is part of the series adding support for the USB High
Speed Device Port on the AT91CAP9 system on chip. The AT91CAP9
uses the same UDPHS IP as the AVR32 and the AT91SAM9RL.

The only differences between the AVR32 and the AT91 version of the
device are in the enable/disable and suspend/wakeup sequences: the
AT91 version needs to toggle the USB bias and pulldown explicitly.

Signed-off-by: Stelian Pop <stelian@popies.net>
Acked-by: Andrew Victor <linux@maxim.org.za>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-04-06 17:25:06 -04:00
Stelian Pop 5275653fa1 atmel_usba_udc: Add missing kfree() in usba_udc_remove()
Signed-off-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-04-06 17:21:17 -04:00
Stelian Pop 8d855317fc atmel_usba_udc: move endpoint declarations into platform data.
The atmel_usba_udc driver is being used by several platforms and arches
(avr32 and at91 ATM), and each platform may have different endpoint
settings.

The patch below moves the endpoint declarations into the platform
data and make the necessary adjustments for AVR32 (improved by
Haavard Skinnemoen <hskinnemoen@atmel.com>).

Signed-off-by: Stelian Pop <stelian@popies.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-04-06 17:15:08 -04:00
Stelian Pop 8d12c32c19 atmel_usba_udc: Kill GPIO_PIN_NONE
GPIO_PIN_NONE should no longer be used. Replace it with a simple
test against negative values.

This is a transitional patch, waiting for gpio_is_valid() to be
merged at which point the tests should be revisited.

Signed-off-by: Stelian Pop <stelian@popies.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-04-06 17:15:07 -04:00
Stelian Pop 7a242471af atmel_usba_udc: Fix endpoint names.
The endpoints of the atmel_usba_udc driver do not have directional
(in/out) or usage (ctrl/bulk/iso) restrictions, as their names
incorrectly implied.

Signed-off-by: Stelian Pop <stelian@popies.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2008-04-06 17:15:07 -04:00
Haavard Skinnemoen 5d4c2707cf atmel_usba: Kill copy_to_fifo() and copy_from_fifo()
These functions do exactly the same as memcpy_toio() and
memcpy_fromio() respectively.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
2008-04-06 17:15:07 -04:00
Roy Hashimoto 12cd5b984f USB: fix gadgetfs class request delegation
gadgetfs (drivers/usb/gadget/inode.c) was not delegating all
non-device requests to userspace.  This patch makes the handling of
all request cases consistent.

Signed-off-by: Roy Hashimoto <hashimot@alumni.caltech.edu>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-03-24 22:26:14 -07:00
Li Yang 33635efafe USB: fsl_usb2_udc: fix broken Kconfig
The patch fixes broken Kconfig caused by the name change of MPC834x option.
It also makes fsl_usb2_udc selectable on new platforms like MPC837x.

Signed-off-by: Li Yang <leoli@freescale.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-03-10 16:42:26 -07:00
Tony Jones 3503510064 USB: remove incorrect struct class_device from the printer gadget
This field does nothing, and should not be allowed to stick around
incase someone gets any other ideas...

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-03-04 14:57:44 -08:00
Dmitry Baryshkov 64cc2dd937 USB: pxa2xx_udc: fix misuse of clock enable/disable calls
Fix pxa2xx_udc to balance calls to clk_enable/clk_disable.

[db: remove inline #ifdefs for IXP non-support of <linux/clk.h> calls]

Signed-off-by: Dmitry Baryshkov dbaryshkov@gmail.com
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-03-04 14:57:44 -08:00
Jan Altenberg 41566bcf35 USB: gadget: queue usb USB_CDC_GET_ENCAPSULATED_RESPONSE message
commit 0cf4f2de0a introduced a bug, which
prevents sending an USB_CDC_GET_ENCAPSULATED_RESPONSE message. This
breaks the RNDIS initialization (especially / only Windoze machines
dislike this behavior...).

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
Signed-off-by: Jan Altenberg <jan.altenberg@linutronix.de>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-21 15:38:52 -08:00
Adrian Bunk efa66f14e2 USB: g_printer, fix empty if statement
A bug every C programmer makes at some point in time...

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Craig W. Nadler <craig@nadler.us>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-21 15:38:50 -08:00
Jan Blunck cf28b4863f d_path: Make d_path() use a struct path
d_path() is used on a <dentry,vfsmount> pair.  Lets use a struct path to
reflect this.

[akpm@linux-foundation.org: fix build in mm/memory.c]
Signed-off-by: Jan Blunck <jblunck@suse.de>
Acked-by: Bryan Wu <bryan.wu@analog.com>
Acked-by: Christoph Hellwig <hch@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Neil Brown <neilb@suse.de>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-14 21:17:09 -08:00
David Howells 62fb44b962 usb: net2280 can't have a function called show_registers()
net2280 can't have a function called show_registers() because this can produce
a namespace clash with an arch function of the same name.

All this driver's functions and variables should really be prefixed with
"net2280_" to avoid such a problem in future.

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Greg KH <greg@kroah.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 09:22:30 -08:00
Denis Cheng b75be4abf1 USB: Use menuconfig objects
commit 04d06ad0f1 have added menuconfig support
for the whole USB Kconfig, but there are still menuconfig need for usb/serial,
usb/atm, and usb/gadget, so that the user can disable all the options in that
menu at once instead of having to disable each option separately.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 14:35:06 -08:00
Dmitry Baryshkov 040fa1b962 USB: pxa2xx_udc: use debugfs not procfs
Use debugfs instead of /proc/driver/udc

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 14:35:01 -08:00
David Brownell f3db6e8203 USB: at91_udc uses generic GPIO calls; minor cleanup
Various small at91_udc cleanups:

 - Use generic GPIO calls, not older platform-specific ones
 - Use gpio_request()/gpio_free()
 - Use VERBOSE_DEBUG convention, not older VERBOSE
 - Fix sparse complaint about parameter type (changed to gfp_t)
 - Add missing newline to some rarely-seen debug messages
 - Fix some old cleanup bugs on probe() fault paths

Also add a mechanism whereby rm9200 gpios can drive the D+ pullup
through an inverting transistor, based on a patch from Steve Birtles.
Most UDC drivers supporting a GPIO based pullup should probably have
such an option, but testing it requries such a board in hand!

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Steve Birtles <arm_kernel_development@micromark.net.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 14:35:01 -08:00
David Brownell 1440e0967d USB: gadget: at91_udc minor fix (there is no number six)
Fix a small glitch noted by Yannick Cote.  There is no endpoint number
six, so if a (broken) host wrongly tried to change or read status of
that endpoint, the driver could access reserved register space.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Yannick Cote <yanick@yanos.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 14:34:59 -08:00