Commit graph

1444 commits

Author SHA1 Message Date
Mauro Carvalho Chehab 676ee36be0 Merge branch 'patchwork' into v4l_for_linus
* patchwork: (404 commits)
  [media] uvcvideo: add support for VIDIOC_QUERY_EXT_CTRL
  [media] uvcvideo: fix cropcap v4l2-compliance failure
  [media] media: omap3isp: remove unused clkdev
  [media] coda: Add tracing support
  [media] coda: drop dma_sync_single_for_device in coda_bitstream_queue
  [media] coda: fix fill bitstream errors in nonstreaming case
  [media] coda: call SEQ_END when the first queue is stopped
  [media] coda: fail to start streaming if userspace set invalid formats
  [media] coda: remove duplicate error messages for buffer allocations
  [media] coda: move parameter buffer in together with context buffer allocation
  [media] coda: allocate bitstream buffer from REQBUFS, size depends on the format
  [media] coda: allocate per-context buffers from REQBUFS
  [media] coda: use strlcpy instead of snprintf
  [media] coda: bitstream payload is unsigned
  [media] coda: fix double call to debugfs_remove
  [media] coda: check kasprintf return value in coda_open
  [media] coda: bitrate can only be set in kbps steps
  [media] v4l2-mem2mem: no need to initialize b in v4l2_m2m_next_buf and v4l2_m2m_buf_remove
  [media] s5p-mfc: set allow_zero_bytesused flag for vb2_queue_init
  [media] coda: set allow_zero_bytesused flag for vb2_queue_init
  ...
2015-04-21 06:12:35 -03:00
Hans Verkuil e183201b9e [media] uvcvideo: add support for VIDIOC_QUERY_EXT_CTRL
Add support for the new VIDIOC_QUERY_EXT_CTRL ioctl. Since uvc doesn't use
the control framework, support for this ioctl isn't automatic.

This is makes v4l2-compliance happy as well.

[Added blank lines for improved readability]

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-10 10:29:27 -03:00
Hans Verkuil 1461fe7ab6 [media] uvcvideo: fix cropcap v4l2-compliance failure
The v4l2-compliance tool expects that if VIDIOC_CROPCAP is defined, then
VIDIOC_G_SELECTION for TGT_CROP_BOUNDS/DEFAULT is also defined (or COMPOSE
in the case of an output device).

In fact, all that a driver has to do to implement cropcap is to support
those two targets since the v4l2 core will implement cropcap and fill in
the pixelaspect to 1/1 by default.

Implementing cropcap is only needed if the pixelaspect isn't square.

So implement g_selection instead of cropcap in uvc to fix the v4l2-compliance
failure.

[Added blank lines for improved readability]

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-10 10:26:02 -03:00
Christian Dale 09f50121e3 [media] WinFast DTV2000 DS Plus
Add Leadtek WinFast DTV2000DS Plus device based on Realtek RTL2832U.

I have not tested the remote, but it is the Y04G0051 model.

Signed-off-by: Christian Dale <kernel@techmunk.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 15:41:58 -03:00
Dimitris Lampridis 882302c859 [media] rtl28xxu: add support for Turbo-X DTT2000
ID 1b80:d3a4 Afatech

Simply added the PID (0xd3a4) of this DVB-T USB device to the list of rtl2832u-supported devices. VID (0x1b80) is same as KWORLD2.

Tested and verified to work in amd64 with kernels 3.13.0 and 3.16.0.

Signed-off-by: Dimitris Lampridis <dlampridis@logikonlabs.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 13:14:38 -03:00
David Howells 974e08d8f0 [media] cxusb: Use enum to represent table offsets rather than hard-coding numbers
Use enum to represent table offsets rather than hard-coding numbers to avoid
problems with the numbers becoming out of sync with the table.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 12:36:37 -03:00
Luis de Bethencourt 67a260f1eb [media] dib0700: remove unused macros
Remove unused macros RC_REPEAT_DELAY and RC_REPEAT_DELAY_V1_20

Signed-off-by: Luis de Bethencourt <luis.bg@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 08:33:13 -03:00
Luis de Bethencourt e68c2fe64c [media] dvb-usb: fix spaces after commas
Fixing a few checkpatch errors of type: space required after that ','

Signed-off-by: Luis de Bethencourt <luis.bg@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 07:39:24 -03:00
Benjamin Larsson 021cd2d21b [media] mn88472: add ts mode and ts clock to driver
Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 06:54:41 -03:00
Hans Verkuil d8da7513bc [media] uvc: embed video_device
Embed the video_device struct to simplify the error handling and in
order to (eventually) get rid of video_device_alloc/release.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 06:47:13 -03:00
Hans Verkuil d4352f3639 [media] em28xx: embed video_device
Embed the video_device struct to simplify the error handling and in
order to (eventually) get rid of video_device_alloc/release.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08 06:46:31 -03:00
Alexey Khoroshilov afd270d1a4 [media] usbvision: fix leak of usb_dev on failure paths in usbvision_probe()
There is no usb_put_dev() on failure paths in usbvision_probe().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 23:55:20 -03:00
Hans Verkuil 60acf18768 [media] cx231xx: embed video_device
Embed the video_device struct to simplify the error handling and in
order to (eventually) get rid of video_device_alloc/release.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 23:53:34 -03:00
Hans Verkuil 2aa689dd80 [media] usbvision: embed video_device
Embed the video_device struct to simplify the error handling and in
order to (eventually) get rid of video_device_alloc/release.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 23:52:21 -03:00
Hans Verkuil 65b88c0be1 [media] tm6000: embed video_device
Embed the video_device struct to simplify the error handling and in
order to (eventually) get rid of video_device_alloc/release.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 23:49:49 -03:00
Hans Verkuil 4b30409b1b [media] hdpvr: embed video_device
Embed the video_device struct to simplify the error handling and in
order to (eventually) get rid of video_device_alloc/release.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 23:36:54 -03:00
Antti Palosaari 0fecb6c094 [media] dw2102: switch ts2022 to ts2020 driver
Change ts2022 driver to ts2020 driver. ts2020 driver supports
both tuner chip models.

That affects TechnoTrend TT-connect S2-4600 DVB-S/S2 device, which
Olli just added.

Cc: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:26:16 -03:00
Antti Palosaari f31a638600 [media] dvbsky: switch ts2022 to ts2020 driver
Change ts2022 driver to ts2020 driver. ts2020 driver supports
both tuner chip models.

Cc: Nibble Max <nibble.max@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:25:52 -03:00
Antti Palosaari 83c1b6ce75 [media] em28xx: switch PCTV 461e to ts2020 driver
Change ts2022 driver to ts2020 driver as ts2020 driver now supports
both models.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:24:25 -03:00
Olli Salonen 27254c3634 [media] dw2102: TechnoTrend TT-connect S2-4600 DVB-S/S2 tuner
TechnoTrend TT-connect S2-4600 is a USB2.0 DVB-S/S2 tuner using the popular
Montage M88DS3103/M88TS2022 demod/tuner.

The demodulator needs a firmware. Antti posted a firmware when releasing
support for PCTV 461e, available here:
http://palosaari.fi/linux/v4l-dvb/firmware/M88DS3103/

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:24:02 -03:00
Olli Salonen 70769b24d2 [media] dw2102: store i2c client for tuner into dw2102_state
Prepare the dw2102 driver for tuner drivers that are implemented as I2C
drivers (such as m88ts2022). The I2C client is stored in to the state
and released at disconnect.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:24:01 -03:00
Olli Salonen 2c4ffe27d0 [media] dw2102: combine su3000_state and s6x0_state into dw2102_state
Two separate state structs are defined for different devices inside the
dw2102. Combine them, as both only contain one element.

This will also make it easier to further cleanup the driver.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 22:24:01 -03:00
Benjamin Larsson 46cf707482 [media] rtl28xxu: lower the rc poll time to mitigate i2c transfer errors
The Astrometa device has issues with i2c transfers. Lowering the
poll time somehow makes these errors disappear.

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 21:51:37 -03:00
Guennadi Liakhovetski a37462b919 [media] V4L: remove clock name from v4l2_clk API
All uses of the v4l2_clk API so far only register one clock with a fixed
name. This allows us to get rid of it, which also will make CCF and DT
integration easier.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:32:53 -03:00
Hans Verkuil 8a55ddd94c [media] au0828: fix broken streaming
Commit c5036d61e0 ("media: au0828: drop
vbi_buffer_filled() and re-use buffer_filled()") broke video and vbi streaming.

The vb2_buffer struct was copied instead of taking a pointer to it, but
vb2_buffer_done() needs the real object, not a copy, since it is hooking
the buffer into a different list.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:28:59 -03:00
Antti Palosaari b18042a673 [media] rtl28xxu: return success for unimplemented FE callback
Return success for FE callback on case we don't have any special
implementation. fc0013 tuner driver calls that callback in order to
switch antenna input, even we don't provide antenna switch.
Returning error caused fc0013 driver given up tuning.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:27:14 -03:00
Hans Verkuil 27eb5e24e0 [media] cx231xx: fix compiler warnings
If CONFIG_VIDEO_CX231XX_RC is undefined, then these compiler warnings
are generated:

In file included from drivers/media/usb/cx231xx/cx231xx-cards.c:23:0:
drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_release_resources’:
drivers/media/usb/cx231xx/cx231xx.h:982:30: warning: statement with no effect [-Wunused-value]
 #define cx231xx_ir_exit(dev) (0)
                              ^
drivers/media/usb/cx231xx/cx231xx-cards.c:1158:2: note: in expansion of macro ‘cx231xx_ir_exit’
  cx231xx_ir_exit(dev);
  ^
drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_init_dev’:
drivers/media/usb/cx231xx/cx231xx.h:981:30: warning: statement with no effect [-Wunused-value]
 #define cx231xx_ir_init(dev) (0)
                              ^
drivers/media/usb/cx231xx/cx231xx-cards.c:1351:2: note: in expansion of macro ‘cx231xx_ir_init’
  cx231xx_ir_init(dev);
  ^
drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_usb_probe’:
drivers/media/usb/cx231xx/cx231xx.h:982:30: warning: statement with no effect [-Wunused-value]
 #define cx231xx_ir_exit(dev) (0)
                              ^
drivers/media/usb/cx231xx/cx231xx-cards.c:1705:2: note: in expansion of macro ‘cx231xx_ir_exit’
  cx231xx_ir_exit(dev);
  ^
drivers/media/usb/cx231xx/cx231xx-cards.c: In function ‘cx231xx_usb_disconnect’:
drivers/media/usb/cx231xx/cx231xx.h:982:30: warning: statement with no effect [-Wunused-value]
 #define cx231xx_ir_exit(dev) (0)
                              ^
drivers/media/usb/cx231xx/cx231xx-cards.c:1754:3: note: in expansion of macro ‘cx231xx_ir_exit’
   cx231xx_ir_exit(dev);
   ^

Fix by using static inlines instead of defines.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:24:04 -03:00
Ezequiel Garcia aeff092767 [media] stk1160: Make sure current buffer is released
The available (i.e. not used) buffers are returned by stk1160_clear_queue(),
on the stop_streaming() path. However, this is insufficient and the current
buffer must be released as well. Fix it.

Cc: stable@vger.kernel.org
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:18:37 -03:00
Laurent Pinchart 1cdf60c97a [media] uvcvideo: Validate index during step-wise frame intervals enumeration
Frame intervals exposed as an interval and step (so-called step-wise)
are restricted by the V4L2 API to a single enumeration entry. Return an
error when the index is not zero.

Reported-by: Alexey Smirnoff <fling@member.fsf.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[mchehab@osg.samsung.com: add a missing collon at the end of the return
 statement, in order to avoid compilation breakage]
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 17:31:48 -03:00
Laurent Pinchart fe6524719d [media] uvcvideo: Recognize the Tasco USB microscope
The device is based on an Aveo chipset, implements UVC but advertises a
vendor-specific class on all interfaces.

Support it by listing the USB VID:PID explicitly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 17:30:05 -03:00
Laurent Pinchart 9e68c53910 [media] uvcvideo: Don't call vb2 mmap and get_unmapped_area with queue lock held
videobuf2 has long been subject to AB-BA style deadlocks due to the
queue lock and mmap_sem being taken in different orders for the mmap and
get_unmapped_area operations. The problem has been fixed by making those
two operations callable without taking the queue lock, using an
mmap_lock internal to videobuf2.

The uvcvideo driver still calls the mmap and get_unmapped_area
operations with the queue lock held, resulting in a potential deadlock.
As the operations can now be called without locking the queue, fix it.

Reported-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 17:29:28 -03:00
Gilles Risch 1fe0fbd69a [media] Basic support for the Elgato EyeTV Hybrid INT 2008 USB Stick
This patch will add basic support for the Elgato EyeTV Hybrid INT
2008 USB Stick.

Signed-off-by: Gilles Risch <gilles.risch@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 11:20:50 -03:00
Wei Yongjun 03983e5db1 [media] v4l2: remove unused including <linux/version.h>
Remove including <linux/version.h> that don't need it.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 11:20:12 -03:00
Shuah Khan 41071bb8c7 [media] media: au0828 - embed vdev and vbi_dev structs in au0828_dev
Embed video_device structs vdev and vbi_dev in au0828_dev.
With this change, dynamic allocation and error path logic
in au0828_analog_register() is removed as it doesn't need
to allocate and handle allocation errors. Unregister path
doesn't need to free the now static video_device structures,
hence, changed video_device.release in au0828_video_template
to point to video_device_release_empty.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 11:19:52 -03:00
Lad, Prabhakar c5036d61e0 [media] media: au0828: drop vbi_buffer_filled() and re-use buffer_filled()
The vbi_buffer_filled() and buffer_filled() did the same functionality
except for incrementing the buffer sequence, this patch drops the
vbi_buffer_filled() and re-uses buffer_filled() for vbi buffers
as well by adding the check for vb2-queue type while incrementing
the sequence numbers. Along side this patch aligns the input parameters
of buffer_filled() function appropriately.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 11:17:56 -03:00
Olli Salonen 809abdbf46 [media] cx231xx: Hauppauge HVR-955Q ATSC/QAM tuner
Hauppauge HVR-955Q is a ATSC/QAM USB tuner with LGDT3306A demodulator and SiLabs Si2157-A30 tuner.

Only digital TV has been tested (both ATSC and QAM256).

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 10:36:12 -03:00
Randy Dunlap d5c00762ec [media] media: fix gspca drivers build dependencies
Several (15) drivers in media/usb/gspca use IF_ENABLED(CONFIG_INPUT)
to decide if they should call input* interfaces, but those drivers
do not build successfully when CONFIG_INPUT=m and the gspca drivers
are builtin (=y).  Making USB_GSPCA depend on INPUT || INPUT=n
fixes the build dependencies and allows all of them to build
cleanly.

Fixes these build errors (selections, not all are listed):

drivers/built-in.o: In function `gspca_disconnect':
(.text+0x32ed0f): undefined reference to `input_unregister_device'
drivers/built-in.o: In function `sd_isoc_irq':
konica.c:(.text+0x333098): undefined reference to `input_event'
konica.c:(.text+0x3330ab): undefined reference to `input_event'
drivers/built-in.o: In function `sd_stopN':
konica.c:(.text+0x3338d3): undefined reference to `input_event'
konica.c:(.text+0x3338e5): undefined reference to `input_event'
drivers/built-in.o: In function `ov51x_handle_button':
ov519.c:(.text+0x335ddb): undefined reference to `input_event'
drivers/built-in.o:ov519.c:(.text+0x335ded): more undefined references to `input_event' follow
pac7302.c:(.text+0x336ea1): undefined reference to `input_event'
pac7302.c:(.text+0x336eb3): undefined reference to `input_event'
drivers/built-in.o: In function `sd_pkt_scan':
spca561.c:(.text+0x338fd8): undefined reference to `input_event'
drivers/built-in.o:spca561.c:(.text+0x338feb): more undefined references to `input_event' follow
t613.c:(.text+0x33a6fd): undefined reference to `input_event'
drivers/built-in.o:t613.c:(.text+0x33a70f): more undefined references to `input_event' follow

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc:	Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-03 10:16:31 -03:00
Hans Verkuil cee05cb359 [media] pvrusb2: use struct v4l2_fh
By using struct v4l2_fh both the prio handling and the linked list
implementation in pvrusb2 can be removed since both are now done in
the v4l2 core if you use struct v4l2_fh.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-02 17:08:48 -03:00
Hans Verkuil ab91c61129 [media] pvrusb2: replace .ioctl by .unlocked_ioctl
As far as I can tell pvrusb2 does its own locking, so there is
no need to use .ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-02 17:03:42 -03:00
Markus Elfring 8aa9eb9059 [media] au0828: Delete unnecessary checks before the function call "video_unregister_device"
The video_unregister_device() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-02 14:53:46 -03:00
Markus Elfring 704b3f4c11 [media] stk-webcam: Delete an unnecessary check before the function call "vfree"
The vfree() function performs also input parameter validation.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-02 14:53:27 -03:00
Mauro Carvalho Chehab 559addc25b [media] fixp-arith: replace sin/cos table by a better precision one
The cos table used at fixp-arith.h has only 8 bits of precision.
That causes problems if it is reused on other drivers.

As some media drivers require a higher precision sin/cos
implementation, replace the current implementation by one that
will provide 32 bits precision.

The values generated by the new implementation matches the
32 bit precision of glibc's sin for an angle measured in
integer degrees.

It also provides support for fractional angles via linear
interpolation. On experimental calculus, when used a table
with a 0.001 degree angle, the maximum error for sin is
0.000038, which is likely good enough for practical purposes.

There are some logic there that seems to be specific to the
usage inside ff-memless.c. Move those logic to there, as they're
not needed elsewhere.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-02 14:50:06 -03:00
Nicholas Mc Guire 9713883b0f [media] cx231xx: drop condition with no effect
The if and the else code are identical - so the condition has no effect
on the effective code.
This patch removes the condition and the duplicated code.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-02 14:39:32 -03:00
Mauro Carvalho Chehab f704eab5b6 [media] siano: avoid a linkedit error if !MC
If the media controller (MC) is not enabled, it will compile
fine, but will fail at the linkedition:

 ERROR: "media_device_unregister" [drivers/media/usb/siano/smsusb.ko] undefined!

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-02 14:17:01 -03:00
Mauro Carvalho Chehab 89a2c1d60a [media] use a function for DVB media controller register
This is really a simple function, but using it avoids to have
if's inside the drivers.

Also, the kABI becomes a little more clearer.

This shouldn't generate any overhead, and the type check
will happen when compiling with MC DVB enabled.

So, let's do it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-02 11:29:39 -03:00
Mauro Carvalho Chehab 872b9dbedd [media] dvb: Avoid warnings when compiled without the media controller
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function ‘dvb_usbv2_adapter_dvb_exit’:
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:531:25: warning: unused variable ‘d’ [-Wunused-variable]
  struct dvb_usb_device *d = adap_to_d(adap);
                         ^
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:403:13: warning: ‘dvb_usbv2_media_device_register’ defined but not used [-Wunused-function]
 static void dvb_usbv2_media_device_register(struct dvb_usb_adapter *adap)

drivers/media/usb/dvb-usb/dvb-usb-dvb.c:97:13: warning: ‘dvb_usb_media_device_register’ defined but not used [-Wunused-function]
 static void dvb_usb_media_device_register(struct dvb_usb_adapter *adap)
             ^

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-02 11:25:45 -03:00
Mauro Carvalho Chehab 480884b647 [media] dvbdev: use adapter arg for dvb_create_media_graph()
Instead of using media_dev argument for dvb_create_media_graph(),
use the adapter.

That allows to create a stub for this function, if compiled
without DVB support, avoiding to add extra if's at the drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-03-02 11:25:38 -03:00
Mauro Carvalho Chehab a3dfc6d925 [media] dvb-usb: create one media_dev per adapter
Instead of assuming just one adapter, change the code to store
one media controller per adapter.

This works fine for dvb-usb, as, on all drivers here, it is not
possible to write a media graph that would mix resources between
the two different adapters.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-26 09:52:26 -03:00
Rafael Lourenço de Lima Chehab 496ccf92b9 [media] dvb-usb: add support for the media controller at USB driver
Create a struct media_device and add it to the dvb adapter.

Please notice that the tuner is not mapped yet by the dvb core.

[mchehab@osg.samsung.com: use config option MEDIA_CONTROLLER_DVB]
Signed-off-by: Rafael Lourenço de Lima Chehab <chehabrafael@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-26 09:52:26 -03:00
Mauro Carvalho Chehab 823b460ee7 [media] dvb-usb-v2: create one media_dev per adapter
Instead of assuming just one adapter, change the code to store
one media controller per adapter.

This works fine for dvb-usb, as, on all drivers here, it is not
possible to write a media graph that would mix resources between
the two different adapters.

Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-26 09:52:25 -03:00