]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
15 years agoUSB: make actual_length in struct urb field u32
Greg Kroah-Hartman [Sat, 7 Mar 2009 05:31:03 +0000 (21:31 -0800)]
USB: make actual_length in struct urb field u32

actual_length should also be a u32 and not a signed value.  This patch
changes this field to be 'u32' to prevent any potential negative
conversion and comparison errors.

This triggered a few compiler warning messages when these fields were
being used with the min macro, so they have also been fixed up in this
patch.

Cc: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: make transfer_buffer_lengths in struct urb field u32
Greg Kroah-Hartman [Wed, 4 Mar 2009 00:44:13 +0000 (16:44 -0800)]
USB: make transfer_buffer_lengths in struct urb field u32

Roel Kluin pointed out that transfer_buffer_lengths in struct urb was
declared as an 'int'.  This patch changes this field to be 'u32' to
prevent any potential negative conversion and comparison errors.

This triggered a few compiler warning messages when these fields were
being used with the min macro, so they have also been fixed up in this
patch.

Cc: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: uhci: don't use pseudo negative values
Alan Stern [Thu, 5 Mar 2009 16:01:11 +0000 (11:01 -0500)]
USB: uhci: don't use pseudo negative values

The code in uhci-q.c doesn't have to use pseudo-negative values.  I did
it that way because it was easy and because it would give the expected
output during debugging.  But it doesn't have to work that way.  Here's
another approach.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: TWL: disable VUSB regulators when cable unplugged
Jouni Hogander [Fri, 20 Feb 2009 12:02:31 +0000 (14:02 +0200)]
USB: TWL: disable VUSB regulators when cable unplugged

This patch disables USB regulators VUSB1V5, VUSB1V8, and VUSB3V1
when the USB cable is unplugged to reduce power consumption.
Added a depencency from twl4030 usb driver to TWL_REGULATOR.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@digia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: usbmon: Add binary API v1
Pete Zaitcev [Fri, 20 Feb 2009 05:54:45 +0000 (22:54 -0700)]
USB: usbmon: Add binary API v1

This patch adds an extension to the binary API so it reaches parity with
existing text API (so-called "1u"). The extension delivers additional data,
such as ISO descriptors and the interrupt interval.

Signed-Off-By: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: ch341 serial: fix port number changed after resume
Ming Lei [Fri, 20 Feb 2009 13:23:09 +0000 (21:23 +0800)]
USB: ch341 serial: fix port number changed after resume

This patch fixes the following bug:
.plug ch341 usb serial port into a hub port;
.ch341 driver bound to the device and /dev/ttyUSB0 comes
.open /dev/ttyUSB0 by minicom and we can use the serial successfully
.suspend the ch341 usb serial device(such as: echo suspend > power/level)
.resume the ch341 usb serial device (such as: echo on > power/level)
.new port /dev/ttyUSB1 comes ,and the original /dev/ttyUSB0 still exists,
but is no longer usable by minicom

The patch adds suspend and resume callback to ch341 usb driver to prevent it
from unbinding during suspend. The /dev/ttyUSB0 is not released until being
closed, so /dev/ttyUSB1 comes after resume, and the original /dev/ttyUSB0 is
no longer usable by minicom. It is really a mess for a minicom user.

This patch also adds the reset_resume callback to make it usable after resuming
from STR or hibernation, for generally STR or hibernation will make the vbus
of root-hub lost.

Finally enable the driver's supports_autosuspend, for the device is in working
order with it.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb: partial DaVinci dm355 support
David Brownell [Tue, 24 Feb 2009 23:31:54 +0000 (15:31 -0800)]
USB: musb: partial DaVinci dm355 support

Partial support for DaVinci DM355, on the EVM board; peripheral
mode should work, once mainline merges DM355 support.  Missing:

  (a) renumbering the GPIO for DRVVBUS on the DM6446 EVM,
      when DAVINCI_N_GPIO increases;

  (b) disabling DM355_DEEPSLEEP.DRVVBUS_OVERRIDE so VBUS is
      driven according to the ID signal, if cpu_is_..._dm355()

The new PHY control bits are ignored on DM6446.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb: only turn off vbus in OTG hosts
Ajay Kumar Gupta [Tue, 24 Feb 2009 23:29:04 +0000 (15:29 -0800)]
USB: musb: only turn off vbus in OTG hosts

Except on DaVinci, VBUS is now switched off as part of idling the
USB link (after a_wait_bcon) whenever a device is disconnected
from host.  This is correct for OTG hosts, where either SRP or
an ID interrupt could turn VBUS on again.

However, for non-OTG hosts there's no way to turn VBUS on again,
so the host becomes unusable.  And the procfs entry which once
allowed a manual workaround for this is now gone.

This patch adds an is_otg_enabled() check before scheduling the
switch-off timer in disconnect path, supporting a "classic host"
mode where SRP is unavailable.

[ dbrownell@users.sourceforge.net: tweak patch description ]

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb: fix init oops crash with static FIFO config
Giuseppe GORGOGLIONE [Tue, 24 Feb 2009 23:27:34 +0000 (15:27 -0800)]
USB: musb: fix init oops crash with static FIFO config

Correct musb_read_fifosize() and musb_configure_ep0() functions
for the #ifndef BLACKFIN branch when the silicon uses static FIFO
configuration.  (Most current silicon configures this controller
to use dynamic FIFO configuration; some parts from ST don't, like
the STM STA2062.)

Signed-off-by: Giuseppe GORGOGLIONE <giuseppe.gorgoglione@st.com>
Signed-off-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>
15 years agoUSB: musb: NAK timeout scheme on bulk RX endpoint
Ajay Kumar Gupta [Tue, 24 Feb 2009 23:26:13 +0000 (15:26 -0800)]
USB: musb: NAK timeout scheme on bulk RX endpoint

Fixes endpoint starvation issue when more than one bulk QH is
multiplexed on the reserved bulk RX endpoint, which is normal
for cases like serial and ethernet adapters.

This patch sets the NAK timeout interval for such QHs, and when
a timeout triggers the next QH will be scheduled.  (This resembles
the bulk scheduling done in hardware by EHCI, OHCI, and UHCI.)

This scheme doesn't work for devices which are connected to a
high to full speed tree (transaction translator) as there is
no NAK timeout interrupt from the musb controller from such
devices.

Tested with PIO, Inventra DMA, CPPI DMA.

[ dbrownell@users.sourceforge.net:  fold in start_urb() update;
  clarify only for bulk RX; don't accidentally clear WZC bits ]

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb: rewrite host periodic endpoint allocation
Sergei Shtylyov [Tue, 24 Feb 2009 23:23:34 +0000 (15:23 -0800)]
USB: musb: rewrite host periodic endpoint allocation

The current MUSB host code doesn't make use of all the available
FIFOs in for periodic transfers since it wrongly assumes the RX
and TX sides of any given hw_ep always share one FIFO.

Change:  use 'in_qh' and 'out_qh' fields of the 'struct musb_hw_ep'
to check the endpoint's business; get rid of the now-unused 'periodic'
array in the 'struct musb'.  Also optimize a loop induction variable
in the endpoint lookup code.

(Based on a previous patch from Ajay Kumar Gupta <ajay.gupta@ti.com>)

[ dbrownell@users.sourceforge.net: clarify description and origin
  of this fix; whitespace ]

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: composite: avoid inconsistent lock state
Felipe Balbi [Thu, 12 Feb 2009 13:09:47 +0000 (15:09 +0200)]
USB: composite: avoid inconsistent lock state

Avoid the following INFO from lock debugging:

[  369.126112] =================================
[  369.132063] [ INFO: inconsistent lock state ]
[  369.136457] 2.6.28-maemo1 #1
[  369.139387] ---------------------------------
[  369.143782] inconsistent {hardirq-on-W} -> {in-hardirq-W} usage.
[  369.149855] swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
[  369.154890]  (&cdev->lock){+-..}, at: [<bf1979f0>] composite_disconnect+0x1c/0]
[  369.163404] {hardirq-on-W} state was registered at:
[  369.168348]   [<c00788a8>] __lock_acquire+0x5d0/0x7d8
[  369.173506]   [<c0078b14>] lock_acquire+0x64/0x78
[  369.178266]   [<c0263a34>] _spin_lock+0x4c/0x80
[  369.182905]   [<bf19597c>] usb_function_deactivate+0x20/0x70 [g_nokia]
[  369.189527]   [<bf1a0a88>] 0xbf1a0a88
[  369.193281]   [<bf19f450>] 0xbf19f450
[  369.197004]   [<bf19fa3c>] 0xbf19fa3c
[  369.200758]   [<bf1a03a0>] 0xbf1a03a0
[  369.204481]   [<bf19f254>] 0xbf19f254
[  369.208204]   [<bf1a0158>] 0xbf1a0158
[  369.211927]   [<bf1a130c>] 0xbf1a130c
[  369.215650]   [<c01c21f0>] usb_gadget_register_driver+0x12c/0x28c
[  369.221846]   [<bf1a06bc>] 0xbf1a06bc
[  369.225569]   [<bf1a06e8>] 0xbf1a06e8
[  369.229322]   [<c002c2dc>] __exception_text_end+0x64/0x19c
[  369.234877]   [<c0081628>] sys_init_module+0x9c/0x194
[  369.240004]   [<c002c8e0>] ret_fast_syscall+0x0/0x2c
[  369.245039]   [<ffffffff>] 0xffffffff
[  369.248793] irq event stamp: 218356
[  369.252302] hardirqs last  enabled at (218355): [<c003a77c>] omap3_enter_idle+8
[  369.260420] hardirqs last disabled at (218356): [<c0264774>] __irq_svc+0x34/0x0
[  369.267927] softirqs last  enabled at (218348): [<c00585a4>] __do_softirq+0x134
[  369.275892] softirqs last disabled at (218335): [<c005899c>] irq_exit+0x60/0xb0
[  369.283308]
[  369.283308] other info that might help us debug this:
[  369.289930] no locks held by swapper/0.

Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: allow libusb to talk to unauthenticated WUSB devices
David Vrabel [Wed, 18 Feb 2009 14:43:47 +0000 (14:43 +0000)]
USB: allow libusb to talk to unauthenticated WUSB devices

To permit a userspace application to associate with WUSB devices
using numeric association, control transfers to unauthenticated WUSB
devices must be allowed.

This requires that wusbcore correctly sets the device state to
UNAUTHENTICATED, DEFAULT and ADDRESS and that control transfers can be
performed to UNAUTHENTICATED devices.

Signed-off-by: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: usb-storage: added missing MODULE_LICENSE("GPL") for usb-storage ums-* modules
Maciej Grela [Sat, 28 Feb 2009 20:39:20 +0000 (12:39 -0800)]
USB: usb-storage: added missing MODULE_LICENSE("GPL") for usb-storage ums-* modules

The lack of a MODULE_LICENSE macro in ums-* subdrivers prevented them
from loading. Needs to be applied after Alan Stern's usb-storage
subdriver separation patchset. Also added missing MODULE_DESCRIPTION and
MODULE_AUTHOR entries.

Signed-off-by: Maciej Grela <maciej.grela@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make onetouch a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:33 +0000 (14:48 -0500)]
usb-storage: make onetouch a separate module

This patch (as1217) converts usb-storage's onetouch subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make karma a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:26 +0000 (14:48 -0500)]
usb-storage: make karma a separate module

This patch (as1216) converts usb-storage's karma subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make alauda a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:22 +0000 (14:48 -0500)]
usb-storage: make alauda a separate module

This patch (as1215) converts usb-storage's alauda subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make jumpshot a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:19 +0000 (14:48 -0500)]
usb-storage: make jumpshot a separate module

This patch (as1214) converts usb-storage's jumpshot subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make datafab a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:15 +0000 (14:48 -0500)]
usb-storage: make datafab a separate module

This patch (as1213) converts usb-storage's datafab subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make freecom a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:11 +0000 (14:48 -0500)]
usb-storage: make freecom a separate module

This patch (as1212) converts usb-storage's freecom subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make shuttle_usbat a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:08 +0000 (14:48 -0500)]
usb-storage: make shuttle_usbat a separate module

This patch (as1211) converts usb-storage's shuttle_usbat subdriver
into a separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make cypress_atacb a separate module
Alan Stern [Thu, 12 Feb 2009 19:48:04 +0000 (14:48 -0500)]
usb-storage: make cypress_atacb a separate module

This patch (as1210) converts usb-storage's cypress_atacb subdriver
into a separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make sddr55 a separate module
Alan Stern [Thu, 12 Feb 2009 19:47:59 +0000 (14:47 -0500)]
usb-storage: make sddr55 a separate module

This patch (as1209) converts usb-storage's sddr55 subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make isd200 a separate module
Alan Stern [Thu, 12 Feb 2009 19:47:54 +0000 (14:47 -0500)]
usb-storage: make isd200 a separate module

This patch (as1208) converts usb-storage's isd200 subdriver into a
separate module.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: make sddr09 a separate module
Alan Stern [Thu, 12 Feb 2009 19:47:49 +0000 (14:47 -0500)]
usb-storage: make sddr09 a separate module

This patch (as1207) converts usb-storage's sddr09 subdriver into a
separate module.

An unexpected complication arises because of DPCM devices, in which
one LUN uses the sddr09 transport and one uses the standard CB
transport.  Since these devices can be used even when
USB_STORAGE_SDDR09 isn't configured, their entries in unusual_devs.h
require special treatment.  If SDDR09 isn't configured then the
entries remain in unusual_devs.h; if it is then the entries are
present in unusual_sddr09.h instead.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-storage: prepare for subdriver separation
Alan Stern [Thu, 12 Feb 2009 19:47:44 +0000 (14:47 -0500)]
usb-storage: prepare for subdriver separation

This patch (as1206) is the first step in converting usb-storage's
subdrivers into separate modules.  It makes the following large-scale
changes:

Remove a bunch of unnecessary #ifdef's from usb_usual.h.
Not truly necessary, but it does clean things up.

Move the USB device-ID table (which is duplicated between
libusual and usb-storage) into its own source file,
usual-tables.c, and arrange for this to be linked with
either libusual or usb-storage according to whether
USB_LIBUSUAL is configured.

Add to usual-tables.c a new usb_usual_ignore_device()
function to detect whether a particular device needs to be
managed by a subdriver and not by the standard handlers
in usb-storage.

Export a whole bunch of functions in usb-storage, renaming
some of them because their names don't already begin with
"usb_stor_".  These functions will be needed by the new
subdriver modules.

Split usb-storage's probe routine into two functions.
The subdrivers will call the probe1 routine, then fill in
their transport and protocol settings, and then call the
probe2 routine.

Take the default cases and error checking out of
get_transport() and get_protocol(), which run during
probe1, and instead put a check for invalid transport
or protocol values into the probe2 function.

Add a new probe routine to be used for standard devices,
i.e., those that don't need a subdriver.  This new routine
checks whether the device should be ignored (because it
should be handled by ub or by a subdriver), and if not,
calls the probe1 and probe2 functions.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-serial: fix usb_serial_register bug when boot with nousb param
Dave Young [Sat, 14 Feb 2009 13:21:13 +0000 (21:21 +0800)]
usb-serial: fix usb_serial_register bug when boot with nousb param

With "nousb" cmdline booting, built-in serial drivers (ie. airecable)
will trigger kernel oops.

Indeed, if nousb, usb_serial_init will failed, and the usb serial bus type
will not be registerd, then usb_serial_register call driver_register
which try to register the driver to a not registered bus.

Here add usb_disabled() check in usb_serial_register to fix it.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: fix ehci printk formats
Randy Dunlap [Fri, 13 Feb 2009 19:22:06 +0000 (11:22 -0800)]
USB: fix ehci printk formats

Fix ehci printk formats:

drivers/usb/host/ehci-q.c:351: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
drivers/usb/host/ehci-q.c:351: warning: format '%d' expects type 'int', but argument 5 has type 'size_t'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: replace uses of __constant_{endian}
Harvey Harrison [Wed, 11 Feb 2009 22:11:36 +0000 (14:11 -0800)]
USB: replace uses of __constant_{endian}

The base versions handle constant folding now.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: serial: add qualcomm wireless modem driver
Greg Kroah-Hartman [Wed, 18 Feb 2009 06:39:56 +0000 (22:39 -0800)]
USB: serial: add qualcomm wireless modem driver

Driver originally written by Qualcomm, but rewritten by me due to the
totally different coding style.  Cleaned up the probe logic to make a
bit more sense, this is one wierd device.  They could have prevented all
of this by just writing sane firmware for the modem.

Cc: Tamm Liu <tamml@qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: symbolserial: log the ioctl commands
Greg Kroah-Hartman [Sat, 21 Mar 2009 03:26:30 +0000 (20:26 -0700)]
USB: symbolserial: log the ioctl commands

We need to figure out what userspace programs are expecting from this
driver, so log them so we can try to get it right.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: serial: add symbol serial driver
Greg Kroah-Hartman [Sat, 14 Feb 2009 01:25:46 +0000 (17:25 -0800)]
USB: serial: add symbol serial driver

This is for the Symbol 6608 barcode scanner in a fake "HID" mode.

Thanks to Dalibor Grgec for working with me to get this to start to work
properly.

Cc: Dalibor Grgec <dalibor.grgec@zemris.fer.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: Add platform device support for the ISP1760 USB chip
Catalin Marinas [Tue, 10 Feb 2009 16:55:51 +0000 (16:55 +0000)]
USB: Add platform device support for the ISP1760 USB chip

Currently, the driver only supports PCI and PPC_OF but there are
boards like ARM RealView where this is a platform device. The patch adds
the necessary functions and registration to the isp1760-if.c file and
modifies the corresponding Makefile and Kconfig to be able to use this
driver even if PCI and PPC_OF are not enabled.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: Make the isp1760_register function prototype more generic
Catalin Marinas [Tue, 10 Feb 2009 16:55:45 +0000 (16:55 +0000)]
USB: Make the isp1760_register function prototype more generic

The patch changes the prototype of the isp1760_register() function to use
predefined types like phys_addr_t and resource_size_t rather than u64

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: EHCI: add software retry for transaction errors
Alan Stern [Tue, 10 Feb 2009 15:16:58 +0000 (10:16 -0500)]
USB: EHCI: add software retry for transaction errors

This patch (as1204) adds a software retry mechanism to ehci-hcd.  It
gets invoked when the driver encounters transaction errors on an
asynchronous endpoint.  On many systems, hardware deficiencies cause
such errors to occur if one device is unplugged while the host is
communicating with another device.  With the patch, the failed
transactions are retried and generally succeed the second or third
time through.

This is based on code originally written by Koichiro Saito.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested by: Koichiro Saito <Saito.Koichiro@adniss.jp>
CC: David Brownell <david-b@pacbell.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: fix USB_STORAGE_CYPRESS_ATACB
Boaz Harrosh [Wed, 11 Feb 2009 07:54:31 +0000 (09:54 +0200)]
USB: fix USB_STORAGE_CYPRESS_ATACB

commit 64a87b24: [SCSI] Let scsi_cmnd->cmnd use request->cmd buffer
changed the scsi_eh_prep_cmnd logic by making it clear
the ->cmnd buffer. But the sat to cypress atacb translation supposed
the ->cmnd buffer wasn't modified.

This patch makes it set the ->cmnd buffer after scsi_eh_prep_cmnd call.
The problem and a fix was reported by Matthieu CASTET <castet.matthieu@free.fr>

It also removes all the hackery fiddling of scsi_cmnd and scsi_eh_save by
requesting from scsi_eh_prep_cmnd to prepare a read into ->sense_buffer,
which is much more suitable a buffer for HW transfers, then after the command
execution the regs read is copied into regs buffer before actual preparation
of sense_buffer.

Also fix an alien comment character to my utf-8 editor.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Cc: stable <stable@kernel.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Matthew Dharm <mdharm-kernel@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: EHCI: Make timer_action out-of-line
Alan Stern [Wed, 11 Feb 2009 19:26:38 +0000 (14:26 -0500)]
USB: EHCI: Make timer_action out-of-line

This patch (as1205) moves timer_action() from ehci.h to ehci-hcd.c and
makes it out-of-line.  Over the years it has grown too big to be inline
any more.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb: kill prehistorical comments about USB_EHCI_HCD
Thierry Vignaud [Wed, 11 Feb 2009 21:31:05 +0000 (13:31 -0800)]
usb: kill prehistorical comments about USB_EHCI_HCD

Remove old comments about USB_EHCI_HCD.

Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: serial: refuse to open recently removed USB Serial devices
James Woodcock [Wed, 11 Feb 2009 15:06:53 +0000 (15:06 +0000)]
USB: serial: refuse to open recently removed USB Serial devices

A USB-serial converter device is plugged into a system, and a process
opens it's device node.  If the device is physically removed whilst the
process still has its device node open, then other processes can
sucessfully open the now non-existent device's node.  I would expect
that open() on a device that has been physically removed should return
ENODEV.

This is manifesting itself with getty on my system.  I do the following:
1.  set up inittab to spawn getty on ttyUSB0, eg:
    T1:23:respawn:/sbin/getty -L ttyUSB0 115200 vt100
2.  Plug in USB-serial converter cable
3.  Wait for a login prompt on a terminal program attached to the serial
    cable
4.  Login
5.  Pull the USB-serial converter cable from the box
6.  getty doesn't realise that ttyUSB0 no longer exists as /dev/ttyUSB0
    can still be opened.
7.  Re-insert the USB-serial converter cable
8.  You should no longer get a login prompt over the serial cable, as
    the the USB-serial cable now shows up as /dev/ttyUSB1, and getty is
    trying to talk to /dev/ttyUSB0.

The attached patch will cause open("/dev/ttyUSB0", O_RDONLY) to return
ENODEV after the USB-serial converter has been pulled.  The patch was
created against 2.6.28.1.  I can supply it against something else if
needs be.  It is fairly simple, so should be OK.

I am using a pl2303 device, although I don't think that makes any
difference.

From: James Woodcock <James.Woodcock@ACULAB.COM>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: serial: remove recourse to generic method
Oliver Neukum [Mon, 9 Feb 2009 09:03:49 +0000 (10:03 +0100)]
USB: serial: remove recourse to generic method

This removes the fallback to the generic method. It is cleaner to
explicitely request it. Introducing this was my mistake. This will
be solved by an explicit test and the driver being allowed to request
what it needs to be done upon resumption.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: skeleton: Use dev_info instead of info
Matt Kraai [Sat, 7 Feb 2009 03:38:51 +0000 (19:38 -0800)]
USB: skeleton: Use dev_info instead of info

338b67b0c1a97ca705023a8189cf41aa0828d294 removed the info macro and
replaced its uses with dev_info.  This patch does so for
usb-skeleton.c, which was missed.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb_storage: make Kconfig note visible in the console
Borislav Petkov [Sat, 7 Feb 2009 19:20:42 +0000 (20:20 +0100)]
usb_storage: make Kconfig note visible in the console

Make lines about usb_storage depending on SCSI visible when configuring the
kernel in a 80x25 console

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: serial: opticon: add serial line ioctls
Greg Kroah-Hartman [Sat, 7 Feb 2009 02:31:46 +0000 (18:31 -0800)]
USB: serial: opticon: add serial line ioctls

This lets userspace determine what the state of the RTS line is, which
is what is needed to properly handle data flow for this device (it
raises RTS when there is data to be sent from it.)

Cc: Kees Stoop <kees.stoop@opticon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: serial: opticon: add write support
Greg Kroah-Hartman [Sat, 7 Feb 2009 02:30:56 +0000 (18:30 -0800)]
USB: serial: opticon: add write support

This patch allows data to be sent to the scanner.

Cc: Kees Stoop <kees.stoop@opticon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: otg: adding nop usb transceiver
Ajay Kumar Gupta [Fri, 6 Feb 2009 12:02:35 +0000 (17:32 +0530)]
USB: otg: adding nop usb transceiver

NOP transceiver is used by all the usb transceiver which are mostly
autonomous and doesn't require any programming or which are built
into the usb ip itself.NOP transceiver only allocates the memory
for struct xceiv and calls otg_set_transceiver() so function call
to otg_get_transceiver() will return a valid transceiver.

NOP transceiver device should be registered by calling
usb_nop_xceiv_register() from platform files.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: ftdi_sio: remove pointless syslog spew
David Brownell [Fri, 6 Feb 2009 10:39:11 +0000 (02:39 -0800)]
USB: ftdi_sio: remove pointless syslog spew

Remove some pointless messages from the FTDI serial driver;
I found these filling up syslog on one system.  Also remove
a pointless "break" after a "return" in the same area.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: add missing KERN_* constants to printks
Frank Seidel [Thu, 5 Feb 2009 15:16:24 +0000 (16:16 +0100)]
USB: add missing KERN_* constants to printks

According to kerneljanitors todo list all printk calls (beginning
a new line) should have an according KERN_* constant.
Those are the missing peaces here for the usb subsystem.

Signed-off-by: Frank Seidel <frank@f-seidel.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: serial: use generic method if no alternative is provided in usb serial layer
Oliver Neukum [Fri, 6 Feb 2009 17:06:43 +0000 (18:06 +0100)]
USB: serial: use generic method if no alternative is provided in usb serial layer

This patch makes use of the generic method if a serial driver provides
no implementation. This simplifies implementing suspend/resume support
in serial drivers.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: serial: export symbol of usb_serial_generic_resume
Oliver Neukum [Fri, 6 Feb 2009 14:37:14 +0000 (15:37 +0100)]
USB: serial: export symbol of usb_serial_generic_resume

This exports a symbol for usb_serial_generic_resume, so that modules can
use it.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: serial generic resume function fix
Oliver Neukum [Fri, 6 Feb 2009 14:01:54 +0000 (15:01 +0100)]
USB: serial generic resume function fix

This removes an unnecessary check for autoresume from the generic
resume method. The check has been obsoleted by the now delayed
increase of the usage counter which makes the error this check prevented
impossible. This change allows drivers which only use the bulk read URB
the use of the generic method even if they support autosuspend.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: serial: introduce a flag into the usb serial layer to tell drivers that their...
Oliver Neukum [Thu, 5 Feb 2009 15:54:25 +0000 (16:54 +0100)]
USB: serial: introduce a flag into the usb serial layer to tell drivers that their URBs are killed due to suspension

This patch introduces a flag into the usb serial layer to tell drivers
that their URBs are killed due to suspension. That is necessary to let
drivers know whether they should report an error back.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Hi Greg,

this is for 2.6.30. Patches to use this in drivers are under development.

Regards
Oliver

15 years agoUSB: count reaches -1, tested 0
Roel Kluin [Sat, 31 Jan 2009 11:37:04 +0000 (12:37 +0100)]
USB: count reaches -1, tested 0

With a postfix decrement count will reach -1 rather than 0,
so the warning will not be issued.

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>
15 years agoUSB: suspend/resume for opticon driver
Oliver Neukum [Wed, 14 Jan 2009 17:34:06 +0000 (18:34 +0100)]
USB: suspend/resume for opticon driver

this does the standard support for suspend/resume for the opticon
driver.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: suspend/resume support for option driver
Oliver Neukum [Tue, 27 Jan 2009 16:21:40 +0000 (17:21 +0100)]
USB: suspend/resume support for option driver

This patch implements suspend and resume methods for the
option driver. With my hardware I can even suspend the system
and keep up a connection for a short time.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: imx_udc: Fix IMX UDC gadget general irq handling
Darius Augulis [Wed, 21 Jan 2009 13:19:19 +0000 (15:19 +0200)]
USB: imx_udc: Fix IMX UDC gadget general irq handling

Workaround of hw bug in IMX UDC.
This bug causes wrong handling of CFG_CHG interrupt.
Workaround is documented inline source code.

Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: imx_udc: Fix IMX UDC gadget ep0 irq handling
Darius Augulis [Wed, 21 Jan 2009 13:18:33 +0000 (15:18 +0200)]
USB: imx_udc: Fix IMX UDC gadget ep0 irq handling

Fix ep0 interrupt handling in IMX UDC Gadget.

Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: imx_udc: Fix IMX UDC gadget code style
Darius Augulis [Wed, 21 Jan 2009 13:17:55 +0000 (15:17 +0200)]
USB: imx_udc: Fix IMX UDC gadget code style

Fix code style errors in IMX UDC Gadget.

Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: imx_udc: Fix IMX UDC gadget bugs
Darius Augulis [Wed, 21 Jan 2009 13:17:25 +0000 (15:17 +0200)]
USB: imx_udc: Fix IMX UDC gadget bugs

Fix small bugs and add some omptimization in IMX UDC Gadget.

Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: usb-serial ch341: support for DTR/RTS/CTS
Werner Cornelius [Fri, 16 Jan 2009 20:02:41 +0000 (21:02 +0100)]
USB: usb-serial ch341: support for DTR/RTS/CTS

Fixup of Werner Cornelius patch to the ch341 USB-serial driver, which adds:
- support all baudrates, not just a hard-coded set
- support for controlling DTR, RTS and CTS

Features still missing:
- character length other than 8 bits
- parity settings
- break control

I adapted his patch for the new usb_serial API introduced in 2.6.25-git8 by
Alan Cox on 22 July 2008. Non-compliance to the new API was a reason for
refusing a similar patch from Tollef Fog Heen.

Usage example by Tollef Fog Heen :
        TEMPer USB thermometer <http://err.no/src/TEMPer.c>

Signed-off-by: Werner Cornelius <Werner.Cornelius@cornelius-consult.de>
Signed-off-by: Boris Hajduk <boris@hajduk.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: gadget: remove duplicated #include
Huang Weiyi [Sun, 11 Jan 2009 09:25:13 +0000 (17:25 +0800)]
USB: gadget: remove duplicated #include

Removed duplicated #include in
  drivers/usb/gadget/ci13xxx_udc.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: drivers: use USB API functions rather than constants
Julia Lawall [Mon, 29 Dec 2008 10:22:14 +0000 (11:22 +0100)]
USB: drivers: use USB API functions rather than constants

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: Remove redundant test in pxa27x_udc and ftdi_sio
Julia Lawall [Sun, 21 Dec 2008 15:41:36 +0000 (16:41 +0100)]
USB: Remove redundant test in pxa27x_udc and ftdi_sio

priv is checked not to be NULL near the beginning of the function and not
changed subsequently, making the test redundant.

A simplified version of the semantic patch that makes this change is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@

if (x@p1 == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
x@p2 == NULL
|
x@p2 != NULL
)

// another path to the test that is not through p1?
@s exists@
local idexpression r.x;
position r.p1,r.p2;
@@

... when != x@p1
(
x@p2 == NULL
|
x@p2 != NULL
)

@fix depends on !s@
position r.p1,r.p2;
expression x,E;
statement S1,S2;
@@

(
- if ((x@p2 != NULL) || ...)
  S1
|
- if ((x@p2 == NULL) && ...) S1
|
- BUG_ON(x@p2 == NULL);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: ub: use USB API functions rather than constants
Julia Lawall [Mon, 29 Dec 2008 10:19:10 +0000 (11:19 +0100)]
USB: ub: use USB API functions rather than constants

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: Move definitions from usb.h to usb/ch9.h
Julia Lawall [Mon, 29 Dec 2008 21:48:19 +0000 (22:48 +0100)]
USB: Move definitions from usb.h to usb/ch9.h

The 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_is_isoc_in(epd)
usb_endpoint_is_isoc_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)

are moved from include/linux/usb.h to include/linux/usb/ch9.h.
include/linux/usb/ch9.h makes more sense for these functions because they
only depend on constants that are defined in this file.

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: pxa27x_udc: add vbus_draw callback
Robert Jarzmik [Sun, 25 Jan 2009 07:59:38 +0000 (23:59 -0800)]
USB: pxa27x_udc: add vbus_draw callback

Add the vbus_draw() callback to inform the transceiver, if
it exists, how much current may be drawn. The decision is
taken on gadget driver side using the configuration chosen
by the host and its bMaxPower field.  Some systems can use
the host's VBUS supply to augment or recharge a battery.
(There's also a default of 100 mA for unconfigured devices,
or 8 mA if they're OTG devices.)

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: pxa27x_udc: add otg transceiver support
Robert Jarzmik [Sun, 25 Jan 2009 07:57:30 +0000 (23:57 -0800)]
USB: pxa27x_udc: add otg transceiver support

When a transceiver driver is used, no automatic udc enable
is done. The transceiver (OTG or not) should :
 - take care of VBus sensing
 - call usb_gadget_vbus_connect()
 - call usb_gadget_vbus_disconnect()

The pullup should remain within this driver's management,
either by gpio_pullup of udc_command() fields.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: pxa27x_udc: add vbus session handling
Robert Jarzmik [Sun, 25 Jan 2009 07:56:42 +0000 (23:56 -0800)]
USB: pxa27x_udc: add vbus session handling

On vbus_session() call, optionally activate D+ pullup
resistor and enable the udc, or deactivate D+ pullup
resistor and disable the udc.

It is intentional to not handle any VBus sense related irq.
An external transceiver driver (like gpio_vbus) should
catch VBus sense signal, and call usb_gadget_vbus_connect()
or usb_gadget_vbus_disconnect().

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: pxa27x_udc: factor pullup code to prepare otg transceiver
Robert Jarzmik [Sun, 25 Jan 2009 07:55:34 +0000 (23:55 -0800)]
USB: pxa27x_udc: factor pullup code to prepare otg transceiver

Prepare pxa27x_udc to handle usb D+ pullup properly : it
should connect the pullup resistor and disconnect it only
if no external transceiver is handling it.

[ dbrownell@users.sourceforge.net: kerneldoc and gpio fixes ]

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: gpio_vbus: add delayed vbus_session calls
Robert Jarzmik [Sun, 25 Jan 2009 07:54:31 +0000 (23:54 -0800)]
USB: gpio_vbus: add delayed vbus_session calls

Call usb_gadget_vbus_connect() and ...disconnect() from a
workqueue rather than from an irq handler, allowing msleep()
calls in vbus_session.  Update kerneldoc to match.

[ dbrownell@users.sourceforge.net: more kerneldoc updates ]

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousblp: continuously poll for status
Pete Zaitcev [Wed, 7 Jan 2009 00:20:42 +0000 (17:20 -0700)]
usblp: continuously poll for status

The usblp in 2.6.18 polled for status regardless if we actually needed it.
At some point I dropped it, to save the batteries if nothing else.
As it turned out, printers exist (e.g. Canon BJC-3000) that need prodding
this way or else they stop. This patch restores the old behaviour.
If you want to save battery, don't leave jobs in the print queue.

I tested this on my printers by printing and examining usbmon traces
to make sure status is being requested and printers continue to print.
Tuomas Jäntti verified the fix on BJC-3000.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: usb-storage: increase max_sectors for tape drives
Alan Stern [Mon, 23 Mar 2009 13:51:02 +0000 (09:51 -0400)]
USB: usb-storage: increase max_sectors for tape drives

This patch (as1203) increases the max_sector limit for USB tape
drives.  By default usb-storage sets max_sectors to 240 (i.e., 120 KB)
for all devices.  But tape drives need a higher limit, since tapes can
and do have very large block sizes.  Without the ability to transfer
an entire large block in a single command, such tapes can't be used.

This fixes Bugzilla #12207.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Phil Mitchell <philipm@sybase.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: gadget: fix rndis regression
David Brownell [Fri, 20 Mar 2009 08:08:20 +0000 (01:08 -0700)]
USB: gadget: fix rndis regression

Restore some code that was wrongly dropped from the RNDIS
driver, and caused interop problems observed with OpenMoko.

The issue is with hardware which needs help conforming to part
of the USB 2.0 spec (section 8.5.3.2); some can automagically
send a ZLP in response to an unexpected IN, but not all chips
will do that.  We don't need to check the packet length ourselves
the way earlier code did, since the UDC must already check it.
But we do need to tell the UDC when it must force a short packet
termination of the data stage.

(Based on a patch from Aric D. Blumer <aric at sdgsystems.com>)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: add quirk to avoid config and interface strings
Alan Stern [Wed, 18 Mar 2009 18:28:53 +0000 (14:28 -0400)]
USB: add quirk to avoid config and interface strings

Apparently the Configuration and Interface strings aren't used as
often as the Vendor, Product, and Serial strings.  In at least one
device (a Saitek Cyborg Gold 3D joystick), attempts to read the
Configuration string cause the device to stop responding to Control
requests.

This patch (as1226) adds a quirks flag, telling the kernel not to
read a device's Configuration or Interface strings, together with a
new quirk for the offending joystick.

Reported-by: Melchior FRANZ <melchior.franz@gmail.com>
Tested-by: Melchior FRANZ <melchior.franz@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org> [2.6.28 and 2.6.29, nothing earlier]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoide: use try_to_identify() in ide_driveid_update()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:59 +0000 (23:22 +0100)]
ide: use try_to_identify() in ide_driveid_update()

* Pass pointer to buffer for IDENTIFY data to do_identify()
  and try_to_identify().

* Un-static try_to_identify() and use it in ide_driveid_update().

* Rename try_to_identify() to ide_dev_read_id().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: clear drive IRQ after re-enabling local IRQs in ide_driveid_update()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:58 +0000 (23:22 +0100)]
ide: clear drive IRQ after re-enabling local IRQs in ide_driveid_update()

Clear drive IRQ after re-enabling local IRQs in ide_driveid_update()
to match try_to_identify().

Also remove superfluous local_irq_enable() call while at it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: sanitize SELECT_MASK() usage in ide_driveid_update()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:58 +0000 (23:22 +0100)]
ide: sanitize SELECT_MASK() usage in ide_driveid_update()

Call SELECT_MASK() after ide_fix_driveid().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: classify device type in do_probe()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:58 +0000 (23:22 +0100)]
ide: classify device type in do_probe()

Defer classifying device type from do_identify() to do_probe().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove broken EXABYTENEST support
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:58 +0000 (23:22 +0100)]
ide: remove broken EXABYTENEST support

do_identify() marks EXABYTENEST device as non-present and frees
drive->id so enable_nest() has absolutely no chance of working.

The code was like this since at least 2.6.12-rc2 and nobody
has noticed so just remove broken EXABYTENEST support.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: shorten timeout value in ide_driveid_update()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:57 +0000 (23:22 +0100)]
ide: shorten timeout value in ide_driveid_update()

Shorten timeout value in ide_driveid_update() (30s -> 15s)
to match try_to_identify().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: propagate AltStatus workarounds to ide_driveid_update()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:55 +0000 (23:22 +0100)]
ide: propagate AltStatus workarounds to ide_driveid_update()

Propagate AltStatus workarounds from try_to_identify()
to ide_driveid_update().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: fix kmalloc() failure handling in ide_driveid_update()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:54 +0000 (23:22 +0100)]
ide: fix kmalloc() failure handling in ide_driveid_update()

* Doing kmalloc() in the middle of command execution is not only ugly
  but leaves drive waiting to send data on kmalloc() failure.  Fix it.

While at it:

* Unify error code paths.

* Fixup error message to be more useful and add missing KERN_ERR level.

* Rename 'stat' variable to 's'.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agomn10300: remove <asm/ide.h>
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:54 +0000 (23:22 +0100)]
mn10300: remove <asm/ide.h>

* Remove superfluous <asm/intctl-regs.h> include.

* Remove no longer used SUPPORT_SLOW_DATA_PORTS define.

* Move defining SUPPORT_VLB_SYNC to <linux/ide.h>.

* Use __ide_mm_*() macros from <asm-generic/ide_iops.h>
  (MN10300 uses only memory-mapped I/O).

* Remove <asm/ide.h>.

While at it:

* Remove superfluous SPARC64 #ifdef from <linux/ide.h>.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agofrv: remove <asm/ide.h>
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:54 +0000 (23:22 +0100)]
frv: remove <asm/ide.h>

* Remove superfluous <asm/{setup,io,irq}.h> includes.

* Remove <asm/ide.h>.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove pciirq argument from ide_pci_setup_ports()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:53 +0000 (23:22 +0100)]
ide: remove pciirq argument from ide_pci_setup_ports()

* Set ->irq explicitly in cs5520.c.

* Remove irq argument from ide_hw_configure().

* Remove pciirq argument from ide_pci_setup_ports().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: fix ->init_chipset method to return 'int' value
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:53 +0000 (23:22 +0100)]
ide: fix ->init_chipset method to return 'int' value

* Return 0 instead of dev->irq in ->init_chipset implementations.

* Fix ->init_chipset method to return 'int' value instead of
  'unsigned int' one.

This fixes ->init_chipset handling for host drivers (cs5530, hpt366
and pdc202xx_new) for which it is possible for this method to fail.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove try_to_identify() wrapper
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:53 +0000 (23:22 +0100)]
ide: remove try_to_identify() wrapper

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove no longer needed IRQ auto-probing from try_to_identify() (v2)
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:53 +0000 (23:22 +0100)]
ide: remove no longer needed IRQ auto-probing from try_to_identify() (v2)

v2:
Update actual_try_to_identify() documentation.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove no longer needed IRQ fallback code from hwif_init()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:52 +0000 (23:22 +0100)]
ide: remove no longer needed IRQ fallback code from hwif_init()

Then remove no longer used __ide_default_irq().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoamd74xx: remove no longer needed ->init_hwif method
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:52 +0000 (23:22 +0100)]
amd74xx: remove no longer needed ->init_hwif method

This is now handled by core IDE PCI code.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove no longer needed IDE_HFLAG[_FORCE]_LEGACY_IRQS
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:52 +0000 (23:22 +0100)]
ide: remove no longer needed IDE_HFLAG[_FORCE]_LEGACY_IRQS

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: use ide_pci_is_in_compatibility_mode() in ide_pci_init_{one,two}()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:51 +0000 (23:22 +0100)]
ide: use ide_pci_is_in_compatibility_mode() in ide_pci_init_{one,two}()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: use pci_get_legacy_ide_irq() in ide_pci_init_{one,two}()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:49 +0000 (23:22 +0100)]
ide: use pci_get_legacy_ide_irq() in ide_pci_init_{one,two}()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: handle IDE_HFLAG[_FORCE]_LEGACY_IRQS in ide_pci_init_{one,two}()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:49 +0000 (23:22 +0100)]
ide: handle IDE_HFLAG[_FORCE]_LEGACY_IRQS in ide_pci_init_{one,two}()

Move handling of IDE_HFLAG[_FORCE]_LEGACY_IRQS from ide_init_port()
to ide_pci_init_{one,two}().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agotrm290: small ->init_hwif cleanup
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:49 +0000 (23:22 +0100)]
trm290: small ->init_hwif cleanup

Core IDE PCI code takes care of assigning hwif->irq for both ports.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agons87415: small ->init_hwif cleanup
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:49 +0000 (23:22 +0100)]
ns87415: small ->init_hwif cleanup

Core IDE PCI code takes care of assigning hwif->irq for both ports.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agons87415: use pci_get_legacy_ide_irq()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:48 +0000 (23:22 +0100)]
ns87415: use pci_get_legacy_ide_irq()

Fix ->init_hwif to use pci_get_legacy_ide_irq() instead of
__ide_default_irq().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoamd74xx: use ide_pci_is_in_compatibility_mode()
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:48 +0000 (23:22 +0100)]
amd74xx: use ide_pci_is_in_compatibility_mode()

Fix ->init_hwif to check if IDE PCI controller is in compatibility
mode instead of checking for hwif->irq == 0.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agomn10300: add pci_get_legacy_ide_irq() to <asm/pci.h>
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:48 +0000 (23:22 +0100)]
mn10300: add pci_get_legacy_ide_irq() to <asm/pci.h>

Add missing pci_get_legacy_ide_irq() implementation
before it becomes required by core IDE PCI code.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: move error handling code to ide-eh.c (v2)
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:47 +0000 (23:22 +0100)]
ide: move error handling code to ide-eh.c (v2)

Do some CodingStyle fixups in <linux/ide.h> while at it.

v2:
Add missing <linux/delay.h> include (reported by Stephen Rothwell).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: checkpatch.pl fixes for ide-iops.c
Bartlomiej Zolnierkiewicz [Tue, 24 Mar 2009 22:22:47 +0000 (23:22 +0100)]
ide: checkpatch.pl fixes for ide-iops.c

Fix following checkpatch.pl warnings/errors:
- WARNING: space prohibited between function name and open parenthesis '('
- WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
- WARNING: line over 80 characters
- ERROR: trailing whitespace
- ERROR: space required before the open parenthesis '('

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>