GitHub/exynos8895/android_kernel_samsung_universal8895.git
10 years ago[media] mem2mem_testdev: add USERPTR support
Hans Verkuil [Mon, 10 Mar 2014 13:58:26 +0000 (10:58 -0300)]
[media] mem2mem_testdev: add USERPTR support

There is no reason why we shouldn't enable this here.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mem2mem_testdev: set priv to 0
Hans Verkuil [Mon, 10 Mar 2014 13:58:25 +0000 (10:58 -0300)]
[media] mem2mem_testdev: set priv to 0

v4l2_compliance fix.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mem2mem_testdev: pick default format with try_fmt
Hans Verkuil [Mon, 10 Mar 2014 13:58:24 +0000 (10:58 -0300)]
[media] mem2mem_testdev: pick default format with try_fmt

This resolves an issue raised by v4l2-compliance: if the given format does
not exist, then pick a default format.

While there is an exception regarding this for TV capture drivers, this
m2m driver should do the right thing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mem2mem_testdev: use 40ms default transfer time
Hans Verkuil [Mon, 10 Mar 2014 13:58:23 +0000 (10:58 -0300)]
[media] mem2mem_testdev: use 40ms default transfer time

The default of 1 second is a bit painful, switch to a 25 Hz framerate.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: remove meaningless memory bank assignment
Seung-Woo Kim [Thu, 6 Mar 2014 04:55:39 +0000 (01:55 -0300)]
[media] s5p-mfc: remove meaningless memory bank assignment

This patch removes meaningless assignment of memory bank to itself.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-mfc: Replaced commas with semicolons
Joonyoung Shim [Fri, 21 Feb 2014 02:22:12 +0000 (23:22 -0300)]
[media] s5p-mfc: Replaced commas with semicolons

There is no any reason to use comma here.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7180: Add support for power down
Lars-Peter Clausen [Mon, 10 Mar 2014 17:05:39 +0000 (14:05 -0300)]
[media] adv7180: Add support for power down

The adv7180 has a low power mode in which the analog and the digital processing
section are shut down. Implement the s_power callback to let bridge drivers put
the part into low power mode when not needed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7180: Add support for async device registration
Lars-Peter Clausen [Fri, 7 Mar 2014 16:14:32 +0000 (13:14 -0300)]
[media] adv7180: Add support for async device registration

Add support for async device registration to the adv7180 driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7180: Use threaded IRQ instead of IRQ + workqueue
Lars-Peter Clausen [Fri, 7 Mar 2014 16:14:31 +0000 (13:14 -0300)]
[media] adv7180: Use threaded IRQ instead of IRQ + workqueue

The proper way to handle IRQs that need to be able to sleep in their IRQ handler
is to use a threaded IRQ.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7180: Remove duplicated probe error message
Lars-Peter Clausen [Fri, 7 Mar 2014 16:14:30 +0000 (13:14 -0300)]
[media] adv7180: Remove duplicated probe error message

The device driver core already prints out a very similar message when a driver
fails to probe. No need to print one in the driver itself.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7180: Remove unnecessary v4l2_device_unregister_subdev() from probe error...
Lars-Peter Clausen [Fri, 7 Mar 2014 16:14:29 +0000 (13:14 -0300)]
[media] adv7180: Remove unnecessary v4l2_device_unregister_subdev() from probe error path

The device can't possibly be registered at this point, so no need to to call
v4l2_device_unregister_subdev().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7180: Free control handler on remove()
Lars-Peter Clausen [Fri, 7 Mar 2014 16:14:28 +0000 (13:14 -0300)]
[media] adv7180: Free control handler on remove()

Make sure to free the control handler when the device is removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7180: Fix remove order
Lars-Peter Clausen [Fri, 7 Mar 2014 16:14:27 +0000 (13:14 -0300)]
[media] adv7180: Fix remove order

The mutex is used in the subdev callbacks, so unregister the subdev before the
mutex is destroyed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] DocBook v4l2: update the G/S_EDID documentation
Hans Verkuil [Fri, 7 Mar 2014 14:17:33 +0000 (11:17 -0300)]
[media] DocBook v4l2: update the G/S_EDID documentation

Document that it is now possible to call G/S_EDID from video nodes, not
just sub-device nodes. Add a note that -EINVAL will be returned if
the pad does not support EDIDs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv*: replace the deprecated v4l2_subdev_edid by v4l2_edid
Hans Verkuil [Tue, 4 Mar 2014 11:05:19 +0000 (08:05 -0300)]
[media] adv*: replace the deprecated v4l2_subdev_edid by v4l2_edid

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2: add VIDIOC_G/S_EDID support to the v4l2 core
Hans Verkuil [Fri, 7 Mar 2014 10:18:37 +0000 (07:18 -0300)]
[media] v4l2: add VIDIOC_G/S_EDID support to the v4l2 core

Support this ioctl as part of the v4l2 core. Use the new ioctl
name and struct v4l2_edid type in the existing core code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2: allow v4l2_subdev_edid to be used with video nodes
Hans Verkuil [Tue, 4 Mar 2014 10:46:47 +0000 (07:46 -0300)]
[media] v4l2: allow v4l2_subdev_edid to be used with video nodes

Struct v4l2_subdev_edid and the VIDIOC_SUBDEV_G/S_EDID ioctls were
specific for subdevices, but for hardware with a simple video pipeline
you do not need/want to create subdevice nodes to just get/set the EDID.

Move the v4l2_subdev_edid struct to v4l2-common.h and rename as
v4l2_edid. Add the same ioctls to videodev2.h as well, thus allowing
this API to be used with both video nodes and v4l-subdev nodes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-compat-ioctl32: fix wrong VIDIOC_SUBDEV_G/S_EDID32 support
Hans Verkuil [Thu, 6 Mar 2014 10:24:21 +0000 (07:24 -0300)]
[media] v4l2-compat-ioctl32: fix wrong VIDIOC_SUBDEV_G/S_EDID32 support

The wrong ioctl numbers were used due to a copy-and-paste error.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org # for v3.7 and up
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] lm3646: add new dual LED Flash driver
Daniel Jeong [Mon, 3 Mar 2014 09:52:10 +0000 (06:52 -0300)]
[media] lm3646: add new dual LED Flash driver

This patch adds the driver for the LM3646, dual LED Flash driver.
The LM3646 has two 1.5A sync. boost converter with dual white current source.
It is controlled via an I2C compatible interface.
Each flash brightness, torch brightness and enable/disable can be controlled.
Under voltage, input voltage monitor and thermal threshhold Faults are added.
Please refer the datasheet http://www.ti.com/lit/ds/snvs962/snvs962.pdf

Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-controls.h: Add addtional Flash fault bits
Daniel Jeong [Mon, 3 Mar 2014 09:52:08 +0000 (06:52 -0300)]
[media] v4l2-controls.h: Add addtional Flash fault bits

Three Flash fault are added. V4L2_FLASH_FAULT_UNDER_VOLTAGE for the case low
voltage below the min. limit. V4L2_FLASH_FAULT_INPUT_VOLTAGE for the case
falling input voltage and chip adjust flash current not occur under voltage
event. V4L2_FLASH_FAULT_LED_OVER_TEMPERATURE for the case the temperature
exceed the maximun limit

Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] controls.xml: Document addtional Flash fault bits
Daniel Jeong [Mon, 3 Mar 2014 09:52:09 +0000 (06:52 -0300)]
[media] controls.xml: Document addtional Flash fault bits

Descriptions for flash faults V4L2_FLASH_FAULT_UNDER_VOLTAGE,
V4L2_FLASH_FAULT_INPUT_VOLTAGE, and V4L2_FLASH_FAULT_LED_OVER_TEMPERATURE.

Removed spaces before tabs.

Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] lm3560: prevent memory leak in case of pdata absence
Andy Shevchenko [Wed, 12 Feb 2014 09:02:07 +0000 (06:02 -0300)]
[media] lm3560: prevent memory leak in case of pdata absence

If we have no pdata defined and driver fails to register we leak memory.
Converting to devm_kzalloc prevents this to happen.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] lm3560: keep style for the comments
Andy Shevchenko [Wed, 12 Feb 2014 09:02:06 +0000 (06:02 -0300)]
[media] lm3560: keep style for the comments

Let's keep the style for all comments in the code, namely using small letters
whenever it's possible.

There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] lm3560: remove FSF address from the license
Andy Shevchenko [Wed, 12 Feb 2014 09:02:05 +0000 (06:02 -0300)]
[media] lm3560: remove FSF address from the license

There is no need to keep the FSF address inside each file. Moreover, it might
change in future which will make this one obsolete.

There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: of: Support empty port nodes
Laurent Pinchart [Mon, 10 Mar 2014 23:15:12 +0000 (20:15 -0300)]
[media] v4l: of: Support empty port nodes

Empty port nodes are allowed but currently unsupported as the
v4l2_of_get_next_endpoint() function assumes that all port nodes have at
least an endpoint. Fix this.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] MAINTAINERS: remove myself as a maintainer of VEU and VOU V4L2 drivers
Guennadi Liakhovetski [Sun, 24 Nov 2013 20:44:08 +0000 (17:44 -0300)]
[media] MAINTAINERS: remove myself as a maintainer of VEU and VOU V4L2 drivers

Since I'm currently unable to dedicate sufficient time to the maintainership
of these two drivers update their status to "orphan" until new maintainers
appear.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: soc_camera: rcar_vin: Add support for 10-bit YUV cameras
Phil Edworthy [Tue, 25 Feb 2014 09:10:27 +0000 (06:10 -0300)]
[media] media: soc_camera: rcar_vin: Add support for 10-bit YUV cameras

Add support for MBUS YUV10 BT656 and BT601 formats at rcar driver.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s2255drv: memory leak fix
sensoray-dev [Fri, 28 Feb 2014 22:19:44 +0000 (19:19 -0300)]
[media] s2255drv: memory leak fix

Fixes memory leak introduced by
commit 47d8c881c304642a68d398b87d9e8846e643c81a.

Signed-off-by: Dean Anderson <linux-dev@sensoray.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] tvp5150: Make debug module parameter visible in sysfs
Philipp Zabel [Thu, 27 Feb 2014 16:44:48 +0000 (13:44 -0300)]
[media] tvp5150: Make debug module parameter visible in sysfs

Set permissions on the debug module parameter to make it appear in sysfs.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] tvp5150: Fix type mismatch warning in clamp macro
Philipp Zabel [Thu, 27 Feb 2014 16:44:47 +0000 (13:44 -0300)]
[media] tvp5150: Fix type mismatch warning in clamp macro

This patch fixes the following warning:

drivers/media/i2c/tvp5150.c: In function '__tvp5150_try_crop':
include/linux/kernel.h:762:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&__val == &__min);  \
                 ^
drivers/media/i2c/tvp5150.c:886:16: note: in expansion of macro 'clamp'
  rect->width = clamp(rect->width,
                ^
include/linux/kernel.h:763:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&__val == &__max);  \
                 ^
drivers/media/i2c/tvp5150.c:886:16: note: in expansion of macro 'clamp'
  rect->width = clamp(rect->width,
                ^
include/linux/kernel.h:762:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&__val == &__min);  \
                 ^
drivers/media/i2c/tvp5150.c:904:17: note: in expansion of macro 'clamp'
  rect->height = clamp(rect->height,
                 ^
include/linux/kernel.h:763:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&__val == &__max);  \
                 ^
drivers/media/i2c/tvp5150.c:904:17: note: in expansion of macro 'clamp'
  rect->height = clamp(rect->height,
                 ^

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] em28xx-cards: remove a wrong indent level
Dan Carpenter [Wed, 5 Mar 2014 11:09:37 +0000 (08:09 -0300)]
[media] em28xx-cards: remove a wrong indent level

This code is correct but the indenting is wrong and triggers a static
checker warning "add curly braces?".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] staging/dt3155v4l: use PCI_VENDOR_ID_INTEL
Jon Mason [Mon, 3 Mar 2014 17:00:38 +0000 (14:00 -0300)]
[media] staging/dt3155v4l: use PCI_VENDOR_ID_INTEL

Use PCI_VENDOR_ID_INTEL instead of creating its own vendor ID #define.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media DocBook: fix NV16M description
Hans Verkuil [Sun, 2 Mar 2014 09:43:12 +0000 (06:43 -0300)]
[media] media DocBook: fix NV16M description

The NV16M description contained some copy-and-paste text from NV12M,
suggesting that this format is a 4:2:0 format when it really is a
4:2:2 format.

Fixed the text.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] arv: fix sleep_on race
Arnd Bergmann [Wed, 26 Feb 2014 11:01:48 +0000 (08:01 -0300)]
[media] arv: fix sleep_on race

interruptible_sleep_on is racy and going away. In the arv driver that
race has probably never caused problems since it would require a whole
video frame to be captured before the read function has a chance to
go to sleep, but using wait_event_interruptible lets us kill off the
old interface. In order to do this, we have to slightly adapt the
meaning of the ar->start_capture field to distinguish between not having
started a frame and having completed it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: VIDEO_SH_VOU should depend on HAS_DMA
Geert Uytterhoeven [Fri, 21 Feb 2014 19:57:17 +0000 (16:57 -0300)]
[media] v4l: VIDEO_SH_VOU should depend on HAS_DMA

If NO_DMA=y:

    warning: (VIDEO_DM6446_CCDC && VIDEO_DM355_CCDC && VIDEO_DM365_ISIF && VIDEO_OMAP2_VOUT && VIDEO_SH_VOU && VIDEO_VIU && VIDEO_TIMBERDALE && VIDEO_MX1 && VIDEO_OMAP1) selects VIDEOBUF_DMA_CONTIG which has unmet direct dependencies (MEDIA_SUPPORT && HAS_DMA)

    drivers/built-in.o: In function `videobuf_vm_close':
    videobuf-dma-contig.c:(.text+0x407aa0): undefined reference to `videobuf_queue_cancel'
    drivers/built-in.o: In function `__videobuf_dc_alloc':
    videobuf-dma-contig.c:(.text+0x407ba2): undefined reference to `dma_alloc_coherent'
    drivers/built-in.o: In function `__videobuf_mmap_mapper':
    videobuf-dma-contig.c:(.text+0x407d44): undefined reference to `dma_free_coherent'
    drivers/built-in.o: In function `free_buffer':
    sh_vou.c:(.text+0x41f73a): undefined reference to `videobuf_waiton'
    drivers/built-in.o: In function `sh_vou_poll':
    sh_vou.c:(.text+0x41f884): undefined reference to `videobuf_poll_stream'
    drivers/built-in.o: In function `sh_vou_buf_prepare':
    sh_vou.c:(.text+0x41fdf6): undefined reference to `videobuf_iolock'
    drivers/built-in.o: In function `sh_vou_reqbufs':
    sh_vou.c:(.text+0x4203b0): undefined reference to `videobuf_reqbufs'
    drivers/built-in.o: In function `sh_vou_querybuf':
    sh_vou.c:(.text+0x42040a): undefined reference to `videobuf_querybuf'
    drivers/built-in.o: In function `sh_vou_qbuf':
    sh_vou.c:(.text+0x42045e): undefined reference to `videobuf_qbuf'
    drivers/built-in.o: In function `sh_vou_dqbuf':
    sh_vou.c:(.text+0x4204c2): undefined reference to `videobuf_dqbuf'
    drivers/built-in.o: In function `sh_vou_streamon':
    sh_vou.c:(.text+0x420572): undefined reference to `videobuf_streamon'
    drivers/built-in.o: In function `sh_vou_streamoff':
    sh_vou.c:(.text+0x4205d2): undefined reference to `videobuf_streamoff'
    drivers/built-in.o: In function `sh_vou_mmap':
    sh_vou.c:(.text+0x420c46): undefined reference to `videobuf_mmap_mapper'

VIDEO_SH_VOU selects VIDEOBUF_DMA_CONTIG, which bypasses its dependency on
HAS_DMA.  Make VIDEO_SH_VOU depend on HAS_DMA to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-ctrls: replace BUG_ON by WARN_ON
Hans Verkuil [Fri, 21 Feb 2014 09:16:32 +0000 (06:16 -0300)]
[media] v4l2-ctrls: replace BUG_ON by WARN_ON

BUG_ON is unnecessarily strict.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drivers/media/usb/usbtv/usbtv-core.c:119:22: sparse: symbol 'usbtv_id_table...
Fengguang Wu [Tue, 4 Feb 2014 09:02:02 +0000 (06:02 -0300)]
[media] drivers/media/usb/usbtv/usbtv-core.c:119:22: sparse: symbol 'usbtv_id_table' was not declared. Should it be static?

tree:   git://linuxtv.org/media_tree.git master
head:   a3550ea665acd1922df8275379028c1634675629
commit: a3550ea665acd1922df8275379028c1634675629 [499/499] [media] usbtv: split core and video implementation
reproduce: make C=1 CF=-D__CHECK_ENDIAN__

sparse warnings: (new ones prefixed by >>)

>> drivers/media/usb/usbtv/usbtv-core.c:119:22: sparse: symbol 'usbtv_id_table' was not declared. Should it be static?
>> drivers/media/usb/usbtv/usbtv-core.c:129:19: sparse: symbol 'usbtv_usb_driver' was not declared. Should it be static?

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodrx-j: Fix post-BER calculus on QAM modulation
Mauro Carvalho Chehab [Tue, 11 Mar 2014 10:43:54 +0000 (07:43 -0300)]
drx-j: Fix post-BER calculus on QAM modulation

There are two troubles there:
1) the bit error measure were not accumulating;
2) it was missing the bit count.

Fix them.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agodrx-j: use ber_count var
Mauro Carvalho Chehab [Tue, 11 Mar 2014 10:34:44 +0000 (07:34 -0300)]
drx-j: use ber_count var

drivers/media/dvb-frontends/drx39xyj/drxj.c: In function 'ctrl_get_qam_sig_quality':
drivers/media/dvb-frontends/drx39xyj/drxj.c:9468:6: warning: variable 'ber_cnt' set but not used [-Wunused-but-set-variable]
  u32 ber_cnt = 0; /* BER count */
      ^

By reading the comment, it is said that BER should be calculated as:
qam_pre_rs_ber = frac_times1e6( ber_cnt, rs_bit_cnt );

Also, it makes sense to take the mantissa into account, so fix the
code to do what's commented.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: enable DVBv5 stats
Mauro Carvalho Chehab [Mon, 10 Mar 2014 11:22:34 +0000 (08:22 -0300)]
[media] drx-j: enable DVBv5 stats

Now that everything is set, let's enable DVBv5 stats, for
applications that support it.

DVBv3 apps will still work.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: Fix detection of no signal
Mauro Carvalho Chehab [Mon, 10 Mar 2014 11:18:31 +0000 (08:18 -0300)]
[media] drx-j: Fix detection of no signal

When the signal is 7, it means that no signal was received.

Value experimentally measured.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: properly handle bit counts on stats
Mauro Carvalho Chehab [Mon, 10 Mar 2014 11:08:53 +0000 (08:08 -0300)]
[media] drx-j: properly handle bit counts on stats

Instead of just assuming that the min resolution is 1E-6,
pass both bit error and bit counts for userspace to calculate
BER. The same applies for PER, for 8VSB. It is not clear how
to get the packet count for QAM. So, for now, don't expose PER
for QAM.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: Prepare to use DVBv5 stats
Mauro Carvalho Chehab [Sun, 9 Mar 2014 20:46:01 +0000 (17:46 -0300)]
[media] drx-j: Prepare to use DVBv5 stats

Convert the stats internally to use DVBv5. For now, it will keep
showing everything via DVBv3 API only, as the .len value were
not initialized.

That allows testing if the new stats code didn't break anything.

A latter patch will add the final bits for the DVBv5 stats to
fully work.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: re-add get_sig_strength()
Mauro Carvalho Chehab [Sun, 9 Mar 2014 20:37:27 +0000 (17:37 -0300)]
[media] drx-j: re-add get_sig_strength()

We'll need to use this function. Restore it from the
git history.

This function will be used on the next patch.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: Don't use "state" for DVB lock state
Mauro Carvalho Chehab [Sun, 9 Mar 2014 20:30:48 +0000 (17:30 -0300)]
[media] drx-j: Don't use "state" for DVB lock state

State is already used on other places for the state struct.
Don't use it here, to avoid troubles with latter patches.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: get rid of some unused vars
Mauro Carvalho Chehab [Sun, 9 Mar 2014 13:47:01 +0000 (10:47 -0300)]
[media] drx-j: get rid of some unused vars

As reported when compiled with W=1:

drivers/media/dvb-frontends/drx39xyj/drxj.c: In function â€˜ctrl_set_channel’:
drivers/media/dvb-frontends/drx39xyj/drxj.c:10340:26: warning: variable â€˜common_attr’ set but not used [-Wunused-but-set-variable]
  struct drx_common_attr *common_attr = NULL;
                          ^
drivers/media/dvb-frontends/drx39xyj/drxj.c:10336:6: warning: variable â€˜intermediate_freq’ set but not used [-Wunused-but-set-variable]
  s32 intermediate_freq = 0;

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: propagate returned error from request_firmware()
Mauro Carvalho Chehab [Sun, 9 Mar 2014 13:36:24 +0000 (10:36 -0300)]
[media] drx-j: propagate returned error from request_firmware()

Fix a smatch warning:
drivers/media/dvb-frontends/drx39xyj/drxj.c:11711 drx_ctrl_u_code() info: why not propagate 'rc' from request_firmware() instead of (-2)?

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: Fix usage of drxj_close()
Mauro Carvalho Chehab [Sun, 9 Mar 2014 13:33:54 +0000 (10:33 -0300)]
[media] drx-j: Fix usage of drxj_close()

This function is currently not used. However, it was meant to
be called at device release. So, add it there.

While here, remove the bad check, as reported by Dan, as
smatch warning:
drivers/media/dvb-frontends/drx39xyj/drxj.c:20041 drxj_close() warn: variable dereferenced before check 'demod' (see line 20036)

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: remove external symbols
Mauro Carvalho Chehab [Sun, 9 Mar 2014 13:33:19 +0000 (10:33 -0300)]
[media] drx-j: remove external symbols

This driver doesn't export any external symbol, except for
the attach() method.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: get rid of dead code
Mauro Carvalho Chehab [Sun, 9 Mar 2014 10:34:51 +0000 (07:34 -0300)]
[media] drx-j: get rid of dead code

There are large chunks of code at drx-j that aren't used. Most
of them are due to analog TV support. Well, just enabling them
won't make analog support work, as devices with DRX and analog
support requires an extra chip (avf4910).

We don't have drivers for it, nor the current device that uses
this frontend has support for analog TV.

So, let's just get rid of this code. If latter needed, this
patch can easily be reverted from git history.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: don't use mc_info before checking if its not NULL
Mauro Carvalho Chehab [Sun, 9 Mar 2014 13:10:19 +0000 (10:10 -0300)]
[media] drx-j: don't use mc_info before checking if its not NULL

smatch warning:
drivers/media/dvb-frontends/drx39xyj/drxj.c:20803 drx_ctrl_u_code() warn: variable dereferenced before check 'mc_info' (see line 20800)

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx39xxj.h: Fix undefined reference to attach function
Mauro Carvalho Chehab [Sun, 9 Mar 2014 12:46:39 +0000 (09:46 -0300)]
[media] drx39xxj.h: Fix undefined reference to attach function

As reported by the kbuild test robot <fengguang.wu@intel.com>:

drivers/built-in.o: In function `em28xx_dvb_init':
    em28xx-dvb.c:(.text+0x876f2c): undefined reference to `drx39xxj_attach'

That happens when CONFIG_VIDEO_EM28XX_DVB is selected, and neither
CONFIG_MEDIA_SUBDRV_AUTOSELECT or DVB_DRX39XYJ is selected.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: Fix dubious usage of "&" instead of "&&"
Mauro Carvalho Chehab [Sun, 9 Mar 2014 12:36:59 +0000 (09:36 -0300)]
[media] drx-j: Fix dubious usage of "&" instead of "&&"

Fixes the following warnings:
drivers/media/dvb-frontends/drx39xyj/drxj.c:16764:68: warning: dubious: x & !y
drivers/media/dvb-frontends/drx39xyj/drxj.c:16778:68: warning: dubious: x & !y
drivers/media/dvb-frontends/drx39xyj/drxj.c:16797:68: warning: dubious: x & !y

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: Don't use 0 as NULL
Mauro Carvalho Chehab [Sun, 9 Mar 2014 12:32:58 +0000 (09:32 -0300)]
[media] drx-j: Don't use 0 as NULL

Fixes the following warnings:
drivers/media/dvb-frontends/drx39xyj/drxj.c:1679:65: warning: Using plain integer as NULL pointer
drivers/media/dvb-frontends/drx39xyj/drxj.c:1679:71: warning: Using plain integer as NULL pointer
drivers/media/dvb-frontends/drx39xyj/drxj.c:1681:52: warning: Using plain integer as NULL pointer
drivers/media/dvb-frontends/drx39xyj/drxj.c:1681:58: warning: Using plain integer as NULL pointer

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-d: add missing braces in drxd_hard.c:DRXD_init
Dave Jones [Thu, 5 Sep 2013 02:51:48 +0000 (23:51 -0300)]
[media] drx-d: add missing braces in drxd_hard.c:DRXD_init

No functional changes, but removes a duplicate check, if
!state->type_A.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] drx-j: drxj_default_aud_data_g can be static
Fengguang Wu [Sun, 9 Mar 2014 12:08:30 +0000 (09:08 -0300)]
[media] drx-j: drxj_default_aud_data_g can be static

Fix sparse warning:
drivers/media/dvb-frontends/drx39xyj/drxj.c:1039:16: sparse: symbol 'drxj_default_aud_data_g' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] em28xx-dvb: remove one level of identation at fini callback
Mauro Carvalho Chehab [Fri, 7 Mar 2014 17:40:46 +0000 (14:40 -0300)]
[media] em28xx-dvb: remove one level of identation at fini callback

Simplify the logic a little by removing one level of identation.
Also, it only makes sense to print something if the .fini callback
is actually doing something.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] em28xx: Only deallocate struct em28xx after finishing all extensions
Mauro Carvalho Chehab [Wed, 5 Mar 2014 14:21:07 +0000 (11:21 -0300)]
[media] em28xx: Only deallocate struct em28xx after finishing all extensions

We can't free struct em28xx while one of the extensions is still
using it.

So, add a kref() to control it, freeing it only after the
extensions fini calls.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] em28xx: only enable PCTV 80e led when streaming
Mauro Carvalho Chehab [Tue, 4 Mar 2014 23:49:07 +0000 (20:49 -0300)]
[media] em28xx: only enable PCTV 80e led when streaming

Instead of keeping the led always on, use it to indicate
when DVB is streaming.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vivi: fix ENUM_FRAMEINTERVALS implementation
Hans Verkuil [Tue, 25 Feb 2014 10:15:54 +0000 (07:15 -0300)]
[media] vivi: fix ENUM_FRAMEINTERVALS implementation

This function never checked if width and height are correct. Add such
a check so the v4l2-compliance tool returns OK again for vivi.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vivi: correctly cleanup after a start_streaming failure
Hans Verkuil [Fri, 21 Feb 2014 08:34:49 +0000 (05:34 -0300)]
[media] vivi: correctly cleanup after a start_streaming failure

If start_streaming fails then any queued buffers must be given back
to the vb2 core.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: call buf_finish after the state check
Hans Verkuil [Fri, 28 Feb 2014 16:30:48 +0000 (13:30 -0300)]
[media] vb2: call buf_finish after the state check

Don't call buf_finish unless we know that the buffer is in a valid state.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: fix streamoff handling if streamon wasn't called
Hans Verkuil [Tue, 25 Feb 2014 12:42:45 +0000 (09:42 -0300)]
[media] vb2: fix streamoff handling if streamon wasn't called

If you request buffers, then queue buffers and then call STREAMOFF
those buffers are not returned to their dequeued state because streamoff
will just return if q->streaming was 0.

This means that afterwards you can never QBUF that same buffer again unless
you do STREAMON, REQBUFS or close the filehandle first.

It is clear that if you do STREAMOFF even if no STREAMON was called before,
you still want to have all buffers returned to their proper dequeued state.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: replace BUG by WARN_ON
Hans Verkuil [Mon, 3 Feb 2014 14:22:45 +0000 (11:22 -0300)]
[media] vb2: replace BUG by WARN_ON

No need to oops for this, WARN_ON is good enough.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: properly clean up PREPARED and QUEUED buffers
Hans Verkuil [Fri, 28 Feb 2014 15:49:18 +0000 (12:49 -0300)]
[media] vb2: properly clean up PREPARED and QUEUED buffers

If __reqbufs was called then existing buffers are freed. However, if that
happens without ever having started STREAMON, but if buffers have been queued,
then the buf_finish op is never called.

Add a call to __vb2_queue_cancel in __reqbufs so that these buffers are
cleaned up there as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: only call start_streaming if sufficient buffers are queued
Hans Verkuil [Mon, 24 Feb 2014 16:51:03 +0000 (13:51 -0300)]
[media] vb2: only call start_streaming if sufficient buffers are queued

In commit 02f142ecd24aaf891324ffba8527284c1731b561 support was added to
start_streaming to return -ENOBUFS if insufficient buffers were queued
for the DMA engine to start. The vb2 core would attempt calling
start_streaming again if another buffer would be queued up.

Later analysis uncovered problems with the queue management if start_streaming
would return an error: the buffers are enqueued to the driver before the
start_streaming op is called, so after an error they are never returned to
the vb2 core. The solution for this is to let the driver return them to
the vb2 core in case of an error while starting the DMA engine. However,
in the case of -ENOBUFS that would be weird: it is not a real error, it
just says that more buffers are needed. Requiring start_streaming to give
them back only to have them requeued again the next time the application
calls QBUF is inefficient.

This patch changes this mechanism: it adds a 'min_buffers_needed' field
to vb2_queue that drivers can set with the minimum number of buffers
required to start the DMA engine. The start_streaming op is only called
if enough buffers are queued. The -ENOBUFS handling has been dropped in
favor of this new method.

Drivers are expected to return buffers back to vb2 core with state QUEUED
if start_streaming would return an error. The vb2 core checks for this
and produces a warning if that didn't happen and it will forcefully
reclaim such buffers to ensure that the internal vb2 core state remains
consistent and all buffer-related resources have been correctly freed
and all op calls have been balanced.

__reqbufs() has been updated to check that at least min_buffers_needed
buffers could be allocated. If fewer buffers were allocated then __reqbufs
will free what was allocated and return -ENOMEM. Based on a suggestion from
Pawel Osciak.

__create_bufs() doesn't do that check, since the use of __create_bufs
assumes some advance scenario where the user might want more control.
Instead streamon will check if enough buffers were allocated to prevent
streaming with fewer than the minimum required number of buffers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: don't init the list if there are still buffers
Hans Verkuil [Mon, 24 Feb 2014 16:41:20 +0000 (13:41 -0300)]
[media] vb2: don't init the list if there are still buffers

__vb2_queue_free() would init the queued_list at all times, even if
q->num_buffers > 0. This should only happen if num_buffers == 0.

This situation can happen if a CREATE_BUFFERS call couldn't allocate
enough buffers and had to free those it did manage to allocate before
returning an error.

While we're at it: __vb2_queue_alloc() returns the number of buffers
allocated, not an error code. So stick the result in allocated_buffers
instead of ret as that's very confusing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: rename queued_count to owned_by_drv_count
Hans Verkuil [Thu, 6 Feb 2014 08:46:11 +0000 (05:46 -0300)]
[media] vb2: rename queued_count to owned_by_drv_count

'queued_count' is a bit vague since it is not clear to which queue it
refers to: the vb2 internal list of buffers or the driver-owned list
of buffers.

Rename to make it explicit.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: fix buf_init/buf_cleanup call sequences
Hans Verkuil [Wed, 29 Jan 2014 16:36:53 +0000 (13:36 -0300)]
[media] vb2: fix buf_init/buf_cleanup call sequences

Ensure that these ops are properly balanced.

There are two scenarios:

1) for MMAP buf_init is called when the buffers are created and buf_cleanup
   must be called when the queue is finally freed. This scenario was always
   working.

2) for USERPTR and DMABUF it is more complicated. When a buffer is queued
   the code checks if all planes of this buffer have been acquired before.
   If that's the case, then only buf_prepare has to be called. Otherwise
   buf_cleanup needs to be called if the buffer was acquired before, then,
   once all changed planes have been (re)acquired, buf_init has to be
   called followed by buf_prepare. Should buf_prepare fail, then buf_cleanup
   must be called on the newly acquired planes to release them in.

Finally, in __vb2_queue_free we have to check if the buffer was actually
acquired before calling buf_cleanup. While that it always true for MMAP
mode, it is not necessarily true for the other modes. E.g. if you just
call REQBUFS and close the file handle, then buffers were never queued and
so no buf_init was ever called.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: consistent usage of periods in videobuf2-core.h
Hans Verkuil [Fri, 28 Feb 2014 15:25:28 +0000 (12:25 -0300)]
[media] vb2: consistent usage of periods in videobuf2-core.h

Sometimes sentences in comments ended with a period, and sometimes they
didn't. Add periods. No other changes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: call buf_finish from __queue_cancel
Hans Verkuil [Tue, 4 Mar 2014 10:34:49 +0000 (07:34 -0300)]
[media] vb2: call buf_finish from __queue_cancel

If a queue was canceled, then the buf_finish op was never called for the
pending buffers. So add this call to queue_cancel. Before calling buf_finish
set the buffer state to PREPARED, which is the correct state. That way the
states DONE and ERROR will only be seen in buf_finish if streaming is in
progress.

Since buf_finish can now be called from non-streaming state we need to
adapt the handful of drivers that actually need to know this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] pwc: do not decompress the image unless the state is DONE
Hans Verkuil [Tue, 4 Mar 2014 10:28:11 +0000 (07:28 -0300)]
[media] pwc: do not decompress the image unless the state is DONE

There is no point in trying to decompress a captured frame unless
the buffer state is OK. It won't be used in any other state, and
in fact the contents of the buffer might well be corrupt.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: change result code of buf_finish to void
Hans Verkuil [Tue, 4 Mar 2014 10:27:13 +0000 (07:27 -0300)]
[media] vb2: change result code of buf_finish to void

The buf_finish op should always work, so change the return type to void.
Update the few drivers that use it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Reviewed-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: add debugging code to check for unbalanced ops
Hans Verkuil [Wed, 29 Jan 2014 14:53:25 +0000 (11:53 -0300)]
[media] vb2: add debugging code to check for unbalanced ops

When a vb2_queue is freed check if all the mem_ops and queue ops were balanced.
So the number of calls to e.g. buf_finish has to match the number of calls to
buf_prepare, etc.

This code is only enabled if CONFIG_VIDEO_ADV_DEBUG is set.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: fix PREPARE_BUF regression
Hans Verkuil [Mon, 10 Feb 2014 16:12:00 +0000 (13:12 -0300)]
[media] vb2: fix PREPARE_BUF regression

Fix an incorrect test in vb2_internal_qbuf() where only DEQUEUED buffers
are allowed. But PREPARED buffers are also OK.

Introduced by commit 4138111a27859dcc56a5592c804dd16bb12a23d1
("vb2: simplify qbuf/prepare_buf by removing callback").

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: fix read/write regression
Hans Verkuil [Fri, 14 Feb 2014 09:46:50 +0000 (06:46 -0300)]
[media] vb2: fix read/write regression

Commit 88e268702bfba78448abd20a31129458707383aa ("vb2: Improve file I/O
emulation to handle buffers in any order") broke read/write support if
the size of the buffer being read/written is less than the size of the
image.

When the commit was tested originally I used qv4l2, which calls read()
with exactly the size of the image. But if you try 'cat /dev/video0'
then it will fail and typically hang after reading two buffers.

This patch fixes the behavior by adding a new cur_index field that
contains the index of the field currently being filled/read, or it
is num_buffers in which case a new buffer needs to be dequeued.

The old index field has been renamed to initial_index in order to be
a bit more descriptive.

This has been tested with both read and write.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: Check if there are buffers before streamon
Ricardo Ribalda Delgado [Wed, 8 Jan 2014 08:01:33 +0000 (05:01 -0300)]
[media] vb2: Check if there are buffers before streamon

This patch adds a test preventing streamon() if there is no buffer
ready.

Without this patch, a user could call streamon() before
preparing any buffer. This leads to a situation where if he calls
close() before calling streamoff() the device is kept streaming.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoMerge tag 'v3.14-rc5' into patchwork
Mauro Carvalho Chehab [Tue, 11 Mar 2014 09:55:49 +0000 (06:55 -0300)]
Merge tag 'v3.14-rc5' into patchwork

Linux 3.14-rc5

* tag 'v3.14-rc5': (1117 commits)
  Linux 3.14-rc5
  drm/vmwgfx: avoid null pointer dereference at failure paths
  drm/vmwgfx: Make sure backing mobs are cleared when allocated. Update driver date.
  drm/vmwgfx: Remove some unused surface formats
  MAINTAINERS: add maintainer entry for Armada DRM driver
  arm64: Fix !CONFIG_SMP kernel build
  arm64: mm: Add double logical invert to pte accessors
  dm cache: fix truncation bug when mapping I/O to >2TB fast device
  perf tools: Fix strict alias issue for find_first_bit
  powerpc/powernv: Fix indirect XSCOM unmangling
  powerpc/powernv: Fix opal_xscom_{read,write} prototype
  powerpc/powernv: Refactor PHB diag-data dump
  powerpc/powernv: Dump PHB diag-data immediately
  powerpc: Increase stack redzone for 64-bit userspace to 512 bytes
  powerpc/ftrace: bugfix for test_24bit_addr
  powerpc/crashdump : Fix page frame number check in copy_oldmem_page
  powerpc/le: Ensure that the 'stop-self' RTAS token is handled correctly
  kvm, vmx: Really fix lazy FPU on nested guest
  perf tools: fix BFD detection on opensuse
  drm/radeon: enable speaker allocation setup on dce3.2
  ...

10 years ago[media] omap3isp: Fix kerneldoc for _module_sync_is_stopping and isp_isr()
Peter Meerwald [Fri, 28 Feb 2014 17:36:07 +0000 (14:36 -0300)]
[media] omap3isp: Fix kerneldoc for _module_sync_is_stopping and isp_isr()

Use the correct name in the comment describing function
omap3isp_module_sync_is_stopping().

isp_isr() never returned IRQ_NONE, remove the comment saying so.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] omap3isp: Rename the variable names in description
Lad, Prabhakar [Fri, 21 Feb 2014 12:07:23 +0000 (09:07 -0300)]
[media] omap3isp: Rename the variable names in description

This patch renames the variable in the description to match it
appropriately to function definition.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] omap3isp: ispccdc: Remove unwanted comments
Lad, Prabhakar [Fri, 21 Feb 2014 12:07:22 +0000 (09:07 -0300)]
[media] omap3isp: ispccdc: Remove unwanted comments

This patch removes the description of members which does not exists for
ispccdc_lsc structure.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] omap3isp: Fix typos
Lad, Prabhakar [Fri, 21 Feb 2014 12:07:21 +0000 (09:07 -0300)]
[media] omap3isp: Fix typos

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] uvcvideo: Add bayer 8-bit patterns to uvcvideo
Edgar Thier [Thu, 20 Feb 2014 07:12:51 +0000 (04:12 -0300)]
[media] uvcvideo: Add bayer 8-bit patterns to uvcvideo

Add bayer 8-bit GUIDs to uvcvideo and associated them with the
corresponding V4L2 pixel formats.

Signed-off-by: Edgar Thier <info@edgarthier.net>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] uvcvideo: Do not use usb_set_interface on bulk EP
Oleksij Rempel [Sun, 16 Feb 2014 09:59:32 +0000 (06:59 -0300)]
[media] uvcvideo: Do not use usb_set_interface on bulk EP

The UVC specification uses alternate setting selection to notify devices
of stream start/stop. This breaks when using bulk-based devices, as the
video streaming interface has a single alternate setting in that case,
making video stream start and video stream stop events to appear
identical to the device. Bulk-based devices are thus not well supported
by UVC.

The webcam built in the Asus Zenbook UX302LA ignores the set interface
request and will keep the video stream enabled when the driver tries to
stop it. If USB autosuspend is enabled the device will then be suspended
and will crash, requiring a cold reboot.

USB trace capture showed that Windows sends a CLEAR_FEATURE(HALT)
request to the bulk endpoint when stopping the stream instead of
selecting alternate setting 0. The camera then behaves correctly, and
thus seems to require that behaviour.

Replace selection of alternate setting 0 with clearing of the endpoint
halt feature at video stream stop for bulk-based devices. Let's refrain
from blaming Microsoft this time, as it's not clear whether this
Windows-specific but USB-compliant behaviour was specifically developed
to handle bulkd-based UVC devices, or if the camera just took advantage
of it.

CC: stable@vger.kernel.org
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Document timestamp buffer flag behaviour
Sakari Ailus [Fri, 7 Feb 2014 22:44:39 +0000 (19:44 -0300)]
[media] v4l: Document timestamp buffer flag behaviour

Timestamp buffer flags are constant at the moment. Document them so that 1)
they're always valid and 2) not changed by the drivers. This leaves room to
extend the functionality later on if needed.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Copy timestamp source flags to destination on m2m devices
Sakari Ailus [Sat, 8 Feb 2014 17:21:35 +0000 (14:21 -0300)]
[media] v4l: Copy timestamp source flags to destination on m2m devices

Copy the flags containing the timestamp source from source buffer flags to
the destination buffer flags on memory-to-memory devices. This is analogous
to copying the timestamp field from source to destination.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] exynos-gsc, m2m-deinterlace, mx2_emmaprp: Copy v4l2_buffer data from src...
Sakari Ailus [Sat, 8 Feb 2014 16:37:59 +0000 (13:37 -0300)]
[media] exynos-gsc, m2m-deinterlace, mx2_emmaprp: Copy v4l2_buffer data from src to dst

The timestamp and timecode fields were copied from destination to source,
not the other way around as they should. Fix it.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] uvcvideo: Tell the user space we're using start-of-exposure timestamps
Sakari Ailus [Mon, 10 Feb 2014 22:26:44 +0000 (19:26 -0300)]
[media] uvcvideo: Tell the user space we're using start-of-exposure timestamps

The UVC device provided timestamps are taken from the clock once the
exposure of the frame has begun, not when the reception of the frame would
have been finished as almost anywhere else. Show this to the user space by
using V4L2_BUF_FLAG_TSTAMP_SRC_SOE buffer flag.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Handle buffer timestamp flags correctly
Sakari Ailus [Tue, 25 Feb 2014 22:08:52 +0000 (19:08 -0300)]
[media] v4l: Handle buffer timestamp flags correctly

For COPY timestamps, buffer timestamp source flags will traverse the queue
untouched.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Add timestamp source flags, mask and document them
Sakari Ailus [Sun, 25 Aug 2013 20:57:03 +0000 (17:57 -0300)]
[media] v4l: Add timestamp source flags, mask and document them

Some devices do not produce timestamps that correspond to the end of the
frame. The user space should be informed on the matter. This patch achieves
that by adding buffer flags (and a mask) for timestamp sources since more
possible timestamping points are expected than just two.

A three-bit mask is defined (V4L2_BUF_FLAG_TSTAMP_SRC_MASK) and two of the
eight possible values is are defined V4L2_BUF_FLAG_TSTAMP_SRC_EOF for end of
frame (value zero) V4L2_BUF_FLAG_TSTAMP_SRC_SOE for start of exposure (next
value).

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Kamil Debski <k.debski@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Timestamp flags will soon contain timestamp source, not just type
Sakari Ailus [Sat, 1 Mar 2014 13:28:02 +0000 (10:28 -0300)]
[media] v4l: Timestamp flags will soon contain timestamp source, not just type

Mask out other bits when comparing timestamp types.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Rename vb2_queue.timestamp_type as timestamp_flags
Sakari Ailus [Tue, 25 Feb 2014 22:12:19 +0000 (19:12 -0300)]
[media] v4l: Rename vb2_queue.timestamp_type as timestamp_flags

The timestamp_type field used to contain only the timestamp type. Soon it
will be used for timestamp source flags as well. Rename the field
accordingly.

[m.chehab@samsung.com: do the change also to drivers/staging/media and at s2255]
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Use full 32 bits for buffer flags
Sakari Ailus [Sun, 25 Aug 2013 17:00:43 +0000 (14:00 -0300)]
[media] v4l: Use full 32 bits for buffer flags

The buffer flags field is 32 bits but the defined only used 16. This is
fine, but as more than 16 bits will be used in the very near future, define
them as 32-bit numbers for consistency.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: Document timestamp behaviour to correspond to reality
Sakari Ailus [Fri, 25 Jan 2013 18:00:07 +0000 (15:00 -0300)]
[media] v4l: Document timestamp behaviour to correspond to reality

Document that monotonic timestamps are taken after the corresponding frame
has been received, not when the reception has begun. This corresponds to the
reality of current drivers: the timestamp is naturally taken when the
hardware triggers an interrupt to tell the driver to handle the received
frame.

Remove the note on timestamp accuracy as it is fairly subjective what is
actually an unstable timestamp.

Also remove explanation that output buffer timestamps can be used to delay
outputting a frame.

Remove the footnote saying we always use realtime clock.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vb2: fix timecode and flags handling for output buffers
Hans Verkuil [Mon, 24 Feb 2014 17:44:50 +0000 (14:44 -0300)]
[media] vb2: fix timecode and flags handling for output buffers

When sending a buffer to a video output device some of the fields need
to be copied so they arrive in the driver. These are the KEY/P/BFRAME
flags and the TIMECODE flag, and, if that flag is set, the timecode field
itself.

There are a number of functions involved in this: the __fill_vb2_buffer()
is called while preparing a buffer. For output buffers the buffer contains
the video data, so any meta data associated with that (KEY/P/BFRAME and
the field information) should be stored at that point.

The timecode, timecode flag and timestamp information is not part of that,
that information will have to be set when vb2_internal_qbuf() is called to
actually queue the buffer to the driver. Usually VIDIOC_QBUF will do the
prepare as well, but you can call PREPARE_BUF first and only later VIDIOC_QBUF.
You most likely will want to set the timestamp and timecode when you actually
queue the buffer, not when you prepare it.

Finally, in buf_prepare() make sure the timestamp and sequence fields are
actually cleared so that when you do a QUERYBUF of a prepared-but-not-yet-queued
buffer you will not see stale timestamp/sequence data.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l: add RF tuner gain controls
Antti Palosaari [Sat, 25 Jan 2014 02:44:26 +0000 (23:44 -0300)]
[media] v4l: add RF tuner gain controls

Modern silicon RF tuners used nowadays has many controllable gain
stages on signal path. Usually, but not always, there is at least
3 gain stages. Also on some cases there could be multiple gain
stages within the ones specified here. However, I think that having
these three controllable gain stages offers enough fine-tuning for
real use cases.

1) LNA gain. That is first gain just after antenna input.
2) Mixer gain. It is located quite middle of the signal path, where
RF signal is down-converted to IF/BB.
3) IF gain. That is last gain in order to adjust output signal level
to optimal level for receiving party (usually demodulator ADC).

Each gain stage could be set rather often both manual or automatic
(AGC) mode. Due to that add separate controls for controlling
operation mode.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] DocBook: document RF tuner gain controls
Antti Palosaari [Thu, 30 Jan 2014 03:00:10 +0000 (00:00 -0300)]
[media] DocBook: document RF tuner gain controls

Add documentation for LNA, mixer and IF gain controls. These
controls are RF tuner specific.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] DocBook: media: document V4L2_CTRL_CLASS_RF_TUNER
Antti Palosaari [Sat, 1 Feb 2014 00:27:19 +0000 (21:27 -0300)]
[media] DocBook: media: document V4L2_CTRL_CLASS_RF_TUNER

It is class for RF tuner specific controls, like gain controls,
filters, signal strength.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rtl2832: implement delayed I2C gate close
Antti Palosaari [Sat, 8 Feb 2014 06:50:04 +0000 (03:50 -0300)]
[media] rtl2832: implement delayed I2C gate close

Delay possible I2C gate close a little bit in order to see if there
is next message coming to tuner in a sequence.

Also, export private muxed I2C adapter. That is aimed only for SDR
extension module as SDR belongs to same RTL2832 physical I2C bus (it
is physically property of RTL2832, whilst it is own kernel module).

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rtl2832: Fix deadlock on i2c mux select function
Luis Alves [Wed, 4 Dec 2013 23:21:22 +0000 (20:21 -0300)]
[media] rtl2832: Fix deadlock on i2c mux select function

Signed-off-by: Luis Alves <ljalvs@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>