GitHub/exynos8895/android_kernel_samsung_universal8895.git
9 years ago[media] media: v4l2-image-sizes.h: correct the SVGA height definition
Josh Wu [Thu, 27 Nov 2014 03:15:01 +0000 (00:15 -0300)]
[media] media: v4l2-image-sizes.h: correct the SVGA height definition

SVGA height should be 600 not 680.

Reported-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] tda18271: Fix identation
Mauro Carvalho Chehab [Wed, 26 Nov 2014 15:26:09 +0000 (12:26 -0300)]
[media] tda18271: Fix identation

As reported by smatch:
drivers/media/tuners/tda18271-common.c:176 tda18271_read_extended() warn: if statement not indented

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] stv090x: remove export symbol for stv090x_set_gpio()
Mauro Carvalho Chehab [Wed, 26 Nov 2014 13:07:41 +0000 (10:07 -0300)]
[media] stv090x: remove export symbol for stv090x_set_gpio()

Drivers that use dvb_attach can have just one exported symbol,
or they will cause compilation breakages depending on the
selected frontends.

As Jim reported:
drivers/built-in.o: In function `technisat_usb2_set_voltage':
technisat-usb2.c:(.text+0x3b4919): undefined reference to `stv090x_set_gpio'
make: *** [vmlinux] Error 1

That happens because, on his configuration, the configuration
is:

CONFIG_DVB_USB=y
CONFIG_DVB_STV090x=m

Luis proposed ar way to fix, but that would just force the
STV090x to be selected, even if one wants to use a device
with a different frontend.

Instead, let's do the right thing: move set_gpio to the
configuration structure and fill it during dvb_attach().

This way, the driver can still call it, and dvb_attach()
will load stv090x module only if the device really needs it.

Reported by: Jim Davis <jim.epost@gmail.com>

Cc: Luis Rodriguez <mcgrof@suse.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb-usb-dvbsky: add TechnoTrend CT2-4400 and CT2-4650 devices support
Nibble Max [Wed, 26 Nov 2014 12:35:28 +0000 (09:35 -0300)]
[media] dvb-usb-dvbsky: add TechnoTrend CT2-4400 and CT2-4650 devices support

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Tested-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cxusb: remove TechnoTrend CT2-4400 and CT2-4650 devices
Nibble Max [Wed, 26 Nov 2014 12:35:14 +0000 (09:35 -0300)]
[media] cxusb: remove TechnoTrend CT2-4400 and CT2-4650 devices

Remove TechnoTrend CT2-4400 and CT2-4650 devices from cxusb.
They are supported by dvb-usb-dvbsky driver in PATCH 3/3.

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb-usb-dvbsky: add T330 dvb-t2/t/c usb stick support
Nibble Max [Wed, 26 Nov 2014 12:34:46 +0000 (09:34 -0300)]
[media] dvb-usb-dvbsky: add T330 dvb-t2/t/c usb stick support

DVBSky T330 dvb-t2/t/c usb stick:
1>dvb frontend: SI2157A30(tuner), SI2168B40(demod)
2>usb controller: CY7C68013A

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: exynos-gsc: fix build warning
Mauro Carvalho Chehab [Tue, 25 Nov 2014 15:04:16 +0000 (12:04 -0300)]
[media] media: exynos-gsc: fix build warning

Fixes following build warnings:

gsc-core.c:350:17: warning: 'low_plane' may be used uninitialized
gsc-core.c:371:31: warning: 'high_plane' may be used uninitialized

Reported-by: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rtl2832_sdr: control ADC
Antti Palosaari [Wed, 3 Dec 2014 23:11:03 +0000 (20:11 -0300)]
[media] rtl2832_sdr: control ADC

Recent rtl28xxu patch I made moved demod ADC enable from power control
to frontend control (due to slave demod support). Because of that we
need call USB interface frontend control too in order to enable ADC.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l: vb2: Fix race condition in _vb2_fop_release
Laurent Pinchart [Sat, 1 Nov 2014 13:32:28 +0000 (10:32 -0300)]
[media] v4l: vb2: Fix race condition in _vb2_fop_release

The function releases the queue if the file being released is the queue
owner. The check reads the queue->owner field without taking the queue
lock, creating a race condition with functions that set the queue owner,
such as vb2_ioctl_reqbufs() for instance.

Fix this by moving the queue->owner check within the mutex protected
section.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l: vb2: Fix race condition in vb2_fop_poll
Laurent Pinchart [Sat, 1 Nov 2014 13:32:28 +0000 (10:32 -0300)]
[media] v4l: vb2: Fix race condition in vb2_fop_poll

The vb2_fop_poll() implementation tries to be clever on whether it needs
to lock the queue mutex by checking whether polling might start fileio.
The test requires reading the q->num_buffer field, which is racy if we
don't hold the queue mutex in the first place.

Remove the extra cleverness and just lock the mutex.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] smiapp: Support V4L2_SEL_TGT_NATIVE_SIZE
Sakari Ailus [Thu, 6 Nov 2014 19:54:33 +0000 (16:54 -0300)]
[media] smiapp: Support V4L2_SEL_TGT_NATIVE_SIZE

Add support for selection target V4L2_SEL_TGT_NATIVE_SIZE. It is equivalent
of what V4L2_SEL_TGT_CROP_BOUNDS used to be. Support for
V4L2_SEL_TGT_CROP_BOUNDS is still supported by the driver as a compatibility
interface.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] smiapp: Set left and top to zero for crop bounds selection
Sakari Ailus [Sun, 16 Nov 2014 14:48:31 +0000 (11:48 -0300)]
[media] smiapp: Set left and top to zero for crop bounds selection

The fields were previously uninitialised, leaving the returned values to
where the user had set them. This was never the intention.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l: Add input and output capability flags for native size setting
Sakari Ailus [Tue, 18 Nov 2014 05:27:00 +0000 (02:27 -0300)]
[media] v4l: Add input and output capability flags for native size setting

Add input and output capability flags for setting native size of the device,
and document them.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target
Sakari Ailus [Wed, 15 Oct 2014 16:38:15 +0000 (13:38 -0300)]
[media] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target

The V4L2_SEL_TGT_NATIVE_SIZE target is used to denote e.g. the size of a
sensor's pixel array.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l: Clean up sub-device format documentation
Sakari Ailus [Wed, 15 Oct 2014 13:08:19 +0000 (10:08 -0300)]
[media] v4l: Clean up sub-device format documentation

The sub-device format documentation documented scaling configuration through
formats. Instead the compose selection rectangle is elsewhere documented to
be used for the purpose. Remove scaling related part of the documentation.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] omap_vout: fix compile warnings
Hans Verkuil [Mon, 1 Dec 2014 11:32:54 +0000 (08:32 -0300)]
[media] omap_vout: fix compile warnings

When compiling under COMPILE_TEST on a x86_64 the following warnings
appear:

drivers/media/platform/omap/omap_vout.c: In function 'omap_vout_uservirt_to_phys':
drivers/media/platform/omap/omap_vout.c:209:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   return virt_to_phys((void *) virtp);
                       ^
drivers/media/platform/omap/omap_vout.c: In function 'omapvid_setup_overlay':
drivers/media/platform/omap/omap_vout.c:420:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat=]
  v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev,
  ^
drivers/media/platform/omap/omap_vout.c: In function 'omap_vout_buffer_prepare':
drivers/media/platform/omap/omap_vout.c:794:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   vout->queued_buf_addr[vb->i] = (u8 *)
                                  ^
In file included from arch/x86/include/asm/dma-mapping.h:44:0,
                 from include/linux/dma-mapping.h:82,
                 from drivers/media/platform/omap/omap_vout.c:40:
drivers/media/platform/omap/omap_vout.c:803:58: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   dma_addr = dma_map_single(vout->vid_dev->v4l2_dev.dev, (void *) addr,
                                                          ^
include/asm-generic/dma-mapping-common.h:174:60: note: in definition of macro 'dma_map_single'
 #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL)
                                                            ^

These are fixed by this patch.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: davinci: vpif_capture: use vb2_ops_wait_prepare/finish helper
Prabhakar Lad [Wed, 26 Nov 2014 22:42:33 +0000 (19:42 -0300)]
[media] media: davinci: vpif_capture: use vb2_ops_wait_prepare/finish helper

This patch adds support in the capture driver for using
vb2_ops_wait_prepare/finish()  helpers provided by the
vb2 core.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: blackfin: use vb2_ops_wait_prepare/finish helper
Prabhakar Lad [Wed, 26 Nov 2014 22:42:31 +0000 (19:42 -0300)]
[media] media: blackfin: use vb2_ops_wait_prepare/finish helper

This patch drops driver specific wait_prepare() and
wait_finish() callbacks from vb2_ops and instead uses
the the helpers vb2_ops_wait_prepare/finish() provided
by the vb2 core, the lock member of the queue needs
to be initalized to a mutex so that vb2 helpers
vb2_ops_wait_prepare/finish() can make use of it.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: marvell-ccic: use vb2_ops_wait_prepare/finish helper
Prabhakar Lad [Wed, 26 Nov 2014 22:42:29 +0000 (19:42 -0300)]
[media] media: marvell-ccic: use vb2_ops_wait_prepare/finish helper

This patch drops driver specific wait_prepare() and
wait_finish() callbacks from vb2_ops and instead uses
the the helpers vb2_ops_wait_prepare/finish() provided
by the vb2 core, the lock member of the queue needs
to be initalized to a mutex so that vb2 helpers
vb2_ops_wait_prepare/finish() can make use of it.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] V4L2: Deletion of an unnecessary check before the function call "vb2_put_vma"
Markus Elfring [Sun, 30 Nov 2014 22:10:51 +0000 (19:10 -0300)]
[media] V4L2: Deletion of an unnecessary check before the function call "vb2_put_vma"

The vb2_put_vma() 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>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media/platform: fix querycap
Hans Verkuil [Mon, 24 Nov 2014 09:37:26 +0000 (06:37 -0300)]
[media] media/platform: fix querycap

Querycap shouldn't set the version field (the core does that for you),
but it should set the device_caps field.

In addition, remove the CAPTURE and OUTPUT caps for M2M devices. These
were already slated for removal, so it's time to do so.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Kamil Debski <k.debski@samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media/platform: fix querycap
Hans Verkuil [Mon, 24 Nov 2014 09:37:25 +0000 (06:37 -0300)]
[media] media/platform: fix querycap

Querycap shouldn't set the version field (the core does that for you),
but it should set the device_caps field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>
Cc: Gerhard Sittig <gsi@denx.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media/radio: fix querycap
Hans Verkuil [Mon, 24 Nov 2014 09:37:24 +0000 (06:37 -0300)]
[media] media/radio: fix querycap

Querycap should set the device_caps field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media/usb,pci: fix querycap
Hans Verkuil [Mon, 24 Nov 2014 09:37:23 +0000 (06:37 -0300)]
[media] media/usb,pci: fix querycap

Querycap shouldn't set the version field (the core does that for you),
but it should set the device_caps field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] staging/media: fix querycap
Hans Verkuil [Mon, 24 Nov 2014 09:37:22 +0000 (06:37 -0300)]
[media] staging/media: fix querycap

Querycap shouldn't set the version field (the core does that for you),
but it should set the device_caps field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx18: add device_caps support
Hans Verkuil [Mon, 24 Nov 2014 09:37:21 +0000 (06:37 -0300)]
[media] cx18: add device_caps support

This was missing in this driver, so add this functionality.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] adv7511: improve colorspace handling
Hans Verkuil [Thu, 27 Nov 2014 13:07:38 +0000 (10:07 -0300)]
[media] adv7511: improve colorspace handling

Add support for YCbCr output and support setting colorspace,
YCbCr encoding and quantization for the AVI InfoFrame.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid: add support for YCbCr encoding and quantization
Hans Verkuil [Mon, 17 Nov 2014 13:26:01 +0000 (10:26 -0300)]
[media] vivid: add support for YCbCr encoding and quantization

Implement controls to set the YCbCr encoding and the quantization
range for the colorspace.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid: add new colorspaces
Hans Verkuil [Mon, 17 Nov 2014 13:21:19 +0000 (10:21 -0300)]
[media] vivid: add new colorspaces

Add AdobeRGB and BT.2020 support.

The colorspace control now orders the colorspaces according to how often
they are used. So rarely used colorspaces are moved to the end. This makes
it more logical when testing colorspace support.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid-tpg: improve colorspace support
Hans Verkuil [Mon, 17 Nov 2014 13:14:32 +0000 (10:14 -0300)]
[media] vivid-tpg: improve colorspace support

Add support for the new AdobeRGB and BT.2020 colorspaces. Also support
explicit Y'CbCr and quantization settings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid-tpg-colors: add AdobeRGB and BT.2020 support
Hans Verkuil [Mon, 17 Nov 2014 13:05:39 +0000 (10:05 -0300)]
[media] vivid-tpg-colors: add AdobeRGB and BT.2020 support

This extends the precalculated tpg_csc_colors matrix with AdobeRGB and BT.2020
colorspace support.

It also adds two precalculated tables that convert between linear RGB and non-linear
Rec.709 R'G'B' values, i.e. the Rec. 709 transfer function. This is needed to
efficiently handle the BT.2020 Constant Luminance Yc'CbcCrc encoding and decoding.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook media: rewrite the Colorspace chapter
Hans Verkuil [Thu, 27 Nov 2014 13:16:08 +0000 (10:16 -0300)]
[media] DocBook media: rewrite the Colorspace chapter

The colorspace chapter in the V4L2 Specification was always poorly
written. This patch rewrites it, documenting the new Y'CbCr encoding
and quantization defines and going into much more detail with respect
to how colorspaces are used and what it all means.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-ioctl.c: log the new ycbcr_enc and quantization fields
Hans Verkuil [Mon, 17 Nov 2014 12:12:41 +0000 (09:12 -0300)]
[media] v4l2-ioctl.c: log the new ycbcr_enc and quantization fields

Log the new ycbcr_enc and quantization fields. Note that it now
also logs the flags field for the multiplanar buffer type. This was
forgotten when the flags field was added.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-mediabus: improve colorspace support
Hans Verkuil [Mon, 17 Nov 2014 12:10:33 +0000 (09:10 -0300)]
[media] v4l2-mediabus: improve colorspace support

Add and copy the new ycbcr_enc and quantization fields.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] videodev2.h: improve colorspace support
Hans Verkuil [Mon, 17 Nov 2014 12:06:42 +0000 (09:06 -0300)]
[media] videodev2.h: improve colorspace support

Add support for the new AdobeRGB and BT.2020 colorspaces as needed for
HDMI 2.0.

Add support to specify the Y'CbCr encoding and quantization range explicitly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] ARM: dts: meson: add IR receiver node
Beniamino Galvani [Tue, 18 Nov 2014 20:22:35 +0000 (17:22 -0300)]
[media] ARM: dts: meson: add IR receiver node

This adds a node for the IR remote control receiver to the Amlogic
Meson DTS.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: rc: add driver for Amlogic Meson IR remote receiver
Beniamino Galvani [Tue, 18 Nov 2014 20:22:34 +0000 (17:22 -0300)]
[media] media: rc: add driver for Amlogic Meson IR remote receiver

Amlogic Meson SoCs include a infrared remote control receiver that can
operate in two modes: "NEC" mode in which the hardware decodes frames
using the NEC IR protocol, and "general" mode in which the receiver
simply reports the duration of pulses and spaces for software
decoding.

This is a driver for the IR receiver that implements software decoding
of received frames.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Acked-by: Carlo Caione <carlo@caione.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: rc: meson: document device tree bindings
Beniamino Galvani [Tue, 18 Nov 2014 20:22:33 +0000 (17:22 -0300)]
[media] media: rc: meson: document device tree bindings

This adds binding documentation for the infrared remote control
receiver available in Amlogic Meson SoCs.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] omap: disable COMPILE_TEST
Mauro Carvalho Chehab [Wed, 26 Nov 2014 01:41:09 +0000 (23:41 -0200)]
[media] omap: disable COMPILE_TEST

This causes lots of errors, because of sub-arch specific dependencies:

All error/warnings:

>> ERROR: "omapdss_compat_init" [drivers/media/platform/omap/omap-vout.ko] undefined!
>> ERROR: "omap_dss_get_overlay_manager" [drivers/media/platform/omap/omap-vout.ko] undefined!
>> ERROR: "omap_dss_get_num_overlay_managers" [drivers/media/platform/omap/omap-vout.ko] undefined!
>> ERROR: "omap_dss_get_overlay" [drivers/media/platform/omap/omap-vout.ko] undefined!
>> ERROR: "omapdss_is_initialized" [drivers/media/platform/omap/omap-vout.ko] undefined!
>> ERROR: "omap_dispc_register_isr" [drivers/media/platform/omap/omap-vout.ko] undefined!
>> ERROR: "omapdss_get_version" [drivers/media/platform/omap/omap-vout.ko] undefined!
>> ERROR: "omap_dss_put_device" [drivers/media/platform/omap/omap-vout.ko] undefined!
>> ERROR: "omap_dss_get_next_device" [drivers/media/platform/omap/omap-vout.ko] undefined!
>> ERROR: "omap_dispc_unregister_isr" [drivers/media/platform/omap/omap-vout.ko] undefined!
>> ERROR: "omapdss_compat_uninit" [drivers/media/platform/omap/omap-vout.ko] undefined!
>> ERROR: "omap_dss_get_device" [drivers/media/platform/omap/omap-vout.ko] undefined!
>> ERROR: "omap_dss_get_num_overlays" [drivers/media/platform/omap/omap-vout.ko] undefined!

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years agoRevert "[media] lmed04: add missing breaks"
Mauro Carvalho Chehab [Tue, 25 Nov 2014 17:46:13 +0000 (15:46 -0200)]
Revert "[media] lmed04: add missing breaks"

According with Malcolm, the missing breaks are intentional.

So, let's revert commit d442b15fb4deb2b5d516e2dae1f569b1d5472399,
add some comments to document it and fix the two smatch warnings:

drivers/media/usb/dvb-usb-v2/lmedm04.c:828 lme_firmware_switch() warn: missing break? reassigning 'st->dvb_usb_lme2510_firmware'
drivers/media/usb/dvb-usb-v2/lmedm04.c:850 lme_firmware_switch() warn: missing break? reassigning 'st->dvb_usb_lme2510_firmware'

using a different strategy to avoid reassign values to
st->dvb_usb_lme2510_firmware.

Acked-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] siano: unnecessary check before rc_unregister_device()
Markus Elfring [Mon, 24 Nov 2014 21:32:30 +0000 (18:32 -0300)]
[media] siano: unnecessary check before rc_unregister_device()

The rc_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: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: v4l2-image-sizes.h: add SVGA, XGA and UXGA size definitions
Josh Wu [Tue, 25 Nov 2014 08:54:27 +0000 (05:54 -0300)]
[media] media: v4l2-image-sizes.h: add SVGA, XGA and UXGA size definitions

Add SVGA, UXGA and XGA size definitions to v4l2-image-sizes.h.
The definitions are sorted by alphabet order.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] omap: Fix typo "HAS_MMU"
Paul Bolle [Mon, 24 Nov 2014 12:07:45 +0000 (09:07 -0300)]
[media] omap: Fix typo "HAS_MMU"

Commit 38a073116525 ("[media] omap: be sure that MMU is there for
COMPILE_TEST") added a dependency on HAS_MMU. There's no Kconfig symbol
HAS_MMU. Use MMU instead.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media/au0828: Fix IR stop, poll to not access device during disconnect
Shuah Khan [Sat, 22 Nov 2014 00:17:08 +0000 (21:17 -0300)]
[media] media/au0828: Fix IR stop, poll to not access device during disconnect

au0828 IR stop and poll routines continue to access device
while usb disconnect is in progress. There is small window
between device disconnect and usb interface is set to null.
This results in filling the log with several of the following
error messages. Fix it to detect device disconnect condition
and avoid device access.

Nov 20 18:58:02 anduin kernel: [  102.949819] au0828: au0828_usb_disconnect()
Nov 20 18:58:02 anduin kernel: [  102.950046] au0828: send_control_msg() Failed sending control message, error -71.
Nov 20 18:58:02 anduin kernel: [  102.950052] au0828: send_control_msg() Failed sending control message, error -19.
Nov 20 18:58:02 anduin kernel: [  102.950056] au0828: send_control_msg() Failed sending control message, error -19.
Nov 20 18:58:02 anduin kernel: [  102.950061] au0828: send_control_msg() Failed sending control message, error -19.
Nov 20 18:58:02 anduin kernel: [  102.950065] au0828: recv_control_msg() Failed receiving control message, error -19.
Nov 20 18:58:02 anduin kernel: [  102.950069] au0828: recv_control_msg() Failed receiving control message, error -19.
Nov 20 18:58:02 anduin kernel: [  102.950072] au0828: recv_control_msg() Failed receiving control message, error -19.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] USB: Deletion of unnecessary checks before three function calls
Markus Elfring [Thu, 20 Nov 2014 12:26:36 +0000 (09:26 -0300)]
[media] USB: Deletion of unnecessary checks before three function calls

GIT_AUTHOR_DATE=1416486805
The functions pvr2_hdw_destroy(), rc_unregister_device() and vfree() perform
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: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] platform: Deletion of unnecessary checks before two function calls
Markus Elfring [Thu, 20 Nov 2014 10:44:20 +0000 (07:44 -0300)]
[media] platform: Deletion of unnecessary checks before two function calls

The functions i2c_put_adapter() and release_firmware() test whether their
argument is NULL and then return 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: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rc: Deletion of unnecessary checks before two function calls
Markus Elfring [Thu, 20 Nov 2014 12:01:32 +0000 (09:01 -0300)]
[media] rc: Deletion of unnecessary checks before two function calls

The functions input_free_device() and rc_close() test whether their argument
is NULL and then return 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: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] i2c: Deletion of an unnecessary check before the function call "rc_unregister...
Markus Elfring [Thu, 20 Nov 2014 10:13:16 +0000 (07:13 -0300)]
[media] i2c: Deletion of an unnecessary check before the function call "rc_unregister_device"

The rc_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: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] firewire: Deletion of an unnecessary check before the function call "dvb_unre...
Markus Elfring [Thu, 20 Nov 2014 09:49:07 +0000 (06:49 -0300)]
[media] firewire: Deletion of an unnecessary check before the function call "dvb_unregister_device"

The dvb_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>
Reviewed-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] exynos4-is: fix error handling of irq_of_parse_and_map
Dmitry Torokhov [Fri, 14 Nov 2014 22:09:50 +0000 (19:09 -0300)]
[media] exynos4-is: fix error handling of irq_of_parse_and_map

Return value of irq_of_parse_and_map() is unsigned int, with 0
indicating failure, so testing for negative result never works.

Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] smipcie: add DVBSky T9580 V3 support
Nibble Max [Sat, 8 Nov 2014 11:35:20 +0000 (08:35 -0300)]
[media] smipcie: add DVBSky T9580 V3 support

v2:
- Update Kconfig file.

DVBSky T9580 V3 card is the dual tuner card, which supports S/S2 and T2/T/C.
1>DVB-S/S2 frontend: M88DS3103/M88TS2022
2>DVB-T2/T/C frontend: SI2168B40/SI2157A30
2>PCIe bridge: SMI PCIe

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] smipcie: use add_i2c_client and del_i2c_client functions
Nibble Max [Sat, 8 Nov 2014 11:35:08 +0000 (08:35 -0300)]
[media] smipcie: use add_i2c_client and del_i2c_client functions

v2:
-no change, just resend with other patches.

"add_i2c_client" and "del_i2c_client" functions make code shorter and easy to maintain.

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dvb-usb-dvbsky: add T680CI dvb-t2/t/c usb ci box support
Nibble Max [Thu, 13 Nov 2014 08:10:41 +0000 (05:10 -0300)]
[media] dvb-usb-dvbsky: add T680CI dvb-t2/t/c usb ci box support

DVBSky T680CI dvb-t2/t/c usb ci box:
1>dvb frontend: SI2158A20(tuner), SI2168A30(demod)
2>usb controller: CY7C86013A
3>ci controller: CIMAX SP2 or its clone.

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] si2168: One function call less in si2168_init() after error detection
Markus Elfring [Wed, 19 Nov 2014 22:23:15 +0000 (19:23 -0300)]
[media] si2168: One function call less in si2168_init() after error detection

GIT_AUTHOR_DATE=1416472767
The release_firmware() function was called in some cases by the
si2168_init() function during error handling even if the passed variable
contained still a null pointer. This implementation detail could be improved
by the introduction of another jump label.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] m88ds3103: One function call less in m88ds3103_init() after error detection
Markus Elfring [Wed, 19 Nov 2014 22:20:51 +0000 (19:20 -0300)]
[media] m88ds3103: One function call less in m88ds3103_init() after error detection

GIT_AUTHOR_DATE=1416472158
The release_firmware() function was called in some cases by the
m88ds3103_init() function during error handling even if the passed variable
contained still a null pointer. This implementation detail could be improved
by the introduction of another jump label.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DVB-frontends: Deletion of unnecessary checks before the function call "relea...
Markus Elfring [Wed, 19 Nov 2014 21:27:24 +0000 (18:27 -0300)]
[media] DVB-frontends: Deletion of unnecessary checks before the function call "release_firmware"

GIT_AUTHOR_DATE=1416472432
The release_firmware() 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: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lmed04: add missing breaks
Mauro Carvalho Chehab [Tue, 25 Nov 2014 11:17:13 +0000 (09:17 -0200)]
[media] lmed04: add missing breaks

drivers/media/usb/dvb-usb-v2/lmedm04.c:828 lme_firmware_switch() warn: missing break? reassigning 'st->dvb_usb_lme2510_firmware'
drivers/media/usb/dvb-usb-v2/lmedm04.c:849 lme_firmware_switch() warn: missing break? reassigning 'st->dvb_usb_lme2510_firmware'

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cxusb: Geniatech T230 support
CrazyCat [Fri, 14 Nov 2014 21:24:28 +0000 (18:24 -0300)]
[media] cxusb: Geniatech T230 support

Geniatech Mygica T230 DVB-T/T2/C USB stick support.

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Reviewed-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>
9 years ago[media] si2168: TS clock inversion control
CrazyCat [Fri, 14 Nov 2014 21:22:10 +0000 (18:22 -0300)]
[media] si2168: TS clock inversion control

TS clock polarity control implemented.

[Antti: Resolved simple conflict]

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Reviewed-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>
9 years ago[media] si2157: Si2148 support
CrazyCat [Fri, 14 Nov 2014 21:19:37 +0000 (18:19 -0300)]
[media] si2157: Si2148 support

Si2148-A20 silicon tuner support.

[Antti: Resolved conflict]

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] si2157: make checkpatch.pl happy (remove break after goto)
Olli Salonen [Mon, 24 Nov 2014 06:57:35 +0000 (03:57 -0300)]
[media] si2157: make checkpatch.pl happy (remove break after goto)

Break after goto is unnecessary.

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>
9 years ago[media] em28xx: Add support for Terratec Cinergy T2 Stick HD
Olli Salonen [Mon, 24 Nov 2014 06:57:34 +0000 (03:57 -0300)]
[media] em28xx: Add support for Terratec Cinergy T2 Stick HD

Terratec Cinergy T2 Stick HD [eb1a:8179] is a USB DVB-T/T2/C tuner that
contains following components:

* Empia EM28178 USB bridge
* Silicon Labs Si2168-A30 demodulator
* Silicon Labs Si2146-A10 tuner

I don't have the remote, so the RC_MAP is a best guess based on the pictures of
the remote controllers and other supported Terratec devices with a similar
remote.

[Antti: Resolved conflict caused by Leadtek VC100 patch]

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>
9 years ago[media] si2157: Add support for Si2146-A10
Olli Salonen [Mon, 24 Nov 2014 06:57:33 +0000 (03:57 -0300)]
[media] si2157: Add support for Si2146-A10

The Silicon Labs Si2146 tuner seems to work with the same driver as the Si2157,
but there a few exceptions. The powerup command seems to be quite a bit
different. In addition there's a property 0207 that requires a different value.
Thus another entry is created in the si2157_id table to support also si2146 in
this driver.

The datasheet is available on manufacturer's website:
http://www.silabs.com/support%20documents/technicaldocs/Si2146-short.pdf

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>
9 years ago[media] vb2: use dma_map_sg_attrs to prevent unnecessary sync
Hans Verkuil [Tue, 18 Nov 2014 12:51:08 +0000 (09:51 -0300)]
[media] vb2: use dma_map_sg_attrs to prevent unnecessary sync

By default dma_map_sg syncs the mapped buffer to the device. But
buf_prepare expects a buffer syncs for the cpu and the buffer
will be synced to the device in the prepare memop.

The reverse is true for dma_unmap_sg, buf_finish and the finish
memop.

To prevent unnecessary syncs we ask dma_(un)map_sg to skip the
sync.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vim2m: support expbuf
Hans Verkuil [Tue, 18 Nov 2014 12:51:07 +0000 (09:51 -0300)]
[media] vim2m: support expbuf

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid: enable vb2_expbuf support
Hans Verkuil [Tue, 18 Nov 2014 12:51:06 +0000 (09:51 -0300)]
[media] vivid: enable vb2_expbuf support

Now that vb2 supports DMABUF export for dma-sg and vmalloc memory
modes, we can enable the vb2_expbuf support in vivid.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vb2-vmalloc: add support for dmabuf exports
Hans Verkuil [Tue, 18 Nov 2014 12:51:05 +0000 (09:51 -0300)]
[media] vb2-vmalloc: add support for dmabuf exports

Add support for DMABUF exporting to the vb2-vmalloc implementation.

All memory models now have support for both importing and exporting of DMABUFs.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vb2-dma-sg: add support for dmabuf exports
Hans Verkuil [Tue, 18 Nov 2014 12:51:04 +0000 (09:51 -0300)]
[media] vb2-dma-sg: add support for dmabuf exports

Add DMABUF export support to vb2-dma-sg.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vb2-dma-sg: add dmabuf import support
Hans Verkuil [Tue, 18 Nov 2014 12:51:03 +0000 (09:51 -0300)]
[media] vb2-dma-sg: add dmabuf import support

Add support for importing dmabuf to videobuf2-dma-sg.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vb2-dma-sg: move dma_(un)map_sg here
Hans Verkuil [Mon, 24 Nov 2014 11:50:31 +0000 (08:50 -0300)]
[media] vb2-dma-sg: move dma_(un)map_sg here

This moves dma_(un)map_sg to the get_userptr/put_userptr and alloc/put
memops of videobuf2-dma-sg.c and adds dma_sync_sg_for_device/cpu to the
prepare/finish memops.

Now that vb2-dma-sg will sync the buffers for you in the prepare/finish
memops we can drop that from the drivers that use dma-sg.

For the solo6x10 driver that was a bit more involved because it needs to
copy JPEG or MPEG headers to the buffer before returning it to userspace,
and that cannot be done in the old place since the buffer there is still
setup for DMA access, not for CPU access. However, the buf_finish
op is the ideal place to do this. By the time buf_finish is called
the buffer is available for CPU access, so copying to the buffer is fine.

[mchehab@osg.samsung.com: Fix a compilation breakage:
 drivers/media/v4l2-core/videobuf2-dma-sg.c:150:19: error: 'struct vb2_dma_sg_buf' has no member named 'dma_sgt']

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vb2-dma-sg: add allocation context to dma-sg
Hans Verkuil [Tue, 18 Nov 2014 12:51:01 +0000 (09:51 -0300)]
[media] vb2-dma-sg: add allocation context to dma-sg

Require that dma-sg also uses an allocation context. This is in preparation
for adding prepare/finish memops to sync the memory between DMA and CPU.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vb2: don't free alloc context if it is ERR_PTR
Hans Verkuil [Tue, 18 Nov 2014 12:51:00 +0000 (09:51 -0300)]
[media] vb2: don't free alloc context if it is ERR_PTR

Don't try to free a pointer containing an ERR_PTR().

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vb2: add dma_dir to the alloc memop
Hans Verkuil [Tue, 18 Nov 2014 12:50:59 +0000 (09:50 -0300)]
[media] vb2: add dma_dir to the alloc memop

This is needed for the next patch where the dma-sg alloc memop needs
to know the dma_dir.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vb2: replace 'write' by 'dma_dir'
Hans Verkuil [Tue, 18 Nov 2014 12:50:58 +0000 (09:50 -0300)]
[media] vb2: replace 'write' by 'dma_dir'

The 'write' argument is very ambiguous. I first assumed that if it is 1,
then we're doing video output but instead it meant the reverse.

Since it is used to setup the dma_dir value anyway it is now replaced by
the correct dma_dir value which is unambiguous.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] videobuf2-core.h: improve documentation
Hans Verkuil [Tue, 18 Nov 2014 12:50:57 +0000 (09:50 -0300)]
[media] videobuf2-core.h: improve documentation

Document that drivers can access/modify the buffer contents in buf_prepare
and buf_finish. That was not clearly stated before.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Return all buffers to vb2 at stream stop and start failure
Laurent Pinchart [Tue, 21 Oct 2014 19:37:55 +0000 (16:37 -0300)]
[media] uvcvideo: Return all buffers to vb2 at stream stop and start failure

videobuf2 requires drivers to give back ownership of all queue buffers
in the stop_streaming operation, as well as in the start_streaming
operation in case of failure. Mark all queued buffers as done in the
error or queued state.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Rename and split uvc_queue_enable to uvc_queue_stream(on|off)
Laurent Pinchart [Tue, 21 Oct 2014 19:19:04 +0000 (16:19 -0300)]
[media] uvcvideo: Rename and split uvc_queue_enable to uvc_queue_stream(on|off)

This brings the function name in line with the V4L2 API terminology and
allows removing the duplicate queue type check.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Rename uvc_alloc_buffers to uvc_request_buffers
Laurent Pinchart [Tue, 21 Oct 2014 19:02:00 +0000 (16:02 -0300)]
[media] uvcvideo: Rename uvc_alloc_buffers to uvc_request_buffers

This brings the function name in line with the V4L2 API terminology.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Don't stop the stream twice at file handle release
Laurent Pinchart [Tue, 21 Oct 2014 19:07:15 +0000 (16:07 -0300)]
[media] uvcvideo: Don't stop the stream twice at file handle release

When releasing the file handle the driver calls the vb2_queue_release
which turns the stream off. There's thus no need to turn the stream off
explicitly beforehand.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Implement vb2 queue start and stop stream operations
Laurent Pinchart [Tue, 21 Oct 2014 16:03:08 +0000 (13:03 -0300)]
[media] uvcvideo: Implement vb2 queue start and stop stream operations

To work propertly the videobuf2 core code needs to be in charge of
stream start/stop control. Implement the start_streaming and
stop_streaming vb2 operations and move video enable/disable code to
them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Add function to convert from queue to stream
Laurent Pinchart [Tue, 21 Oct 2014 15:58:35 +0000 (12:58 -0300)]
[media] uvcvideo: Add function to convert from queue to stream

Factorize the container_of() call into an inline function and update
callers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Separate video and queue enable/disable operations
Laurent Pinchart [Mon, 13 Oct 2014 13:11:35 +0000 (10:11 -0300)]
[media] uvcvideo: Separate video and queue enable/disable operations

In order to make use of the vb2 queue start/stop_streaming operations
the video and queue enable/disable operations need to be split, as the
vb2 queue will need to enable and disable video instead of the other way
around.

Also move buffer queue disable outside of uvc_video_resume() to remove
all queue disable operations out of uvc_video.c.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Set buffer field to V4L2_FIELD_NONE
Laurent Pinchart [Fri, 31 Oct 2014 12:56:16 +0000 (09:56 -0300)]
[media] uvcvideo: Set buffer field to V4L2_FIELD_NONE

The driver doesn't support interlaced video, set field to
V4L2_FIELD_NONE for all vb2 buffers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Move to video_ioctl2
Laurent Pinchart [Thu, 30 Sep 2010 13:17:54 +0000 (10:17 -0300)]
[media] uvcvideo: Move to video_ioctl2

Simplify ioctl handling by using video_ioctl2.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2: get/set prio using video_dev prio structure
Laurent Pinchart [Fri, 31 Oct 2014 13:01:49 +0000 (10:01 -0300)]
[media] v4l2: get/set prio using video_dev prio structure

The v4l2_device structure embed a v4l2_prio_state structure used by
default for priority handling, but drivers can override that default by
setting the video_dev prio pointer to a different v4l2_prio_state
instance.

However, the VIDIO_G_PRIORITY and VIDIOC_S_PRIORITY implementations use
the prio state embedded in v4l2_device unconditionally, breaking drivers
that need to override the default. Fix them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Fix destruction order in uvc_delete()
Takashi Iwai [Fri, 24 Oct 2014 08:10:20 +0000 (05:10 -0300)]
[media] uvcvideo: Fix destruction order in uvc_delete()

We've got a bug report at disconnecting a Webcam, where the kernel
spews warnings like below:
  WARNING: CPU: 0 PID: 8385 at ../fs/sysfs/group.c:219 sysfs_remove_group+0x87/0x90()
  sysfs group c0b2350c not found for kobject 'event3'
  CPU: 0 PID: 8385 Comm: queue2:src Not tainted 3.16.2-1.gdcee397-default #1
  Hardware name: ASUSTeK Computer INC. A7N8X-E/A7N8X-E, BIOS ASUS A7N8X-E Deluxe ACPI BIOS Rev 1013  11/12/2004
    c08d0705 ddc75cbc c0718c5b ddc75ccc c024b654 c08c6d44 ddc75ce8 000020c1
    c08d0705 000000db c03d1ec7 c03d1ec7 00000009 00000000 c0b2350c d62c9064
    ddc75cd4 c024b6a3 00000009 ddc75ccc c08c6d44 ddc75ce8 ddc75cfc c03d1ec7
  Call Trace:
    [<c0205ba6>] try_stack_unwind+0x156/0x170
    [<c02046f3>] dump_trace+0x53/0x180
    [<c0205c06>] show_trace_log_lvl+0x46/0x50
    [<c0204871>] show_stack_log_lvl+0x51/0xe0
    [<c0205c67>] show_stack+0x27/0x50
    [<c0718c5b>] dump_stack+0x3e/0x4e
    [<c024b654>] warn_slowpath_common+0x84/0xa0
    [<c024b6a3>] warn_slowpath_fmt+0x33/0x40
    [<c03d1ec7>] sysfs_remove_group+0x87/0x90
    [<c05a2c54>] device_del+0x34/0x180
    [<c05e3989>] evdev_disconnect+0x19/0x50
    [<c05e06fa>] __input_unregister_device+0x9a/0x140
    [<c05e0845>] input_unregister_device+0x45/0x80
    [<f854b1d6>] uvc_delete+0x26/0x110 [uvcvideo]
    [<f84d66f8>] v4l2_device_release+0x98/0xc0 [videodev]
    [<c05a25bb>] device_release+0x2b/0x90
    [<c04ad8bf>] kobject_cleanup+0x6f/0x1a0
    [<f84d5453>] v4l2_release+0x43/0x70 [videodev]
    [<c0372f31>] __fput+0xb1/0x1b0
    [<c02650c1>] task_work_run+0x91/0xb0
    [<c024d845>] do_exit+0x265/0x910
    [<c024df64>] do_group_exit+0x34/0xa0
    [<c025a76f>] get_signal_to_deliver+0x17f/0x590
    [<c0201b6a>] do_signal+0x3a/0x960
    [<c02024f7>] do_notify_resume+0x67/0x90
    [<c071ebb5>] work_notifysig+0x30/0x3b
    [<b7739e60>] 0xb7739e5f
   ---[ end trace b1e56095a485b631 ]---

The cause is that uvc_status_cleanup() is called after usb_put_*() in
uvc_delete().  usb_put_*() removes the sysfs parent and eventually
removes the children recursively, so the later device_del() can't find
its sysfs.  The fix is simply rearrange the call orders in
uvc_delete() so that the child is removed before the parent.

Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=897736
Reported-and-tested-by: Martin Pluskal <mpluskal@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Add quirk to force the Oculus DK2 IR tracker to grayscale
Philipp Zabel [Wed, 6 Aug 2014 20:50:49 +0000 (17:50 -0300)]
[media] uvcvideo: Add quirk to force the Oculus DK2 IR tracker to grayscale

This patch adds a quirk to force Y8 pixel format even if the camera reports
half-width YUYV.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-common: move v4l2_ctrl_check to cx2341x
Hans Verkuil [Sun, 23 Nov 2014 12:39:55 +0000 (09:39 -0300)]
[media] v4l2-common: move v4l2_ctrl_check to cx2341x

The v4l2_ctrl_check() helper function is now only used in cx2341x.
Move it there and make it static.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-ctrl: move function prototypes from common.h to ctrls.h
Hans Verkuil [Sun, 23 Nov 2014 12:39:54 +0000 (09:39 -0300)]
[media] v4l2-ctrl: move function prototypes from common.h to ctrls.h

For some unknown reason several control prototypes where in v4l2-common.c
instead of in v4l2-ctrls.h. Move them and document them.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-common: remove unused helper functions
Hans Verkuil [Sun, 23 Nov 2014 12:39:53 +0000 (09:39 -0300)]
[media] v4l2-common: remove unused helper functions

Several control helper functions are no longer needed since most drivers
are now converted to the control framework. So we can delete them.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-dev: vdev->v4l2_dev is always set, so simplify code
Hans Verkuil [Sun, 23 Nov 2014 12:14:01 +0000 (09:14 -0300)]
[media] v4l2-dev: vdev->v4l2_dev is always set, so simplify code

These days vdev->v4l2_dev must always be set. This means that some
old code that still tests for a NULL vdev->v4l2_dev can be removed
or simplified.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] bttv/cx25821/cx88/ivtv: use sg_next instead of sg++
Hans Verkuil [Fri, 21 Nov 2014 10:57:12 +0000 (07:57 -0300)]
[media] bttv/cx25821/cx88/ivtv: use sg_next instead of sg++

Never use sg++, always use sg = sg_next(sg). Scatterlist entries can
be combined if the memory is contiguous but sg++ won't know about that.

As far as I can tell cx88 and ivtv are really broken because of this,
and bttv and cx25821 are OK because vb1 doesn't combine scatterlist
entries.

But regardless, sg++ should never be used, only sg_next is safe.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: vivid: use vb2_ops_wait_prepare/finish helper
Prabhakar Lad [Tue, 18 Nov 2014 11:23:39 +0000 (08:23 -0300)]
[media] media: vivid: use vb2_ops_wait_prepare/finish helper

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] staging/media/Makefile: drop omap24xx reference
Hans Verkuil [Sun, 23 Nov 2014 13:31:18 +0000 (10:31 -0300)]
[media] staging/media/Makefile: drop omap24xx reference

The omap2 media driver got removed. Remove a left-over for
tcm825x driver that were also at omap2 tree.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] staging: media: bcm2048: fix coding style error
Christian Resell [Sat, 15 Nov 2014 19:43:37 +0000 (16:43 -0300)]
[media] staging: media: bcm2048: fix coding style error

Simple style fix (checkpatch.pl: "space prohibited before that ','").
For the eudyptula challenge (http://eudyptula-challenge.org/).

Signed-off-by: Christian F. Resell <christian.resell@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] em28xx: initialize si2168_config struct
Olli Salonen [Thu, 20 Nov 2014 20:33:49 +0000 (17:33 -0300)]
[media] em28xx: initialize si2168_config struct

When new parameters are added for si2168 driver, the parameters have to be explicitly defined for each device if the
si2168_config struct is not initialized to all zeros.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] af9035: initialize si2168_config struct
Olli Salonen [Thu, 20 Nov 2014 20:33:48 +0000 (17:33 -0300)]
[media] af9035: initialize si2168_config struct

When new parameters are added for si2168 driver, the parameters have to be explicitly defined for each device if the
si2168_config struct is not initialized to all zeros.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cxusb: initialize si2168_config struct
Olli Salonen [Thu, 20 Nov 2014 20:33:47 +0000 (17:33 -0300)]
[media] cxusb: initialize si2168_config struct

When new parameters are added for si2168 driver, the parameters have to be explicitly defined for each device if the
si2168_config struct is not initialized to all zeros.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: pci: smipcie: Fix dependency for DVB_SMIPCIE
Andreas Ruprecht [Fri, 21 Nov 2014 18:23:28 +0000 (15:23 -0300)]
[media] media: pci: smipcie: Fix dependency for DVB_SMIPCIE

In smipcie.c, the function i2c_bit_add_bus() is called. This
function is defined by the I2C bit-banging interfaces enabled
with CONFIG_I2C_ALGOBIT.

As there was no dependency in Kconfig, CONFIG_I2C_ALGOBIT could
be set to "m" while CONFIG_DVB_SMIPCIE was set to "y", resulting
in a build error due to an undefined reference.

This patch adds the dependency on CONFIG_I2C_ALGOBIT in Kconfig
by selecting it when CONFIG_DVB_SMIPCIE is selected.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] rtl28xxu: add SDR module for devices having R828D tuner
Antti Palosaari [Wed, 12 Nov 2014 02:31:16 +0000 (23:31 -0300)]
[media] rtl28xxu: add SDR module for devices having R828D tuner

Load SDR sub-driver in order to support SDR for devices having
this tuner too.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>