safe/jmp/linux-2.6
14 years agoUSB: FHCI: Correct the size argument to kzalloc
Julia Lawall [Wed, 30 Dec 2009 14:34:37 +0000 (15:34 +0100)]
USB: FHCI: Correct the size argument to kzalloc

urb_priv->tds has type struct td **, not struct td *, so the
elements of the array should have pointer type, not structure type.

Convert kzalloc to kcalloc as well.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@disable sizeof_type_expr@
type T;
T **x;
@@

  x =
  <+...sizeof(
- T
+ *x
  )...+>
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cypress_m8: use put_unaligned_le32() where necessary
Johan Hovold [Thu, 31 Dec 2009 15:48:01 +0000 (16:48 +0100)]
USB: cypress_m8: use put_unaligned_le32() where necessary

Cc: Lonnie Mendez <dignome@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ch341: use get_unaligned_le16 in break_ctl
Johan Hovold [Thu, 31 Dec 2009 15:47:59 +0000 (16:47 +0100)]
USB: ch341: use get_unaligned_le16 in break_ctl

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: serial: fix DMA buffers on stack for io_edgeport.c
Dan Carpenter [Thu, 31 Dec 2009 15:42:55 +0000 (17:42 +0200)]
USB: serial: fix DMA buffers on stack for io_edgeport.c

The original code was passing a stack variable as a dma buffer, so I
made it an allocated variable.  Instead of adding a bunch of kfree()
calls, I changed all the error return paths to gotos.

Also I noticed that the error checking wasn't correct because
usb_get_descriptor() can return negative values.

While I was at it, I made an unrelated white space change by moving
the unicode_to_ascii() on to one line.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: kobil_sct: clean up kobil_set_termios
Johan Hovold [Mon, 28 Dec 2009 22:01:58 +0000 (23:01 +0100)]
USB: kobil_sct: clean up kobil_set_termios

Kill string that is allocated and generated using speed and parity
settings but is never used (and never has been).

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: visor: fix DMA buffers on stack
Johan Hovold [Mon, 28 Dec 2009 22:01:57 +0000 (23:01 +0100)]
USB: visor: fix DMA buffers on stack

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: oti6858: fix DMA buffer on stack
Johan Hovold [Mon, 28 Dec 2009 22:01:56 +0000 (23:01 +0100)]
USB: oti6858: fix DMA buffer on stack

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: mos7840: fix DMA buffers on stack and endianess bugs
Johan Hovold [Mon, 28 Dec 2009 22:01:55 +0000 (23:01 +0100)]
USB: mos7840: fix DMA buffers on stack and endianess bugs

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: mos7720: fix DMA buffers on stack and clean up send_mos_cmd
Johan Hovold [Mon, 28 Dec 2009 22:01:54 +0000 (23:01 +0100)]
USB: mos7720: fix DMA buffers on stack and clean up send_mos_cmd

Change data-argument type from (void *) to (u8 *) to prevent endianess
problems.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: kl5kusb105: fix DMA buffers on stack
Johan Hovold [Mon, 28 Dec 2009 22:01:52 +0000 (23:01 +0100)]
USB: kl5kusb105: fix DMA buffers on stack

Cc: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: keyspan_pda: fix DMA buffers on stack
Johan Hovold [Mon, 28 Dec 2009 22:01:51 +0000 (23:01 +0100)]
USB: keyspan_pda: fix DMA buffers on stack

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: io_ti: fix DMA buffers on stack
Johan Hovold [Mon, 28 Dec 2009 22:01:50 +0000 (23:01 +0100)]
USB: io_ti: fix DMA buffers on stack

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cypress_m8: fix endianess bug
Johan Hovold [Mon, 28 Dec 2009 22:01:49 +0000 (23:01 +0100)]
USB: cypress_m8: fix endianess bug

Cc: Lonnie Mendez <dignome@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cypress_m8: fix DMA buffer on stack
Johan Hovold [Mon, 28 Dec 2009 22:01:48 +0000 (23:01 +0100)]
USB: cypress_m8: fix DMA buffer on stack

Cc: Lonnie Mendez <dignome@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ch341: use le16_to_cpup to be explicit about endianess
Johan Hovold [Mon, 28 Dec 2009 22:01:47 +0000 (23:01 +0100)]
USB: ch341: use le16_to_cpup to be explicit about endianess

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ch341: fix DMA buffer on stack
Johan Hovold [Mon, 28 Dec 2009 22:01:46 +0000 (23:01 +0100)]
USB: ch341: fix DMA buffer on stack

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ch341: replace printk warnings with dev_err
Johan Hovold [Mon, 28 Dec 2009 22:01:45 +0000 (23:01 +0100)]
USB: ch341: replace printk warnings with dev_err

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: host: ehci: adding regulator framework in ehci-omap.c driver.
Ajay Kumar Gupta [Mon, 28 Dec 2009 11:40:46 +0000 (13:40 +0200)]
usb: host: ehci: adding regulator framework in ehci-omap.c driver.

OMAP3 has three HS USB ports so it can have three different regulator
for each PHY connected to each port.

Currently these regulators are assumed to be optional and driver doesn't
fail but continue with the initialization if it doesn't get any regulators.

Regulator supply names has to be mapped in board files as 'hsusbN' where
'N' is port number and can be {0, 1 ,2}.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: host: ehci: fix missing kfree in remove path also
Ajay Kumar Gupta [Mon, 28 Dec 2009 11:40:45 +0000 (13:40 +0200)]
usb: host: ehci: fix missing kfree in remove path also

Added missing kfree() in ehci_hcd_omap_remove().

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: Add 'extvbus' in musb_hdrc_platform_data
Ajay Kumar Gupta [Mon, 28 Dec 2009 11:40:42 +0000 (13:40 +0200)]
usb: musb: Add 'extvbus' in musb_hdrc_platform_data

Some of the board might use external Vbus power supply on musb
interface which would require to program ULPI_BUSCONTROL register.

Adding 'extvbus' flag which can be set from such boards which will
be checked at musb driver files before programming ULPI_BUSCONTROL.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: save dynfifo in musb struct
Ajay Kumar Gupta [Mon, 28 Dec 2009 11:40:41 +0000 (13:40 +0200)]
usb: musb: save dynfifo in musb struct

Save dynamic FIFO read only information for later uses during
musb_save/restore_context functions.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: handle irqs in the order dictated by programming guide
Arnaud Mandy [Mon, 28 Dec 2009 11:40:40 +0000 (13:40 +0200)]
usb: musb: handle irqs in the order dictated by programming guide

MUSB's programming guide dictates how we should handle its
irqs and in which order. Follow that.

Signed-off-by: Arnaud Mandy <ext-arnaud.2.mandy@nokia.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: clean up commit 'workaround Blackfin FIFO anomalies'
Bryan Wu [Mon, 28 Dec 2009 11:40:39 +0000 (13:40 +0200)]
usb: musb: clean up commit 'workaround Blackfin FIFO anomalies'

The version applied had a few comments which are now
done.

Thanks to Sergei for pointing out.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: Fix cppi_channel_abort() function to handle Tx abort correctly
Swaminathan S [Mon, 28 Dec 2009 11:40:38 +0000 (13:40 +0200)]
usb: musb: Fix cppi_channel_abort() function to handle Tx abort correctly

This patch fixes the Tx abort/teardown logic. We now wait for the teardown
completion interrupt and acknowledge the same by setting the tx_complete
register to 0.

This change is needed to ensure that abort processing works on DM365 platform.
Without this change after completion of abort processing the system is
overwhelmed with continuous stream of abort interrupts.

This change has been tested on all CPPI3.x platforms (DM644x, DM646x, DM35x,
DM36x).

Signed-off-by: Swaminathan S <swami.iyer@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: workaround toggle bug when doing bulk transfer after isoc
Swaminathan S [Mon, 28 Dec 2009 11:40:37 +0000 (13:40 +0200)]
usb: musb: workaround toggle bug when doing bulk transfer after isoc

This patch implements the work around for a Mentor controller related
bug where it's observed a BULK Tx toggle error on the bus when a
BULK IO gets scheduled on an endpoint that was earlier used for
handling ISOC transaction and needed to start on 1 toggle.  When such
a situation arises even if the TXCSR toggle bits are programmed
correctly by the musb driver the data gets transmitted with 0 toggle
which leads to toggle error on the bus and the BULK transaction fails.
In case of MSC write, the device gets reset by the Host.

This Mentor bug is observed on almost all Mentor versions (1.3, 1.5,
1.8).  Confirmed on DM644x, DM355, DM365, OMAPL13x platforms.

Signed-off-by: Swaminathan S <swami.iyer@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: workaround MUSB DMA_INTR sometimes reads zero
Anand Gadiyar [Mon, 28 Dec 2009 11:40:36 +0000 (13:40 +0200)]
usb: musb: workaround MUSB DMA_INTR sometimes reads zero

MUSB DMA_INTR register may sometimes read zero when infact there
was a pending interrupt. Workaround this by reading the DMA_COUNT
values for all enabled channels when this condition occurs.
Flag these channels as the ones needing to be serviced.

Additionally, the absence of a debug print meant we would never
catch a spurious DMA interrupt in MUSB. So this patch adds a
debug print in the IRQ handler.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Cc: Ajay Kumar Gupta <ajay.gupta@ti.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: musb: hsdma: add wrapper for reading DMA count
Anand Gadiyar [Mon, 28 Dec 2009 11:40:35 +0000 (13:40 +0200)]
usb: musb: hsdma: add wrapper for reading DMA count

Add a wrapper for reading the DMA count register, analogous
to the one for writing to this register.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Cc: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: musb: Add new fifo table for a OMAP3 errata
Ajay Kumar Gupta [Mon, 28 Dec 2009 11:40:34 +0000 (13:40 +0200)]
USB: musb: Add new fifo table for a OMAP3 errata

We have observed MSC data read corruption when USB LAN device is
also connected and it's interface is up.

Silicon team has confirmed an errata where in all the active
transfers should use FIFO space either in first 8K or next 8K.
So far we have observed the issue in above use case scenario.

As a workaround to it, adding a new FIFO config (5) fitting well
within first 8K which can be used for such use cases.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Acked-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousb: otg: twl4030: move to request_threaded_irq
Felipe Balbi [Mon, 28 Dec 2009 11:02:48 +0000 (13:02 +0200)]
usb: otg: twl4030: move to request_threaded_irq

move to request_threaded_irq() on twl4030 children.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Correct CONFIG variable typo.
Robert P. J. Day [Mon, 28 Dec 2009 11:31:08 +0000 (06:31 -0500)]
USB: Correct CONFIG variable typo.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: usblp: Remove checks no longer needed with the new runtime PM system
Oliver Neukum [Sun, 27 Dec 2009 23:52:17 +0000 (00:52 +0100)]
USB: usblp: Remove checks no longer needed with the new runtime PM system

Under the new system a device cannot be suspended against
the driver's wish. Therefore this condition no longer needs
to be checked for.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ftdi_sio: remove unnecessary initialisations
Johan Hovold [Thu, 24 Dec 2009 11:42:11 +0000 (12:42 +0100)]
USB: ftdi_sio: remove unnecessary initialisations

Return values are being initialised to zero only to be unconditionally
assigned to a few instructions later. This may give the impression that
zero is returned on success, which is not the case.

Note also that ftdi_NDI_device_setup never reports errors.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ftdi_sio: clean up modem status handling
Johan Hovold [Thu, 24 Dec 2009 11:42:10 +0000 (12:42 +0100)]
USB: ftdi_sio: clean up modem status handling

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ftdi_sio: fix DMA buffers on stack
Johan Hovold [Thu, 24 Dec 2009 11:42:09 +0000 (12:42 +0100)]
USB: ftdi_sio: fix DMA buffers on stack

Also remove unnecessary buffer allocations for zero-length transfers.

Reported-by: Matti Aarnio <matti.aarnio@zmailer.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ftdi_sio: fix latency-timeout endianess bug
Johan Hovold [Thu, 24 Dec 2009 11:42:08 +0000 (12:42 +0100)]
USB: ftdi_sio: fix latency-timeout endianess bug

Also fixes DMA transfer to stack for latency buffer.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ftdi_sio: use error code from usb stack in read_latency_timer
Johan Hovold [Thu, 24 Dec 2009 11:42:07 +0000 (12:42 +0100)]
USB: ftdi_sio: use error code from usb stack in read_latency_timer

Use same semantics as for write_latency_timer.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: rename USB_SPEED_VARIABLE to USB_SPEED_WIRELESS
Greg Kroah-Hartman [Thu, 14 Jan 2010 19:08:04 +0000 (11:08 -0800)]
USB: rename USB_SPEED_VARIABLE to USB_SPEED_WIRELESS

It's really the wireless speed, so rename the thing to make
more sense.  Based on a recommendation from David Vrabel

Cc: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: retain USB device power/wakeup setting across reconfiguration
Dan Streetman [Wed, 6 Jan 2010 14:56:53 +0000 (09:56 -0500)]
USB: retain USB device power/wakeup setting across reconfiguration

Currently a non-root-hub USB device's wakeup settings are initialized when the
device is set to a configured state using device_init_wakeup(), but this is not
correct as wakeup is split into "capable" (can_wakeup) and "enabled"
(should_wakeup).  The settings should be initialized instead in the device
initialization (usb_new_device) with the "capable" setting disabled and the
"enabled" setting enabled.  The "capable" setting should be set based on the
device being configured or unconfigured, and "enabled" setting set based on
the sysfs power/wakeup control.

This patch retains the sysfs power/wakeup setting of a non-root-hub USB device
over a USB device re-configuration, which can happen (for example) after a
suspend/resume cycle.

Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cdc_acm: Silence "It is not a modem." error for pbLua devices
Julian Calaby [Tue, 5 Jan 2010 12:58:20 +0000 (23:58 +1100)]
USB: cdc_acm: Silence "It is not a modem." error for pbLua devices

The pbLua console port is known to not be a modem, so it is
unnecessary to be told this when it is plugged in.

Add NOT_A_MODEM quirk to tell the driver that we know this already
and hence not to warn us, and mark the pbLua console port.

Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cdc_acm: Add support for pbLua console port
Julian Calaby [Tue, 5 Jan 2010 12:57:46 +0000 (23:57 +1100)]
USB: cdc_acm: Add support for pbLua console port

The pbLua firmware (http://pblua.com/) for the Lego Mindstorms NXT
provides a CDC ACM port for it's serial console.

This used to be detected automatically, but this support has been
dropped, probably for sensible reasons.

Explicitly add support for this device by adding an item to the
device ID table.

Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agousbmon: add bus number to text API
Pete Zaitcev [Tue, 5 Jan 2010 18:50:07 +0000 (11:50 -0700)]
usbmon: add bus number to text API

Due to a simple oversight when bus zero was added, the text API fails to
deliver the bus number in 'E' messages (which are equivalent of 'C'
messages, only for error case). This makes it harder, for instance,
use a search-and-highlight in a text editor. So fix it.

Also, Alan Stern requested adding timestamps to 'E' messages. This is
purely cosmetic, but makes it easier to read the trace. This is done
for both text and binary APIs.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: musb: remove some of the never defined defines
Felipe Balbi [Tue, 15 Dec 2009 09:08:39 +0000 (11:08 +0200)]
USB: musb: remove some of the never defined defines

just makes the musb init code a bit cleaner.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: musb: move to sysfs_groups
Felipe Balbi [Tue, 15 Dec 2009 09:08:38 +0000 (11:08 +0200)]
USB: musb: move to sysfs_groups

it's easier to keep up and add more sysfs entries
as necessary.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: musb: move two printk to dev_err
Felipe Balbi [Tue, 15 Dec 2009 09:08:43 +0000 (11:08 +0200)]
USB: musb: move two printk to dev_err

trivial cleanup, no functional changes.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: musb: use resource_size()
Felipe Balbi [Tue, 15 Dec 2009 09:08:42 +0000 (11:08 +0200)]
USB: musb: use resource_size()

it makes ioremap() usage looks cleaner.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: gadget: add INT support for Blackfin musb
Cliff Cai [Mon, 21 Dec 2009 15:42:39 +0000 (10:42 -0500)]
USB: gadget: add INT support for Blackfin musb

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: gadget: use ep5 for bulk-in and ep6 for bulk-out for Blackfin MUSB
Bryan Wu [Mon, 21 Dec 2009 15:43:06 +0000 (10:43 -0500)]
USB: gadget: use ep5 for bulk-in and ep6 for bulk-out for Blackfin MUSB

Normally, the musb uses ep1 as the bidirectional bulk endpoint.  This won't
work on the Blackfin musb as all endpoints (except ep0) are unidirectional.
Further, ep1-ep4 have a small 128 byte FIFO which makes them undesirable
for bulk endpoints (which need more like a 512 byte FIFO).  This leaves us
with ep5-ep7 which have 1024 byte FIFOs and can be configured as either
in/out and bulk/interrupt/iso on the fly.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: host: SL811: allow the hcd on Blackfin systems
Michael Hennerich [Mon, 21 Dec 2009 16:16:00 +0000 (11:16 -0500)]
USB: host: SL811: allow the hcd on Blackfin systems

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: host: SL811: fix unaligned accesses
Michael Hennerich [Mon, 21 Dec 2009 17:53:24 +0000 (12:53 -0500)]
USB: host: SL811: fix unaligned accesses

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: isp1362: Use kzalloc for allocating only one thing
Julia Lawall [Sat, 19 Dec 2009 07:17:44 +0000 (08:17 +0100)]
USB: isp1362: Use kzalloc for allocating only one thing

Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
@@

- kcalloc(1,
+ kzalloc(
          ...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cypress_m8: allow unstable baud rates
Mike Frysinger [Fri, 18 Dec 2009 21:33:03 +0000 (16:33 -0500)]
USB: cypress_m8: allow unstable baud rates

I've got a crappy cypress converter here, and while running at higher
baud rates craps out on throughput, it works fine with lower ones.
While it'd be nice to simply use a lower baud rate, not all devices
can be configured this way, and it is possible to (slowly) interact
at higher rates by sending a byte at a time.  So let people force
higher rates when they need it via a module parameter.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cypress_m8: unify confusing new baudrate check
Mike Frysinger [Fri, 18 Dec 2009 21:33:02 +0000 (16:33 -0500)]
USB: cypress_m8: unify confusing new baudrate check

The current code has a confusing duplicate new_baudrate init when setting
the serial parameters.  So just combine the if statement checks to avoid
this.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cypress_m8: stop using USB debug driver config
Mike Frysinger [Fri, 18 Dec 2009 21:33:01 +0000 (16:33 -0500)]
USB: cypress_m8: stop using USB debug driver config

The USB_SERIAL_DEBUG Kconfig is for the USB serial debug driver, not for
generically enabling debug output in random USB serial drivers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Export QUIRK_RESET_MORPHS through sysfs
Oliver Neukum [Sat, 16 Jan 2010 00:33:03 +0000 (01:33 +0100)]
USB: Export QUIRK_RESET_MORPHS through sysfs

Some devices which use mode switching revert to their
primary mode as they are reset. They must not be reset for
error handling. As user spaces makes the switch it also
has to tell the kernel that a device is quirky.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: storage: Never reset devices that will morph to an old mode
Oliver Neukum [Fri, 18 Dec 2009 11:14:21 +0000 (12:14 +0100)]
USB: storage: Never reset devices that will morph to an old mode

Some devices must be switched to a new mode to fully use them.
A reset would make them revert to the old mode. Therefore a reset
must not be used for error handling with such devices.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: otg: twl4030: add support for notifier
Felipe Balbi [Thu, 17 Dec 2009 11:01:37 +0000 (13:01 +0200)]
USB: otg: twl4030: add support for notifier

it's expected that the transceiver driver will
initialize and call the notifier chain when
necessary. Implement that for twl4030-usb driver.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: otg: add notifier support
Felipe Balbi [Thu, 17 Dec 2009 11:01:36 +0000 (13:01 +0200)]
USB: otg: add notifier support

The notifier will be used to communicate usb events
to other drivers like the charger chip.

This can be used as source of information to kick
usb charger detection as described by the USB
Battery Charging Specification 1.1 and/or to
pass bMaxPower field of selected usb_configuration
to charger chip in order to use that information
as input current on the charging profile
setup.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: wusb: check CHID is all zeros before stopping the host
Julia Lawall [Thu, 17 Dec 2009 13:57:33 +0000 (13:57 +0000)]
USB: wusb: check CHID is all zeros before stopping the host

An incorrect sizeof() resulted in only 4 (or 8) octets of the CHID being
checked instead of all 16 octets.  A randomly generated CHID had a
probability of being unable to start a WUSB host of less than 1 in
2 billion.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: xhci: No GFP_KERNEL in block error handling
Oliver Neukum [Wed, 16 Dec 2009 18:43:59 +0000 (19:43 +0100)]
USB: xhci: No GFP_KERNEL in block error handling

xhci_add_endpoint() is used in the reset path. It must
use GFP_NOIO to avoid a possible deadlock.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Acked-by: Sarah Sharp <sarah.a.sharp@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cdc-acm: Update to new autopm API
Oliver Neukum [Wed, 16 Dec 2009 16:05:57 +0000 (17:05 +0100)]
USB: cdc-acm: Update to new autopm API

Update cdc-acm to the async methods eliminating the workqueue

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ehci-au1xxx.c: use platform_get_resource() and resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 23:22:42 +0000 (18:22 -0500)]
USB: ehci-au1xxx.c: use platform_get_resource() and resource_size()

Use platform_get_resource() to fetch the memory resource and
resource_size() for calculate the length.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ehci-atmel.c: use resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 23:15:35 +0000 (18:15 -0500)]
USB: ehci-atmel.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ehci-orion.c: use resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 23:13:00 +0000 (18:13 -0500)]
USB: ehci-orion.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: at91_udc.c: use resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 22:59:22 +0000 (17:59 -0500)]
USB: at91_udc.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: atmel_usba_udc.c: use resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 23:04:49 +0000 (18:04 -0500)]
USB: atmel_usba_udc.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: pxa27x_udc.c: use resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 23:05:02 +0000 (18:05 -0500)]
USB: pxa27x_udc.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ehci-fsl: Add power management support
Anton Vorontsov [Mon, 14 Dec 2009 15:41:12 +0000 (18:41 +0300)]
USB: ehci-fsl: Add power management support

EHCI FSL controller preserve its state during sleep mode, so nothing
fancy needs to be done.

Though, during 'deep sleep' mode (as found in MPC831x CPUs) the
controller turns off and needs to be reinitialized upon resume.

This patch adds support for hibernation and resuming after deep sleep.
Based on Dave Liu and Jerry Huang's work[1].

[1] http://www.bitshrine.org/gpp/linux-fsl-2.6.24.3-MPC8315ERDB-usb-power-mangement.patch

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ehci-fsl: Fix sparse warnings
Anton Vorontsov [Mon, 14 Dec 2009 15:41:05 +0000 (18:41 +0300)]
USB: ehci-fsl: Fix sparse warnings

This patch fixes following warnings:

ehci-fsl.c:43:5: warning: symbol 'usb_hcd_fsl_probe' was not declared. Should it be static?
ehci-fsl.c:150:6: warning: symbol 'usb_hcd_fsl_remove' was not declared. Should it be static?

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ehci: fix audio record functionality for some Full speed sound blaster devices
Dmitri Epshtein [Mon, 14 Dec 2009 15:17:34 +0000 (17:17 +0200)]
USB: ehci: fix audio record functionality for some Full speed sound blaster devices

This patch fix audio record functionality for some Full speed sound blaster devices.
Issue: Sometimes transaction complete indication is coming from HW one frame later.
Solution: If scan_periodic process now frame or previous frame now-1 and sitd transaction
is not finished yet, exit scan_periodic function and check the same transaction in the next frame.

Signed-off-by: Dimitry Epshtein <dima@marvell.com>
Signed-off-by: Saeed Bishara <saeed@marvell.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ehci: add call of free_cached_itd_list() function in disable_periodic()
Dmitri Epshtein [Mon, 14 Dec 2009 15:17:33 +0000 (17:17 +0200)]
USB: ehci: add call of free_cached_itd_list() function in disable_periodic()

Sometimes disable_periodic() stop scan_periodic before than free_cached_itd_list() was called.
In such case USB Host stacked during disconnect operation
Solution: add call of free_cached_itd_list() function in disable_periodic()

Signed-off-by: Dimitry Epshtein <dima@marvell.com>
Signed-off-by: Saeed Bishara <saeed@marvell.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: Add call to notify xHC of a device reset.
Sarah Sharp [Wed, 9 Dec 2009 23:59:17 +0000 (15:59 -0800)]
USB: Add call to notify xHC of a device reset.

Add a new host controller driver method, reset_device(), that the USB core
will use to notify the host of a successful device reset.  The call may
fail due to out-of-memory errors; attempt the port reset sequence again if
that happens.  Update hub_port_init() to allow resetting a configured
device.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: xhci: Notify the xHC when a device is reset.
Sarah Sharp [Wed, 9 Dec 2009 23:59:13 +0000 (15:59 -0800)]
USB: xhci: Notify the xHC when a device is reset.

When a USB device is reset, the xHCI hardware must know, in order to match
the device state and disable all endpoints except control endpoint 0.
Issue a Reset Device command after a USB device is successfully reset.
Wait on the command to finish, and then cache or free the disabled
endpoint rings.

There are four different USB device states that the xHCI hardware tracks:
 - disabled/enabled - device connection has just been detected,
 - default - the device has been reset and has an address of 0,
 - addressed - the device has a non-zero address but no configuration has
   been set,
 - configured - a set configuration succeeded.

The USB core may issue a port reset when a device is in any state, but the
Reset Device command will fail for a 0.96 xHC if the device is not in the
addressed or configured state.  Don't consider this failure as an error,
but don't free any endpoint rings if this command fails.

A storage driver may request that the USB device be reset during error
handling, so use GPF_NOIO instead of GPF_KERNEL while allocating memory
for the Reset Device command.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: xhci: Allow roothub ports to be disabled.
Sarah Sharp [Wed, 9 Dec 2009 23:59:11 +0000 (15:59 -0800)]
USB: xhci: Allow roothub ports to be disabled.

Add the hub emulation code to allow ports on an xHCI root hub to be
disabled.  Add the code to clear the port enabled/disabled bit, and clear
the port enabled/disabled change bit.  Like EHCI, the port cannot be
enabled by setting the port enabled/disabled bit.  Instead, a port is
enabled by the host controller after a reset.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: xhci: Refactor code to clear port change bits.
Sarah Sharp [Wed, 9 Dec 2009 23:59:08 +0000 (15:59 -0800)]
USB: xhci: Refactor code to clear port change bits.

Refactor the code to clear the port change bits in the port status
register.  All port status change bits are write one to clear.

Remove a redundant port status read that was supposed to unblock any
posted writes.  We read the port after the write to get the updated status
for debugging, so the port read after that is unnecessary.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: xhci: Refactor test for vendor-specific completion codes.
Sarah Sharp [Wed, 9 Dec 2009 23:59:06 +0000 (15:59 -0800)]
USB: xhci: Refactor test for vendor-specific completion codes.

All commands that can be issued to the xHCI hardware can come back with
vendor-specific "informational" completion codes.  These are to be treated
like a successful completion code.  Refactor out the code to test for the
range of these codes and print debugging messages.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: xhci: Allow allocation of commands without input contexts.
Sarah Sharp [Wed, 9 Dec 2009 23:59:03 +0000 (15:59 -0800)]
USB: xhci: Allow allocation of commands without input contexts.

The xhci_command structure is the basic structure for issuing commands to
the xHCI hardware.  It contains a struct completion (so that the issuing
function can wait on the command), command status, and a input context
that is used to pass information to the hardware.  Not all commands need
the input context, so make it optional to allocate.  Allow
xhci_free_container_ctx() to be passed a NULL input context, to make
freeing the xhci_command structure simple.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: xhci: Refactor code to free or cache endpoint rings.
Sarah Sharp [Wed, 9 Dec 2009 23:59:01 +0000 (15:59 -0800)]
USB: xhci: Refactor code to free or cache endpoint rings.

Refactor out the code to cache or free endpoint rings from recently
dropped or disabled endpoints.  This code will be used by a new function
to reset a device and disable all endpoints except control endpoint 0.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: xhci: Fix error path when configuring endpoints.
Sarah Sharp [Wed, 9 Dec 2009 23:58:58 +0000 (15:58 -0800)]
USB: xhci: Fix error path when configuring endpoints.

If we fail to queue an evaluate context command or a configure endpoint
command to the command ring in xhci_configure_endpoint(), we need to
remove the xhci_command structure from the device's command list before
returning.  If the command is left on the command list, it will sit there
indefinitely, blocking commands submitted after this fails.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: check the endpoint type against the pipe type
Alan Stern [Fri, 11 Dec 2009 21:20:20 +0000 (16:20 -0500)]
USB: check the endpoint type against the pipe type

This patch (as1316) adds some error checking to usb_submit_urb().
It's conditional on CONFIG_USB_DEBUG, so it won't affect normal users.
The new check makes sure that the actual type of the endpoint
described by urb->pipe agrees with the type encoded in the pipe value.

The USB error code documentation is updated to include the code
returned by the new check, and the usbfs SUBMITURB handler is updated
to use the correct pipe type when legacy user code tries to submit a
bulk transfer to an interrupt endpoint.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agocdc_acm: add reset_resume method
Francesco Lavra [Tue, 8 Dec 2009 08:54:11 +0000 (09:54 +0100)]
cdc_acm: add reset_resume method

Add reset resume logic to the cdc acm driver

Signed-off-by: Francesco Lavra <francescolavra@interfree.it>
Acked-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: serial mct_usb232: move DMA buffers to heap
Pete Zaitcev [Tue, 8 Dec 2009 03:29:05 +0000 (20:29 -0700)]
USB: serial mct_usb232: move DMA buffers to heap

My distro kernel (Fedora Rawhide) started throwing warnings from DMA API
checker, so I have no choice but band-aid it quick. There's no attempt
to reuse DMA buffers. Control messages are only sent rarely anyway.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: pxa27x_udc: avoid compiler warnings and misbehavior on buggy hardware
Enrico Scholz [Sun, 11 Oct 2009 09:52:48 +0000 (11:52 +0200)]
USB: pxa27x_udc: avoid compiler warnings and misbehavior on buggy hardware

hardware reports wrong interrupt.  Although such a situation should not
happen, the compiler complains about this access.

This patch adds a sanity check and generates warning to detect such
issues.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: fix occasional ULPI timeouts with ehci-mxc
Valentin Longchamp [Wed, 20 Jan 2010 18:43:23 +0000 (19:43 +0100)]
USB: fix occasional ULPI timeouts with ehci-mxc

On various mxc boards, the intial ULPI reads resulted in a timeout
which prevented the transceiver to be identified and thus the ehci
device to be probed.

Initializing the hardware lines connected to the transceiver (through
pdata->init call) before actually enabling clocks and configuring
registers in the devices fixes this problem.

Signed-off-by: Valentin Longchamp <valentin.longchamp@epfl.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ftdi_sio: remove support for 5 and 6 data bits
Mark Adamson [Tue, 24 Nov 2009 09:39:10 +0000 (09:39 +0000)]
USB: ftdi_sio: remove support for 5 and 6 data bits

Removed CS5 and CS6 from data bits since these are not supported
in FTDI hardware.

Signed-off-by: Mark J. Adamson <mark.adamson@ftdichip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ftdi_sio: fix initialisation of latency timeout
Johan Hovold [Sun, 22 Nov 2009 20:25:20 +0000 (21:25 +0100)]
USB: ftdi_sio: fix initialisation of latency timeout

Latency timeout was read but never stored on port probe. When
ASYNC_LOW_LATENCY was cleared the device timeout would get set to 0
rather than the default 16ms.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: serial: fix typo in debug message
Johan Hovold [Sun, 22 Nov 2009 16:42:34 +0000 (17:42 +0100)]
USB: serial: fix typo in debug message

Fixes confusing "serial_chars_in_buffer = port 0" messages.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ftdi_sio: remove obsolete comment
Johan Hovold [Sun, 22 Nov 2009 16:25:08 +0000 (17:25 +0100)]
USB: ftdi_sio: remove obsolete comment

We always push characters to ldisc immediately regardless of
ASYNC_LOW_LATENCY.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: ftdi_sio: fix error message on close
Johan Hovold [Sun, 22 Nov 2009 16:01:13 +0000 (17:01 +0100)]
USB: ftdi_sio: fix error message on close

Resubmitting read urb fails with -EPERM if completion handler runs while
urb is being killed on close. This should not be reported as an error.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cxacru: increment driver version
Simon Arlott [Sat, 21 Nov 2009 15:16:38 +0000 (15:16 +0000)]
USB: cxacru: increment driver version

Changes:
  Return an empty string for modulation
    when there is no connection
  Fix sysfs unload race conditions
  Log firmware load process, remove delay
  Add new configuration interface
  Remove cxacru-cf.bin

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cxacru: remove cxacru-cf.bin loader
Simon Arlott [Sat, 21 Nov 2009 15:15:47 +0000 (15:15 +0000)]
USB: cxacru: remove cxacru-cf.bin loader

This has never worked properly because wsize passed to
cxacru_cm() is incorrectly set to the number of values
instead of the data bytes. The maximum number of values
that can be set at once is 7 which means the device will
not get enough data to work with and none of the
configuration values will be used.

At least one existing cxacru-cf.bin file contains invalid
data which will prevent the modem from syncing properly.

Fixing it is likely to break existing systems, and the
new sysfs interface for setting configuration parameters
can provide the same functionality. A script is provided
to convert from the original format.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cxacru: add write-only sysfs attribute for modem configuration
Simon Arlott [Sat, 21 Nov 2009 15:14:01 +0000 (15:14 +0000)]
USB: cxacru: add write-only sysfs attribute for modem configuration

The modem can be configured using CM_REQUEST_CARD_DATA_SET,
although CM_REQUEST_CARD_DATA_GET does not return any data.

Tested by setting the modulation (0x0a) option.

There is a list of parameters in the following archive,
but the meaning of many of them is not well documented:
  http://sourceforge.net/project/shownotes.php?release_id=301825

This source also indicates that the highest parameter set
is 0x4a but this varies by model so an arbitrary limit of
0x7f has been used (the index is a 32-bit integer).

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cxacru: firmware writes on OHCI are slow, log progress
Simon Arlott [Sat, 21 Nov 2009 15:12:56 +0000 (15:12 +0000)]
USB: cxacru: firmware writes on OHCI are slow, log progress

Firmware writing takes 256ms per 4KB with OHCI, which
is very slow compared to 7ms per 4KB with UHCI.

Until I have access to a hardware USB analyser it may
not be possible to determine why this happens.

Instead of appearing to do nothing, log progress when
writing firmware and then log the ATM device information
when finished. Remove an unnecessary 4 second delay.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cxacru: document how to interact with the flash memory
Simon Arlott [Sat, 21 Nov 2009 15:12:21 +0000 (15:12 +0000)]
USB: cxacru: document how to interact with the flash memory

These commands were found by accident... fortunately
it still works even if the flash memory is erased,
despite having no USB device IDs.

Some example sysfs code for raw command access:
  http://simon.arlott.org/pub/cxacru/raw.c

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cxacru: check device isn't being removed during sysfs calls
Simon Arlott [Sat, 21 Nov 2009 15:33:51 +0000 (15:33 +0000)]
USB: cxacru: check device isn't being removed during sysfs calls

It is possible for usb_get_intfdata() to return NULL if
sysfs is accessed while the module is being unloaded or
the device is being removed.

Move the access code to an inline function in usbatm.h,
and return -ENODEV if any of the pointers are NULL.

It should not be possible for the instance data or atm
device to be invalid until after unbind() completes and
the sysfs attributes have been removed.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cxacru: check data length is not negative
Simon Arlott [Sat, 21 Nov 2009 15:07:14 +0000 (15:07 +0000)]
USB: cxacru: check data length is not negative

When attempting to read data that is not actually
an array of values, the length may be negative
which causes an Oops due to a likely access off
the end of the data array.

This bug should not occur under normal use unless
the device returns an invalid response.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: cxacru: return an empty value for modulation if there is no connection
Simon Arlott [Sat, 21 Nov 2009 15:03:23 +0000 (15:03 +0000)]
USB: cxacru: return an empty value for modulation if there is no connection

When there is no connection, return an empty string
instead of "0" for the connection modulation.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: MXC: add platform resources for i.MX21 USB host controller.
Martin Fuzzey [Sat, 21 Nov 2009 11:14:58 +0000 (12:14 +0100)]
USB: MXC: add platform resources for i.MX21 USB host controller.

Signed-off-by: Martin Fuzzey <mfuzzey@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: MXC: use DMA_BIT_MASK macro rather than hardcoded constants.
Martin Fuzzey [Sat, 21 Nov 2009 11:14:54 +0000 (12:14 +0100)]
USB: MXC: use DMA_BIT_MASK macro rather than hardcoded constants.

Also fixes tab/space issue causing checkpatch to complain.

Signed-off-by: Martin Fuzzey <mfuzzey@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoUSB: MXC: Add i.MX21 specific USB host controller driver.
Martin Fuzzey [Sat, 21 Nov 2009 11:14:48 +0000 (12:14 +0100)]
USB: MXC: Add i.MX21 specific USB host controller driver.

This driver is a Full / Low speed only USB host for the i.MX21.

Signed-off-by: Martin Fuzzey <mfuzzey@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 years agoMerge branch 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 1 Mar 2010 21:05:40 +0000 (13:05 -0800)]
Merge branch 'davinci-for-linus' of git://git./linux/kernel/git/khilman/linux-davinci

* 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci: (40 commits)
  DaVinci DM365: Adding support for SPI EEPROM
  DaVinci DM365: Adding DM365 SPI support
  DaVinci DM355: Modifications to DM355 SPI support
  DaVinci: SPI: Adding header file for SPI support.
  davinci: dm646x: CDCE clocks: davinci_clk converted to clk_lookup
  davinci: clkdev cleanup: remove clk_lookup wrapper, use clkdev_add_table()
  DaVinci: DM365: Voice codec support for the DM365 SoC
  davinci: clock: let clk->set_rate function sleep
  Add SDA and SCL pin numbers to i2c platform data
  davinci: da8xx/omap-l1xx: Add EDMA platform data for da850/omap-l138
  davinci: build list of unused EDMA events dynamically
  davinci: Fix edma_alloc_channel api for EDMA_CHANNEL_ANY case
  davinci: Keep count of channel controllers on a platform
  davinci: Correct return value of edma_alloc_channel api
  davinci: add CDCE949 support on DM6467 EVM
  davinci: add support for CDCE949 clock synthesizer
  davinci: da850/omap-l138 EVM: register for suspend support
  davinci: da850/omap-l138: add support for SoC suspend
  davinci: add power management support
  DaVinci: DM365: Changing default queue for DM365.
  ...