Currently, for any multi-standard frontend it is assumed that it just
has a single standard capability. This is fine in some cases, but
makes things hard when there are incompatible standards in conjuction.
Eg: DVB-S can be seen as a subset of DVB-S2, but the same doesn't hold
the same for DSS. This is not specific to any driver as it is, but a
generic issue. This was handled correctly in the multiproto tree,
while such functionality is missing from the v5 API update.
Later on a FE_CAN_2G_MODULATION was added as a hack to workaround this
issue in the v5 API, but that hack is incapable of addressing the
issue, as it can be used to simply distinguish between DVB-S and
DVB-S2 alone, or another X vs X2 modulation. If there are more systems,
then you have a potential issue.
An application needs to query the device capabilities before requesting
any operation from the device.
Signed-off-by: Manu Abraham <abraham.manu@gmail.com> Acked-by: Andreas Oberritter <obi@linuxtv.org> Acked-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Thomas Meyer [Tue, 29 Nov 2011 20:08:00 +0000 (17:08 -0300)]
[media] pvrusb2: Use kcalloc instead of kzalloc to allocate array
The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.
The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107
Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Acked-By: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] tm6000: Fix a warning at tm6000_ir_int_start()
drivers/media/video/tm6000/tm6000-input.c: In function ‘tm6000_ir_int_start’:
drivers/media/video/tm6000/tm6000-input.c:381:3: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
Haogang Chen [Tue, 29 Nov 2011 21:32:25 +0000 (18:32 -0300)]
[media] uvcvideo: Fix integer overflow in uvc_ioctl_ctrl_map()
There is a potential integer overflow in uvc_ioctl_ctrl_map(). When a
large xmap->menu_count is passed from the userspace, the subsequent call
to kmalloc() will allocate a buffer smaller than expected.
map->menu_count and map->menu_info would later be used in a loop (e.g.
in uvc_query_v4l2_ctrl), which leads to out-of-bound access.
The patch checks the ioctl argument and returns -EINVAL for zero or too
large values in xmap->menu_count.
UVC devices transmit a device timestamp along with video frames. Convert
the timestamp to a host timestamp and use it to fill the V4L2 buffer
timestamp field.
[media] uvcvideo: Ignore GET_RES error for XU controls
GET_RES request support is mandatory for extension units, but some
cameras still choke on it (one example is the Logitech QuickCam PTZ that
returns a single byte for the PTZ relative control instead of four).
Instead of skipping the payload completely, which would make the
resulting image corrupted anyway, store the payload normally and mark
the buffer as erroneous. If the no_drop module parameter is set to 1 the
buffer will then be passed to userspace, and tt will then be up to the
application to decide what to do with the buffer.
Laurent Pinchart [Mon, 24 Oct 2011 14:49:19 +0000 (11:49 -0300)]
[media] uvcvideo: Move fields from uvc_buffer::buf to uvc_buffer
Add mem, length and bytesused fields to the uvc_buffer structure and use
them instead of accessing the uvc_buffer::buf m.offset, length and
bytesused fields directly. This prepares the driver to the conversion to
videobuf2.
Thierry Reding [Tue, 6 Dec 2011 12:39:35 +0000 (09:39 -0300)]
[media] tm6000: Fix check for interrupt endpoint
Checking for &dev->int_in is useless because it returns the address of
the embedded struct tm6000_endpoint, which will always be positive and
therefore true.
Thierry Reding [Tue, 6 Dec 2011 12:05:03 +0000 (09:05 -0300)]
[media] tm6000: Fix fast USB access quirk
The original patch used the fast USB quirk to enable fast access to
registers in the tm6000_read_write_usb(). The applied patch moved the
check to the tm6000_reset(), probably due to some merge conflicts.
[media] Remove unneeded comments from the media API DocBook files
This removes comment tags intended for emacs configuration from
67 files in the Media API DocBook. Such comments are not really
helpful and violate the coding style rules.
Dan Carpenter [Mon, 28 Nov 2011 12:08:53 +0000 (09:08 -0300)]
[media] saa7164: fix endian conversion in saa7164_bus_set()
The msg->command field is 32 bits, and we should fill it with a call
to cpu_to_le32(). The current code is broke on big endian systems.
On little endian systems it truncates the 32 bit value to 16 bits
which probably still works fine.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] drxk: Switch the delivery system on FE_SET_PROPERTY
The DRX-K doesn't change the delivery system at set_properties,
but do it at frontend init. This causes problems on programs like
w_scan that, by default, opens both frontends.
Instead, explicitly set the format when set_parameters callback is
called.
Tested-by: Eddi De Pieri <eddi@depieri.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] xc5000: Add support for 7MHz bandwidth for DVB-C/DVB-T
While xc5000 supports 7MHz bandwidth, the driver were lacking the code
implementing this feature, causing tuning issues with VHF chanels
used in Countries like Italy.
After this patch:
>>> tune to: 177500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
0x0000 0x0d49: pmt_pid 0x0102 RAI -- Rai 1 (running)
0x0000 0x0d4a: pmt_pid 0x0101 RAI -- Rai 2 (running)
0x0000 0x0d4b: pmt_pid 0x0100 RAI -- Rai 3 TGR Veneto (running)
0x0000 0x0d53: pmt_pid 0x0118 RAI -- Rai News (running)
0x0000 0x0d54: pmt_pid 0x0119 Rai -- Rai 3 TGR Emilia Romagna (running)
0x0000 0x0d4c: pmt_pid 0x0103 Rai -- Rai Radio1 (running)
0x0000 0x0d4d: pmt_pid 0x0104 Rai -- Rai Radio2 (running)
0x0000 0x0d4e: pmt_pid 0x0105 Rai -- Rai Radio3 (running)
Network Name 'Rai'
Tested-by: Eddi De Pieri <eddi@depieri.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] xc5000: Remove the global mutex lock at xc5000 firmware init
As reported by Devin Heitmueller <dheitmueller@kernellabs.com>:
> It seems like a change such as this could significantly change the
> timing of tuner initialization if you have multiple xc5000 based
> products that might have a slow i2c bus. Was that intentional?
After discussed with Eddi de Pierri <eddi@depieri.net>, it was pointed that
the change was not intentional, and it was just a trial while developing
the patches that add support for HVR-930C.
The IR support were broken on my tests with HVR-900H. Also,
there were several issues on the current implementation.
This patch is a major rewrite of the IR support for this
- Improve debug messages;
- Don't do polling for interrrupt based IR;
- Add proper support for RC-5 protocol;
- Always provide 16 bits for NEC and RC-5;
- Fix polling code;
- Split polling functions from URB Interrupt ones;
- Don't hardcode the XTAL reference for tm6000 IR;
- If a URB submit fails, retries after 100ms;
- etc.
Tested on Hauppauge HVR-900H, with RC-5 and NEC remotes.
Issues on IR handling, on this device:
- Repeat events aren't detected (neither on NEC or RC-5);
- NEC codes are always provided with 16 bits.
drivers/media/video/tm6000/tm6000-video.c: In function ‘tm6000_release’:
drivers/media/video/tm6000/tm6000-video.c:1608:7: warning: unused variable ‘err’ [-Wunused-variable]
[media] tm6000: Fix tm6010 audio standard selection
A V4L2 standards mask may contain several standards. A more restricted
mask with just one standard is used when user needs to bind to an specific
standard that can't be auto-detect among a more generic mask.
So, Improve the autodetection logic to detect the correct audio standard
most of the time.
Based on a patch made by Dmitri Belimov <d.belimov@gmail.com>.
Hans Verkuil [Wed, 9 Nov 2011 13:53:01 +0000 (10:53 -0300)]
[media] V4L2 spec: fix the description of V4L2_FBUF_CAP_SRC_CHROMAKEY
V4L2_FBUF_CAP_SRC_CHROMAKEY is the opposite of V4L2_FBUF_CAP_CHROMAKEY, but
according to the documentation it was the same. The terms 'video' and
'framebuffer' were accidentally swapped in the text.
Hans Verkuil [Mon, 7 Nov 2011 15:44:28 +0000 (12:44 -0300)]
[media] v4l2 framework doc: clarify locking
high-latency devices.
Thanks to Hans de Goede for our discussions on this topic.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Thanks-to: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Wed, 12 Oct 2011 09:58:44 +0000 (06:58 -0300)]
[media] V4L spec: fix typo and missing CAP_RDS documentation
For some reason the V4L2_TUNER_CAP_RDS_CONTROLS/BLOCK_IO capabilities were never
documented in the proper table. In addition, then RDS interface section incorrectly
referred to them as V4L2_TUNER_SUB_RDS_... instead of CAP_RDS_...
This is now fixed.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] DiB8000: improve the tuning and the SNR monitoring
This patches improves the tuning of the dib8000 and correct the monitoringr
of the SNR.The patch allows to faster detect that there is no ISDB-T channel
on the wanted frequency.
Gianluca Gennari [Thu, 17 Nov 2011 15:35:05 +0000 (12:35 -0300)]
[media] staging: as102: Add support for Sky Italia Digital Key based on the same chip
Add support for the Sky Italia Digital Key, an USB dongle offered
by Sky Italia to its customers for use with their satellite set-top-boxes.
This is the "green led" model based on the Abilis as102 chip, while the
so called "blue led" model is based on the Avermedia A867 design.
Tomas Winkler [Wed, 9 Nov 2011 11:26:32 +0000 (08:26 -0300)]
[media] easycap: cleanup function usage
1. Remove declarations of none global functions from easycap.h
and make them static in the c-files.
2. Reorder static functions to reduce number of forward declarations.
3. Remove unused functions.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>