PCI PM: Use pci_set_power_state during early resume
Once we have allowed timer interrupts to be enabled during the early
phase of resuming devices, we are now able to use the generic
pci_set_power_state() to put PCI devices into D0 at that time. Then,
the platform-specific PM code will have a chance to handle devices
that don't implement the native PCI PM or that require some
additional, platform-specific operations to be carried out to power
them up. Also, by doing this we can simplify the code quite a bit.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Ingo Molnar <mingo@elte.hu> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Frans Pop [Mon, 16 Mar 2009 21:39:56 +0000 (22:39 +0100)]
PCI PM: Consistently use variable name "error" for pm call return values
I noticed two functions use a variable "i" to store the return value of PM
function calls while the rest of the file uses "error". As "i" normally
indicates a counter of some sort it seems better to keep this consistent.
Signed-off-by: Frans Pop <elendil@planet.nl> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Change the ordering of the hibernation core code so that the platform
"prepare" callbacks are executed and the nonboot CPUs are disabled
after calling device drivers' "late suspend" methods.
This change (along with the previous analogous change of the suspend
core code) will allow us to rework the PCI PM core so that the power
state of devices is changed in the "late" phase of suspend (and
analogously in the "early" phase of resume), which in turn will allow
us to avoid the race condition where a device using shared interrupts
is put into a low power state with interrupts enabled and then an
interrupt (for another device) comes in and confuses its driver.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Ingo Molnar <mingo@elte.hu>
Change the ordering of the suspend core code so that the platform
"prepare" callback is executed and the nonboot CPUs are disabled
after calling device drivers' "late suspend" methods.
This change will allow us to rework the PCI PM core so that the power
state of devices is changed in the "late" phase of suspend (and
analogously in the "early" phase of resume), which in turn will allow
us to avoid the race condition where a device using shared interrupts
is put into a low power state with interrupts enabled and then an
interrupt (for another device) comes in and confuses its driver.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Ingo Molnar <mingo@elte.hu>
PM: Rework handling of interrupts during suspend-resume
Use the functions introduced in by the previous patch,
suspend_device_irqs(), resume_device_irqs() and check_wakeup_irqs(),
to rework the handling of interrupts during suspend (hibernation) and
resume. Namely, interrupts will only be disabled on the CPU right
before suspending sysdevs, while device drivers will be prevented
from receiving interrupts, with the help of the new helper function,
before their "late" suspend callbacks run (and analogously during
resume).
In addition, since the device interrups are now disabled before the
CPU has turned all interrupts off and the CPU will ACK the interrupts
setting the IRQ_PENDING bit for them, check in sysdev_suspend() if
any wake-up interrupts are pending and abort suspend if that's the
case.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Ingo Molnar <mingo@elte.hu>
PM: Introduce functions for suspending and resuming device interrupts
Introduce helper functions allowing us to prevent device drivers from
getting any interrupts (without disabling interrupts on the CPU)
during suspend (or hibernation) and to make them start to receive
interrupts again during the subsequent resume. These functions make it
possible to keep timer interrupts enabled while the "late" suspend and
"early" resume callbacks provided by device drivers are being
executed. In turn, this allows device drivers' "late" suspend and
"early" resume callbacks to sleep, execute ACPI callbacks etc.
The functions introduced here will be used to rework the handling of
interrupts during suspend (hibernation) and resume. Namely,
interrupts will only be disabled on the CPU right before suspending
sysdevs, while device drivers will be prevented from receiving
interrupts, with the help of the new helper function, before their
"late" suspend callbacks run (and analogously during resume).
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Ingo Molnar <mingo@elte.hu>
Linus Torvalds [Mon, 30 Mar 2009 18:38:31 +0000 (11:38 -0700)]
Merge branch 'x86-stage-3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-stage-3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (190 commits)
Revert "cpuacct: reduce one NULL check in fast-path"
Revert "x86: don't compile vsmp_64 for 32bit"
x86: Correct behaviour of irq affinity
x86: early_ioremap_init(), use __fix_to_virt(), because we are sure it's safe
x86: use default_cpu_mask_to_apicid for 64bit
x86: fix set_extra_move_desc calling
x86, PAT, PCI: Change vma prot in pci_mmap to reflect inherited prot
x86/dmi: fix dmi_alloc() section mismatches
x86: e820 fix various signedness issues in setup.c and e820.c
x86: apic/io_apic.c define msi_ir_chip and ir_ioapic_chip all the time
x86: irq.c keep CONFIG_X86_LOCAL_APIC interrupts together
x86: irq.c use same path for show_interrupts
x86: cpu/cpu.h cleanup
x86: Fix a couple of sparse warnings in arch/x86/kernel/apic/io_apic.c
Revert "x86: create a non-zero sized bm_pte only when needed"
x86: pci-nommu.c cleanup
x86: io_delay.c cleanup
x86: rtc.c cleanup
x86: i8253 cleanup
x86: kdebugfs.c cleanup
...
Linus Torvalds [Mon, 30 Mar 2009 17:36:35 +0000 (10:36 -0700)]
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (21 commits)
MIPS: Alchemy: PB1200: use SMC91X platform data.
MIPS: Alchemy: MIPS hazard workarounds are not required.
MIPS: Alchemy: provide cpu feature overrides.
MIPS: Alchemy: unify CPU model constants.
MIPS: Make a needlessly global symbol static in arch/mips/kernel/smp.c
MIPS: Fix global namespace pollution in arch/mips/kernel/smp-up.c
MIPS: Malta: make a needlessly global integer variable static
MIPS: Use BUG_ON() where possible.
MIPS: Convert obsolete irq_desc_t to struct irq_desc
MIPS: Enable GENERIC_HARDIRQS_NO__DO_IRQ for all platforms
MIPS: EMMA2RH: Set UART mapbase
MIPS: EMMA2RH: Use set_irq_chip_and_handler_name
MIPS: EMMA2RH: Use handle_edge_irq() handler for GPIO interrupts
MIPS: Mark Eins: Fix cascading interrupt dispatcher
MIPS: Au1000: convert to using gpiolib
MIPS: Stop using <asm-generic/int-l64.h>.
MIPS: Cavium: Add -Werror
MIPS: Makefile: Add simple make install target.
MIPS: Compat: Zero upper 32-bit of offset_high and offset_low.
MIPS: __raw_spin_lock() may spin forever on ticket wrap.
...
Linus Torvalds [Mon, 30 Mar 2009 17:23:53 +0000 (10:23 -0700)]
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (180 commits)
powerpc: clean up ssi.txt, add definition for fsl,ssi-asynchronous
powerpc/85xx: Add support for the "socrates" board (MPC8544).
powerpc: Fix bugs introduced by sysfs changes
powerpc: Sanitize stack pointer in signal handling code
powerpc: Add write barrier before enabling DTL flags
powerpc/83xx: Update ranges in gianfar node to match other dts
powerpc/86xx: Move gianfar mdio nodes under the ethernet nodes
powerpc/85xx: Move gianfar mdio nodes under the ethernet nodes
powerpc/83xx: Move gianfar mdio nodes under the ethernet nodes
powerpc/83xx: Add power management support for MPC837x boards
powerpc/mm: Introduce early_init_mmu() on 64-bit
powerpc/mm: Add option for non-atomic PTE updates to ppc64
powerpc/mm: Fix printk type warning in mmu_context_nohash
powerpc/mm: Rename arch/powerpc/kernel/mmap.c to mmap_64.c
powerpc/mm: Merge various PTE bits and accessors definitions
powerpc/mm: Tweak PTE bit combination definitions
powerpc/cell: Fix iommu exception reporting
powerpc/mm: e300c2/c3/c4 TLB errata workaround
powerpc/mm: Used free register to save a few cycles in SW TLB miss handling
powerpc/mm: Remove unused register usage in SW TLB miss handling
...
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (70 commits)
ide: keep track of number of bytes instead of sectors in struct ide_cmd
ide: remove ide_execute_pkt_cmd() (v2)
ide: add ->dma_timer_expiry method and remove ->dma_exec_cmd one (v2)
ide: set hwif->expiry prior to calling [__]ide_set_handler()
ide: use do_rw_taskfile() for ATA_CMD_PACKET commands
ide: pass command to ide_map_sg()
ide: remove ide_end_request()
ide: use ide_end_rq() in ide_complete_rq()
ide: pass number of bytes to complete to ide_complete_rq()
ide: remove BUG() from ide_complete_rq()
ide: move rq->errors quirk out from ide_end_request()
ide: pass error value to ide_complete_rq()
ide: sanitize ide_end_rq()
ide: add ide_end_rq() (v2)
ide: make ide_special_rq() BUG() on unknown requests
ide: sanitize ide_finish_cmd()
ide: use ide_complete_cmd() for REQ_UNPARK_HEADS
ide: use ide_complete_cmd() for head unload commands
ide: task_error() -> task_error_cmd()
ide: unify exit paths in task_pio_intr()
...
The audio and vbi functions where still called through an ioctl-like
interface, even though this is no longer needed with v4l2-subdev. Just
change each 'case' into a proper function and call that directly.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sun, 29 Mar 2009 20:47:30 +0000 (17:47 -0300)]
V4L/DVB (11305): cx88: prevent probing rtc and ir devices
tuner-core.c contains a hack for cx88 board to prevent probing of certain
addresses:
/* HACK: Ignore 0x6b and 0x6f on cx88 boards.
* FusionHDTV5 RT Gold has an ir receiver at 0x6b
* and an RTC at 0x6f which can get corrupted if probed.
*/
With the new i2c API this hack no longer works. So instead change the
list of tuner probe addresses in the cx88 driver itself, which is much
more clean.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sun, 29 Mar 2009 11:26:01 +0000 (08:26 -0300)]
V4L/DVB (11300): cx88: convert to v4l2_subdev.
Convert cx88 to use v4l2_subdev since the old i2c autoprobing mechanism
will be removed.
Added code to explicitly load tvaudio where needed. Also fix the rtc-isl1208
support: since that driver no longer supports autoprobing it has to be
loaded using the new i2c API.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sun, 29 Mar 2009 09:53:29 +0000 (06:53 -0300)]
V4L/DVB (11297): cx23885: convert to v4l2_subdev.
Convert this driver to v4l2_subdev. Note that currently the only card with
analog support in this driver is the HVR-1800. The analog tuner support in
this driver is limited to what is needed for this board. When analog support
is added for other cards, then the tuner load code will probably have to be
expanded to take care of those boards. For example, there is currently no
support for either radio tuners or tda9887 demods.
I'd like to thank Steven Toth for testing this on his HVR-1800.
Tested-by: Steven Toth <stoth@linuxtv.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Márton Németh [Fri, 27 Mar 2009 14:13:57 +0000 (11:13 -0300)]
V4L/DVB (11293): uvcvideo: Add zero fill for VIDIOC_ENUM_FMT
When enumerating formats with VIDIOC_ENUM_FMT the uvcvideo driver does not
fill the reserved fields of the struct v4l2_fmtdesc with zeros as required by
V4L2 API revision 0.24 [1]. Add the missing initializations.
The patch was tested with v4l-test 0.10 [2] with CNF7129 webcam found on EeePC
901.
References:
[1] V4L2 API specification, revision 0.24
http://v4l2spec.bytesex.org/spec/r8367.htm
[2] v4l-test: Test environment for Video For Linux Two API
http://v4l-test.sourceforge.net/
When resetting the PID-filter block a safety msleep(1) was injected. Now that the function is called from interrupt context, it was replaced with a udelay. It seems that this delay is not necessary at all, let's remove it for now and test a while.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB (11284): Fix i2c code of flexcop-driver for rare revisions
This patch adds a workaround in the i2c-code of the flexcop-driver to
fix support for SkyStar2 rev 2.7. There are not many devices out
there, that's why this bug was not revealed earlier.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Sat, 28 Mar 2009 11:29:00 +0000 (08:29 -0300)]
V4L/DVB (11278): bttv: convert to v4l2_subdev since i2c autoprobing will disappear.
Since i2c autoprobing will disappear bttv needs to be converted to use
v4l2_subdev instead.
Without autoprobing the autoload module option has become obsolete. A warning
is generated if it is set, but it is otherwise ignored.
Since the bttv card definitions are of questionable value a new option was
introduced to allow the user to control which audio module is selected:
msp3400, tda7432 or tvaudio (or none at all).
By default bttv will use the card definitions and fallback on tvaudio as the
last resort.
If no audio device was found a warning is printed.
The saa6588 RDS device is now also explicitly probed since it is no longer
possible to autoprobe it. A new saa6588 module option was added to override
the card definition since I suspect more cards have this device than one
would guess from the card definitions.
Note that the probe addresses of the i2c modules are hardcoded in this
driver. Once all v4l drivers are converted to v4l2_subdev this will be
cleaned up. Such data belongs in an i2c driver header.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Thu, 19 Mar 2009 19:53:32 +0000 (16:53 -0300)]
V4L/DVB (11277): tvaudio: always call init_timer to prevent rmmod crash.
In the tvaudio_remove function del_timer_sync(&chip->wt) is called.
However, chip->wt isn't always initialized depending on the type of
audio chip. Since del_timer_sync hangs when given an uninitialized timer
we should always initialize it.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Wed, 18 Mar 2009 17:02:36 +0000 (14:02 -0300)]
V4L/DVB (11276): tvaudio: add tda9875 support.
This change allows bttv to use tvaudio for this device. Since this device
has the same i2c address as the tda9874 we need to support both in the same
tvaudio driver. This makes it possible for tvaudio to detect which chip is
used. Originally the tda9875 was only available in the dedicated tda9875
driver, but that makes life very hard for bttv since loading tvaudio might
misdetect a tda9875 as a tda9874.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Wed, 18 Mar 2009 16:59:34 +0000 (13:59 -0300)]
V4L/DVB (11275): tvaudio: fix mute and s/g_tuner handling
The mute control depends on CHIP_HAS_INPUTSEL, so test for that first.
The s/g_tuner code should check whether getmode/setmode is set at the
beginning instead of filling in the struct and discovering at
the end that this chip doesn't implement audiomodes after all (i.e. is
a simple muxer chip).
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Trent Piepho [Sun, 29 Mar 2009 01:25:36 +0000 (22:25 -0300)]
V4L/DVB (11272): zr364xx: Remove code for things already done by video_ioctl2
The ->vidioc_(s|g|try|enum)_fmt_vid_cap() methods are only called on
VIDEO_CAPTURE buffers. Thus, there is no need to check or set the buffer's
'type' field since it must already be set to VIDEO_CAPTURE. Checking the
buffer type can be removed from zr364xx_vidioc_(s|g|try|enum)_fmt_vid_cap().
The v4l2 core code in v4l2_ioctl will zero out the structure the driver is
supposed to fill in for read-only ioctls. For read/write ioctls, all the
fields which aren't supplied from userspace will be zeroed out.
Zeroing code can be removed from zr364xx_vidioc_querycap(),
zr364xx_vidioc_enum_input(), zr364xx_vidioc_enum_fmt_vid_cap(), and
zr364xx_vidioc_g_fmt_vid_cap().
Trent Piepho [Sun, 29 Mar 2009 01:25:36 +0000 (22:25 -0300)]
V4L/DVB (11271): usbvision: Remove buffer type checks from enum_fmt_vid_cap, XXXbuf
The v4l2-ioctl core only allows buffer types for which the corresponding
->vidioc_try_fmt_xxx() methods are defined to be used with
vidioc_(q|dq|query)buf() and vidioc_reqbufs().
Since this driver only defines ->vidioc_try_fmt_vid_cap() the checks can be
removed from vidioc_reqbufs(), vidioc_qbuf(), and vidioc_dqbuf().
The ->vidioc_(s|g|try|enum)_fmt_vid_cap() methods are only called on
VIDEO_CAPTURE buffers. Thus, there is no need to check or set the buffer's
'type' field since it must already be set to VIDEO_CAPTURE. So setting the
buffer type in vidioc_enum_fmt_vid_cap() can be removed.
Trent Piepho [Sun, 29 Mar 2009 01:25:36 +0000 (22:25 -0300)]
V4L/DVB (11270): meye: Remove buffer type checks from XXX_fmt_vid_cap, XXXbuf
The ->vidioc_(s|g|try|enum)_fmt_vid_cap() methods are only called on
VIDEO_CAPTURE buffers. Thus, there is no need to check or set the buffer's
'type' field since it must already be set to VIDEO_CAPTURE.
The v4l2-ioctl core only allows buffer types for which the corresponding
->vidioc_try_fmt_xxx() methods are defined to be used with
vidioc_(q|dq|query)bufs() and vidioc_reqbufs().
Since this driver only defines ->vidioc_try_fmt_vid_cap() the checks can be
removed from vidioc_reqbufs(), vidioc_querybuf(), vidioc_qbuf(), and
vidioc_dqbuf(). Also, the buffer index is unsigned so it's not necessary
to check if it is less than zero.
Trent Piepho [Sun, 29 Mar 2009 01:25:36 +0000 (22:25 -0300)]
V4L/DVB (11269): cx88-blackbird: Stop setting buffer type in XXX_fmt_vid_cap
The ->vidioc_(s|g|try|enum)_fmt_vid_cap() methods are only called on
VIDEO_CAPTURE buffers. Thus, there is no need to check or set the 'type'
field since it must already be set to VIDEO_CAPTURE.
Trent Piepho [Sun, 29 Mar 2009 01:25:36 +0000 (22:25 -0300)]
V4L/DVB (11268): cx23885-417: Don't need to zero ioctl parameter fields
The v4l2 core code in v4l2_ioctl will zero out the structure the driver is
supposed to fill in for read-only ioctls. For read/write ioctls, all the
fields which aren't supplied from userspace will be zeroed out.
Zeroing code is removed from enum_input, g_tuner, g_frequency, querycap,
enum_fmt_vid_cap, g_fmt_vid_cap, and try_fmt_vid_cap.
The ->vidioc_(s|g|try|enum)_fmt_vid_cap() methods are only called on
VIDEO_CAPTURE buffers. Thus, there is no need to check or set the buffer's
'type' field since it must already be set to VIDEO_CAPTURE.
There also appeared to be a copy and paste error in
vidioc_try_fmt_vid_cap() that would set f->fmt.pix.sizeimage to zero.
Note that the s_fmt_vid_cap method doesn't appear to actually do anything.
Whatever parameters were requested are just silently ignored. Was this
intentional? Who knows, as the commit log entry for the driver just says,
"Add generic cx23417 hardware encoder support." There are no docs. A
comment like "this driver totally ignores the v4l2 spec w.r.t.
VIDIOC_S_FMT because ..." would have gone a long way.
Trent Piepho [Sun, 29 Mar 2009 01:25:36 +0000 (22:25 -0300)]
V4L/DVB (11267): cafe_ccic: Remove buffer type check from XXXbuf
The v4l2-ioctl core only allows buffer types for which the corresponding
->vidioc_try_fmt_xxx() methods are defined to be used with
vidioc_(q|dq|query)bufs() and vidioc_reqbufs().
This driver only defines ->vidioc_try_fmt_vid_cap() so only VIDEO_CAPTURE
buffers are allowed to be used with cafe_vidioc_reqbufs(),
cafe_vidioc_querybuf(), cafe_vidioc_qbuf(), and cafe_vidioc_dqbuf().
The ->vidioc_(s|g|try|enum)_fmt_vid_cap() methods are only called on
VIDEO_CAPTURE buffers. Thus, there is no need to check or set the buffer's
'type' field since it must already be set to VIDEO_CAPTURE. So the
check in cafe_vidioc_enum_fmt_vid_cap() can be removed.
The 'index' field of v4l2_buffer is unsigned so the checks for it being
less than zero can be removed too.
Trent Piepho [Sun, 29 Mar 2009 01:25:36 +0000 (22:25 -0300)]
V4L/DVB (11266): vino: Remove code for things already done by video_ioctl2
The v4l2-ioctl core only allows buffer types for which the corresponding
->vidioc_try_fmt_xxx() methods are defined to be used in vidioc_(g|s)_parm,
vidioc_(q|dq|query)buf, and vidioc_reqbufs.
Remove buffer type checking from vino_g_parm(), vino_s_parm(),
vino_reqbufs(), vino_querybuf(), vino_qbuf(), and vino_dqbuf(). This
reduced the indent level of the code so a few lines can be wrapped better.
Also fixed the C++ type comments.
The v4l2-ioctl core also provides structs that have been pre-zeroed for all
fields that driver is supposed to fill in, so remove zeroing code from
vino_enum_fmt_vid_cap(). Also, the format index is unsigned so it's not
necessary to check if it's less than zero.
Trent Piepho [Sun, 29 Mar 2009 01:25:36 +0000 (22:25 -0300)]
V4L/DVB (11265): stkwebcam: Remove buffer type check from g_parm and q/dq/reqbufs
The v4l2-ioctl core only allows buffer types for which the corresponding
->vidioc_try_fmt_xxx() methods are defined to be used with
vidioc_(q|dq|query)bufs(), vidioc_reqbufs() and now vidioc_(s|g)_parm.
This driver only defines ->vidioc_try_fmt_vid_cap() so only VIDEO_CAPTURE
buffers are allowed to be used with vidioc_g_parm(), vidioc_qbuf(),
vidioc_dqbuf(), and vidioc_reqbufs().
Trent Piepho [Sun, 29 Mar 2009 01:25:36 +0000 (22:25 -0300)]
V4L/DVB (11264): omap24xxcam: Remove buffer type check from vidioc_s/g_parm
The v4l2-ioctl core now only allows buffer types for which the corresponding
->vidioc_try_fmt_xxx() methods are defined to be used in vidioc_(g|s)_parm.
This driver only defines ->vidioc_try_fmt_vid_cap() so only VIDEO_CAPTURE
buffers are allowed to be used with vidioc_s_parm() and vidioc_g_parm().
Trent Piepho [Sun, 29 Mar 2009 01:25:35 +0000 (22:25 -0300)]
V4L/DVB (11263): gspca: Stop setting buffer type, and avoid memset in querycap
The v4l2-ioctl core checks the buffer type now by only allowing buffer
types for which the corresponding ->vidioc_try_fmt_xxx() methods are
defined.
This driver only defines ->vidioc_try_fmt_vid_cap() so only VIDEO_CAPTURE
buffers are allowed to be used with vidioc_g_parm. Also,
->vidioc_enum_fmt_vid_cap() is only called for VIDEO_CAPTURE buffers.
There is no need to set the buffer type since it must already be the
correct value.
The struct which ->vidioc_querycap() is supposed to fill in is already
zeroed so it's not necessary to call memset on it.
Trent Piepho [Sun, 29 Mar 2009 01:25:35 +0000 (22:25 -0300)]
V4L/DVB (11262): bttv: Remove buffer type check from vidioc_g_parm
The v4l2-ioctl core only allows buffer types for which the corresponding
->vidioc_try_fmt_xxx() methods are defined to be used with
vidioc_(q|dq|query)bufs(), vidioc_reqbufs() and now vidioc_(s|g)_parm.
The driver was only allowing VIDEO_CAPTURE buffers for g_parm, but since
the driver defines ->vidioc_try_fmt_vid_overlay() and
->vidioc_try_fmt_vbi_cap() it will now allow VIDEO_OVERLAY and VBI_CAPTURE
buffers as well. This should be fine as the driver only fills in the frame
rate field, which is just as valid for video overlay and vbi capture as it
is for video capture.
Trent Piepho [Sun, 29 Mar 2009 01:25:35 +0000 (22:25 -0300)]
V4L/DVB (11261): saa7146: Remove buffer type check from vidioc_g_parm
The v4l2-ioctl core now only allows buffer types for which the
corresponding ->vidioc_try_fmt_xxx() methods are defined to be used with
vidioc_(g|s)_parm.
The driver was only allowing VIDEO_CAPTURE buffers for g_parm, but since
the driver defines ->vidioc_try_fmt_vid_overlay() it will now allow
VIDEO_OVERLAY buffers as well. This should be fine as the fields the
driver fills in, readbuffers and frame rate, aren't wrong for VIDEO_OVERLAY
buffers.
Trent Piepho [Sun, 29 Mar 2009 01:25:35 +0000 (22:25 -0300)]
V4L/DVB (11260): v4l2-ioctl: Check format for S_PARM and G_PARM
Return EINVAL if VIDIOC_S/G_PARM is called for a buffer type that the
driver doesn't define a ->vidioc_try_fmt_XXX() method for. Several other
ioctls, like QUERYBUF, QBUF, and DQBUF, etc. do this too. It saves each
driver from having to check if the buffer type is one that it supports.
This card has the saa6752hs on 7-bit address 0x21 instead of 0x20. Add
support in the card definition struct to select which address to use and
update the definitions accordingly.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Michael Krufky [Sat, 28 Mar 2009 18:35:26 +0000 (15:35 -0300)]
V4L/DVB (11251): tuner: prevent invalid initialization of t->config in set_type
Drivers that don't set "config" directly in the set_type function will
end up with an invalid configuration value. Check that the value is sane,
otherwise initialize to 0.
Thanks to James Edward Geiger & Steven Toth for reporting this bug.
Cc: Steven Toth <stoth@linuxtv.org> Cc: James Edward Geiger <james.e.geiger@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Alan Cox [Thu, 26 Mar 2009 20:47:48 +0000 (17:47 -0300)]
V4L/DVB (11244): pluto2: silence spew of card hung up messages
If the card is ejected on some systems you get a spew of messages as other
shared IRQ devices interrupt between the card eject and the card IRQ
disable.
We don't need to spew them all out
Closes #7472
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Daniel Glöckner [Thu, 26 Mar 2009 14:31:08 +0000 (11:31 -0300)]
V4L/DVB (11242): allow v4l2 drivers to provide a get_unmapped_area handler
Shared memory mappings on nommu machines require a get_unmapped_area
file operation that suggests an address for the mapping. This patch
adds a way for v4l2 drivers to provide this callback.
Signed-off-by: Daniel Glöckner <dg@emlix.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Janne Grunau [Thu, 26 Mar 2009 23:56:06 +0000 (20:56 -0300)]
V4L/DVB (11231): hdpvr: locking fixes
unlock io_mutex in hdpvr_stop_streaming hdpvr_disconnect to allow the
streaming worker to stop before we flush the workqueue.
do not return to user space with mutex held in vidioc_encoder_cmd with
an unknown encoder command.
Signed-off-by: Janne Grunau <j@jannau.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
V4L/DVB (11227): ce6230: avoid using unitialized var
drivers/media/dvb/dvb-usb/ce6230.c: In function ‘ce6230_i2c_xfer’:
drivers/media/dvb/dvb-usb/ce6230.c:107: warning: ‘ret’ may be used uninitialized in this function
V4L/DVB (11226): avoid warnings for request_ihex_firmware on dabusb and vicam
drivers/media/video/usbvideo/vicam.c: In function ‘vicam_open’:
drivers/media/video/usbvideo/vicam.c:194: warning: ‘fw’ may be used uninitialized in this function
drivers/media/video/dabusb.c: In function ‘dabusb_probe’:
drivers/media/video/dabusb.c:337: warning: ‘fw’ may be used uninitialized in this function
Documentation/video4linux/v4lgrab.c: In function ‘main’:
Documentation/video4linux/v4lgrab.c:193: warning: ‘src_depth’ is used uninitialized in this function
Documentation/video4linux/v4lgrab.c:108: warning: ‘b’ may be used uninitialized in this function
Documentation/video4linux/v4lgrab.c:108: warning: ‘g’ may be used uninitialized in this function
Documentation/video4linux/v4lgrab.c:108: warning: ‘r’ may be used uninitialized in this function
Hans de Goede [Thu, 26 Mar 2009 08:08:48 +0000 (05:08 -0300)]
V4L/DVB (11221): gspca - sonixj: Prefer sonixj instead of sn9c102 for 0471:0327.
Prefer the gspca sonixj driver for the Philips SPC600NC webcam instead of
the sn9c102 driver. As we've got userreports that it works with the gspca
driver, whereas it fails with the sn9c102 driver, see:
https://bugzilla.redhat.com/show_bug.cgi?id=477111
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Theodore Kilgore [Wed, 25 Mar 2009 10:13:13 +0000 (07:13 -0300)]
V4L/DVB (11213): gspca - sq905c: New subdriver.
The code in the new sq905c.c is based upon the structure of the code in
gspca/sq905.c, and upon the code in libgphoto2/camlibs/digigr8, which supports
the same set of cameras in stillcam mode. I am a co-author of gspca/sq905.c and
I am the sole author of libgphoto2/camlibs/digigr8, which is licensed under the
LGPL. I hereby give myself permission to use my own code from libgphoto2 in
gspca/sq905c.c.