Commit graph

3640 commits

Author SHA1 Message Date
Rafael J. Wysocki 3494252d56 USB/PCI: Fix resume breakage of controllers behind cardbus bridges
If a USB PCI controller is behind a cardbus bridge, we are trying to
restore its configuration registers too early, before the cardbus
bridge is operational.  To fix this, call pci_restore_state() from
usb_hcd_pci_resume() and remove usb_hcd_pci_resume_early() which is
no longer necessary (the configuration spaces of USB controllers that
are not behind cardbus bridges will be restored by the PCI PM core
with interrupts disabled anyway).

This patch fixes the regression from 2.6.28 tracked as
http://bugzilla.kernel.org/show_bug.cgi?id=12659

[ Side note: the proper long-term fix is probably to just force the
  unplug event at suspend time instead of doing a plug/unplug at resume
  time, but this patch is fine regardless  - Linus ]

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-by: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-02-17 16:56:31 -08:00
David Vrabel a3c1239eb5 wusb: whci-hcd: always lock whc->lock with interrupts disabled
Always lock whc->lock with spin_lock_irq() or spin_lock_irqsave().

Signed-off-by: David Vrabel <david.vrabel@csr.com>
2009-02-16 14:37:12 +00:00
Nick Holloway 049a6acb50 USB: Storage: Update unusual_devs entry for Datafab KECF-USB
This device suffers from the off-by-one error when reporting the capacity,
so add US_FL_FIX_CAPACITY to the existing entry.

Signed-off-by: Nick Holloway <Nick.Holloway@pyrites.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:49 -08:00
Ivan Kuten 26e1287594 USB: Correct Makefile to make isp1760 buildable
Signed-off-by: Ivan Kuten <ivan.kuten@promwad.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:49 -08:00
Dirk De Schepper c200b9c9e8 USB: option: New mobile broadband modems to be supported
- New Novatel and Dell mobile broadband modem products added
 - Dell pid variables used in stead of numerical PIDs for known
   products

Signed-off-by: Dirk De Schepper <ddeschepper@nvtl.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Matthias Urlichs <matthias@urlichs.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:48 -08:00
Oliver Neukum 97dcf0416e USB: two more usb ids for ti_usb_3410_5052
This patch adds device IDs and balances the counts to make the
hot ID additioning mechanism work.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Cc: stable <stable@kernel.org>
Cc: Chris Adams <cmadams@hiwaay.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:48 -08:00
Dan Carpenter 64905b4809 USB: ftdi_sio: unlock_kernel() on error in set_serial_info()
There was one error path where unlock_kernel() wasn't called.

This was found with a code checker (http://repo.or.cz/w/smatch.git/)
Compile tested only, sorry.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:48 -08:00
Alan Stern 506e946983 USB: usb-storage: add Pentax to the bad-vendor list
This patch (as1202) adds Pentax to usb-storage's list of bad vendors
whose devices always need the CAPACITY_HEURISTICS flag.  This is in
addition to the existing entries: Nokia, Nikon, and Motorola.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Virgo Pärna <virgo.parna@mail.ee>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:48 -08:00
Stephane Clerambault e38c287447 USB: ftdi_sio: add support for the NDI Polaris system
Add support for the NDI Polaris system *http://www.ndigital.com/).

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:48 -08:00
Dave Young 78c8fb3717 USB: usb-serial: fix the aircable_init failure path
The failure path of aircable_init is wrong, fix the order of (goto) labels.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Acked-by: Naranjo Manuel Francisco <naranjo.manuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:48 -08:00
Alan Stern 0d020aae0a USB: usb-storage: remove WARN from last-sector hacks
This patch (as1201) removes the WARN() from the last-sector hacks in
usb-storage, thereby making the code match the version now in
.27-stable and .28-stable.  The WARN() isn't needed, since there is no
longer any intention of assuming that all storage devices have an even
number of sectors, and it annoys users for no good reason.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:47 -08:00
Greg Kroah-Hartman 6b40c0057a Revert USB: option: add Pantech cards
Revert 8b6346ec89 as these devices really
work just fine with the cdc-acm driver, as they follow the spec
properly.

Thanks to Chuck Ebbert for pointing out the problem here.

Cc: Chuck Ebbert <cebbert@redhat.com>
Cc: Dan Williams <dcbw@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:47 -08:00
James Treacy 2057ac86da USB: cdc-acm.c: remove duplicate lines for MTK gps support
The same patch to add support for MTK gps loggers was submitted by two
different people and applied twice. Remove the redundant lines.

Signed-off-by: James Treacy <treacy@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:47 -08:00
Anton Vorontsov af3ddbd763 USB: fsl_qe_udc: Fix stalled TX requests bug
While disabling an endpoint the driver nuking any pending requests,
thus completing them with -ESHUTDOWN status. But the driver doesn't
clear the tx_req, which means that a next TX request (after
ep_enable), might get stalled, since the driver won't queue the new
reqests.

This patch fixes a bug I'm observing with ethernet gadget while
playing with ifconfig usb0 up/down (the up/down sequence disables
and enables `in' and `out' endpoints).

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:47 -08:00
Anton Vorontsov 82341b3690 USB: fsl_qe_udc: Fix muram corruption by disabled endpoints
Before freeing an endpoint's muram memory, we should stop all activity
of the endpoint, otherwise the QE UDC controller might do nasty things
with the muram memory that isn't belong to that endpoint anymore.

The qe_ep_reset() effectively flushes the hardware fifos, finishes all
late transaction and thus prevents the corruption.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:47 -08:00
Anton Vorontsov ef84e4055f USB: fsl_qe_udc: Fix disconnects reporting during bus reset
Freescale QE UDC controllers can't report the "port change" states,
so the only way to handle disconnects is to process bus reset
interrupts. The bus reset can take some time, that is, few irqs.
Gadgets may print the disconnection events, and this causes few
repetitive messages in the kernel log.

This patch fixes the issue by using the usb_state machine, if the
usb controller has been already reset, just quit the reset irq
early.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:47 -08:00
Anton Vorontsov 2247818a32 USB: fsl_qe_udc: Fix QE USB controller initialization
qe_udc_reg_init() leaves the USB controller enabled before muram memory
initialized. Sometimes the uninitialized muram memory confuses the
controller, and it start sending the busy interrupts.

Fix this by disabling the controller, it will be enabled later by
the gadget driver, at bind time.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:47 -08:00
Anton Vorontsov a30551db66 USB: fsl_qe_udc: Fix recursive locking bug in ch9getstatus()
The call chain is this:

qe_udc_irq() <- grabs the udc->lock spinlock
rx_irq()
qe_ep0_rx()
ep0_setup_handle()
setup_received_handle()
ch9getstatus()
qe_ep_queue() <- tries to grab the udc->lock again

It seems unsafe to temporarily drop the lock in the ch9getstatus(),
so to fix that bug the lock-less __qe_ep_queue() function
implemented and used by the ch9getstatus().

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:46 -08:00
Anton Vorontsov 94f341db3d USB: fsl_qe_udc: Fix oops on QE UDC probe failure
In case of probing errors the driver kfrees the udc_controller, but it
doesn't set the pointer to NULL.

When usb_gadget_register_driver is called, it checks for udc_controller
!= NULL, the check passes and the driver accesses nonexistent memory.
Fix this by setting udc_controller to NULL in case of errors.

While at it, also implement irq_of_parse_and_map()'s failure and cleanup
cases.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-02-09 11:19:46 -08:00
David Vrabel 8f04915532 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-upstream 2009-02-02 17:52:39 +00:00
Anton Vorontsov 236dd4d18f USB: Driver for Freescale QUICC Engine USB Host Controller
This patch adds support for the FHCI USB controller, as found
in the Freescale MPC836x and MPC832x processors. It can support
Full or Low speed modes.

Quite a lot the hardware is doing by itself (SOF generation, CRC
generation and checking), though scheduling and retransmission is on
software's shoulders.

This controller does not integrate the root hub, so this driver also
fakes one-port hub. External hub is required to support more than
one device.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:38 -08:00
Alex.Cheng@quantatw.com fc91be2ad0 USB: option: add QUANTA HSDPA Data Card device ids
This patch adds the support  for the QUANTA Q101 series HSDPA Data Card.
With the vendor and product IDs are set properly,
the data card can be detected and works fine.

Signed-off-by: Alex Cheng <alex.cheng@quantatw.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:37 -08:00
Phil Dibowitz aa23c8d616 USB: storage: Add another unusual_dev for off-by-one bug
Argosy has released another device with the off-by-one sector. This is a
harddrive with an internal cardreader which is affected.

Based on a patch written by Martijn Hijdra <martijn.hijdra@gmail.com>

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Cc: Martijn Hijdra <martijn.hijdra@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:37 -08:00
Phil Dibowitz a83775b146 USB: unusual_dev: usb-storage needs to ignore a device
This patch adds an unusual_devs entry for a Sony Ericsson modem. Like many
other modems, we have to ignore the storage device in order to access the
modem.


At this time usb_modeswitch does not work with this device.


Reported-by: The Solutor <thesolutor@gmail.com>.
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:37 -08:00
Roel Kluin 0df2479232 USB: GADGET: fix !x & y
! has a higher precedence than &

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:37 -08:00
Oliver Neukum 1a1fab5137 USB: new id for ti_usb_3410_5052 driver
This adds a new device id

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:37 -08:00
Alan Cox c89c60e9d6 USB: cdc-acm: Add another conexant modem to the quirks
Another Conexant, another device with the same quirk

Signed-off-by: Alan Cox <alan@redhat.com>
Acked-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:37 -08:00
Marcel Sebek 3b498a66a6 USB: 'option' driver - onda device MT503HS has wrong id
While trying to make GSM modem Onda MT503HS working, I found a mismatch
between device id in the driver code (0x0200) and id in the lsusb
output (0x2000).

This patch fixed it for me, but I don't know if the original device id was
also correct and the new ID should be added instead of replacing the
old one.


Signed-off-by: Marcel Sebek <sebek64@post.cz>
Acked-by: Domenico Riccio <domenico.riccio@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:36 -08:00
Phil Dibowitz d547f13472 USB: Remove ZTE modem from unusual_devices
The ZTE modem entry causes usb-storage to ignore the device, but for some
versions of the device, usb-storage mode is required to get to modem ode. For
both kinds the tool: http://www.draisberghof.de/usb_modeswitch/ should work.

Note that the various versions of the device have the same ProductId,
VendorId, and bcdDevice number, so we cannot have the entry for some and not
others.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:36 -08:00
Jean-Baptiste Onofre 649150926b USB: storage: support of Dane-Elec MediaTouch USB device
This adds another unusual_devs.h entry for a device that can't handle more
than 64k reads/writes in a single command.

Signed-off-by: Jean-Baptiste Onofre <jb@nanthrax.net>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:36 -08:00
Pete Zaitcev 7abce6bedc USB: usbmon: Implement compat_ioctl
Running a 32-bit usbmon(8) on 2.6.28-rc9 produces the following:
ioctl32(usbmon:28563): Unknown cmd fd(3) cmd(400c9206){t:ffffff92;sz:12} arg(ffd3f458) on /dev/usbmon0

It happens because the compatibility mode was implemented for 2.6.18
and not updated for the fsops.compat_ioctl API.

This patch relocates the pieces from under #ifdef CONFIG_COMPAT into
compat_ioctl with no other changes except one new whitespace.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:36 -08:00
Mhayk Whandson ca80801bfb USB: ftdi_sio driver support of bar code scanner from Diebold
Added the product id of bcs(bar code scanner) from Diebold Procomp Brazil.

Signed-off-by: Mhayk Whandson <eu@mhayk.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:36 -08:00
Robie Basak 45eeff848b USB: ftdi_sio: added Alti-2 VID and Neptune 3 PID
This patch adds the vendor and product ID for the Alti-2 Neptune 3
(http://www.alti-2.com) which uses the FTDI chip.

Signed-off-by: Robie Basak <rb-oss-1@justgohome.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:36 -08:00
Tomasz K 877e262c4e USB: cp2101 device
My girl use modem GSM (EDGE) Commanader 2 on iPlus Polsih provider,

PLEASE add this vendor=0x10C4 and product=0x822B to USB serial driver cp2101.c

From: Tomasz K <eros81@o2.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:36 -08:00
Brandon Philips 06a743bfc4 USB: usblp.c: add USBLP_QUIRK_BIDIR to Brother HL-1440
My Brother HL-1440 would print one document before CUPS would stop
printing with the error "Printer not connected; will retry in 30
seconds...". I traced this down to the CUPS usb backend getting an EIO
out of usblp on the IOCNR_GET_DEVICE_ID IOCTL. Adding the
USBLP_QUIRK_BIDIR fixes the problem but is it the right solution?

output from strace /usr/lib/cups/backend/usb after printing a document
(Note: SNDCTL_DSP_SYNC == IOCNR_GET_DEVICE_ID):

before patch

open("/dev/usb/lp0", O_RDWR|O_EXCL)     = 3
ioctl(3, SNDCTL_DSP_SYNC, 0x7fff2478cef0) = -1 EIO (Input/output error)

after patch

open("/dev/usb/lp0", O_RDWR|O_EXCL)     = 3
ioctl(3, SNDCTL_DSP_SYNC, 0x7fffb8d474c0) = 0

Possibly related bug: https://bugs.launchpad.net/ubuntu/+source/cupsys/+bug/35638

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:36 -08:00
sware 296361ec3a USB: remove vernier labpro from ldusb
Labpro device is in both ldusb and vstusb device tables.
Should only be a vstusb device.

Signed-off-by: stephen ware <stephen.ware@eqware.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:36 -08:00
Andrew Lunn 0f9c7b4a1c USB: CDC-ACM quirk for MTK GPS
This patch adds a device quirk for a MediaTek Inc GPS chipset. The
device implements USB CDC ACM, but is missing the union descriptor, so
the ACM class driver fails to probe the device.

I've tested this patch with an iBlue A+ GPS which uses this chipset
and using kernel 2.6.28-rc9.

Signed-off-by: Andrew Lunn, <andrew@lunn.ch>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:36 -08:00
James A. Treacy 837d842496 USB: cdc-acm: support some gps data loggers
Below is a patch which allows a number of GPS loggers to work
under linux. It is known to support the i-Blue 747 (all models),
i-Blue 757, Qstarz BT-Q1000, i.Trek Z1, Konet BGL-32, and the Holux
M-241.

From: James A. Treacy <treacy@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:36 -08:00
Bryan Wu 08889517b3 USB: composite: Fix bug: low byte of w_index is the usb interface number not the whole 2 bytes of w_index
In some usb gadget driver, for example usb audio class device, the high
byte of w_index is the entity id and low byte is the interface number.
If we use the 2 bytes of w_index as the array number, we will get a
wrong pointer or NULL pointer.

This patch fixes this issue.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:35 -08:00
Bryan Wu dd4dff8b03 USB: composite: Fix bug: should test set_alt function pointer before use it
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:35 -08:00
David Brownell cd67435ef9 USB: musb: Kconfig fix
The Blackfin MUSB Kconfig text didn't properly parenthesise its
dependencies.  This was visible in non-Blackfin configs by the
way the user interfaces lost track of dependencies, when doing
a bunch of test builds.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:35 -08:00
Swaminathan S 191b776616 USB: musb cppi dma fix
Initializes the actual_len field to 0 before every DMA transaction.

Signed-off-by: Swaminathan S <swami.iyer@ti.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:35 -08:00
Hugo Villeneuve 704a14854a USB: musb cppi bugfixes
These compilation errors are related to incorrect
debugging macro and variable names and generated the
following errors:

  drivers/usb/musb/cppi_dma.c:437:5: warning: "MUSB_DEBUG" is not defined
  drivers/usb/musb/cppi_dma.c: In function 'cppi_next_rx_segment':
  drivers/usb/musb/cppi_dma.c:884: error: 'debug' undeclared (first use in this function)

Signed-off-by: Hugo Villeneuve <hugo@hugovil.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:35 -08:00
Julia Lawall 96bcd090fa USB: musb uses endpoint functions
This set of patches introduces calls to the following set of functions:

usb_endpoint_dir_in(epd)
usb_endpoint_dir_out(epd)
usb_endpoint_is_bulk_in(epd)
usb_endpoint_is_bulk_out(epd)
usb_endpoint_is_int_in(epd)
usb_endpoint_is_int_out(epd)
usb_endpoint_num(epd)
usb_endpoint_type(epd)
usb_endpoint_xfer_bulk(epd)
usb_endpoint_xfer_control(epd)
usb_endpoint_xfer_int(epd)
usb_endpoint_xfer_isoc(epd)

In some cases, introducing one of these functions is not possible, and it
just replaces an explicit integer value by one of the following constants:

USB_ENDPOINT_XFER_BULK
USB_ENDPOINT_XFER_CONTROL
USB_ENDPOINT_XFER_INT
USB_ENDPOINT_XFER_ISOC

An extract of the semantic patch that makes these changes is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r1@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) ==
- \(USB_ENDPOINT_XFER_CONTROL\|0\))
+ usb_endpoint_xfer_control(epd)

@r5@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
-  \(USB_DIR_IN\|0x80\))
+ usb_endpoint_dir_in(epd)

@inc@
@@

#include <linux/usb.h>

@depends on !inc && (r1||r5)@
@@

+ #include <linux/usb.h>
  #include <linux/usb/...>
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:34 -08:00
Kalle Valo af7e0c5f12 USB: musb: tusb6010 buildfix
drivers/usb/musb/tusb6010_omap.c:18:26: error: asm/arch/dma.h:
  No such file or directory
drivers/usb/musb/tusb6010_omap.c:19:26: error: asm/arch/mux.h:
  No such file or directory

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:33 -08:00
Ajay Kumar Gupta 97a3989681 USB: musb free_irq bugfix
Fixes insert module failure as free_irq() was not
done in previous rmmod.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:33 -08:00
David Brownell 37daa925cf USB: musb_hdrc: another davinci buildfix (otg related)
The DaVinci code had an implementation of the OTG transceiver glue
too; make it use the new-standard one.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:32 -08:00
David Brownell 10b4eadef1 USB: musb davinci buildfix
Trying once more to get this merged.  The original was submitted
for 2.6.27-rc2 or so, and never got correctly merged.  Neither
were any of the numerous subsequent resends.  Sigh.

  CC      drivers/usb/musb/davinci.o
drivers/usb/musb/davinci.c:35:32: error: mach/arch/hardware.h: No such file or directory
drivers/usb/musb/davinci.c:36:30: error: mach/arch/memory.h: No such file or directory
drivers/usb/musb/davinci.c:37:28: error: mach/arch/gpio.h: No such file or directory
drivers/usb/musb/davinci.c:373: error: redefinition of 'musb_platform_set_mode'
drivers/usb/musb/davinci.c:368: error: previous definition of 'musb_platform_set_mode' was here

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:32 -08:00
David Brownell 2bf5fa13fc USB: omap1 ohci buildfix (otg related)
> > drivers/built-in.o: In function `ohci_omap_init':
 > > hid-quirks.c:(.text+0x6c608): undefined reference to `otg_get_transceiver'
 > > drivers/built-in.o: In function `omap_udc_probe':
 > > hid-quirks.c:(.init.text+0x34c0): undefined reference to `otg_get_transceiver'
 > > hid-quirks.c:(.init.text+0x3d40): undefined reference to `otg_put_transceiver'

Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-27 16:15:32 -08:00
Alan Stern 501950d846 USB: fix char-device disconnect handling
This patch (as1198) fixes a conceptual bug: Somewhere along the line
we managed to confuse USB class devices with USB char devices.  As a
result, the code to send a disconnect signal to userspace would not be
built if both CONFIG_USB_DEVICE_CLASS and CONFIG_USB_DEVICEFS were
disabled.

The usb_fs_classdev_common_remove() routine has been renamed to
usbdev_remove() and it is now called whenever any USB device is
removed, not just when a class device is unregistered.  The notifier
registration and unregistration calls are no longer conditionally
compiled.  And since the common removal code will always be called as
part of the char device interface, there's no need to call it again as
part of the usbfs interface; thus the invocation of
usb_fs_classdev_common_remove() has been taken out of
usbfs_remove_device().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Alon Bar-Lev <alon.barlev@gmail.com>
Tested-by: Alon Bar-Lev <alon.barlev@gmail.com>
Cc: stable <stable@kernel.org>
2009-01-27 16:15:32 -08:00