Commit graph

50624 commits

Author SHA1 Message Date
Greg Kroah-Hartman 880c9c66a6 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>
2008-10-17 14:41:10 -07:00
Greg Kroah-Hartman 5909f6ea2b 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>
2008-10-17 14:41:09 -07:00
Greg Kroah-Hartman 1b29a375fb 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>
2008-10-17 14:41:09 -07:00
Greg Kroah-Hartman c197a8db59 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>
2008-10-17 14:41:09 -07:00
Greg Kroah-Hartman 46fcaec505 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>
2008-10-17 14:41:09 -07:00
Greg Kroah-Hartman 3b6004f3b5 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>
2008-10-17 14:41:09 -07:00
Greg Kroah-Hartman 4dc8994806 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>
2008-10-17 14:41:08 -07:00
Greg Kroah-Hartman aa82661baf 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>
2008-10-17 14:41:08 -07:00
Greg Kroah-Hartman 1817b1692a 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>
2008-10-17 14:41:08 -07:00
Li Yang 15d5a9acb1 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>
2008-10-17 14:41:08 -07:00
Li Yang 928dfa6c62 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>
2008-10-17 14:41:08 -07:00
Will Newton 23d7cd040e 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>
2008-10-17 14:41:07 -07:00
Will Newton 59097fb73c 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>
2008-10-17 14:41:07 -07:00
Will Newton 224b503901 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>
2008-10-17 14:41:07 -07:00
Will Newton 825bee3a33 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>
2008-10-17 14:41:07 -07:00
Will Newton c93eebbe75 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>
2008-10-17 14:41:07 -07:00
Will Newton e06da9a828 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>
2008-10-17 14:41:06 -07:00
Will Newton 9d9d88c80e 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>
2008-10-17 14:41:06 -07:00
Will Newton bf7409a23b 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>
2008-10-17 14:41:06 -07:00
Will Newton 7483cff8a3 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>
2008-10-17 14:41:05 -07:00
Will Newton f6e4411fe7 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>
2008-10-17 14:41:05 -07:00
Will Newton 9c94155ea0 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>
2008-10-17 14:41:04 -07:00
Stephen Ware 84dcd59495 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>
2008-10-17 14:41:04 -07:00
Alan Stern 71b7497c07 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>
2008-10-17 14:41:04 -07:00
Dan Williams 8b6346ec89 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>
2008-10-17 14:41:04 -07:00
Jaroslav Kysela fd7c519dd4 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>
2008-10-17 14:41:04 -07:00
Sarah Sharp 49e7cc84a8 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>
2008-10-17 14:41:03 -07:00
Alan Stern eafe5b99f2 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>
2008-10-17 14:41:03 -07:00
Alan Stern 2da41d5f6c 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>
2008-10-17 14:41:03 -07:00
Jon K Hellan bb78a825fa 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>
2008-10-17 14:41:03 -07:00
Alan Stern 9beeee6584 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>
2008-10-17 14:41:03 -07:00
Alan Stern 2b70f07343 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>
2008-10-17 14:41:02 -07:00
Oliver Neukum 1987625226 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>
2008-10-17 14:41:02 -07:00
Sarah Sharp c0f082c536 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>
2008-10-17 14:41:02 -07:00
Julien Brunel ce5dee50ed 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>
2008-10-17 14:41:02 -07:00
Yi Yang f0d781d59c 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>
2008-10-17 14:41:02 -07:00
Alan Stern e58dcebcd8 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>
2008-10-17 14:41:01 -07:00
Huang Weiyi 925dff5dee 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>
2008-10-17 14:41:01 -07:00
Stephen Ware cbc30118d7 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>
2008-10-17 14:41:01 -07:00
David Brownell 29bac7b766 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>
2008-10-17 14:41:01 -07:00
Tony Lindgren f1c9e151b1 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>
2008-10-17 14:41:00 -07:00
Tony Lindgren 9b466c3b82 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>
2008-10-17 14:40:59 -07:00
Felipe Balbi 28c2c51c07 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>
2008-10-17 14:40:59 -07:00
Felipe Balbi 458e6a511f 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>
2008-10-17 14:40:59 -07:00
David Brownell c767c1c6f1 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>
2008-10-17 14:40:59 -07:00
Bryan Wu 64ca44a65a 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>
2008-10-17 14:40:59 -07:00
Ajay Kumar Gupta 2492e6747f 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>
2008-10-17 14:40:58 -07:00
Ajay Kumar Gupta ae5ad29639 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>
2008-10-17 14:40:58 -07:00
Felipe Balbi eaa3246e7d 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>
2008-10-17 14:40:58 -07:00
Yauhen Kharuzhy f9e9cff613 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>
2008-10-17 14:40:58 -07:00
David Brownell 36e893d25a 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>
2008-10-17 14:40:58 -07:00
Kevin Hilman 02582b92f6 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>
2008-10-17 14:40:58 -07:00
Kumar Gala cede969fe2 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>
2008-10-17 14:40:57 -07:00
Arjan van de Ven bb4e3b5ac8 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>
2008-10-17 14:40:57 -07:00
Alan Stern 8520f38099 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>
2008-10-17 14:40:57 -07:00
Ming Lei 3c4bb71f96 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>
2008-10-17 14:40:57 -07:00
Ming Lei 3c04e20ea9 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>
2008-10-17 14:40:57 -07:00
Felipe Balbi 549c41e0ac 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>
2008-10-17 14:40:56 -07:00
SangSu Park 8296345a35 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>
2008-10-17 14:40:56 -07:00
Kevin Lloyd 7384a922b5 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>
2008-10-17 14:40:56 -07:00
Oliver Neukum 399d31da4e 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>
2008-10-17 14:40:55 -07:00
Paulius Zaleckas 682650437e 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>
2008-10-17 14:40:55 -07:00
Peter Korsgaard bc45df950d 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>
2008-10-17 14:40:54 -07:00
Alan Stern 4a511bc3f5 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>
2008-10-17 14:40:54 -07:00
Alan Stern 8bfa247270 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>
2008-10-17 14:40:54 -07:00
Li Yang 3948f0e0c9 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>
2008-10-17 14:40:54 -07:00
Julien Brunel bedf0883cb 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>
2008-10-17 14:40:53 -07:00
Huang Weiyi 58209018cf 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>
2008-10-17 14:40:53 -07:00
David Brownell 2121427836 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>
2008-10-17 14:40:53 -07:00
Felipe Balbi 3086775a49 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>
2008-10-17 14:40:53 -07:00
David Brownell 60beed95e3 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>
2008-10-17 14:40:53 -07:00
Alan Stern 8066134ff8 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>
2008-10-17 14:40:52 -07:00
Alan Stern 851a526dcf 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>
2008-10-17 14:40:52 -07:00
David Brownell a7a19fac8a 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>
2008-10-17 14:40:52 -07:00
Marc Zyngier 2714021937 USB: Let some USB host controllers get IRQ flags from resource
[This version fixes a thinko in the r8a66597 driver]

This patch let a few discrete USB host controllers drivers (isp116x-hcd,
r8a66597-hcd and sl811-hcd) obtain IRQ flags from their IORESOURCE_IRQ
resource if configured as such, much like it's been done for the smc91x
driver.

It spares people writing support for specific boards the burden to
configure the interrupt controller independantly, and keeps all IRQ
related information in a single resource.

HCD that are integrally part of a SoC have been left aside, as there
is probably no "wiring" options...

Tested on an Xscale PXA-255 based platform with isp116x-hcd.

Signed-off-by: Marc Zyngier <marc.zyngier@altran.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17 14:40:52 -07:00
Pete Zaitcev 7dbcbe88b1 ub: remove sg_stat
Remove forgotten code related to sg_stat[].

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17 14:40:52 -07:00
Oliver Neukum 6a2839bedc USB: extend poisoning to anchors
this extends the poisoning concept to anchors. This way poisoning
will work with fire and forget drivers.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17 14:40:51 -07:00
Oliver Neukum 55b447bf79 USB: kill URBs permanently
looking at usb_kill_urb() it seems to me that it is unnecessarily lenient.
In the use case of disconnect() you never want to use the URB again
(for the same device) But leaving urb->reject elevated will make it easier
to avoid races between read/write and disconnect.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17 14:40:51 -07:00
Julia Lawall 49b707b90c drivers/usb/class/usblp.c: adjust error handling code
In this code, it is possible to tell statically whether usblp will be NULL
in the error handling code.

Oliver Neukum suggested to make a goto to the final return rather than 
return directly.

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

// <smpl>
@@
identifier f,err,l,l1;
type T;
expression x,E;
statement S;
@@

x = NULL
... when != goto l1;
* x = f(...)
... when != x
err = E;
goto l;
...
* if (x != NULL)
  S
return err;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17 14:40:51 -07:00
Greg Kroah-Hartman 5b775f672c USB: add USB test and measurement class driver
This driver was originaly written by Stefan Kopp, but massively
reworked by Greg for submission.

Thanks to Felipe Balbi <me@felipebalbi.com> for lots of work in cleaning
up this driver.

Thanks to Oliver Neukum <oliver@neukum.org> for reviewing previous
versions and pointing out problems.


Cc: Stefan Kopp <stefan_kopp@agilent.com>
Cc: Marcel Janssen <korgull@home.nl>
Cc: Felipe Balbi <me@felipebalbi.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17 14:40:51 -07:00
Harrison Metzger eb86be5424 USB: Added driver for a Delcom USB 7-segment LED Display
Added basic support for a Delcom USB 7-segment LED Display

Signed-off by: Harrison Metzger <harrisonmetz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17 14:40:51 -07:00
Vladimir Vukicevic c3d36c453c USB: Add Oceanic product ID to ftdi_sio
Add Oceanic PID to ftdi_sio driver

Oceanic dive computers (such as the VT3 --
http://www.oceanicworldwide.com/p_computers_vt3.html) all use an onboard
FTDI serial converter, with the FTDI vid and a  PID of 0xf460.  The
attached patch adds that pid to ftdi_sio; driver  connects to my VT3
after that.

Signed-off-by: Vladimir Vukicevic <vladimir@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17 14:40:50 -07:00
Denis Joseph Barrow 631556a076 USB: option.c remove duplicate device ids now supported in hso.c
Remove duplicate device ids which are now supported by drivers/usb/net/hso.c

Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17 14:40:50 -07:00
Dan Williams b064eca9b0 USB: option: add Ericsson F3507g and Dell 5530
Add a few more mobile broadband cards.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17 14:40:50 -07:00
Matthias Hopf 4b40893918 drm/i915: fix ioremap of a user address for non-root (CVE-2008-3831)
Olaf Kirch noticed that the i915_set_status_page() function of the i915
kernel driver calls ioremap with an address offset that is supplied by
userspace via ioctl. The function zeroes the mapped memory via memset
and tells the hardware about the address. Turns out that access to that
ioctl is not restricted to root so users could probably exploit that to
do nasty things. We haven't tried to write actual exploit code though.

It only affects the Intel G33 series and newer.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:18:05 +10:00
Dave Airlie 9e0b97e37f drm: make CONFIG_DRM depend on CONFIG_SHMEM.
This can be removed later when DRM doesn't depend on shmem.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:54 +10:00
Alex Deucher edc6f389f6 radeon: fix PCI bus mastering support enables.
Someone noticed these registers moved around for later chips,
so we redo the codepaths per-chip. PCIE chips don't appear to
require explicit enables.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:54 +10:00
Alex Deucher b2ceddfa52 radeon: add RS400 family support.
This adds support for the RS400 family of IGPs for Intel CPUs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:54 +10:00
Alex Deucher f0738e9240 drm/radeon: add support for RS740 IGP chipsets.
This adds support for the HS2100 IGP chipset.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:54 +10:00
Eric Anholt b612eda98e i915: GM45 has GM965-style MCH setup.
Fixes tiling swizzling mode failures that manifest in glReadPixels().

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:53 +10:00
Keith Packard 6dbe2772d6 i915: Don't run retire work handler while suspended
At leavevt and lastclose time, cancel any pending retire work handler
invocation, and keep the retire work handler from requeuing itself if it is
currently running.

This patch restructures i915_gem_idle to perform all of these tasks instead
of having both leavevt and lastclose call a sequence of functions.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:53 +10:00
Keith Packard ba1eb1d825 i915: Map status page cached for chips with GTT-based HWS location.
This should improve performance by avoiding uncached reads by the CPU (the
point of having a status page), and may improve stability.  This patch only
affects G33, GM45 and G45 chips as those are the only ones using GTT-based
HWS mappings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:53 +10:00
Keith Packard 50aa253d82 i915: Fix up ring initialization to cover G45 oddities
G45 appears quite sensitive to ring initialization register writes,
sometimes leaving the HEAD register with the START register contents. Check
to make sure HEAD is reset correctly when START is written, and fix it up,
screaming loudly.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:53 +10:00
Keith Packard 0cdad7e88a i915: Use non-reserved status page index for breadcrumb
Dwords 0 through 0x1f are reserved for use by the hardware. Move the GEM
breadcrumb from 0x10 to 0x20 to keep out of this area.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:53 +10:00
Eric Anholt 630681d9a5 drm: Increment dev_priv->irq_received so i915_gem_interrupts count works.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:53 +10:00
Jesse Barnes 9bfbd5cb72 drm: kill drm_device->irq
Like the last patch but adds a macro to get at the irq value instead of
dereferencing pdev directly.  Should  make things easier for the BSD guys and
if we ever support non-PCI devices.

Signed-off-by:  Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:53 +10:00
Dave Airlie e0f0754ff6 drm: wbinvd is cache coherent.
doing an ipi for the wbinvd case isn't necessary.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:53 +10:00
Dave Airlie e7d22bc3cb i915: add missing return in error path.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:52 +10:00
Dave Airlie 2bdf00b221 i915: fixup permissions on gem ioctls.
init/entervt/leavevt should be root-only master ioctls.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:52 +10:00
Eric Anholt 3043c60c48 drm: Clean up many sparse warnings in i915.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:52 +10:00
Eric Anholt bd88ee4c1b drm: Use ioremap_wc in i915_driver instead of ioremap, since we always want WC.
Fixes failure to map the ringbuffer when PAT tells us we don't get to do
uncached on something that's already mapped WC, or something along those lines.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:52 +10:00
Eric Anholt 28af0a2767 drm: G33-class hardware has a newer 965-style MCH (no DCC register).
Fixes bad software fallback rendering in Mesa in dual-channel configurations.

d9a2470012588dc5313a5ac8bb2f03575af00e99

Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:52 +10:00
Eric Anholt 4f481ed22e drm: Avoid oops in GEM execbuffers with bad arguments.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:52 +10:00
Eric Anholt d4e7b898c1 DRM: Return -EBADF on bad object in flink, and return curent name if it exists.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:52 +10:00
Kristian Høgsberg dbb19d302b i915 gem: install and uninstall irq handler in entervt and leavevt ioctls.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:52 +10:00
Kristian Høgsberg c99b058f13 i915: Make use of sarea_priv conditional.
We fail ioctls that depend on the sarea_priv with EINVAL.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:51 +10:00
Eric Anholt 546b0974c3 i915: Use struct_mutex to protect ring in GEM mode.
In the conversion for GEM, we had stopped using the hardware lock to protect
ring usage, since it was all internal to the DRM now.  However, some paths
weren't converted to using struct_mutex to prevent multiple threads from
concurrently working on the ring, in particular between the vblank swap handler
and ioctls.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:51 +10:00
Kristian Høgsberg ed4c9c4acf i915: Add chip set ID param.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:12 +10:00
Eric Anholt 673a394b1e drm: Add GEM ("graphics execution manager") to i915 driver.
GEM allows the creation of persistent buffer objects accessible by the
graphics device through new ioctls for managing execution of commands on the
device.  The userland API is almost entirely driver-specific to ensure that
any driver building on this model can easily map the interface to individual
driver requirements.

GEM is used by the 2d driver for managing its internal state allocations and
will be used for pixmap storage to reduce memory consumption and enable
zero-copy GLX_EXT_texture_from_pixmap, and in the 3d driver is used to enable
GL_EXT_framebuffer_object and GL_ARB_pixel_buffer_object.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:12 +10:00
Jesse Barnes 0a3e67a4ca drm: Rework vblank-wait handling to allow interrupt reduction.
Previously, drivers supporting vblank interrupt waits would run the interrupt
all the time, or all the time that any 3d client was running, preventing the
CPU from sleeping for long when the system was otherwise idle.  Now, interrupts
are disabled any time that no client is waiting on a vblank event. The new
method uses vblank counters on the chipsets when the interrupts are turned
off, rather than counting interrupts, so that we can continue to present
accurate vblank numbers.

Co-author: Michel Dänzer <michel@tungstengraphics.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:11 +10:00
David Howells 2df68b439f drm/cred: wrap task credential accesses in the drm driver.
Wrap access to task credentials so that they can be separated more easily from
the task_struct during the introduction of COW creds.

Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().

Change some task->e?[ug]id to task_e?[ug]id().  In some places it makes more
sense to use RCU directly rather than a convenient wrapper; these will be
addressed by later patches.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: David Airlie <airlied@redhat.com>
2008-10-18 07:10:11 +10:00
Jesse Barnes b9bfdfe670 new chip name is GM45
Author: Zhenyu Wang <zhenyu.z.wang@intel.com>

i915: official name for GM45 chipset

Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:11 +10:00
Jesse Barnes 317c35d144 separate i915 suspend/resume functions into their own file
[Patch against drm-next.  Consider this a trial balloon for our new Linux
development model.]

This is a big chunk of code.  Separating it out makes it easier to change
without churn on the main i915_drv.c file (and there will be churn as we
fix bugs and add things like kernel mode setting).  Also makes it easier
to share this file with BSD.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:11 +10:00
Dave Airlie 6b79d521e0 radeon: fix writeback across suspend/resume.
Make writeback not get disabled on resume.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:11 +10:00
Dave Airlie 38eda21189 drm: fix sysfs error path.
Pointed out by Roel Kluin on dri-devel.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:11 +10:00
Adrian Bunk dfcf96d09c FB_SIS=m, DRM_SIS=y is not a legal configuration.
Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:11 +10:00
Matthew Garrett 8ee1c3db90 Add Intel ACPI IGD OpRegion support
This adds the support necessary for allowing ACPI backlight control to
work on some newer Intel-based graphics systems. Tested on Thinkpad T61
and HP 2510p hardware.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-10-18 07:10:10 +10:00
Keith Packard 398c9cb20b i915: Initialize hardware status page at device load when possible.
Some chips were unstable with repeated setup/teardown of the hardware status
page.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:10 +10:00
Keith Packard d3a6d4467c i915: Track progress inside of batchbuffers for determining wedgedness.
This avoids early termination for long-running commands.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:10 +10:00
Eric Anholt ed4cb4142b i915: Add support for MSI and interrupt mitigation.
Previous attempts at interrupt mitigation had been foiled by i915_wait_irq's
failure to update the sarea seqno value when the status page indicated that
the seqno had already been passed.  MSI support has been seen to cut CPU
costs by up to 40% in some workloads by avoiding other expensive interrupt
handlers for frequent graphics interrupts.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:10 +10:00
Jesse Barnes 585fb11134 i915: Use more consistent names for regs, and store them in a separate file.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:10 +10:00
Keith Packard 962d4fd727 i915: Ignore X server provided mmio address
It is already correctly detected by the kernel for use in suspend/resume.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:10 +10:00
Keith Packard 0790d5e148 i915: remove settable use_mi_batchbuffer_start
The driver can know what hardware requires MI_BATCH_BUFFER vs
MI_BATCH_BUFFER_START; there's no reason to let user mode configure this.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:10 +10:00
David Howells 48f185d0e0 SiS DRM: fix a pointer cast warning
Fix a pointer cast warning in the SIS DRM code.

This was introduced in patch ce65a44de0.

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:10 +10:00
David Howells 6bb9e4bff5 SiS DRM: fix the memory allocator if the SIS FB is built as a module
Fix the SIS DRM memory allocator if the SIS FB built as a module.  The SIS DRM
code initialises the mm allocation hooks, but _only_ if the SIS FB is not
built as a module because it depends on CONFIG_FB_SIS, and that's unset if the
SIS FB is not built in.  It must check CONFIG_FB_SIS_MODULE as well.

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18 07:10:09 +10:00
Igor M. Liplianin d4305c68cc V4L/DVB (9296): Patch to remove warning message during cx88-dvb compilation
Remove warning message during cx88-dvb compilation.
Also fixes double underline in function and struct names.

Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:41:30 -03:00
Jean-Francois Moine eb229b22fb V4L/DVB (9294): gspca: Add a stop sequence in t613.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:41:20 -03:00
Leandro Costantino ad62fb08de V4L/DVB (9293): gspca: Separate and fix the sensor dependant sequences in t613.
Signed-off-by: Leandro Costantino <lcostantino@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:41:14 -03:00
Jean-Francois Moine 35480b6bc3 V4L/DVB (9292): gspca: Call the control setting functions at init time in t613.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:41:09 -03:00
Jean-Francois Moine cbc51c6d6e V4L/DVB (9291): gspca: Do not set the white balance temperature by default in t613.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:41:00 -03:00
Jean-Francois Moine 392ee5a59d V4L/DVB (9290): gspca: Adjust the sensor init sequences in t613.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:40:55 -03:00
Jean-Francois Moine 236088d215 V4L/DVB (9289): gspca: Other sensor identified as om6802 in t613.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:40:50 -03:00
Jean-Francois Moine 0bc99b5cf7 V4L/DVB (9288): gspca: Write to the USB device and not USB interface in t613.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:40:43 -03:00
Jean-Francois Moine f89be036eb V4L/DVB (9287): gspca: Change the name of the multi bytes write function in t613.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:40:37 -03:00
Jean-Francois Moine cf0fe08dd7 V4L/DVB (9286): gspca: Compilation problem of gspca.c and the kernel version.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:40:31 -03:00
Erik Andrén 88d99fcac4 V4L/DVB (9283): Correct typo and enable setting the gain on the mt9m111 sensor
A typo was introduced during the gspca conversion, crippling the ability to control the gain on the mt9m111 sensor.

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:40:25 -03:00
Erik Andrén 447328194e V4L/DVB (9282): Properly iterate the urbs when destroying them.
Properly iterate the allocated when freeing the urbs, this fixes a memory leak

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:40:18 -03:00
Erik Andren e2c974919f V4L/DVB (9281): gspca: Add hflip and vflip to the po1030 sensor
Signed-off-by: Erik Andren <erik.andren@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:39:50 -03:00
Erik Andren 17ea88ae95 V4L/DVB (9280): gspca: Use the gspca debug macros
Signed-off-by: Erik Andren <erik.andren@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:39:40 -03:00
Erik Andren 0c505e688b V4L/DVB (9279): gspca: Correct some copyright headers
Signed-off-by: Erik Andren <erik.andren@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:39:35 -03:00
Erik Andren 1d733031ea V4L/DVB (9278): gspca: Remove the m5602_debug variable
Signed-off-by: Erik Andren <erik.andren@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:39:29 -03:00
Erik Andren 588dbbb520 V4L/DVB (9277): gspca: propagate an error in m5602_start_transfer()
Signed-off-by: Erik Andren <erik.andren@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:39:22 -03:00
Mauro Carvalho Chehab dcadd0826f V4L/DVB (9276): videobuf-dvb: two functions are now static
This patch marks those two functions as static:
	static int videobuf_dvb_register_adapter(struct videobuf_dvb_frontends *fe,
	static int videobuf_dvb_register_frontend(struct dvb_adapter *adapter,

Since MFE patches changed their calls by videobuf_dvb_register_bus.

To avoid having to declare the prototypes, the patch moves
videobuf_dvb_register_bus() to be after the declaration of the above functions
used there.

Cc: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:39:14 -03:00
Geert Uytterhoeven 64decbfe0d V4L/DVB (9275): dvb: input data pointer of cx24116_writeregN() should be const
| drivers/media/dvb/frontends/cx24116.c:573: warning: passing argument 3 of 'cx24116_writeregN' discards qualifiers from pointer target type

Make the `data' input pointer parameter of cx24116_writeregN() const to
kill the warning.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:31:00 -03:00
Steven Toth a1bc84c083 V4L/DVB (9274): Remove spurious messages and turn into debug.
Remove spurious messages and turn into debug.

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:30:52 -03:00
Steven Toth 11fbedd332 V4L/DVB (9273): MFE: videobuf-dvb.c checkpatch cleanup as part of MFE merge
MFE: videobuf-dvb.c checkpatch cleanup as part of MFE merge

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:30:40 -03:00
Jose Alberto Reguero ca341e4d1b V4L/DVB (9272): mxl5005s: Bug fix stopped DVB-T from working the second time around.
Jose reported:

I am using a Avermedia Volar X with af9015 driver(DVB-T).

The first time you use the card, first call reconfigure with MXL_QAM,
and when tune DVB-T it calls reconfigure with MXL_DVBT. But if you close
the frontend and open again, it calls reconfigure with MXL_QAM, but not
call reconfigure with MXL_DVBT because state->current_mode don't change
(is MXL_DVBT).

Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:30:33 -03:00
Darron Broad 96b7a1a838 V4L/DVB (9271): videobuf: data storage optimisation (2)
To optimise data storage even further one other redundant
var has been removed.

This also removes a redundant assignment.

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:29:59 -03:00
Christophe Thommeret 745632147d V4L/DVB (9270): cx24116: optimise emulated auto-pilot
Christophe divulged the following:
"Since 8PSK (and higher mod) signals are very likely to have pilot symbols,
pilot_auto should start with pilot_on for 8PSK.
And since QPSK signals are unlikely to have pilot, pilot_auto should start
with pilot_off for QPSK.

Without the patch:
QPSK tuning delay: ~100ms
8PSK tuning delay: ~900ms
with patch:
QPSK tuning delay: ~100ms
8PSK tuning delay: ~100ms
"

This patch does as Cristophe asks. In emulated auto-pilot we
choose pilot-on for tuning PSK_8 and pilot-off for
tuning QPSK.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:29:46 -03:00
Darron Broad 430189da04 V4L/DVB (9269): cx88: add I2S-ADC tvaudio method
This adds I2S-ADC tvaudio mode as a formal method of audio
delivery.

This fixes one bug and adds fm audio via I2S-ADC on cards
that support it.

The bug occured before when I2S-ADC mode was initiated on
composite/s-video open but was then reset within 500ms
by the audio thread which used any previous audio tuning
details.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:29:14 -03:00
Darron Broad 953cafc04e V4L/DVB (9268): tuner: add FMD1216MEX tuner
This tuner was already supported by proxy as an FMD1216ME, however,
the MEX uses a different FM Radio IF so this addition is now required.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:29:09 -03:00
Darron Broad 649e13a95b V4L/DVB (9267): cx88: Update of audio routing config for FM radio
This adds audio routing for the hvr-1300/3000/4000 cards
enabling FM audio for the I2S ADC method of the cx88.

At this time only the HVR-4000 has been tested. It
is assumed the HVR-3000/1300 are the same.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:29:03 -03:00
Darron Broad e43f3fab05 V4L/DVB (9266): videobuf: properly handle attachment failure
This fixes attachment failure where we now unwind
attachment and skip non-attached nodes where
necessary so we can survive a fault situation
correctly.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:28:41 -03:00
Darron Broad 7bdf84fc47 V4L/DVB (9265): videobuf: data storage optimisation
To optimise data storage redundant vars are removed.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:28:31 -03:00
Darron Broad 6594690b39 V4L/DVB (9264): MFE: bugfix: multi-frontend mutual exclusion parallel open
When moving from one frontend to another
an application could spawn multiple threads opening
the same new frontend and in some circumstances all of
these could become delayed waiting for the previous
frontend readers or previous frontend writer thread to
complete.

In this scenario the first thread will succeed on open
to bring the new frontend online but any others will return
EBUSY. This is a fault.  If the first succeeds and all others
are on the same frontend then they should succeed also.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:28:22 -03:00
Steven Toth 5c310b1360 V4L/DVB (9263): mxl5005s: Checkpatch compliance
mxl5005s: Checkpatch compliance

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:28:08 -03:00
Steven Toth 376a841440 V4L/DVB (9262): cx88: Change spurious buffer message into a debug only message
A number of users have complained that their syslog often shows this
messages but it doesn't impact performance. I'm changing this to a debug
message, so developers will still see the message during testing and
users will no longer be bothered by this.

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:28:03 -03:00
Steven Toth 8f3cd53006 V4L/DVB (9261): xc5000: Checkpatch compliance
xc5000: Checkpatch compliance

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:59 -03:00
Steven Toth 93504abfeb V4L/DVB (9260): cx24123: Checkpatch compliance
cx24123: Checkpatch compliance

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:56 -03:00
Steven Toth b431c61642 V4L/DVB (9259): s5h1411: Checkpatch compliance
s5h1411: Checkpatch compliance

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:52 -03:00
Steven Toth b7709c0de2 V4L/DVB (9258): s5h1409: Checkpatch compliance
s5h1409: Checkpatch compliance

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:48 -03:00
Steven Toth 98c9482369 V4L/DVB (9257): cx24116: Checkpatch compliance #3
cx24116: Checkpatch compliance #3

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:45 -03:00
Steven Toth 4e3599a5f0 V4L/DVB (9256): cx22702: Checkpatch compliance
cx22702: Checkpatch compliance

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:42 -03:00
Steven Toth 5c2a164aad V4L/DVB (9255): tda10048: Checkpatch compliance
tda10048: Checkpatch compliance

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:38 -03:00
Steven Toth f11ec7d4ee V4L/DVB (9254): cx24116: Checkpatch compliance #2
cx24116: Checkpatch compliance #2

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:34 -03:00
Steven Toth d93356a220 V4L/DVB (9253): cx24116: Checkpatch compliance
cx24116: Checkpatch compliance

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:29 -03:00
Steven Toth a8eb912c6d V4L/DVB (9252): au0828: Checkpatch compliance
au0828: Checkpatch compliance

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:26 -03:00
Steven Toth 9c8ced511e V4L/DVB (9251): cx23885: Checkpatch compliance
cx23885: Checkpatch compliance

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:23 -03:00
Steven Toth 2af03eeadf V4L/DVB (9250): cx88: Convert __FUNCTION__ to __func__
cx88: Convert __FUNCTION__ to __func__

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:27:11 -03:00
Michael Krufky 3dfbe31f09 V4L/DVB (9248): sms1xxx: support two new revisions of the Hauppauge WinTV MiniStick
Autodetect 2040:5520 and 2040:5530 as Hauppauge WinTV MiniStick

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:26:56 -03:00
Michael Krufky a636da6bab V4L/DVB (9247): au0828: add support for another USB id for Hauppauge HVR950Q
Add autodetection support for a new revision of the Hauppauge HVR950Q (2040:721e)

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:26:39 -03:00
Magnus Damm 51354cc3e0 V4L/DVB (9244): video: improve sh_mobile_ceu buffer handling
This patch improves the buffer handling in the sh_mobile_ceu driver.

Instead of marking all queued buffers as VIDEOBUF_ACTIVE the code now
marks queued-but-not-active buffers as VIDEOBUF_QUEUED and buffers
involved in dma as VIDEOBUF_ACTIVE. The code is also updated with
code to cancel active buffers, thanks to Morimoto-san.

Tested-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:26:10 -03:00
Magnus Damm 2c0a072e3e V4L/DVB (9243): video: add byte swap to sh_mobile_ceu driver
Extend the sh_mobile_ceu driver to enable byte swap. This way bytes
are stored in memory in incoming byte order.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:25:56 -03:00
Magnus Damm dd54203b48 V4L/DVB (9242): video: add sh_mobile_ceu comments
This patch adds CEU hardware block comments to the sh_mobile_ceu driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:25:43 -03:00
Guennadi Liakhovetski 50c616fd0b V4L/DVB (9241): soc-camera: move sensor power management to soc_camera_platform.c
Switching sensors on and off is now done by sensor drivers themselves,
typically using platform-provided hooks. Update soc_camera_platform.c to
do the same. Also remove a refundant struct soc_camera_platform_info
definition from soc_camera_platform.c.

Tested-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:25:29 -03:00
Jean Delvare 2a1d245b70 V4L/DVB (9240): saa7127: Fix two typos
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:25:11 -03:00
Magnus Damm def5239320 V4L/DVB (9239): Add support for rgb555 pixel formats to vivi
This patch adds RGB555 pixel format support to the vivi driver. Both
little endian and big endian versions are added. The driver follows
the RGB pixel format described in Table 2-2 of the V4L2 API spec,
_not_ the older BGR interpretation described in Table 2-1.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:25:08 -03:00
Magnus Damm aeadb5d4e5 V4L/DVB (9238): Add support for rgb565 pixel formats to vivi
This patch adds RGB565 pixel format support to the vivi driver. Both
little endian and big endian versions are added. The driver follows
the RGB pixel format described in Table 2-2 of the V4L2 API spec,
_not_ the older BGR interpretation described in Table 2-1.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:25:05 -03:00
Magnus Damm fca36bab97 V4L/DVB (9237): Add uyvy pixel format support to vivi
This patch simply adds UYVY pixel format support to the vivi driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:25:01 -03:00
Magnus Damm d891f47581 V4L/DVB (9236): Teach vivi about multiple pixel formats
This patch contains the ground work to add support for multiple
pixel formats to vivi.c

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:24:57 -03:00
Magnus Damm 74d7c5af78 V4L/DVB (9235): Precalculate vivi yuv values
This patch improves the color space conversion code in vivi.c to
directly draw with precalculated YUV values as palette instead of
drawing with YUV that is calculated from RGB for every two pixels.
This way we eliminate the need for 9 multiplications every two pixels.

A side effect of this patch is that the time counter is changed from
green text on black background to white text on black background.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:24:53 -03:00
Jean Delvare d54c17e435 V4L/DVB (9234): zoran: Drop redundant printk
There's no point in logging two messages for the same error.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:24:49 -03:00
Steven Toth eb0c58bb13 V4L/DVB (9232): cx23885: Move the MFE frontend allocation into the correct place
cx23885 frontend allocation code needs to exist in the higher function,
and it also needs to ensure videobug is also correctly initialised
on a per frontend basis. This code uses the previous num_frontends
patch to safely init each future MFE frontend on a single tsport as
as safely as possible - given that we don't have any of those boards.
Again, better to add all of this safety code now, while the MFE patch
set is fresh in everyone mind, than to try and add it 12-24 months from
now, when the subject is cold.

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:24:43 -03:00
Steven Toth a739a7e4c6 V4L/DVB (9231): cx23885: Define num_frontends as a function of the port
This allows some cardcoded functions to be more flexible, and paves
the way for any future cards that may have MFE support. Better to add it
now when the MFE patches is fresh in peoples mind, rather than 12 months
from now when new cards appear.

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:24:38 -03:00
Steven Toth d782ffa24f V4L/DVB (9230): cx23885: MFE related OOPS fix
Bug: the tree generated an oops when the cx23885 was laoded. This avoids
the oops by ensuring the mutex is correctly initialised before it's used.

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:24:32 -03:00
Darron Broad 63248f2664 V4L/DVB (9229): cx88: Add intial config for FM radio support
This add initial configuration for radio support on the
hvr-3000/4000. FM radio doesn't work as yet without
further patches (to come), but this prepares for
that.

Experimental radio support shows that it works
when combined with additional audio routing
work for cards with an FMD1216ME analogue
frontend, but not the MEX variant (more later).

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:24:26 -03:00
Darron Broad 923ac7f7d7 V4L/DVB (9228): cx88: Add audio routing for the hvr-3000/4000
This adds audio routing on the hvr-3000/4000

This is a preliminary patch for later routing
requirements.

This adds line-in support on the 2 cards mentioned.
It is also apparent that there is an initial open
fault for line-in when opening composite/s-video.
This will be fixed later.

It was also noticed that the bit-field for audio
routing which was 2 bits needs an increase as
the WM8775 for example, allows a value 4 bits
wide for it's audio mux.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:24:22 -03:00
Darron Broad 59b1842da1 V4L/DVB (9227): MFE: Add multi-frontend mutual exclusion
This add frontend R/W mutual exclusion.
Prior to this point in time it was possible to open both
frontends simultaneously which an MFE card cannot support.

In order to stop this, a delayed open is performed which
has the following function:

-  Return EBUSY after a configurable amount of time
   if a frontend is unavailable due to the other being
   in use.

-  Only allow opening of a frontend if the kernel thread
   of the other has stopped.

This solution was chosen to allow switching between
frontends to work as seamlessly as possible. When both
frontends are actually opened simultaneously then one
will only open, but if quick switching is performed
between one of many then the new open will succeed in
a clean fashion rather than interrupting a kernel
thread.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:24:15 -03:00
Darron Broad 2f3af9e64d V4L/DVB (9226): MFE: cx88: Reset cx22702 on hvr-3000/4000
The cx22702 is now always reset on module load. Prior to
this the cx22702 was not found on i2c scan without a
full reset.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:23:34 -03:00
Darron Broad 8e739090d6 V4L/DVB (9225): MFE: Add configurable gate control
This adds a configurable (one per card) gate control option
for multi-frontend. Prior to this point gate control was
assumed to be on the primary frontend, this is a fault
when the gate to the analogue section is on the secondary
which is the default for both the HVR-3000 and HVR-4000
in MFE.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:23:28 -03:00
Darron Broad f972e0bd93 V4L/DVB (9224): MFE: bugfix: add missing frontend allocation
When using MFE on a setup with both and HVR-3000 and ASUS P7131
card it was noticed that frontend allocation for saa7134
adapters was missing. This patch adds that allocation for
both saa7134 and cx23885 adapters.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:23:21 -03:00
Darron Broad 92abe9ee37 V4L/DVB (9223): MFE: Fix a number of bugs and some tidying up
A number of reference to videobuf_dvb_get_frontend used an invalid
index. This has been fixed.

The section for the HVR3000 in advise_acquire was redundant as
the same logic is used on the HVR4000. This has been removed
and both cards now use the same function.

A number of small errors and whitespace errors are also fixed.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:23:15 -03:00
Steven Toth 363c35fc44 V4L/DVB (9222): S2API: Add Multiple-frontend on a single adapter support.
A detailed description from the original patches 2 years ago:

"The WinTV-HVR3000 has a single transport bus which is shared between
a DVB-T and DVB-S modulator. These patches build on the bus acquisition
cx88 work from a few weeks ago to add support for this.

So to applications the HVR3000 looks like this:
/dev/dvb/adapter0/fe0 (cx24123 DVB-S demod)
/dev/dvb/adapter0/fe1 (cx22702 DVB-T demod)

Additional boards continue as before, eg:
/dev/dvb/adapter1/fe0 (lgdt3302 ATSC demod)

The basic change is removing the single instance of the videobuf_dvb in
cx8802_dev and saa7134_dev(?) and replacing it with a list and some
supporting functions.

*NOTE* This branch was taken before v4l-dvb was closed for 2.6.19 so
two or three current cx88 patches appear to be reversed by this tree,
this will be cleaned up in the near future. The patches missing change
the mutex handing to core->lock, fix an enumeration problem."

It should be recognised that a number of people have been maintaining
this patchset. Significant levels of Kudos to everyone one involved,
including but not limited to:

Darron Broad
Fabio M. Di Nitto
Carlo Scarfoglio
Hans Werner

Without the work of these people, and countless others, my two year old
patches would of died on the Mercurial linuxtv.org vine a long time
ago.

TODO: Revise these patches a little further so that the need for
demux1 and dvr0 is optional, not mandatory on the HVR3000.

HISTORY (darron):
This is the last update to MFE prepared by Hans which is based
upon the `scratchpad' diff created by Carlo.
All MFE work prior to that point must be attributed to Fabio
who ported and maintained Steve's original patch up to that
time.

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:23:10 -03:00
Tobias Lorenz 548da7625c V4L/DVB (9219): Kernel config comment corrected (radio-silabs -> radio-si470x)
Just a trivial typo fix.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:22:54 -03:00
Tobias Lorenz 617f53336c V4L/DVB (9218): si470x: removement of get/set input/audio
This patch removes the unnecessary get/set input/audio functions.

The reason is, that the V4L2 specification says, that if input or audio
cannot be switched anyway, the functions doesn't need to be implemented.

I've tested the new driver with all current radio programs in
Debian/testing and found no problems with that.

In my opinion, the driver is much cleaner by removing these unnecessary
functions.

Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:22:24 -03:00
Tobias Lorenz 73a529f9a6 V4L/DVB (9217): si470x: correction of mono/stereo handling
This patch corrects the behavior of mono/stereo indication and
selection.

These functions now work conform to what's defined in the V4L2
specification.

Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:22:03 -03:00
Tobias Lorenz 33632d4773 V4L/DVB (9216): si470x: tuner->type handling
The V4L2 specification says, when to check and when to return
tuner->type as constant value.

This patch corrects exactly this behavior, so that it is now conform to
the V4L2 specification.

Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:21:50 -03:00
Tobias Lorenz eb6e3b860e V4L/DVB (9215): si470x: improvement of unsupported base controls
This patch changes the handling of unsupported base controls.

In the former version, specific unsupported base controls were listed in
the queryctrl table and were flagged as disabled controls. This was done
for all base controls used by the applications.

The patch now removes the specific base controls and instead lets
queryctrl automatically return unsupported base controls flagged as
disabled.

Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:21:29 -03:00
Tobias Lorenz a17c0019f2 V4L/DVB (9214): si470x: improvement of module device support
This patch improves support for multiple radio devices.

In previous versions all region relevant settings were derived from one
module parameter. As in future versions, the region and other
configuration should be configurable per device from the user space,
this patch already retrieves all relevant information from the actual
device specific settings.

Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:21:11 -03:00
Tobias Lorenz 374ab68615 V4L/DVB (9213): si470x: module_param access rights
This patch mainly adds correct module_param access rights. Also there
are a lot of small coding style enhancements and some corrections of the
variable references in module_param.

Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17 17:20:43 -03:00