firefly-linux-kernel-4.4.55.git
16 years agomfd: Don't use NO_IRQ in WM8350
Mark Brown [Wed, 15 Oct 2008 10:28:06 +0000 (12:28 +0200)]
mfd: Don't use NO_IRQ in WM8350

NO_IRQ is only defined on some architectures - the general way to test
for an invalid IRQ in the modern kernel is by comparing with zero.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
16 years agomfd: update TMIO drivers to use the clock API
Ian Molton [Thu, 9 Oct 2008 18:06:09 +0000 (20:06 +0200)]
mfd: update TMIO drivers to use the clock API

This patch updates the remaining two TMIO drivers to use the clock API
rather than callback hooks into platform code.

Signed-off-by: Ian Molton <spyro@f2s.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
16 years agomfd: twl4030-core irq simplification
David Brownell [Wed, 8 Oct 2008 22:30:11 +0000 (00:30 +0200)]
mfd: twl4030-core irq simplification

Simplify twl4030 IRQ handling by removing a needless custom flow
handler.  The top level IRQs, from the PIH, are well suited for
handle_simple_irq() ... they can't be acked or masked.

Switching resolves some issues with how IRQs were dispatched.
Notably, abuse of desc->status, IRQ accounting, and handling
of various faults.

In short, use standard genirq code.

Drivers that request_irq() to the PIH will need to pay more
attention to things like setting IRQF_DISABLED (since it's
no longer ignored), and making I2C calls from handlers (you'll
need a lockdep workaround).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
16 years agomfd: add base support for Dialog DA9030/DA9034 PMICs
Eric Miao [Wed, 15 Oct 2008 10:20:06 +0000 (12:20 +0200)]
mfd: add base support for Dialog DA9030/DA9034 PMICs

DA9030 (a.k.a ARAVA) and DA9034 (a.k.a MICCO) are PMICs designed by
Dialog Semiconductor, usually found on PXA-based platforms. These
PMICs are I2C-based, multi-function devices, usually with LEDs, PWMs
for backlight, BUCKs and LDOs, ADCs and touchscreen controller (on
DA9034).

This is the base support for the I2C operations, event registration
and handling, sub-devices management.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Liam Girdwood <lrg@kernel.org>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
16 years agomfd: TWL4030 core driver
David Brownell [Wed, 15 Oct 2008 10:15:39 +0000 (12:15 +0200)]
mfd: TWL4030 core driver

This patch adds the core of the TWL4030 driver, which supports
chips including the TPS65950.  These chips are multi-function; see

  http://focus.ti.com/docs/prod/folders/print/tps65950.html

Public specs are in the works.  For now, the block diagram on
the second page of the datasheet is fairly informative.

There are some known issues with this core code.  Most notably,
the IRQ dispatching needs simplification (to use more of genirq),
generalization (integrating support for secondary IRQ dispatch
as well as primary, and removing the build dependency on OMAP),
and then probably updating to leverage threaded IRQ support
(expected to arrive in mainline "soon").

Once the core is in mainline, drivers for other parts of this
chip can follow its lead and start swimming upstream too.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
16 years agomfd: support tmiofb cell on tc6393xb
Dmitry Baryshkov [Fri, 3 Oct 2008 22:50:36 +0000 (00:50 +0200)]
mfd: support tmiofb cell on tc6393xb

Add support for tmiofb cell found in tc6393xb chip.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Ian Molton <spyro@f2s.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
16 years agomfd: add OHCI cell to tc6393xb
Dmitry Baryshkov [Fri, 3 Oct 2008 18:11:36 +0000 (20:11 +0200)]
mfd: add OHCI cell to tc6393xb

Add information regarding OHCI cell of the tc6393xb

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Acked-by: Ian Molton <spyro@f2s.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
16 years agomfd: Fix htc-egpio compile warning
Samuel Ortiz [Wed, 24 Sep 2008 22:17:00 +0000 (00:17 +0200)]
mfd: Fix htc-egpio compile warning

resource_size_t can be a 64 bits value. Since this is just a printk, we'll
cast it to a u32.

Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
16 years agomfd: do tcb6393xb state restore on resume only if requested
Dmitry Baryshkov [Wed, 24 Sep 2008 21:46:10 +0000 (23:46 +0200)]
mfd: do tcb6393xb state restore on resume only if requested

As requested by Ian make state restore only if it's requested
by platform data: some platforms do correctly save the state of
the chip during suspend/resume, but some (like tosa) incorrectly
power off the chip at suspend, so the driver supports restoring
some bits of the tc6393xb state (not full, merely enough to support
resume on tosa). With this patch this code is disabled by default.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Acked-by: Ian Molton <spyro@f2s.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
16 years agomfd: provide and use setup hook for tc6393xb
Dmitry Baryshkov [Wed, 24 Sep 2008 21:36:23 +0000 (23:36 +0200)]
mfd: provide and use setup hook for tc6393xb

Instead of using bitfields for initial gpio setup,
provide generic setup/teardown hooks that can be used
to set the gpio states, register child devices, etc.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
16 years agomfd: update sm501 debugging/low information messages
Ben Dooks [Sun, 10 Aug 2008 21:45:24 +0000 (23:45 +0200)]
mfd: update sm501 debugging/low information messages

Make the default output of the SM501 driver to be less noisy wrt to
message that have low informational value, or simply should be debug.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
16 years agomfd: reduce stack usage in mfd-core.c
Ian Molton [Fri, 25 Jul 2008 21:59:29 +0000 (22:59 +0100)]
mfd: reduce stack usage in mfd-core.c

This patch moves the allocation of the resources off the stack in
mfd_add_device().

Signed-off-by: Ian Molton <spyro@f2s.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
Linus Torvalds [Fri, 17 Oct 2008 22:43:52 +0000 (15:43 -0700)]
Merge git://git./linux/kernel/git/gregkh/usb-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (94 commits)
  USB: remove err() macro from more usb drivers
  USB: remove err() macro from usb misc drivers
  USB: remove err() macro from usb core code
  USB: remove err() macro from usb class drivers
  USB: remove use of err() in drivers/usb/serial
  USB: remove info() macro from usb mtd drivers
  USB: remove info() macro from usb input drivers
  USB: remove info() macro from usb network drivers
  USB: remove info() macro from remaining usb drivers
  USB: remove info() macro from usb/misc drivers
  USB: remove info() macro from usb/serial drivers
  USB: remove warn macro from HID core
  USB: remove warn() macro from usb drivers
  USB: remove warn() macro from usb net drivers
  USB: remove warn() macro from usb media drivers
  USB: remove warn() macro from usb input drivers
  usb/fsl_qe_udc: clear data toggle on clear halt request
  usb/fsl_qe_udc: fix response to get status request
  fsl_usb2_udc: Fix oops on probe failure.
  fsl_usb2_udc: Add a wmb before priming endpoint.
  ...

16 years agoMerge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Fri, 17 Oct 2008 22:09:20 +0000 (15:09 -0700)]
Merge branch 'drm-next' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (44 commits)
  drm/i915: fix ioremap of a user address for non-root (CVE-2008-3831)
  drm: make CONFIG_DRM depend on CONFIG_SHMEM.
  radeon: fix PCI bus mastering support enables.
  radeon: add RS400 family support.
  drm/radeon: add support for RS740 IGP chipsets.
  i915: GM45 has GM965-style MCH setup.
  i915: Don't run retire work handler while suspended
  i915: Map status page cached for chips with GTT-based HWS location.
  i915: Fix up ring initialization to cover G45 oddities
  i915: Use non-reserved status page index for breadcrumb
  drm: Increment dev_priv->irq_received so i915_gem_interrupts count works.
  drm: kill drm_device->irq
  drm: wbinvd is cache coherent.
  i915: add missing return in error path.
  i915: fixup permissions on gem ioctls.
  drm: Clean up many sparse warnings in i915.
  drm: Use ioremap_wc in i915_driver instead of ioremap, since we always want WC.
  drm: G33-class hardware has a newer 965-style MCH (no DCC register).
  drm: Avoid oops in GEM execbuffers with bad arguments.
  DRM: Return -EBADF on bad object in flink, and return curent name if it exists.
  ...

16 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Fri, 17 Oct 2008 22:08:47 +0000 (15:08 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/mchehab/linux-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (95 commits)
  V4L/DVB (9296): Patch to remove warning message during cx88-dvb compilation
  V4L/DVB (9294): gspca: Add a stop sequence in t613.
  V4L/DVB (9293): gspca: Separate and fix the sensor dependant sequences in t613.
  V4L/DVB (9292): gspca: Call the control setting functions at init time in t613.
  V4L/DVB (9291): gspca: Do not set the white balance temperature by default in t613.
  V4L/DVB (9290): gspca: Adjust the sensor init sequences in t613.
  V4L/DVB (9289): gspca: Other sensor identified as om6802 in t613.
  V4L/DVB (9288): gspca: Write to the USB device and not USB interface in t613.
  V4L/DVB (9287): gspca: Change the name of the multi bytes write function in t613.
  V4L/DVB (9286): gspca: Compilation problem of gspca.c and the kernel version.
  V4L/DVB (9283): Correct typo and enable setting the gain on the mt9m111 sensor
  V4L/DVB (9282): Properly iterate the urbs when destroying them.
  V4L/DVB (9281): gspca: Add hflip and vflip to the po1030 sensor
  V4L/DVB (9280): gspca: Use the gspca debug macros
  V4L/DVB (9279): gspca: Correct some copyright headers
  V4L/DVB (9278): gspca: Remove the m5602_debug variable
  V4L/DVB (9277): gspca: propagate an error in m5602_start_transfer()
  V4L/DVB (9276): videobuf-dvb: two functions are now static
  V4L/DVB (9275): dvb: input data pointer of cx24116_writeregN() should be const
  V4L/DVB (9274): Remove spurious messages and turn into debug.
  ...

16 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Linus Torvalds [Fri, 17 Oct 2008 22:08:11 +0000 (15:08 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: Remove automatic enabling of the HUGE_FILE feature flag
  ext4: Replace hackish ext4_mb_poll_new_transaction with commit callback
  ext4: Update Documentation/filesystems/ext4.txt
  ext4: Remove unused mount options: nomballoc, mballoc, nocheck
  ext4: Remove compile warnings when building w/o CONFIG_PROC_FS
  ext4: Add missing newlines to printk messages
  ext4: Fix file fragmentation during large file write.
  vfs: Add no_nrwrite_index_update writeback control flag
  vfs: Remove the range_cont writeback mode.
  ext4: Use tag dirty lookup during mpage_da_submit_io
  ext4: let the block device know when unused blocks can be discarded
  ext4: Don't reuse released data blocks until transaction commits
  ext4: Use an rbtree for tracking blocks freed during transaction.
  ext4: Do mballoc init before doing filesystem recovery
  ext4: Free ext4_prealloc_space using kmem_cache_free
  ext4: Fix Kconfig typo for ext4dev
  ext4: Remove an old reference to ext4dev in Makefile comment

16 years agoUSB: remove err() macro from more usb drivers
Greg Kroah-Hartman [Thu, 14 Aug 2008 16:37:34 +0000 (09:37 -0700)]
USB: remove err() macro from more usb drivers

USB should not be having it's own printk macros, so remove err() and
use the system-wide standard of dev_err() wherever possible.  In the
few places that will not work out, use a basic printk().

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove err() macro from usb misc drivers
Greg Kroah-Hartman [Thu, 14 Aug 2008 16:37:34 +0000 (09:37 -0700)]
USB: remove err() macro from usb misc drivers

USB should not be having it's own printk macros, so remove err() and
use the system-wide standard of dev_err() wherever possible.  In the
few places that will not work out, use a basic printk().

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove err() macro from usb core code
Greg Kroah-Hartman [Thu, 14 Aug 2008 16:37:34 +0000 (09:37 -0700)]
USB: remove err() macro from usb core code

USB should not be having it's own printk macros, so remove err() and
use the system-wide standard of dev_err() wherever possible.  In the
few places that will not work out, use a basic printk().

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove err() macro from usb class drivers
Greg Kroah-Hartman [Thu, 14 Aug 2008 16:37:34 +0000 (09:37 -0700)]
USB: remove err() macro from usb class drivers

USB should not be having it's own printk macros, so remove err() and
use the system-wide standard of dev_err() wherever possible.  In the
few places that will not work out, use a basic printk().

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove use of err() in drivers/usb/serial
Greg Kroah-Hartman [Wed, 20 Aug 2008 23:56:34 +0000 (16:56 -0700)]
USB: remove use of err() in drivers/usb/serial

err() is going away, so switch to dev_err() or printk() if it's really
needed.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove info() macro from usb mtd drivers
Greg Kroah-Hartman [Mon, 18 Aug 2008 20:21:04 +0000 (13:21 -0700)]
USB: remove info() macro from usb mtd drivers

USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.

Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove info() macro from usb input drivers
Greg Kroah-Hartman [Mon, 18 Aug 2008 20:21:04 +0000 (13:21 -0700)]
USB: remove info() macro from usb input drivers

USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove info() macro from usb network drivers
Greg Kroah-Hartman [Mon, 18 Aug 2008 20:21:04 +0000 (13:21 -0700)]
USB: remove info() macro from usb network drivers

USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove info() macro from remaining usb drivers
Greg Kroah-Hartman [Mon, 18 Aug 2008 20:21:04 +0000 (13:21 -0700)]
USB: remove info() macro from remaining usb drivers

USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.  In the
few places that will not work out, use a basic printk().

Clean up the remaining usages of this in the drivers/usb/ directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove info() macro from usb/misc drivers
Greg Kroah-Hartman [Mon, 18 Aug 2008 20:21:04 +0000 (13:21 -0700)]
USB: remove info() macro from usb/misc drivers

USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove info() macro from usb/serial drivers
Greg Kroah-Hartman [Mon, 18 Aug 2008 20:21:04 +0000 (13:21 -0700)]
USB: remove info() macro from usb/serial drivers

USB should not be having it's own printk macros, so remove info() and
use the system-wide standard of dev_info() wherever possible.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove warn macro from HID core
Greg Kroah-Hartman [Wed, 15 Oct 2008 18:30:07 +0000 (11:30 -0700)]
USB: remove warn macro from HID core

There were two stragglers that got missed in the last merge of the HID tree that forgot to change the warn() calls to dev_warn().  This patch fixes them up.

Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove warn() macro from usb drivers
Greg Kroah-Hartman [Thu, 14 Aug 2008 16:37:34 +0000 (09:37 -0700)]
USB: remove warn() macro from usb drivers

USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible.  In the
few places that will not work out, use a basic printk().

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove warn() macro from usb net drivers
Greg Kroah-Hartman [Thu, 14 Aug 2008 16:37:34 +0000 (09:37 -0700)]
USB: remove warn() macro from usb net drivers

USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible.  In the
few places that will not work out, use a basic printk().

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove warn() macro from usb media drivers
Greg Kroah-Hartman [Thu, 14 Aug 2008 16:37:34 +0000 (09:37 -0700)]
USB: remove warn() macro from usb media drivers

USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible.  In the
few places that will not work out, use a basic printk().

Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove warn() macro from usb input drivers
Greg Kroah-Hartman [Thu, 14 Aug 2008 16:37:34 +0000 (09:37 -0700)]
USB: remove warn() macro from usb input drivers

USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible.  In the
few places that will not work out, use a basic printk().

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb/fsl_qe_udc: clear data toggle on clear halt request
Li Yang [Wed, 24 Sep 2008 07:50:27 +0000 (15:50 +0800)]
usb/fsl_qe_udc: clear data toggle on clear halt request

Fix to comply with USB spec.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb/fsl_qe_udc: fix response to get status request
Li Yang [Wed, 24 Sep 2008 07:50:26 +0000 (15:50 +0800)]
usb/fsl_qe_udc: fix response to get status request

The original code didn't respond correctly to get status request on
device and endpoint.  Although normal operations can work without the
fix.  It is not compliant with USB spec chapter9 and fails USBCV ch9
tests.  The patch fix this and a few style/typo problems.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Fix oops on probe failure.
Will Newton [Tue, 12 Aug 2008 14:39:17 +0000 (15:39 +0100)]
fsl_usb2_udc: Fix oops on probe failure.

In some circumstances when fsl_udc_probe fails udc_controller is freed but
the pointer remains non-NULL. fsl_udc_remove will then try and teardown
the partly initialized and freed controller structure resulting in an oops.
This patch ensures udc_controller is either NULL or fully initialized after
fsl_udc_probe.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Add a wmb before priming endpoint.
Will Newton [Tue, 12 Aug 2008 14:39:16 +0000 (15:39 +0100)]
fsl_usb2_udc: Add a wmb before priming endpoint.

Add a wmb to fsl_queue_td before priming the endpoint. This ensures that the
modifications to the QH are seen by the hardware.

Added comment as suggested by Felipe Balbi.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Make fsl_queue_td return type void.
Will Newton [Tue, 12 Aug 2008 14:39:15 +0000 (15:39 +0100)]
fsl_usb2_udc: Make fsl_queue_td return type void.

fsl_queue_td always returns 0. Make it void and remove checks for non-zero
return in callers.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Uninline udc_reset_ep_queue.
Will Newton [Tue, 12 Aug 2008 14:39:14 +0000 (15:39 +0100)]
fsl_usb2_udc: Uninline udc_reset_ep_queue.

Uninline udc_reset_ep_queue and remove it's unused return value.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Rename the arguments of the fsl_writel macro.
Will Newton [Tue, 12 Aug 2008 14:39:13 +0000 (15:39 +0100)]
fsl_usb2_udc: Rename the arguments of the fsl_writel macro.

Rename the arguments of the fsl_writel macro to match their use.
Remove a couple of unnecessary prototypes.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Initialize spinlock earlier.
Will Newton [Tue, 12 Aug 2008 14:39:12 +0000 (15:39 +0100)]
fsl_usb2_udc: Initialize spinlock earlier.

Move spinlock initialization earlier so we can turn shared irq handler
debugging on safely.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Clean up whitespace in /proc debugging output.
Will Newton [Tue, 12 Aug 2008 14:39:11 +0000 (15:39 +0100)]
fsl_usb2_udc: Clean up whitespace in /proc debugging output.

Missing spaces were causing the /proc debugging output to be rather
unreadable.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Clean up whitespace in errors and warnings.
Will Newton [Tue, 12 Aug 2008 14:39:10 +0000 (15:39 +0100)]
fsl_usb2_udc: Clean up whitespace in errors and warnings.

VDBG always outputs a trailing \n.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Fix some sparse warnings and remove redundant code.
Will Newton [Tue, 12 Aug 2008 14:39:09 +0000 (15:39 +0100)]
fsl_usb2_udc: Fix some sparse warnings and remove redundant code.

Fix some sparse "integer used as NULL pointer" warnings.
Remove some unnecessary volatiles and static initialization.
Remove some unused struct members and reorder to improve packing.
Remove a few unneeded includes.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Remove check for udc == NULL in dr_controller_setup.
Will Newton [Tue, 12 Aug 2008 14:39:08 +0000 (15:39 +0100)]
fsl_usb2_udc: Remove check for udc == NULL in dr_controller_setup.

Remove check for udc == NULL in dr_controller_setup. All callers of
this function have already dereferenced udc at some point.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofsl_usb2_udc: Make dr_ep_setup function static.
Will Newton [Tue, 12 Aug 2008 14:39:07 +0000 (15:39 +0100)]
fsl_usb2_udc: Make dr_ep_setup function static.

Make dr_ep_setup function static as it's never used outside this file.

Signed-off-by: Will Newton <will.newton@gmail.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix up problems in the vtusb driver
Stephen Ware [Wed, 8 Oct 2008 17:53:56 +0000 (10:53 -0700)]
USB: fix up problems in the vtusb driver

Add range check on buffer sizes passed in from user space
(max is 8*PAGE_SIZE) which will work for the most common
spectrometers even at pages as small as 1K.

Add kref to vst device structure to preserve reference to the
usb object until we truly are done with it.

From: Stephen Ware <stephen.ware@eqware.net>
From: Dennis O'Brien <dennis.obrien@eqware.net>
Signed-off-by: Dennis O'Brien <dennis.obrien@eqware.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: OHCI: fix endless polling behavior
Alan Stern [Thu, 9 Oct 2008 19:40:23 +0000 (15:40 -0400)]
USB: OHCI: fix endless polling behavior

This patch (as1149) fixes an obscure problem in OHCI polling.  In the
current code, if the RHSC interrupt status flag turns on at a time
when RHSC interrupts are disabled, it will remain on forever:

The interrupt handler is the only place where RHSC status
gets turned back off;

The interrupt handler won't turn RHSC status off because it
doesn't turn off status flags if the corresponding interrupt
isn't enabled;

RHSC interrupts will never get enabled because
ohci_root_hub_state_changes() doesn't reenable RHSC if RHSC
status is on!

As a result we will continue polling indefinitely instead of reverting
to interrupt-driven operation, and the root hub will not autosuspend.
This particular sequence of events is not at all unusual; in fact
plugging a USB device into an OHCI controller will usually cause it to
occur.

Of course, this is a bug.  The proper thing to do is to turn off RHSC
status just before reading the actual port status values.  That way
either a port status change will be detected (if it occurs before the
status read) or it will turn RHSC back on.  Possibly both, but that
won't hurt anything.

We can still check for systems in which RHSC is totally broken, by
re-reading RHSC after clearing it and before reading the port
statuses.  (This re-read has to be done anyway, to post the earlier
write.)  If RHSC is on but no port-change statuses are set, then we
know that RHSC is broken and we can avoid re-enabling it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: option: add Pantech cards
Dan Williams [Fri, 10 Oct 2008 10:41:16 +0000 (06:41 -0400)]
USB: option: add Pantech cards

Add some Pantech mobile broadband IDs.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: hub.c: Add initial_descriptor_timeout module parameter for usbcore
Jaroslav Kysela [Fri, 10 Oct 2008 14:24:45 +0000 (16:24 +0200)]
USB: hub.c: Add initial_descriptor_timeout module parameter for usbcore

This patch adds initial_descriptor_timeout module parameter for usbcore.ko
to allow modify initial 64-byte USB_REQ_GET_DESCRIPTOR timeout for
non-standard devices.

For example, the SATA8000 device from DATAST0R Technology Corp
requires about 10 seconds to send reply (probably it waits until
inserted disk is ready for operation).

Also, this patch adds missing usbcore parameters to
Documentation/kernel-parameters.txt.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Export if an interface driver supports autosuspend.
Sarah Sharp [Mon, 6 Oct 2008 21:45:46 +0000 (14:45 -0700)]
USB: Export if an interface driver supports autosuspend.

Create a new sysfs file per interface named supports_autosuspend.  This
file returns true if an interface driver's .supports_autosuspend flag is
set.  It also returns true if the interface is unclaimed (since the USB
core will autosuspend a device if an interface is not claimed).

This new sysfs file will be useful for user space scripts to test whether
a USB device correctly auto-suspends.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: EHCI: fix remote-wakeup support for ARC/TDI core
Alan Stern [Mon, 6 Oct 2008 15:25:53 +0000 (11:25 -0400)]
USB: EHCI: fix remote-wakeup support for ARC/TDI core

This patch (as1147) fixes the remote-wakeup support for EHCI
controllers using the ARC/TDI "embedded-TT" core.  These controllers
turn off the RESUME bit by themselves when a port resume is complete;
hence we need to keep separate track of which ports are suspended or
in the process of resuming.

The patch also makes a couple of small improvements in ehci_irq(),
replacing reads of the command register with the value already stored
in a local variable.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Thomas Reitmayr <treitmayr@devbase.at>
CC: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: snoop processes opening usbfs device files
Alan Stern [Mon, 6 Oct 2008 15:24:26 +0000 (11:24 -0400)]
USB: snoop processes opening usbfs device files

This patch (as1148) adds a new "snoop" message to usbfs when a device
file is opened, identifying the process responsible.  This comes in
extremely handy when trying to determine which program is doing some
unwanted USB access.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Option / AnyData new modem, same ID
Jon K Hellan [Fri, 3 Oct 2008 08:36:16 +0000 (10:36 +0200)]
USB: Option / AnyData new modem, same ID

The AnyData ADU-310 series of wireless modems uses the same product ID as the ADU-E100 series.

Signed-off-by: Jon K Hellan <hellan@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: EHCI: log a warning if ehci-hcd is not loaded first
Alan Stern [Thu, 2 Oct 2008 15:48:13 +0000 (11:48 -0400)]
USB: EHCI: log a warning if ehci-hcd is not loaded first

This patch (as1139) adds a warning to the system log whenever ehci-hcd
is loaded after ohci-hcd or uhci-hcd.  Nowadays most distributions are
pretty good about not doing this; maybe the warning will help convince
anyone still doing it wrong.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org> [2.6.27]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: EHCI, OHCI, UHCI: remove version numbers
Alan Stern [Thu, 2 Oct 2008 15:47:15 +0000 (11:47 -0400)]
USB: EHCI, OHCI, UHCI: remove version numbers

This patch (as1145) removes the essentially useless driver-version
strings from ehci-hcd, ohci-hcd, and uhci-hcd.  It also unifies the
form of the banner lines they display upon loading and adds a missing
test for usb_disabled() to ehci-hcd.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: anchor API changes needed for btusb
Oliver Neukum [Mon, 25 Aug 2008 20:40:25 +0000 (22:40 +0200)]
USB: anchor API changes needed for btusb

This extends the anchor API as btusb needs for autosuspend.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ftdi-elan: Always pass usb_bulk_msg() a timeout in milliseconds.
Sarah Sharp [Mon, 29 Sep 2008 17:58:35 +0000 (10:58 -0700)]
USB: ftdi-elan: Always pass usb_bulk_msg() a timeout in milliseconds.

The kernel doc for usb_bulk_msg() says the timeout for a bulk message should be
specified in milliseconds.  The ftdi-elan driver converts milliseconds to
jiffies before passing the timeout to usb_bulk_msg().  This is mostly harmless,
since it will just lead to very long timeouts, but was obviously not the intent
of the original author.

Signed-off-by: Sarah Sharp <sarah.a.sharp@intel.com>
Acked-by: Tony Olech <tony.olech@elandigitalsystems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: isp1760: Use an IS_ERR test rather than a NULL test
Julien Brunel [Wed, 24 Sep 2008 16:00:36 +0000 (18:00 +0200)]
USB: isp1760: Use an IS_ERR test rather than a NULL test

In case of error, the function isp1760_register returns an ERR
pointer, but never returns a NULL pointer. So after a call to this
function, a NULL test should be replaced by an IS_ERR test. Moreover,
we have noticed that:
(1) the result of isp1760_register is assigned through the function
pci_set_drvdata without an error test,
(2) if the call to isp1760_register fails, the current function
(isp1761_pci_probe) returns 0, and if it succeeds, it returns -ENOMEM,
which seems odd.

Thus, we suggest to move the test before the call to pci_set_drvdata
to correct (1), and to turn it into a non IS_ERR test to correct (2).

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@bad_null_test@
expression x,E;
statement S1, S2;
@@
x =  isp1760_register(...)
... when != x = E
* if (x == NULL)
S1 else S2
// </smpl>

Signed-off-by: Julien Brunel <brunel@diku.dk>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: improve ehci_watchdog's side effect in CPU power management
Yi Yang [Thu, 25 Sep 2008 09:25:44 +0000 (17:25 +0800)]
USB: improve ehci_watchdog's side effect in CPU power management

ehci_watchdog will wake up CPU very frequently so that CPU
stays at C3 very short, average residence time is about 50
ms on Aspire One, but we expect it should be about 1 second
or more, so this kind of periodic timer is very bad for power
saving.

We can't remove this timer because of some bad USB controller
chipset, but at least we should reduce its side effect to as
possible as low.

This patch can make CPU stay at C3 longer, average residence time
is about twice as long as original.

Please consider to apply it, thanks

Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: UHCI: improve scheduling of interrupt URBs
Alan Stern [Thu, 25 Sep 2008 20:59:57 +0000 (16:59 -0400)]
USB: UHCI: improve scheduling of interrupt URBs

This patch (as1140) adds a little intelligence to the interrupt-URB
scheduler in uhci-hcd.  Right now the scheduler is stupid; every URB
having the same period is assigned to the same slot.  Thus a large
group of period-N URBs can fill their slot and cause -ENOSPC errors
even when all the lower-period slots are empty.

With the patch, if an URB doesn't fit in its assigned slot then the
scheduler will try using lower-period slots.  This will provide
greater flexibility.  As an example, the driver will be able to handle
more than just three or four mice, which the current driver cannot.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ti_usb_3410_5052: removed duplicated include
Huang Weiyi [Thu, 25 Sep 2008 05:11:28 +0000 (13:11 +0800)]
USB: ti_usb_3410_5052: removed duplicated include

Removed duplicated #include <linux/firmware.h> in
drivers/usb/serial/ti_usb_3410_5052.c.

Signed-off-by: Huang Weiyi <hwy@cn.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: vstusb.c : new driver for spectrometers used by Vernier Software & Technology...
Stephen Ware [Tue, 30 Sep 2008 18:39:38 +0000 (11:39 -0700)]
usb: vstusb.c : new driver for spectrometers used by Vernier Software & Technology, Inc.

This patch adds the vstusb driver to the drivers/usb/misc directory.
This driver provides support for Vernier Software & Technology
spectrometers, all made by Ocean Optics. The driver provides both IOCTL
and read()/write() methods for sending raw data to spectrometers across
the bulk channel. Each method allows for a configured timeout.

From: Stephen Ware <stephen.ware@eqware.net>
Signed-off-by: Dennis O'Brien <dennis.obrien@eqware.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb gadget: cdc ethernet notification bugfix
David Brownell [Sun, 7 Sep 2008 04:33:49 +0000 (21:33 -0700)]
usb gadget: cdc ethernet notification bugfix

Bugfix for the new CDC Ethernet code:  as part of activating the
network interface's USB link, make sure its link management code
knows whether the interface is open or not.

Without this fix, the link won't work right when it's brought up
before the link is active ... because the initial notification it
sends will have the wrong link state (down, not up).  Makes it
hard to bridge these links (on the host side), among other things.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org> [2.6.27]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: omap_udc: sync with OMAP tree
Tony Lindgren [Thu, 4 Sep 2008 23:25:14 +0000 (16:25 -0700)]
USB: omap_udc: sync with OMAP tree

Sync up USB parts of the omap_udc support in mainline with the OMAP tree.
This patch addresses some OMAP2 differences ... there's another, with
respect to the double-buffering issue with PIO-IN in omap_ep_setup()
(which is now out of sync with the comments), but it's not clear right
now how to address that.

From: Tony Lindgren <tony@atomide.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ohci-omap: handle other omap15xx chips
Tony Lindgren [Thu, 4 Sep 2008 23:29:55 +0000 (16:29 -0700)]
USB: ohci-omap: handle other omap15xx chips

Sync up USB parts of the ohci-omap support in mainline with the OMAP tree.
This patch supports another first generation OMAP1 part: not just the
OMAP 1510 (and its catalog version, the OMAP 5910), but also OMAP 310.

From: Tony Lindgren <tony@atomide.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: musb: remove dead code from procfs
Felipe Balbi [Thu, 11 Sep 2008 08:53:25 +0000 (11:53 +0300)]
usb: musb: remove dead code from procfs

When removing the procfs file, I forgot to remove some
code that created and removed that file. Here's a patch
to fix it. Ideally this patch will be melded into the patch
removing the procfs file, don't know if it's possible still.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: musb: general cleanup to musbhsdma.c
Felipe Balbi [Thu, 11 Sep 2008 08:53:24 +0000 (11:53 +0300)]
usb: musb: general cleanup to musbhsdma.c

Basically getting rid of CaMeLcAsE, but also adding
missing lines and spaces.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: musb_hdrc build fixes
David Brownell [Thu, 11 Sep 2008 08:53:23 +0000 (11:53 +0300)]
usb: musb_hdrc build fixes

Minor musb_hdrc updates:

  - so it'll build on DaVinci, given relevant platform updates;
      * remove support for an un-shipped OTG prototype
      * rely on gpiolib framework conversion for the I2C GPIOs
      * the <asm/arch/hdrc_cnf.h> mechanism has been removed

  - catch comments up to the recent removal of the per-SOC header
    with the silicon configuration data;

  - and remove two inappropriate "inline" declarations which
    just bloat host side code.

There are still some more <asm/arch/XYZ.h> ==> <mach/XYZ.h>
changes needed in this driver, catching up to the relocation
of most of the include/asm-arm/arch-* contents.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Cc: stable <stable@kernel.org> [2.6.27]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: musb: do not mess up count number and CSR0 register value
Bryan Wu [Thu, 11 Sep 2008 08:53:22 +0000 (11:53 +0300)]
usb: musb: do not mess up count number and CSR0 register value

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoOMAP:MUSB: Corrects urb unlink function path
Ajay Kumar Gupta [Thu, 11 Sep 2008 08:53:21 +0000 (11:53 +0300)]
OMAP:MUSB: Corrects urb unlink function path

Fixes kernel panic while ISO IN transfer is aborted.Replaced
usb_hcd_unlink_urb_from_ep() from musb_giveback() to __musb_giveback()
to make sure urb is unlinked before giveback when __musb_giveback() is
called from musb_urb_dequeue().

Acquired musb->lock() before usb_hcd_unlink_urb_from_ep() within in
enqueue path.

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>
16 years agoOMAP:MUSB: Fixes the TT programming.
Ajay Kumar Gupta [Thu, 11 Sep 2008 08:53:20 +0000 (11:53 +0300)]
OMAP:MUSB: Fixes the TT programming.

Fixes enumeration failures when a USB device attached to a LS hub is
connected to OMAP EVM via HS hub. This is fixed by correctly
programming hub address register in enqueue path.

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>
16 years agomusb: io: only define read/write stubs if they're not defined yet
Felipe Balbi [Thu, 11 Sep 2008 08:53:19 +0000 (11:53 +0300)]
musb: io: only define read/write stubs if they're not defined yet

For those archs which don't provide read/write friends we
provide our own implementation so musb driver won't break
compilation.

This is temporary fix until a better solution comes from
upstream. Idealy, <linux/io.h> would provide those calls
if the architecture did not provide them yet. In that case
being possible to remove all those stubs from musb_io.h

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Fix s3c2410_udc usb speed handling
Yauhen Kharuzhy [Fri, 12 Sep 2008 16:02:23 +0000 (09:02 -0700)]
USB: Fix s3c2410_udc usb speed handling

The new composite framework revealed a weakness in the
s3c2410_udc driver gadget register function. Instead of
checking if speed asked for was USB_LOW_SPEED upon
usb_gadget_register() to deny service, it checked only
for USB_FULL_SPEED, thus denying service to usb high
speed capable gadgets (like g_ether).

Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb gadget: USB_GADGET_VBUS_DRAW Kconfig option
David Brownell [Fri, 12 Sep 2008 16:39:06 +0000 (09:39 -0700)]
usb gadget: USB_GADGET_VBUS_DRAW Kconfig option

Offer a "how much VBUS power to request" configuration option
for USB gadgets that aren't using board-specific customization
of their gadget or (composite) configuration drivers.

Also remove a couple pointless "depends on USB_GADGET" bits
from the Kconfig text; booleans inside an "if USB_GADGET" will
already have that dependency.

Based on a patch from Justin Clacherty.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Justin Clacherty <justin@redfish-group.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoMUSB: Add sanity check for maximum number of endpoints
Kevin Hilman [Mon, 15 Sep 2008 10:09:31 +0000 (12:09 +0200)]
MUSB: Add sanity check for maximum number of endpoints

There is no check if platform code passes in more endpoints (num_eps)
than the maximum number of enpoints (MUSB_C_NUM_EPS.)  The result is
that allocate_instance() happily writes past the end of 'struct musb'
corrupting memory.

This patch adds a BUG() if the platform code requests more than the max.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: remove code associated with !CONFIG_PPC_MERGE
Kumar Gala [Mon, 22 Sep 2008 22:00:07 +0000 (15:00 -0700)]
usb: remove code associated with !CONFIG_PPC_MERGE

Now that arch/ppc is gone we don't need CONFIG_PPC_MERGE anymore remove
the dead code associated with !CONFIG_PPC_MERGE.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbmon: fix tiny race exposed by the fastboot patches
Arjan van de Ven [Mon, 22 Sep 2008 22:00:10 +0000 (15:00 -0700)]
usbmon: fix tiny race exposed by the fastboot patches

usbmon registers the notifier chain, takes the bus lock and then goes to
scan the existing devices for hooking up.

Unfortunately, if usb_mon gets initialized while USB bus discovery is
going on, it's possible that usbmon gets a notifier on one cpu (which runs
without USB locks), and the scan is going on and also finds the new bus,
resulting in a double sysfs registration, which then produces a WARNING.

Pete Zaitcev did the bug diagnostics on this one

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: change hub initialization sleeps to delayed_work
Alan Stern [Mon, 22 Sep 2008 18:44:26 +0000 (14:44 -0400)]
USB: change hub initialization sleeps to delayed_work

This patch (as1137) changes the hub_activate() routine, replacing the
power-power-up and debounce delays with delayed_work calls.  The idea
is that on systems where the USB stack is compiled into the kernel
rather than built as modules, these delays will no longer block the
boot thread.  At least 100 ms is saved for each root hub, which can
add up to a significant savings in total boot time.

Arjan van de Ven was very pleased to see that this shaved 700 ms off
his computer's boot time.  Since his total boot time is on the order
of two seconds, the improvement is considerable.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci-dbg: fix reading less content of periodic file
Ming Lei [Thu, 18 Sep 2008 15:06:38 +0000 (23:06 +0800)]
USB: ehci-dbg: fix reading less content of periodic file

This patch fix 2 problems about reading periodic file:

1. The "..." after a interrupt qh is missed because buffer pointer is
   not moved.

2. After setting p.ptr as NULL, its next qh or itd will be omited and
   can't be stored in debug buffer.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ehci-dbg: increase debug buffer size for periodic file
Ming Lei [Thu, 18 Sep 2008 15:06:21 +0000 (23:06 +0800)]
USB: ehci-dbg: increase debug buffer size for periodic file

This patch is based on the following ideas:

1. Some usb devices (such as usb video class) have endpoints of high
   interval attribute, so reading "periodic" file need more debug buffer
   to accommodate the qh or itd schedule information.  For example, 4KB
   buffer is not enough for a single interrupt qh of 2ms period.

2. print a %p need 16 byte buffer on 64-bits arch, but 8 byte on 32-bits
   arch. Add a extra bonus for 64-bits arch.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: gadget: workaround storage command size issues
Felipe Balbi [Thu, 18 Sep 2008 23:00:02 +0000 (02:00 +0300)]
usb: gadget: workaround storage command size issues

Try to workaround issues with bad SCSI implementations
by ignoring the command size error.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: g_printer: fix handling zero-length packet
SangSu Park [Mon, 22 Sep 2008 22:41:15 +0000 (15:41 -0700)]
USB: g_printer: fix handling zero-length packet

g_printer doesn't have to check whether the data size is a multiple of
MaxPacketSize, because device controller driver already make that check.

Signed-off-by: SangSu Park<sangsu@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Fix spelling in usb/serial.h
Geoff Levand [Sat, 20 Sep 2008 21:41:47 +0000 (14:41 -0700)]
USB: Fix spelling in usb/serial.h

Fixes a minor typo in the comments for usb_set_serial_data.

Signed-off-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Fix doc for usb_autopm_enable
Geoff Levand [Sat, 20 Sep 2008 21:41:47 +0000 (14:41 -0700)]
USB: Fix doc for usb_autopm_enable

Correct errors in the descriptions for usb_autopm_enable
and usb_autopm_disable in the USB PM doc.

Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB Serial: Sierra: debug message fix
Kevin Lloyd [Wed, 17 Sep 2008 04:05:24 +0000 (21:05 -0700)]
USB Serial: Sierra: debug message fix

This patch moves dbg calls to dev_dbg where possible. It also fixes some
issues with a previous submission aiming to do the same thing.

Signed-off-by: Kevin Lloyd <klloyd@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: RESET_RESUME needs to block autosuspend when remote wakeup is needed
Oliver Neukum [Mon, 15 Sep 2008 15:29:28 +0000 (17:29 +0200)]
USB: RESET_RESUME needs to block autosuspend when remote wakeup is needed

Reset upon resumption will wipe the input buffer and is therefore
a reason to not suspend if remote wakeup is requested because
the driver needs that data.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ftdi_sio: fix 'product' parameter description
Paulius Zaleckas [Wed, 10 Sep 2008 14:18:46 +0000 (17:18 +0300)]
USB: ftdi_sio: fix 'product' parameter description

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb core: fix USB_OTG_BLACKLIST_HUB typo
Peter Korsgaard [Mon, 8 Sep 2008 08:14:47 +0000 (10:14 +0200)]
usb core: fix USB_OTG_BLACKLIST_HUB typo

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Documentation/usb/anchors.txt #2
Oliver Neukum [Tue, 2 Sep 2008 12:16:11 +0000 (14:16 +0200)]
USB: Documentation/usb/anchors.txt #2

This adds Documentation for the extensions of the anchor API.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoOHCI: Allow broken controllers to auto-stop
Alan Stern [Wed, 3 Sep 2008 20:38:32 +0000 (16:38 -0400)]
OHCI: Allow broken controllers to auto-stop

This patch (as1134) attempts to improve the way we handle OHCI
controllers with broken Root Hub Status Change interrupt support.  In
these controllers the RHSC interrupt bit essentially never turns off,
making RHSC interrupts useless -- they have to remain permanently
disabled.

Such controllers should still be allowed to turn off their root hubs
when no devices are attached.  Polling for new connections can
continue while the root hub is suspended.  The patch implements this
feature.  (It won't have much effect unless CONFIG_PM is enabled and
CONFIG_USB_SUSPEND is disabled, but since the overhead is very small
we may as well do it.)

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb-storage: report underflow with no sense data
Alan Stern [Tue, 2 Sep 2008 14:12:11 +0000 (10:12 -0400)]
usb-storage: report underflow with no sense data

This patch (as1118) addresses a problem with certain USB mass-storage
devices.  These devices sometimes return less data than asked for and
then provide no sense data to explain the problem.  Currently
usb-storage leaves it up to the SCSI layer to decide how this should
be handled, and the SCSI layer interprets the lack of sense data to
mean that nothing went wrong.  But if we got less data than required
then something definitely _did_ go wrong, and we should say so.

The patch tells the SCSI layer to retry the command when this sort of
thing happens.  Retrying may not solve the underlying problem, but
it's better than believing that data was transferred when it wasn't.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: add Freescale QE/CPM USB peripheral controller driver
Li Yang [Tue, 2 Sep 2008 11:58:10 +0000 (19:58 +0800)]
usb: add Freescale QE/CPM USB peripheral controller driver

Some of Freescale SoC chips have a QE or CPM co-processor which
supports full speed USB.  The driver adds device mode support
of both QE and CPM USB controller to Linux USB gadget.  The
driver is tested with MPC8360 and MPC8272, and should work with
other models having QE/CPM given minor tweaks.

Signed-off-by: Xie Xiaobo <X.Xie@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: drivers/usb/misc: Use an IS_ERR test rather than a NULL test
Julien Brunel [Mon, 1 Sep 2008 08:57:27 +0000 (10:57 +0200)]
USB: drivers/usb/misc: Use an IS_ERR test rather than a NULL test

In case of error, the function backlight_device_register returns an
ERR pointer, but never returns a NULL pointer. So a NULL test that may
come after a call to this function should be strengthened by an IS_ERR
test.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@match_bad_null_test@
expression x, E;
statement S1,S2;
@@
x = backlight_device_register(...)
... when != x = E
* if (x != NULL)
S1 else S2
// </smpl>

Signed-off-by: Julien Brunel <brunel@diku.dk>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove unused #include <version.h>
Huang Weiyi [Sat, 23 Aug 2008 05:56:30 +0000 (13:56 +0800)]
USB: remove unused #include <version.h>

The driver(s) below do not use LINUX_VERSION_CODE nor KERNEL_VERSION.
  drivers/usb/gadget/pxa27x_udc.c

This patch removes the said #include <version.h>.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb gadget: defer obex enumeration
David Brownell [Tue, 19 Aug 2008 00:45:25 +0000 (17:45 -0700)]
usb gadget: defer obex enumeration

Some USB peripheral controller drivers support software control
over the data pullup.  Use those controls to prevent the OBEX
function from enumerating until the userspace server has opened
the /dev/ttyGS* node it will use to implement protocol chitchat
with the USB host.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb gadget: cdc obex glue
Felipe Balbi [Tue, 19 Aug 2008 00:39:30 +0000 (17:39 -0700)]
usb gadget: cdc obex glue

The following patch introduces a new f_obex.c function driver.
It allows userspace obex servers to use usb as transport layer
for their messages.

[ dbrownell@users.sourceforge.net: various fixes and cleanups ]

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>
16 years agousb gadget: function activation/deactivation
David Brownell [Tue, 19 Aug 2008 00:38:22 +0000 (17:38 -0700)]
usb gadget: function activation/deactivation

Add a new mechanism to the composite gadget framework, letting
functions deactivate (and reactivate) themselves.  Think of it
as a refcounted wrapper for the software pullup control.

A key example of why to use this mechanism involves functions that
require a userspace daemon.  Those functions shuld use this new
mechanism to prevent the gadget from enumerating until those daemons
are activated.  Without this mechanism, hosts would see devices that
malfunction until the relevant daemons start.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: gadget: net2280: implement set_wedge
Alan Stern [Thu, 14 Aug 2008 19:49:11 +0000 (15:49 -0400)]
USB: gadget: net2280: implement set_wedge

This patch (as1132) implements the set_wedge() method for net2280.
This method is necessary for strict USBCV compliance in
g_file_storage.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: gadget: dummy_hcd: implement set_wedge
Alan Stern [Thu, 14 Aug 2008 19:48:30 +0000 (15:48 -0400)]
USB: gadget: dummy_hcd: implement set_wedge

This patch (as1131) implements the set_wedge() method for dummy_hcd.
This method is necessary for strict USBCV compliance in
g_file_storage.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb: gadget Kconfig cleanup
David Brownell [Fri, 15 Aug 2008 00:04:48 +0000 (17:04 -0700)]
usb: gadget Kconfig cleanup

This reorders the list of USB peripheral controller drivers so it's
more common for the initial (default) value to be relevant:  put the
SOC integrated silicon up front, discrete stuff last.  Alphabetize.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>