Steven Toth [Mon, 10 Oct 2011 14:09:56 +0000 (11:09 -0300)]
[media] cx23885: hook the audio selection functions into the main driver
Ensure audio is established at driver start.
Ensure the correct defaults are established for the audio path if
the cards struct has nothing defined.
Allow the caller to select one of the two baseband input paths.
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Steven Toth [Mon, 10 Oct 2011 14:09:55 +0000 (11:09 -0300)]
[media] cx25840: Enable support for non-tuner LR1/LR2 audio inputs
The change effects cx23885 boards only and preserves support for existing
boards. Essentially, if we're using baseband audio into the cx23885 AV
core then we have to patch registers. The cx23885 driver will call
with either CX25840_AUDIO8 to signify tuner audio or AUDIO7 to
signify baseband audio. If/When we become more comfortable with this change
across a series of products then we may decide to relax the cx23885 only
restriction.
[liplianin@netup.ru: fix missing state declaration]
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Igor M. Liplianin <liplianin@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] cx23885: Don't use memset on vidioc_ callbacks
vidioc_g_tuner should not do any memset for the parameters. Core
already does that. In particular, V4L2 core now does some handling
for the tuner type, and the tuner-core module relies on that.
Lutz Sammer [Fri, 7 Oct 2011 19:11:37 +0000 (16:11 -0300)]
[media] stb0899: Fix slow and not locking DVB-S transponder(s)
In stb0899_status stb0899_check_data the first read of STB0899_VSTATUS
could read old (from previous search) LOOP status bit and the search
fails on a good frequency.
With the patch more transponder could be locked and locks about 2*
faster.
[media] it913x-fe changes to power up and down of tuner
Currently the tuner is constantly powered causing these effects.
1. Remembering last tune channel causing corruptions of changing channel.
2. Causing corruption on other frontend.
3. Higher current in standby of demodulator with clock running.
Power sequence now follows;
Power Up
Tuner on -> Frontend suspend off -> Tuner clk on
Power Down
Frontend suspend on -> Tuner clk off -> Tuner off
[media] tvp5150: Add video format registers configuration values
The tvp5150 video decoder has two operation modes to configure the video
standard used.
If auto-switch mode is enable, the device can sense the signal and detect which
video standard the device is operating. Also the device can be forced to use a
user defined video standard.
Each operation mode uses a different register and the bitmask values to
represent each standard is different.
So we add video standard constants for both autoswitch and no-autoswitch mode.
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Paul Gortmaker [Fri, 30 Sep 2011 20:34:51 +0000 (17:34 -0300)]
[media] drivers/media: fix dependencies in video mt9t001/mt9p031
Both mt9t001.c and mt9p031.c have two identical issues, those
being that they will need module.h inclusion for the upcoming
cleanup going on there, and that their dependencies don't limit
selection of configs that will fail to compile as follows:
The related config options are CONFIG_MEDIA_CONTROLLER and
CONFIG_VIDEO_V4L2_SUBDEV_API. Looking at the code, it appears
that the driver was never intended to work without these enabled,
so add a dependency on CONFIG_VIDEO_V4L2_SUBDEV_API, which in
turn already has a dependency on CONFIG_MEDIA_CONTROLLER.
Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] msp3400: Add standards detection to the driver
As msp3400 allows standards detection, add support for it. That
efectivelly means that devices with msp3400 can now implement
VIDIOC_QUERYSTD, and it will provide very good detection for
the standard, specially if combined with a video decoder detection.
[media] saa7115: Trust that V4L2 core will fill the mask
Instead of using V4L2_STD_ALL when no standard is detected,
trust that the maximum allowed standards are already filled by
the V4L2 core. It is better this way, as the bridge and/or the audio
decoder may have some extra restrictions to some video standards.
This also allow other devices like audio and tuners to contribute to
standards detection, when they support such feature.
[media] v4l2-ioctl: Fill the default value for VIDIOC_QUERYSTD
According with the V4L2 API spec:
"When detection is not possible or fails, the set must contain
all standards supported by the current video input or output."
The V4L2 core has the mask with all supported standards already. So,
apply it. Driver and subdevs can then just remove standards from the
mask, as they're able of detecting audio, video and frames frequency.
There are several bugs at saa7115 standards detection:
After the fix, the driver is returning the proper standards,
as tested with 3 different broadcast sources:
On an invalid channel (without any TV signal):
[ 4394.931630] saa7115 15-0021: Status byte 2 (0x1f)=0xe0
[ 4394.931635] saa7115 15-0021: detected std mask = 00ffffff
With a PAL/M signal:
[ 4410.836855] saa7115 15-0021: Status byte 2 (0x1f)=0xb1
[ 4410.837727] saa7115 15-0021: Status byte 1 (0x1e)=0x82
[ 4410.837731] saa7115 15-0021: detected std mask = 00000900
With a NTSC/M signal:
[ 4422.383893] saa7115 15-0021: Status byte 2 (0x1f)=0xb1
[ 4422.384768] saa7115 15-0021: Status byte 1 (0x1e)=0x81
[ 4422.384772] saa7115 15-0021: detected std mask = 0000b000
Tests were done with a WinTV PVR USB2 Model 29xx card.
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonghun Han [Mon, 26 Sep 2011 04:14:04 +0000 (01:14 -0300)]
[media] media: DocBook: Fix trivial typo in Sub-device Interface
When satisfied with the try results, applications can set the active formats
by setting the which argument to V4L2_SUBDEV_FORMAT_ACTIVE
not V4L2_SUBDEV_FORMAT_TRY.
This patch fixes mbus configuration between Mixer, SDO and HDMI. The SDO
accepts only YUV444 on input. The HDMI in DVI mode accepts only RGB888. Now
Mixer is choosing proper output format depending on mbus format.
Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Current version of the driver does not support HDMI features
not present in DVI standard. Therefore DVI mode is used to
keep compatibility with DVI devices.
Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Chris Rankin [Sun, 25 Sep 2011 21:43:12 +0000 (18:43 -0300)]
[media] em28xx: replug locking cleanup
Simplifies the locking by moving the em28xx_init_extension() call until
em28xx_usb_probe() has finished with the dev->lock mutex. It therefore
makes the second and subsequent "plugging" events logically identical to
the first "plugging" event when the em28xx-dvb and em28xx-alsa modules
must be loaded (i.e. registered).
Basically, em28xx_usb_probe() requests that em28xx-dvb be loaded and
also triggers udev to initialise the V4L2 devices. These two events are
serialised by the dev->lock mutex but the order that they happen in is
undefined. But this has always been the case anyway.
Signed-off-by: Chris Rankin <rankincj@yahoo.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Chris Rankin [Sat, 24 Sep 2011 19:54:58 +0000 (16:54 -0300)]
[media] em28xx: fix deadlock when unplugging and replugging a DVB adapter
This fixes the deadlock that occurs with either multiple PCTV 290e adapters or when a single PCTV 290e adapter is replugged.
For DVB devices, the device lock must now *not* be held when adding/removing either a device or an extension to the respective lists. (Because em28xx_init_dvb() will want to take the lock instead).
Conversely, for Audio-Only devices, the device lock *must* be held when adding/removing either a device or an extension to the respective lists.
Signed-off-by: Chris Rankin <rankincj@yahoo.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Hans Petter Selasky <hselasky@c2i.net> Acked-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Marko Ristola [Sat, 7 Aug 2010 11:16:15 +0000 (08:16 -0300)]
[media] Refactor Mantis DMA transfer to deliver 16Kb TS data per interrupt
With VDR streaming HDTV into network, generating an interrupt once per 16kb,
implemented in this patch, seems to support more robust throughput with HDTV.
Fix leaking almost 64kb data from the previous TS after changing the TS.
One effect of the old version was, that the DMA transfer and driver's
DMA buffer access might happen at the same time - a race condition.
Signed-off-by: Marko M. Ristola <marko.ristola@kolumbus.fi> Reviewed-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Chris Rankin [Sat, 24 Sep 2011 14:02:32 +0000 (11:02 -0300)]
[media] em28xx: fix race on disconnect
This patch closes the race on the device and extension lists at USB disconnect
time. Previously, the device was removed from the device list during
em28xx_release_resources(), and then passed to the em28xx_close_extension()
function so that all extensions could run their fini() operations. However, this
left a (brief, theoretical, highly unlikely ;-)) window between these two calls
during which a new module could call em28xx_register_extension(). The result
would have been that the em28xx_usb_disconnect() function would also have passed
the device to the new extension's fini() function, despite never having called
the extension's init() function.
This patch also restores em28xx_close_extension()'s symmetry with
em28xx_init_extension(), and establishes the property that every device in the
device list must have been initialised for every extension in the extension list.
Signed-off-by: Chris Rankin <rankincj@yahoo.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Walls [Sun, 19 Dec 2010 22:10:28 +0000 (19:10 -0300)]
[media] cx23885, cx25840: Provide IR Rx timeout event reports
(Resending because Mauro reported losing some emails on IRC)
Provide CX2388[578] IR receive timeout (RTO) reports in the
final space raw event sent up the chain to the raw IR pulse
decoders. This should allow the lirc decoder to actually
measure the inter-transmission gap properly.
Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] v4l2: Add polarity flag definitions for the parallel bus FIELD signal
FIELD signal is used for indicating frame field type to the frame grabber
in interlaced scan mode, as specified in ITU-R BT.601 standard.
In normal operation mode FIELD = 0 selects Field1 (odd) and FIELD = 1
selects Field2 (even). When the FIELD signal is inverted it's the other
way around.
Add corresponding flags for configuring the FIELD signal polarity,
V4L2_MBUS_FIELD_EVEN_HIGH for the standard (non-inverted) case and
V4L2_MBUS_FIELD_EVEN_LOW for inverted case.
Also add a comment about usage of V4L2_MBUS_[HV]SYNC* flags for
the hardware that uses [HV]REF signals.
Pekka Enberg [Fri, 23 Sep 2011 13:19:07 +0000 (10:19 -0300)]
[media] media, rc: Use static inline functions to kill warnings
This patch converts some ifdef'd wrapper functions from macros to static inline
functions to kill the following warnings issued by GCC:
CC [M] drivers/media/rc/ir-raw.o
drivers/media/rc/ir-raw.c: In function ‘init_decoders’:
drivers/media/rc/ir-raw.c:353:2: warning: statement with no effect [-Wunused-value]
drivers/media/rc/ir-raw.c:354:2: warning: statement with no effect [-Wunused-value]
drivers/media/rc/ir-raw.c:355:2: warning: statement with no effect [-Wunused-value]
drivers/media/rc/ir-raw.c:356:2: warning: statement with no effect [-Wunused-value]
drivers/media/rc/ir-raw.c:357:2: warning: statement with no effect [-Wunused-value]
drivers/media/rc/ir-raw.c:359:2: warning: statement with no effect [-Wunused-value]
[media] gspca - main: Handle the xHCI error on usb_set_interface()
This patch is adapted from a patch from Sarah Sharp (2010/05/03).
The xHCD handler checks the USB bandwidth on usb_set_interface()
instead of on usb_submit_urb().
Now, the same treatment is applied in case of error of both functions.
[media] gspca - main: Use a better altsetting for image transfer
Previously image transfer used to use the highest altsetting, which, most of
the time, took the whole USB bandwidth.
Now, the altsetting is chosen according to an estimation of the bandwidth
needed for image transfer.
This is an improved version of the patch I sent a little ago.
The problem was:
On my DC-1125 webcam chip from Syntek, whenever the webcam turns
on, the LED light on it is turned on also and never turns off again unless
system is shut downed or restarted.
The previous version seemed to break some other laptop webcam work. Thanks
to Andrea Anacleto for the bug report and solution.
Signed-off-by: Andrea Anacleto <andreaanacleto@libero.it> Signed-off-by: Arvydas Sidorenko <asido4@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] v4l subdev: add dispatching for VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER
Ioctls on the subdevs node currently don't dispatch the register access debug
driver callbacks. Add the dispatching with the same security checks are for
non subdev video nodes (i.e. only capable(CAP_SYS_ADMIN may call the register
access ioctls).
Al Cooper [Thu, 18 Aug 2011 13:28:29 +0000 (10:28 -0300)]
[media] media: Fix a UVC performance problem on systems with non-coherent DMA
The UVC driver uses usb_alloc_coherent() to allocate DMA data buffers.
On systems without coherent DMA this ends up allocating buffers in
uncached memory. The subsequent memcpy's done to coalesce the DMA
chunks into contiguous buffers then run VERY slowly. On a MIPS test
system the memcpy is about 200 times slower. This issue prevents the
system from keeping up with 720p YUYV data at 10fps.
The following patch uses kmalloc to alloc the DMA buffers instead of
usb_alloc_coherent on systems without coherent DMA. With this patch
the system was easily able to keep up with 720p at 10fps.
Signed-off-by: Al Cooper <alcooperx@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The UVCIOC_CTRL_ADD, UVCIOC_CTRL_MAP_OLD, UVCIOC_CTRL_GET and
UVCIOC_CTRL_SET ioctls are deprecated and were scheduled for removal for
v2.6.42. As v2.6.42 == v3.2, remove them.
drivers/media/rc/keymaps/rc-snapstream-firefly.c:105:16: error: expected declaration specifiers or ‘...’ before string constant
drivers/media/rc/keymaps/rc-snapstream-firefly.c:106:15: error: expected declaration specifiers or ‘...’ before string constant
[media] altera-stapl: it is time to move out from staging
[mchehab@redhat.com: Fix a merge conflict] Signed-off-by: Igor M. Liplianin <liplianin@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Anssi Hannula [Sat, 6 Aug 2011 21:18:12 +0000 (18:18 -0300)]
[media] ati_remote: add support for SnapStream Firefly remote
The protocol differs by having two toggle bits in the scancode. Since
one of the bits is otherwise unused, we can safely handle the bits
unconditionally.
[mchehab@redhat.com: Fix some bad whitespacing] Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Anssi Hannula [Sat, 6 Aug 2011 21:18:10 +0000 (18:18 -0300)]
[media] ati_remote: fix check for a weird byte
The ati_remote_dump() function tries to not print "Weird byte" warning
for 1-byte responses that contain 0xff or 0x00, but it doesn't work
properly as it simply falls back to the "Weird data" warning in the else
clause.