platform/kernel/linux-3.10.git
10 years agoupstream: [media] smiapp: Call limits quirk immediately after retrieving the limits
Sakari Ailus [Tue, 15 Apr 2014 17:59:42 +0000 (14:59 -0300)]
upstream: [media] smiapp: Call limits quirk immediately after retrieving the limits

Some of the limits are used before the limits quirk is called. Move the call
immediately after obtaining the limits.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] smiapp: Print the index of the format descriptor
Sakari Ailus [Tue, 15 Apr 2014 17:06:50 +0000 (14:06 -0300)]
upstream: [media] smiapp: Print the index of the format descriptor

This makes constructing quirks easier.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] uvcvideo: Fix marking buffer erroneous in case of FID toggling
Anton Leontiev [Tue, 25 Mar 2014 04:40:57 +0000 (01:40 -0300)]
upstream: [media] uvcvideo: Fix marking buffer erroneous in case of FID toggling

Set error bit for incomplete buffers when end of buffer is detected by
FID toggling (for example when last transaction with EOF is lost).
This prevents passing incomplete buffers to the userspace.

Signed-off-by: Anton Leontiev <bunder@t-25.ru>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] mem2mem_testdev: fix field, sequence and time copying
Hans Verkuil [Mon, 10 Mar 2014 13:58:28 +0000 (10:58 -0300)]
upstream: [media] mem2mem_testdev: fix field, sequence and time copying

- Set the sequence counters correctly.
- Copy timestamps, timecode, relevant buffer flags and field from
  the received buffer to the outgoing buffer.

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>
Conflicts:
drivers/media/platform/mem2mem_testdev.c

[m.chehab@samsung.com: also solve other random conflicts while
 backporting this patch]

10 years agoupstream: [media] mt9p031: Add support for PLL bypass
Laurent Pinchart [Sun, 9 Feb 2014 20:31:47 +0000 (17:31 -0300)]
upstream: [media] mt9p031: Add support for PLL bypass

When the input clock frequency is out of bounds for the PLL, bypass the
PLL and just divide the input clock to achieve the requested output
frequency.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: add [2013:025f] PCTV tripleStick (292e)
Antti Palosaari [Fri, 11 Apr 2014 01:11:27 +0000 (22:11 -0300)]
upstream: [media] em28xx: add [2013:025f] PCTV tripleStick (292e)

Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
drivers/media/usb/em28xx/em28xx-dvb.c

10 years agoupstream: [media] em28xx-dvb: fix PCTV 461e tuner I2C binding
Antti Palosaari [Wed, 12 Feb 2014 17:59:37 +0000 (14:59 -0300)]
upstream: [media] em28xx-dvb: fix PCTV 461e tuner I2C binding

Add missing m88ts2022 module reference counts as removing that module
is not allowed when it is used by em28xx-dvb module. That same module
was not unregistered correctly, fix it too.

Error cases validated by returning errors from m88ds3103, m88ts2022
and a8293 probe().

Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: only enable PCTV 80e led when streaming
Mauro Carvalho Chehab [Tue, 4 Mar 2014 23:49:07 +0000 (20:49 -0300)]
upstream: [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 agoupstream: [media] em28xx: Add LED support for Kworld UB435-Q v3
Mauro Carvalho Chehab [Tue, 4 Mar 2014 15:34:34 +0000 (12:34 -0300)]
upstream: [media] em28xx: Add LED support for Kworld UB435-Q v3

This device has a led at bit 7 of GPIO reg. 0x80 to indicate
when a DVB capture is happening.

Add support for it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: PCTV tripleStick (292e) LNA support
Antti Palosaari [Wed, 23 Apr 2014 01:56:54 +0000 (22:56 -0300)]
upstream: [media] em28xx: PCTV tripleStick (292e) LNA support

External LNA between antenna connector and RF tuner is controlled
by EM28178 GPIO 0. GPIO value 1 is LNA active and value 0 is LNA
disabled.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: add [2013:025f] PCTV tripleStick (292e)
Antti Palosaari [Fri, 11 Apr 2014 01:11:27 +0000 (22:11 -0300)]
upstream: [media] em28xx: add [2013:025f] PCTV tripleStick (292e)

Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
drivers/media/usb/em28xx/em28xx-dvb.c

10 years agoupstream: [media] em28xx: add support for Kworld UB435-Q version 3
Mauro Carvalho Chehab [Mon, 3 Mar 2014 19:28:39 +0000 (16:28 -0300)]
upstream: [media] em28xx: add support for Kworld UB435-Q version 3

This device is close to Kworld UB435-Q, but it uses a different
tuner. Add support for it.

Tested with both 8VSB and 256QAM modulations.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
Documentation/video4linux/CARDLIST.em28xx

10 years agoupstream: [media] tef6862: fix warning on avr32 arch
Mauro Carvalho Chehab [Fri, 1 Nov 2013 16:19:05 +0000 (13:19 -0300)]
upstream: [media] tef6862: fix warning on avr32 arch

On avr32 arch, we get those warnings:
drivers/media/radio/tef6862.c:59:1: warning: "MODE_SHIFT" redefined
In file included from /devel/v4l/ktest-build/arch/avr32/include/asm/ptrace.h:11,
arch/avr32/include/uapi/asm/ptrace.h:41:1: warning: this is the location of the previous definition
Prefix MSA_ to the MSA register bitmap macros, to avoid reusing the same symbol.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] bfin_capture: drop unnecessary vb2_is_streaming check
Hans Verkuil [Thu, 17 Apr 2014 05:52:16 +0000 (02:52 -0300)]
upstream: [media] bfin_capture: drop unnecessary vb2_is_streaming check

The stop_streaming op is only called if streaming is in progress,
so drop the unnecessary 'if (!vb2_is_streaming(vq))' check.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: ti-vpe: Fix initial configuration queue data
Archit Taneja [Mon, 10 Mar 2014 06:57:40 +0000 (03:57 -0300)]
upstream: [media] v4l: ti-vpe: Fix initial configuration queue data

The vpe output and capture queues are initially configured to default values in
vpe_open(). A G_FMT before any S_FMTs will result in these values being
populated.

The colorspace and bytesperline parameter of this initial configuration are
incorrect. This breaks compliance when as we get 'TRY_FMT(G_FMT) != G_FMT'.

Fix the initial queue configuration such that it wouldn't need to be fixed by
try_fmt.

Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] omap3isp: Don't try to locate external subdev for mem-to-mem pipelines
Laurent Pinchart [Sat, 15 Feb 2014 00:40:48 +0000 (21:40 -0300)]
upstream: [media] omap3isp: Don't try to locate external subdev for mem-to-mem pipelines

Memory-to-memory pipelines have no external subdev, we shouldn't try to
locate one and validate its configuration. The driver currently works by
chance due to another bug that results in failure to locate the external
subdev being ignored.

This gets rid of the "omap3isp omap3isp: can't find source, failing now"
error message in the kernel log when operating on a memory-to-memory
pipeline.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Tested-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: ti-vpe: enable CSC support for VPE
Archit Taneja [Thu, 12 Dec 2013 08:36:03 +0000 (05:36 -0300)]
upstream: [media] v4l: ti-vpe: enable CSC support for VPE

Use the csc library functions to configure the CSC block in VPE.

Some changes are required in try_fmt to handle the pix->colorspace parameter
more correctly. Previously, we copied the source queue colorspace to the
destination queue colorspace as we didn't support RGB formats. Now, we configure
pix->colorspace based on the color format set(and the height of the image if
it's a YUV format).

Add basic RGB color formats to the list of supported vpe formats.

If the destination format is RGB colorspace, we also need to use the RGB output
port instead of the Luma and Chroma output ports. This requires configuring the
output data descriptors differently.

Also, make the default colorspace V4L2_COLORSPACE_SMPTE170M as that resembles
the Standard Definition colorspace more closely.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: ti-vpe: Add helper to perform color conversion
Archit Taneja [Thu, 12 Dec 2013 08:36:02 +0000 (05:36 -0300)]
upstream: [media] v4l: ti-vpe: Add helper to perform color conversion

The CSC block can be used for color space conversion between YUV and RGB
formats.

It is configurable via a programmable set of coefficients. Add functionality to
choose the appropriate CSC coefficients and program them in the CSC registers.
We take the source and destination colorspace formats as the arguments, and
choose the coefficient table accordingly.

YUV to RGB coefficients are provided for standard and high definition
colorspaces. The coefficients can also be limited or full range. For now, only
full range coefficients are chosen. We would need some sort of control ioctl for
the user to specify the range needed. Not sure if there is a generic control
ioctl for this already?

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: ti-vpe: create a color space converter block library
Archit Taneja [Thu, 12 Dec 2013 08:36:01 +0000 (05:36 -0300)]
upstream: [media] v4l: ti-vpe: create a color space converter block library

VPE and VIP IPs in DAR7x contain a color space converter(CSC) sub block. Create
a library which will perform CSC related configurations and hold CSC register
definitions. The functions provided by this library will be called by the vpe
and vip drivers using a csc_data handle.

The vpe_dev holds the csc_data handle. The handle represents an instance of the
CSC hardware, and the vpe driver uses it to access the CSC register offsets or
helper functions to configure these registers.

The CSC register offsets are now relative to the CSC block itself, so we need
to use the macro GET_OFFSET_TOP to get the CSC register offset relative to the
VPE IP in the vpe driver.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: ti-vpe: enable basic scaler support
Archit Taneja [Thu, 12 Dec 2013 08:36:00 +0000 (05:36 -0300)]
upstream: [media] v4l: ti-vpe: enable basic scaler support

Add the required SC register configurations which lets us perform linear scaling
for the supported range of horizontal and vertical scaling ratios.

The horizontal scaler performs polyphase scaling using it's 8 tap 32 phase
filter, decimation is performed when downscaling passes beyond 2x or 4x.

The vertical scaler performs polyphase scaling using it's 5 tap 32 phase filter,
it switches to a simpler form of scaling using the running average filter when
the downscale ratio is more than 4x.

Many of the SC features like peaking, trimming and non-linear scaling aren't
implemented for now. Only the minimal register fields required for basic scaling
operation are configured.

The function to configure SC registers takes the sc_data handle, the source and
destination widths and heights, and the scaler address data block offsets for
the current context so that they can be configured.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: ti-vpe: support loading of scaler coefficients
Archit Taneja [Thu, 12 Dec 2013 08:35:58 +0000 (05:35 -0300)]
upstream: [media] v4l: ti-vpe: support loading of scaler coefficients

The SC block in VPE/VIP contains a SRAM within it. This internal memory
requires to be loaded with appropriate scaler coefficients from a contiguous
block of memory through VPDMA.

The horizontal and vertical scaler each require 2 sets of scaler coefficients
for luma and chroma scaling. The horizontal polyphase scaler requires
coefficients for a 32 phase and 8 tap filter. Similarly, the vertical scaler
requires coefficients for a 5 tap filter.

The choice of the scaler coefficients depends on the scaling ratio. Add
coefficient tables for different scaling ratios in sc_coeffs.h. In the case of
horizontal downscaling, we need to consider the change in ratio caused by
decimation performed by the horizontal scaler.

In order to load the scaler coefficients via VPDMA, a configuration descriptor
is used in block mode. The payload for the descriptor is the scaler coefficients
copied to memory. Coefficients for each phase have to be placed in memory in a
particular order understood by the scaler hardware.

The choice of the scaler coefficients, and the loading of the coefficients from
our tables to a contiguous buffer is managed by the functions
sc_set_hs_coefficients and sc_set_vs_coefficients.

The sc_data handle is now added with some parameters to describe the state of
the coefficients loaded in the SC block. 'loaded_coeff_h' and 'loaded_coeff_v'
hold the address of the last dma buffer which was used by VPDMA to copy
coefficients. This information can be used by a vpe mem-to-mem context to decide
whether it should load coefficients or not. 'hs_index' and 'vs_index' provide
some optimization by preventing loading of coefficients if the scaling ratio
didn't change between 2 contexts. 'load_coeff_h' and 'load_coeff_v' tell the
vpe/vip driver whether we need to load the coefficients through VPDMA or not.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] omap3isp: Fix buffer flags handling when querying buffer
Laurent Pinchart [Tue, 10 Dec 2013 01:46:17 +0000 (22:46 -0300)]
upstream: [media] omap3isp: Fix buffer flags handling when querying buffer

A missing break resulted in all done buffers being flagged with
V4L2_BUF_FLAG_QUEUED. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: omap3isp: Don't check for missing get_fmt op on remote subdev
Laurent Pinchart [Mon, 4 Nov 2013 09:52:10 +0000 (06:52 -0300)]
upstream: [media] v4l: omap3isp: Don't check for missing get_fmt op on remote subdev

The remote subdev of any video node in the OMAP3 ISP is an internal
subdev that is guaranteed to implement get_fmt. Don't check the return
value for -ENOIOCTLCMD, as this can't happen.
While at it, move non-critical code out of the mutex-protected section.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
10 years agoupstream: [media] media: marvell-ccic: use devm to release clk
Libin Yang [Tue, 5 Nov 2013 08:29:07 +0000 (05:29 -0300)]
upstream: [media] media: marvell-ccic: use devm to release clk

This patch uses devm to release the clks instead of releasing
manually.
And it adds enable/disable mipi_clk when getting its rate.

Signed-off-by: Libin Yang <lbyang@marvell.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] platform drivers: Fix build on frv arch
Mauro Carvalho Chehab [Fri, 1 Nov 2013 16:59:04 +0000 (13:59 -0300)]
upstream: [media] platform drivers: Fix build on frv arch

On frv, the following errors happen:
drivers/media/platform/soc_camera/rcar_vin.c: In function 'rcar_vin_setup':
drivers/media/platform/soc_camera/rcar_vin.c:284:3: error: implicit declaration of function 'iowrite32' [-Werror=implicit-function-declaration]
drivers/media/platform/soc_camera/rcar_vin.c: In function 'rcar_vin_request_capture_stop':
drivers/media/platform/soc_camera/rcar_vin.c:353:2: error: implicit declaration of function 'ioread32' [-Werror=implicit-function-declaration]
This is because this driver forgot to include linux/io.h.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] sh_mobile_ceu_camera: remove deprecated IRQF_DISABLED
Michael Opdenacker [Sun, 13 Oct 2013 06:01:46 +0000 (03:01 -0300)]
upstream: [media] sh_mobile_ceu_camera: remove deprecated IRQF_DISABLED

This patch proposes to remove the use of the IRQF_DISABLED flag
It's a NOOP since 2.6.35 and it will be removed one day.

Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] mx3-camera: locking cleanup in mx3_videobuf_queue()
Dan Carpenter [Thu, 29 Aug 2013 08:23:36 +0000 (05:23 -0300)]
upstream: [media] mx3-camera: locking cleanup in mx3_videobuf_queue()

Smatch complains about the locking here because we mix spin_lock_irq()
with spin_lock_irqsave() in an unusual way.  According to Smatch, it's
not always clear if the IRQs are enabled or disabled when we return.  It
turns out this function is always called with IRQs enabled and we can
just use spin_lock_irq().
It's called from __enqueue_in_driver().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: vsp1: Initialize media device bus_info field
Laurent Pinchart [Thu, 22 Aug 2013 17:11:47 +0000 (14:11 -0300)]
upstream: [media] v4l: vsp1: Initialize media device bus_info field

Fill bus_info with the VSP1 platform device name

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] marvell-ccic/mmp-driver.c: simplify use of devm_ioremap_resource
Julia Lawall [Wed, 14 Aug 2013 08:11:15 +0000 (05:11 -0300)]
upstream: [media] marvell-ccic/mmp-driver.c: simplify use of devm_ioremap_resource

Remove unneeded error handling on the result of a call to
platform_get_resource when the value is passed to devm_ioremap_resource.
A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression pdev,res,n,e,e1;
expression ret != 0;
identifier l;
@@
- res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  ... when != res
- if (res == NULL) { ... \(goto l;\|return ret;\) }
  ... when != res
+ res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  e = devm_ioremap_resource(e1, res);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] s3c-camif: Remove redundant NULL check
Sachin Kamat [Tue, 30 Apr 2013 05:16:18 +0000 (02:16 -0300)]
upstream: [media] s3c-camif: Remove redundant NULL check

clk_unprepare checks for NULL pointer. Hence convert IS_ERR_OR_NULL
to IS_ERR only.
[s.nawrocki: added initialisation of the clock array to ERR_PTR() value]

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
10 years agoupstream: treewide: Fix typo in printk
Masanari Iida [Tue, 21 May 2013 14:13:12 +0000 (23:13 +0900)]
upstream: treewide: Fix typo in printk

Correct spelling typo in various part of drivers

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
10 years agoupstream: [media] bfin_capture: add query_dv_timings/enum_dv_timings support
Scott Jiang [Fri, 12 Apr 2013 22:52:59 +0000 (19:52 -0300)]
upstream: [media] bfin_capture: add query_dv_timings/enum_dv_timings support

More dv_timings ioctl ops are introduced in video core.
Add query_dv_timings/enum_dv_timings accordingly.

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
10 years agoupstream: [media] coda: dynamic IRAM setup for decoder
Philipp Zabel [Fri, 21 Jun 2013 06:55:32 +0000 (03:55 -0300)]
upstream: [media] coda: dynamic IRAM setup for decoder

This sets up IRAM areas used as temporary memory for the different
hardware units depending on the frame size.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] coda: use vb2_set_plane_payload instead of setting v4l2_planes...
Philipp Zabel [Fri, 21 Jun 2013 06:55:27 +0000 (03:55 -0300)]
upstream: [media] coda: use vb2_set_plane_payload instead of setting v4l2_planes[0].bytesused directly

As stated in the vb2_buffer documentation, drivers should not directly fill
in v4l2_planes[0].bytesused, but should use the vb2_set_plane_payload()
function instead. No functional changes.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: treewide: Fix typo in printk
Masanari Iida [Mon, 30 Sep 2013 14:19:09 +0000 (23:19 +0900)]
upstream: treewide: Fix typo in printk

Correct spelling typo within various part of the kernel

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Conflicts:
drivers/media/i2c/s5c73m3/s5c73m3-core.c
drivers/net/ethernet/mellanox/mlx4/fw.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
drivers/net/wireless/ath/ath10k/pci.c

10 years agoupstream: media: v4l2-mem2mem: sync with upstream
Mauro Carvalho Chehab [Fri, 16 May 2014 19:45:43 +0000 (16:45 -0300)]
upstream: media: v4l2-mem2mem: sync with upstream

Upstream has some linespace differences. Make this one equal,
to make easier to backport future patches if needed.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] videobuf2-dma-sg: Fix typo on debug message
Ricardo Ribalda [Wed, 6 Nov 2013 18:48:38 +0000 (15:48 -0300)]
upstream: [media] videobuf2-dma-sg: Fix typo on debug message

num_pages_from_user and buf->num_pages were swapped.

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>
Conflicts:
drivers/media/v4l2-core/videobuf2-dma-sg.c

10 years agoupstream: [media] vb2: stop_streaming should return void
Hans Verkuil [Thu, 17 Apr 2014 05:47:21 +0000 (02:47 -0300)]
upstream: [media] vb2: stop_streaming should return void

The vb2 core ignores any return code from the stop_streaming op.
And there really isn't anything it can do anyway in case of an error.
So change the return type to void and update any drivers that implement it.

The int return gave drivers the idea that this operation could actually
fail, but that's really not the case.

The pwc amd sdr-msi3101 drivers both had this construction:

        if (mutex_lock_interruptible(&s->v4l2_lock))
                return -ERESTARTSYS;

This has been updated to just call mutex_lock(). The stop_streaming op
expects this to really stop streaming and I very much doubt this will
work reliably if stop_streaming just returns without really stopping the
DMA.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
Documentation/video4linux/v4l2-pci-skeleton.c
drivers/staging/media/msi3101/sdr-msi3101.c

10 years agoupstream: [media] vb2: Add videobuf2-dvb support
Hans Verkuil [Wed, 9 Oct 2013 11:01:05 +0000 (08:01 -0300)]
upstream: [media] vb2: Add videobuf2-dvb support

With the new vb2_thread_start/stop core code it is very easy to implement
videobuf2-dvb. This should simplify converting existing videobuf drivers to
vb2.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] DocBook media: update bytesused field description
Hans Verkuil [Mon, 7 Apr 2014 13:01:28 +0000 (10:01 -0300)]
upstream: [media] DocBook media: update bytesused field description

For output buffers the application has to set the bytesused field.
In reality applications often do not set this since drivers that
deal with fix image sizes just override it anyway.

The vb2 framework will replace this field with the length field if
bytesused was set to 0 by the application, which is what happens
in practice. Document this behavior.

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 agoupstream: [media] vb2: add thread support
Hans Verkuil [Mon, 14 Apr 2014 10:33:00 +0000 (07:33 -0300)]
upstream: [media] vb2: add thread support

In order to implement vb2 DVB support you need to be able to start
a kernel thread that queues and dequeues buffers, calling a callback
function for every buffer. This patch adds support for that.

It's based on drivers/media/v4l2-core/videobuf-dvb.c, but with all the DVB
specific stuff stripped out, thus making it much more generic.

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 agoupstream: [media] vb2: start messages with a lower-case for consistency
Hans Verkuil [Mon, 7 Apr 2014 12:13:22 +0000 (09:13 -0300)]
upstream: [media] vb2: start messages with a lower-case for consistency

The kernel debug messages produced by vb2 started either with a
lower or an upper case character. Switched all to use lower-case
which seemed to be what was used in the majority of the messages.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] vb2: allow read/write as long as the format is single planar
Hans Verkuil [Fri, 11 Apr 2014 07:40:03 +0000 (04:40 -0300)]
upstream: [media] vb2: allow read/write as long as the format is single planar

It was impossible to read() or write() a frame if the queue type was multiplanar.
Even if the current format is single planar. Change this to just check whether
the number of planes is 1 or more.

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 agoupstream: [media] vb2: add vb2_fileio_is_active and check it more often
Hans Verkuil [Mon, 7 Apr 2014 12:23:50 +0000 (09:23 -0300)]
upstream: [media] vb2: add vb2_fileio_is_active and check it more often

Added a vb2_fileio_is_active inline function that returns true if fileio
is in progress. Check for this too in mmap() (you don't want apps mmap()ing
buffers used by fileio) and expbuf() (same reason).

In addition drivers should be able to check for this in queue_setup() to
return an error if an attempt is made to read() or write() with
V4L2_FIELD_ALTERNATE being configured. This is illegal (there is no way
to pass the TOP/BOTTOM information around using file I/O).

However, in order to be able to check for this the init_fileio function
needs to set q->fileio early on, before the buffers are allocated. So switch
to using internal functions (__reqbufs, vb2_internal_qbuf and
vb2_internal_streamon) to skip the fileio check. Well, that's why the internal
functions were created...

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] vb2: set timestamp when using write()
Hans Verkuil [Fri, 11 Apr 2014 07:36:57 +0000 (04:36 -0300)]
upstream: [media] vb2: set timestamp when using write()

When using write() to write data to an output video node the vb2 core
should set timestamps if V4L2_BUF_FLAG_TIMESTAMP_COPY is set. Nobody
else is able to provide this information with the write() operation.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] vb2: use correct prefix
Hans Verkuil [Mon, 7 Apr 2014 12:08:47 +0000 (09:08 -0300)]
upstream: [media] vb2: use correct prefix

Many dprintk's in vb2 use a hardcoded prefix with the function name. In
many cases that is now outdated. To keep things consistent the dprintk
macro has been changed to print the function name in addition to the "vb2:"
prefix. Superfluous prefixes elsewhere in the code have been removed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: Handle buffer timestamp flags correctly
Sakari Ailus [Tue, 25 Feb 2014 22:08:52 +0000 (19:08 -0300)]
upstream: [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 agoupstream: [media] v4l: Timestamp flags will soon contain timestamp source, not just...
Sakari Ailus [Sat, 1 Mar 2014 13:28:02 +0000 (10:28 -0300)]
upstream: [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 agoupstream: [media] vb2: simplify a confusing condition
Hans Verkuil [Mon, 24 Feb 2014 18:52:04 +0000 (15:52 -0300)]
upstream: [media] vb2: simplify a confusing condition

q->start_streaming_called is always true, so the WARN_ON check against
it being false can be dropped.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] vb2: move __qbuf_mmap before __qbuf_userptr
Hans Verkuil [Mon, 10 Mar 2014 15:23:13 +0000 (12:23 -0300)]
upstream: [media] vb2: move __qbuf_mmap before __qbuf_userptr

__qbuf_mmap was sort of hidden in between the much larger __qbuf_userptr
and __qbuf_dmabuf functions. Move it before __qbuf_userptr which is
also conform the usual order these memory models are implemented: first
mmap, then userptr, then dmabuf.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] staging: omap24xx: fix coding style
ileana@telecom-paristech.fr [Tue, 18 Mar 2014 13:31:03 +0000 (10:31 -0300)]
upstream: [media] staging: omap24xx: fix coding style

Fix missing parentheses in macros
Errors found by checkpatch.pl

Signed-off-by: Ioana Ileana <ileana@enst.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] videobuf2-core: fix sparse errors
Hans Verkuil [Mon, 17 Mar 2014 12:54:21 +0000 (09:54 -0300)]
upstream: [media] videobuf2-core: fix sparse errors

Sparse generated a bunch of errors like this:

drivers/media/v4l2-core/videobuf2-core.c:2045:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:136:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:151:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:168:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:183:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:185:9: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:385:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1115:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1268:33: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1270:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1315:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1324:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1396:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1457:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1482:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1484:9: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1523:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1525:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1815:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1828:17: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1914:25: error: incompatible types in conditional expression (different base types)
drivers/media/v4l2-core/videobuf2-core.c:1944:9: error: incompatible types in conditional expression (different base types)

These are caused by the call*op defines which do something like this:

        (ops->op) ? ops->op(args) : 0

which is OK as long as op is not a void function, because in that case one part
of the conditional expression returns void, the other an integer. Hence the sparse
errors.

I've replaced this by introducing three variants of the call_ macros:
call_*op for int returns, call_void_*op for void returns and call_ptr_*op for
pointer returns.

That's the bad news. The good news is that the fail_*op macros could be removed
since the call_*op macros now have enough information to determine if the op
succeeded or not and can increment the op counter only on success. This at least
makes it more robust w.r.t. future changes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: ti-vpe: retain v4l2_buffer flags for captured buffers
Archit Taneja [Tue, 11 Mar 2014 07:47:52 +0000 (04:47 -0300)]
upstream: [media] v4l: ti-vpe: retain v4l2_buffer flags for captured buffers

The dequed CAPTURE_MPLANE type buffers don't contain the flags that the
originally queued OUTPUT_MPLANE type buffers have. This breaks compliance.

Copy the source v4l2_buffer flags to the destination v4l2_buffer flags before
they are dequed.

Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: ti-vpe: zero out reserved fields in try_fmt
Archit Taneja [Mon, 10 Mar 2014 07:19:02 +0000 (04:19 -0300)]
upstream: [media] v4l: ti-vpe: zero out reserved fields in try_fmt

Zero out the reserved formats in v4l2_pix_format_mplane and
v4l2_plane_pix_format members of the returned v4l2_format pointer when passed
through TRY_FMT ioctl.

This ensures that the user doesn't interpret the non-zero fields as some data
passed by the driver, and ensures compliance.

Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: ti-vpe: make vpe driver load scaler coefficients
Archit Taneja [Thu, 12 Dec 2013 08:35:59 +0000 (05:35 -0300)]
upstream: [media] v4l: ti-vpe: make vpe driver load scaler coefficients

Make the driver allocate dma buffers to store horizontal and scaler coeffs.
Use the scaler library api to choose and copy scaler coefficients to a
the above buffers based on the scaling ratio. Since the SC block comes after
the de-interlacer, make sure that the source height is doubled if de-interlacer
was used.

These buffers now need to be used by VPDMA to load the coefficients into the
SRAM within SC.

In device_run, add configuration descriptors which have payloads pointing to
the scaler coefficients in memory. Use the members in sc_data handle to prevent
addition of these descriptors if there isn't a need to re-load coefficients into
SC. This comes helps unnecessary re-loading of the coefficients when we switch
back and forth between vpe contexts.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: ti-vpe: create a scaler block library
Archit Taneja [Thu, 12 Dec 2013 08:35:57 +0000 (05:35 -0300)]
upstream: [media] v4l: ti-vpe: create a scaler block library

VPE and VIP IPs in DAR7x contain a scaler(SC) sub block. Create a library which
will perform scaler block related configurations and hold SC register
definitions. The functions provided by this library will be called by the vpe
and vip drivers using a sc_data handle.

The vpe_dev holds the sc_data handle. The handle represents an instance of the
SC hardware, and the vpe driver uses it to access the scaler register offsets
or helper functions to configure these registers.

We move the SC register definitions to sc.h so that they aren't specific to
VPE anymore. The register offsets are now relative to the sub-block, and not the
VPE IP as a whole. In order for VPDMA to configure registers, it requires it's
offset from the top level VPE module. A macro called GET_OFFSET_TOP is added to
return the offset of the register relative to the VPE IP.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] rc-core: split dev->s_filter
David Härdeman [Fri, 4 Apr 2014 22:06:01 +0000 (19:06 -0300)]
upstream: [media] rc-core: split dev->s_filter

Overloading dev->s_filter to do two different functions (set wakeup filters
and generic hardware filters) makes it impossible to tell what the
hardware actually supports, so create a separate dev->s_wakeup_filter and
make the distinction explicit.

Signed-off-by: David Härdeman <david@hardeman.nu>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] media:gspca:dtcs033 Clean sparse check warnings on endianess
Robert Butora [Wed, 16 Apr 2014 18:46:49 +0000 (15:46 -0300)]
upstream: [media] media:gspca:dtcs033 Clean sparse check warnings on endianess

Warnings due to __le16 / u16 conversions.
Replace offending struct and so stay on cpu domain.

Signed-off-by: Robert Butora <robert.butora.fi@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] stk1160: warrant a NUL terminated string
Mauro Carvalho Chehab [Mon, 7 Apr 2014 13:39:23 +0000 (10:39 -0300)]
upstream: [media] stk1160: warrant a NUL terminated string

strncpy() doesn't warrant a NUL terminated string. Use
strlcpy() instead.

Fixes Coverity bug CID#1195195.

Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] rtl28xxu: remove duplicate ID 0458:707f Genius TVGo DVB-T03
Antti Palosaari [Wed, 26 Mar 2014 22:20:30 +0000 (19:20 -0300)]
upstream: [media] rtl28xxu: remove duplicate ID 0458:707f Genius TVGo DVB-T03

That ID was added twice mistakenly.
1st commit ac298ccdde4fe9b0a966e548a232ff4e8a6b8a31
2nd commit 1c1b8734094551eb4075cf68cf76892498c0da61

Revert commit 1c1b8734094551eb4075cf68cf76892498c0da61

Reported-by: Jan Vcelak <jv@fcelda.cz>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-audio: make sure audio is unmuted on open()
Frank Schaefer [Fri, 17 Jan 2014 17:18:43 +0000 (14:18 -0300)]
upstream: [media] em28xx-audio: make sure audio is unmuted on open()

In all cases, when the first capture is called, we need to
call the code that unmutes the volume.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-cards: remove a wrong indent level
Dan Carpenter [Wed, 5 Mar 2014 11:09:37 +0000 (08:09 -0300)]
upstream: [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 agoupstream: [media] drivers/media/usb/usbtv/usbtv-core.c:119:22: sparse: symbol 'usbtv_...
Fengguang Wu [Tue, 4 Feb 2014 09:02:02 +0000 (06:02 -0300)]
upstream: [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 agoupstream: [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)]
upstream: [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 agoupstream: [media] em28xx: Only deallocate struct em28xx after finishing all extensions
Mauro Carvalho Chehab [Wed, 5 Mar 2014 14:21:07 +0000 (11:21 -0300)]
upstream: [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 agoupstream: [media] uvcvideo: Add bayer 8-bit patterns to uvcvideo
Edgar Thier [Thu, 20 Feb 2014 07:12:51 +0000 (04:12 -0300)]
upstream: [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 agoupstream: [media] em28xx: add support for DVB monitor led
Mauro Carvalho Chehab [Tue, 4 Mar 2014 15:33:45 +0000 (12:33 -0300)]
upstream: [media] em28xx: add support for DVB monitor led

Some devices have a LED to indicate when DVB capture started.
Add support for it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: add support for PCTV 80e remote controller
Mauro Carvalho Chehab [Sun, 19 Jan 2014 10:15:11 +0000 (07:15 -0300)]
upstream: [media] em28xx: add support for PCTV 80e remote controller

This stick uses the same RC-5 remote controll found on other
PCTV devices. So, just use the existing keymap.

Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] gspca_stv06xx: remove an unneeded check
Dan Carpenter [Tue, 18 Feb 2014 15:00:45 +0000 (12:00 -0300)]
upstream: [media] gspca_stv06xx: remove an unneeded check

"err" is zero here so we don't need to check again.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] uvcvideo: Support allocating buffers larger than the current frame...
Laurent Pinchart [Tue, 18 Feb 2014 13:40:47 +0000 (10:40 -0300)]
upstream: [media] uvcvideo: Support allocating buffers larger than the current frame size

The queue_setup handler takes an optional format argument that can be
used to allocate buffers for a format different than the current format.
The uvcvideo driver doesn't support changing the format when buffers
have been allocated, but there's no reason not to support allocating
buffers larger than the minimum size.

When the format argument isn't NULL verify that the requested image size
is large enough for the current format and use it for the buffer size.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-dvb: fix PCTV 461e tuner I2C binding
Antti Palosaari [Wed, 12 Feb 2014 17:46:44 +0000 (14:46 -0300)]
upstream: [media] em28xx-dvb: fix PCTV 461e tuner I2C binding

Add missing m88ts2022 module reference counts as removing that module
is not allowed when it is used by em28xx-dvb module. That same module
was not unregistered correctly, fix it too.

Error cases validated by returning errors from m88ds3103, m88ts2022
and a8293 probe().

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-video: do not unregister the v4l2 dummy clock before v4l2_de...
Frank Schaefer [Fri, 17 Jan 2014 17:45:30 +0000 (14:45 -0300)]
upstream: [media] em28xx-video: do not unregister the v4l2 dummy clock before v4l2_device_unregister() has been called

Otherwiese the core refuses to unregister the clock and the following warning
appears in the system log:

"WARNING: ... at drivers/media/v4l2-core/v4l2-clk.c:231 v4l2_clk_unregister+0x8a/0x90 [videodev]()
 v4l2_clk_unregister(): Refusing to unregister ref-counted 11-0030:mclk clock!"

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-audio: fix user counting in snd_em28xx_capture_open()
Frank Schaefer [Fri, 17 Jan 2014 17:18:42 +0000 (14:18 -0300)]
upstream: [media] em28xx-audio: fix user counting in snd_em28xx_capture_open()

dev->adev.users always needs to be increased when snd_em28xx_capture_open() is
called and succeeds.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-cards: em28xx_devused can be static
Fengguang Wu [Wed, 15 Jan 2014 21:50:26 +0000 (18:50 -0300)]
upstream: [media] em28xx-cards: em28xx_devused can be static

Fix sparse warning:
drivers/media/usb/em28xx/em28xx-cards.c:69:1: sparse: symbol 'em28xx_devused' 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 agoupstream: [media] usbvision: drop unused define USBVISION_SAY_AND_WAIT
Hans Verkuil [Fri, 17 Jan 2014 10:27:27 +0000 (07:27 -0300)]
upstream: [media] usbvision: drop unused define USBVISION_SAY_AND_WAIT

This define uses the deprecated interruptible_sleep_on_timeout
function. Since this define is unused anyway we just remove it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-cards: properly initialize the device bitmap
Mauro Carvalho Chehab [Tue, 14 Jan 2014 20:35:15 +0000 (17:35 -0300)]
upstream: [media] em28xx-cards: properly initialize the device bitmap

Instead of just creating a long int, use DECLARE_BITMAP().

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: make 'em28xx_ctrl_ops' static
Fengguang Wu [Tue, 7 Jan 2014 15:50:47 +0000 (12:50 -0300)]
upstream: [media] em28xx: make 'em28xx_ctrl_ops' static

sparse warnings: (new ones prefixed by >>)

>> drivers/media/usb/em28xx/em28xx-video.c:1151:28: sparse: symbol 'em28xx_ctrl_ops' 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 agoupstream: em28xx-alsa: Fix error patch for init/fini
Mauro Carvalho Chehab [Tue, 14 Jan 2014 16:49:04 +0000 (14:49 -0200)]
upstream: em28xx-alsa: Fix error patch for init/fini

If something bad happens during init, we free the card data.
However, we still keep it initialized, causing some dependent
code to be called at .fini.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-audio: flush work at .fini
Mauro Carvalho Chehab [Mon, 13 Jan 2014 14:32:00 +0000 (11:32 -0300)]
upstream: [media] em28xx-audio: flush work at .fini

As a pending action might be still there at the work
thread, flush it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: adjust period size at runtime
Mauro Carvalho Chehab [Mon, 13 Jan 2014 06:34:23 +0000 (03:34 -0300)]
upstream: [media] em28xx: adjust period size at runtime

While the current hardcoded period is ok for the current values,
we may latter change the driver to work with different bit rates
or with different latencies than 64ms.

So, adust the period size at runtime.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: push mutex down to extensions on .fini callback
Mauro Carvalho Chehab [Mon, 13 Jan 2014 05:53:44 +0000 (02:53 -0300)]
upstream: [media] em28xx: push mutex down to extensions on .fini callback

Avoid circular mutex lock by pushing the dev->lock to the .fini
callback on each extension.

As em28xx-dvb, em28xx-alsa and em28xx-rc have their own data
structures, and don't touch at the common structure during .fini,
only em28xx-v4l needs to be locked.

[   90.994317] ======================================================
[   90.994356] [ INFO: possible circular locking dependency detected ]
[   90.994395] 3.13.0-rc1+ #24 Not tainted
[   90.994427] -------------------------------------------------------
[   90.994458] khubd/54 is trying to acquire lock:
[   90.994490]  (&card->controls_rwsem){++++.+}, at: [<ffffffffa0177b08>] snd_ctl_dev_free+0x28/0x60 [snd]
[   90.994656]
[   90.994656] but task is already holding lock:
[   90.994688]  (&dev->lock){+.+.+.}, at: [<ffffffffa040db81>] em28xx_close_extension+0x31/0x90 [em28xx]
[   90.994843]
[   90.994843] which lock already depends on the new lock.
[   90.994843]
[   90.994874]
[   90.994874] the existing dependency chain (in reverse order) is:
[   90.994905]
-> #1 (&dev->lock){+.+.+.}:
[   90.995057]        [<ffffffff810b8fa3>] __lock_acquire+0xb43/0x1330
[   90.995121]        [<ffffffff810b9f82>] lock_acquire+0xa2/0x120
[   90.995182]        [<ffffffff816a5b6c>] mutex_lock_nested+0x5c/0x3c0
[   90.995245]        [<ffffffffa0422cca>] em28xx_vol_put_mute+0x1ba/0x1d0 [em28xx_alsa]
[   90.995309]        [<ffffffffa017813d>] snd_ctl_elem_write+0xfd/0x140 [snd]
[   90.995376]        [<ffffffffa01791c2>] snd_ctl_ioctl+0xe2/0x810 [snd]
[   90.995442]        [<ffffffff811db8b0>] do_vfs_ioctl+0x300/0x520
[   90.995504]        [<ffffffff811dbb51>] SyS_ioctl+0x81/0xa0
[   90.995568]        [<ffffffff816b1929>] system_call_fastpath+0x16/0x1b
[   90.995630]
-> #0 (&card->controls_rwsem){++++.+}:
[   90.995780]        [<ffffffff810b7a47>] check_prevs_add+0x947/0x950
[   90.995841]        [<ffffffff810b8fa3>] __lock_acquire+0xb43/0x1330
[   90.995901]        [<ffffffff810b9f82>] lock_acquire+0xa2/0x120
[   90.995962]        [<ffffffff816a762b>] down_write+0x3b/0xa0
[   90.996022]        [<ffffffffa0177b08>] snd_ctl_dev_free+0x28/0x60 [snd]
[   90.996088]        [<ffffffffa017a255>] snd_device_free+0x65/0x140 [snd]
[   90.996154]        [<ffffffffa017a751>] snd_device_free_all+0x61/0xa0 [snd]
[   90.996219]        [<ffffffffa0173af4>] snd_card_do_free+0x14/0x130 [snd]
[   90.996283]        [<ffffffffa0173f14>] snd_card_free+0x84/0x90 [snd]
[   90.996349]        [<ffffffffa0423397>] em28xx_audio_fini+0x97/0xb0 [em28xx_alsa]
[   90.996411]        [<ffffffffa040dba6>] em28xx_close_extension+0x56/0x90 [em28xx]
[   90.996475]        [<ffffffffa040f639>] em28xx_usb_disconnect+0x79/0x90 [em28xx]
[   90.996539]        [<ffffffff814a06e7>] usb_unbind_interface+0x67/0x1d0
[   90.996620]        [<ffffffff8142920f>] __device_release_driver+0x7f/0xf0
[   90.996682]        [<ffffffff814292a5>] device_release_driver+0x25/0x40
[   90.996742]        [<ffffffff81428b0c>] bus_remove_device+0x11c/0x1a0
[   90.996801]        [<ffffffff81425536>] device_del+0x136/0x1d0
[   90.996863]        [<ffffffff8149e0c0>] usb_disable_device+0xb0/0x290
[   90.996923]        [<ffffffff814930c5>] usb_disconnect+0xb5/0x1d0
[   90.996984]        [<ffffffff81495ab6>] hub_port_connect_change+0xd6/0xad0
[   90.997044]        [<ffffffff814967c3>] hub_events+0x313/0x9b0
[   90.997105]        [<ffffffff81496e95>] hub_thread+0x35/0x170
[   90.997165]        [<ffffffff8108ea2f>] kthread+0xff/0x120
[   90.997226]        [<ffffffff816b187c>] ret_from_fork+0x7c/0xb0
[   90.997287]
[   90.997287] other info that might help us debug this:
[   90.997287]
[   90.997318]  Possible unsafe locking scenario:
[   90.997318]
[   90.997348]        CPU0                    CPU1
[   90.997378]        ----                    ----
[   90.997408]   lock(&dev->lock);
[   90.997497]                                lock(&card->controls_rwsem);
[   90.997607]                                lock(&dev->lock);
[   90.997697]   lock(&card->controls_rwsem);
[   90.997786]
[   90.997786]  *** DEADLOCK ***
[   90.997786]
[   90.997817] 5 locks held by khubd/54:
[   90.997847]  #0:  (&__lockdep_no_validate__){......}, at: [<ffffffff81496564>] hub_events+0xb4/0x9b0
[   90.998025]  #1:  (&__lockdep_no_validate__){......}, at: [<ffffffff81493076>] usb_disconnect+0x66/0x1d0
[   90.998204]  #2:  (&__lockdep_no_validate__){......}, at: [<ffffffff8142929d>] device_release_driver+0x1d/0x40
[   90.998383]  #3:  (em28xx_devlist_mutex){+.+.+.}, at: [<ffffffffa040db77>] em28xx_close_extension+0x27/0x90 [em28xx]
[   90.998567]  #4:  (&dev->lock){+.+.+.}, at: [<ffffffffa040db81>] em28xx_close_extension+0x31/0x90 [em28xx]

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-v4l: fix the freeing of the video devices memory
Frank Schaefer [Sun, 12 Jan 2014 16:24:25 +0000 (13:24 -0300)]
upstream: [media] em28xx-v4l: fix the freeing of the video devices memory

Remove some dead code from em28xx_v4l2_fini() and fix the leaking of the video,
vbi and radio video_device struct memories.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: always call em28xx_release_resources() in the usb disconnec...
Frank Schaefer [Sun, 12 Jan 2014 16:24:24 +0000 (13:24 -0300)]
upstream: [media] em28xx: always call em28xx_release_resources() in the usb disconnect handler

When the usb device is disconnected, the resources are no longer available,
so there is no reason to keep them registered.

This will also fix the various sysfs group removal warnings which we can see
since kernel 3.13.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-v4l: move v4l2_ctrl_handler freeing and v4l2_device unregist...
Frank Schaefer [Sun, 12 Jan 2014 16:24:22 +0000 (13:24 -0300)]
upstream: [media] em28xx-v4l: move v4l2_ctrl_handler freeing and v4l2_device unregistration to em28xx_v4l2_fini

v4l2_ctrl_handler_free() and v4l2_device_unregister() are currently only called
when the last user closes the device and the device is already disconnected.
But that's wrong, we need to call these functions whenever the em28xx-v4l
extension is closed and we can already do this if the device is still opened
by some users.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: move v4l2 dummy clock deregistration from the core to the...
Frank Schaefer [Sun, 12 Jan 2014 16:24:23 +0000 (13:24 -0300)]
upstream: [media] em28xx: move v4l2 dummy clock deregistration from the core to the v4l extension

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: fix xc3028 demod and firmware setup on DVB
Mauro Carvalho Chehab [Sun, 12 Jan 2014 14:08:22 +0000 (11:08 -0300)]
upstream: [media] em28xx: fix xc3028 demod and firmware setup on DVB

Now that em28xx can be compiled without V4L support, we should
call em28xx_setup_xc3028() on both em28xx-v4l and em28xx-dvb
modules.

Reported-by: Chris Lee <updatelee@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: fix I2S audio sample rate definitions and info output
Frank Schaefer [Sun, 22 Dec 2013 14:17:46 +0000 (11:17 -0300)]
upstream: [media] em28xx: fix I2S audio sample rate definitions and info output

The audio configuration in chip config register 0x00 and eeprom are always
consistent. But currently the audio configuration #defines for the chip config
register say 0x20 means 3 sample rates and 0x30 5 sample rates, while the eeprom
info output says 0x20 means 1 sample rate and 0x30 3 sample rates.

I've checked the datasheet excerpts I have and it seems that the meaning of
these bits is different for em2820/40 (1 and 3 sample rates) and em2860+
(3 and 5 smaple rates).
I have also checked my Hauppauge WinTV USB 2 (em2840) and the chip/eeprom
audio config 0x20 matches the sample rates reproted by the USB device
descriptor (32k only).

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] cx231xx: use after free on error path in probe
Dan Carpenter [Fri, 1 Nov 2013 10:34:40 +0000 (07:34 -0300)]
upstream: [media] cx231xx: use after free on error path in probe

We dereference "dev" after it has already been freed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] V4L2: em28xx: register a V4L2 clock source
Guennadi Liakhovetski [Wed, 28 Aug 2013 13:28:28 +0000 (10:28 -0300)]
upstream: [media] V4L2: em28xx: register a V4L2 clock source

Camera sensors usually require a master clock for data sampling. This patch
registers such a clock source for em28xx cameras. This fixes the currently
broken em28xx ov2640 camera support and can also be used by other camera
sensors.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] az6027: fix sparse warnings
Hans Verkuil [Fri, 4 Oct 2013 14:01:48 +0000 (11:01 -0300)]
upstream: [media] az6027: fix sparse warnings

drivers/media/usb/dvb-usb/az6027.c:257:23: warning: symbol 'az6027_stb0899_config' was not declared. Should it be static?
drivers/media/usb/dvb-usb/az6027.c:294:23: warning: symbol 'az6027_stb6100_config' 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 agoupstream: [media] stk1135: fix two warnings added by changeset 76e0598
Mauro Carvalho Chehab [Thu, 26 Sep 2013 10:41:30 +0000 (07:41 -0300)]
upstream: [media] stk1135: fix two warnings added by changeset 76e0598

drivers/media/usb/gspca/stk1135.c:615:6: warning: no previous prototype for 'stk1135_try_fmt' [-Wmissing-prototypes]
 void stk1135_try_fmt(struct gspca_dev *gspca_dev, struct v4l2_format *fmt)
      ^
drivers/media/usb/gspca/stk1135.c:627:5: warning: no previous prototype for 'stk1135_enum_framesizes' [-Wmissing-prototypes]
 int stk1135_enum_framesizes(struct gspca_dev *gspca_dev,

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] gspca-stk1135: Add variable resolution support
Ondrej Zary [Fri, 30 Aug 2013 20:54:25 +0000 (17:54 -0300)]
upstream: [media] gspca-stk1135: Add variable resolution support

Add variable resolution support to Syntek STK1135 subdriver.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] gspca: Support variable resolution
Ondrej Zary [Fri, 30 Aug 2013 20:54:24 +0000 (17:54 -0300)]
upstream: [media] gspca: Support variable resolution

Add variable resolution support to gspca by allowing subdrivers to
specify try_fmt and enum_framesizes functions.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] gspca: store current mode instead of individual parameters
Ondrej Zary [Fri, 30 Aug 2013 20:54:23 +0000 (17:54 -0300)]
upstream: [media] gspca: store current mode instead of individual parameters

Store complete current mode (struct v4l2_pix_format) in struct gspca_dev
instead of separate pixfmt, width and height parameters.
This is a preparation for variable resolution support.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] uvc: Depend on VIDEO_V4L2
Laurent Pinchart [Sat, 22 Jun 2013 14:23:58 +0000 (11:23 -0300)]
upstream: [media] uvc: Depend on VIDEO_V4L2

The uvcvideo driver lost its dependency on VIDEO_V4L2 during the big
media directory reorganization. Add it back.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
10 years agoupstream: [media] bttv: Add support for PCI-8604PW
Daniel Glöckner [Wed, 19 Mar 2014 09:50:41 +0000 (06:50 -0300)]
upstream: [media] bttv: Add support for PCI-8604PW

This patch adds support for the PCI-8604PW card equipped with four 878A.
It is unknown who the manufacturer of this card is and no drivers were
available during development of the patch. According to images found
online, the card is originally sold with Linux DVR software.

A CPLD on the card prevents the 878A from requesting access to the
bus until an initialization sequence has been issued via GPIOs. The
implemented sequence uses the minimum number of GPIOs needed to
successfully unlock bus access. As there are many more GPIOs connected
to the CPLD, it is very likely that some of the others have an influence
on the bus arbitration scheduling. This should be investigated further
in case of performance issues.

The tested card contains an EEPROM on one of the 878A, but it is
completely empty (i.e. contains only 0xff), so it is not possible
to detect the card.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Tested-by: Robert Longbottom <rongblor@googlemail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] media: bt8xx: add missing put_device call
Levente Kurusa [Thu, 19 Dec 2013 15:06:49 +0000 (12:06 -0300)]
upstream: [media] media: bt8xx: add missing put_device call

This is required so that we give up the last reference to the device.
Remove the kfree() because the put_device() call will actually call
release_sub_device which in turn kfrees the device.

Signed-off-by: Levente Kurusa <levex@linux.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] media: pci: remove DEFINE_PCI_DEVICE_TABLE macro
Jingoo Han [Mon, 2 Dec 2013 23:15:04 +0000 (20:15 -0300)]
upstream: [media] media: pci: remove DEFINE_PCI_DEVICE_TABLE macro

Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro
is not preferred.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] cx88: use correct pci drvdata type in cx88_audio_finidev()
Wei Yongjun [Thu, 21 Nov 2013 03:38:44 +0000 (00:38 -0300)]
upstream: [media] cx88: use correct pci drvdata type in cx88_audio_finidev()

We had set the pci drvdata in cx88_audio_initdev() as a type of
struct snd_card, so cx88_audio_finidev() should used it as the
same type too.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] cx23885: Add DTV support for Mygica X8502/X8507 boards
Mauro Carvalho Chehab [Fri, 9 Aug 2013 11:53:27 +0000 (08:53 -0300)]
upstream: [media] cx23885: Add DTV support for Mygica X8502/X8507 boards

Those boards were missing the ISDB-T support.
Most of the work on this patch were done by Alfredo.
My work here were to port this patch from Kernel 3.2 to upstream,
fix the issue caused by the set_frontend bad hook, and add the
Kconfig bits.
Tested on a X8502 board rebranded as:
"Leadership - Placa PCI-e de Captura de Vídeo Híbrida" - product code 3800.

Thanks-to: Alfredo Delaiti <alfredodelaiti@netscape.net>
Tested-by: Alfredo Delaiti <alfredodelaiti@netscape.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>