platform/kernel/linux-3.10.git
9 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

9 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

9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 years agoupstream: [media] drivers/media/pci/pt1/pt1: Convert to module_pci_driver
Libo Chen [Mon, 27 May 2013 01:31:56 +0000 (22:31 -0300)]
upstream: [media] drivers/media/pci/pt1/pt1: Convert to module_pci_driver

use module_pci_driver instead of init/exit, make code clean.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] stb0899: remove commented value from IQ_SWAP_ON/OFF usages
Reinhard Nissl [Wed, 8 May 2013 20:54:57 +0000 (17:54 -0300)]
upstream: [media] stb0899: remove commented value from IQ_SWAP_ON/OFF usages

As the enum values have changed recently, the comments are void.

Signed-off-by: Reinhard Nißl <rnissl@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] si2157: add copyright and license
Antti Palosaari [Tue, 15 Apr 2014 00:51:32 +0000 (21:51 -0300)]
upstream: [media] si2157: add copyright and license

Add copyright and license for each file.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si2157: extend frequency range for DVB-C
Antti Palosaari [Sat, 12 Apr 2014 04:53:51 +0000 (01:53 -0300)]
upstream: [media] si2157: extend frequency range for DVB-C

DVB-C uses lower frequencies than DVB-T. Extend frequency range down to
110 MHz in order to support DVB-C. 110 - 862 MHz range is defined by
NorDig Unified 2.2 specification.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si2157: Silicon Labs Si2157 silicon tuner driver
Antti Palosaari [Fri, 11 Apr 2014 00:58:10 +0000 (21:58 -0300)]
upstream: [media] si2157: Silicon Labs Si2157 silicon tuner driver

Silicon Labs Si2157 silicon tuner driver.
Currently it supports only DVB-T.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] xc2028: add missing break to switch
Antti Palosaari [Sat, 5 Apr 2014 20:23:44 +0000 (17:23 -0300)]
upstream: [media] xc2028: add missing break to switch

Coverity CID 1196501: Missing break in switch (MISSING_BREAK)

I introduced that bug recently by commit
96a5b3a869e3dc7d55bf04a48a8dca8a4025787e.
As a result, it will flood unintentionally error message to log.

Reported-by: <scan-admin@coverity.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] e4000: make VIDEO_V4L2 dependency optional
Antti Palosaari [Sun, 16 Mar 2014 21:13:05 +0000 (18:13 -0300)]
upstream: [media] e4000: make VIDEO_V4L2 dependency optional

That tuner driver is mainly for DVB API, but there is some V4L2 API
controls for SDR usage. Make driver compile conditional so that V4L2
is not mandatory. Without the V4L2 support driver is build as a DVB
only, without SDR controls.

Fixes following errors reported by kbuild test robot:
ERROR: "v4l2_ctrl_auto_cluster" [drivers/media/tuners/e4000.ko] undefined!
ERROR: "v4l2_ctrl_new_std" [drivers/media/tuners/e4000.ko] undefined!
ERROR: "v4l2_ctrl_handler_init_class" [drivers/media/tuners/e4000.ko] undefined!
ERROR: "v4l2_ctrl_handler_free" [drivers/media/tuners/e4000.ko] undefined!

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] e4000: fix 32-bit build error
Antti Palosaari [Fri, 14 Mar 2014 18:22:24 +0000 (15:22 -0300)]
upstream: [media] e4000: fix 32-bit build error

All error/warnings:
   drivers/built-in.o: In function `e4000_set_params':
>> e4000.c:(.text+0x1219a1b): undefined reference to `__umoddi3'

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] e4000: rename some variables
Antti Palosaari [Tue, 11 Feb 2014 01:52:51 +0000 (22:52 -0300)]
upstream: [media] e4000: rename some variables

Rename some variables.
Change error status checks from (ret < 0) to (ret).
No actual functionality changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] e4000: convert to Regmap API
Antti Palosaari [Sat, 8 Feb 2014 09:20:35 +0000 (06:20 -0300)]
upstream: [media] e4000: convert to Regmap API

That comes possible after driver was converted to kernel I2C model
(I2C binding & proper I2C client with no gate control hack). All
nasty low level I2C routines are now covered by regmap.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] e4000: get rid of DVB i2c_gate_ctrl()
Antti Palosaari [Sat, 8 Feb 2014 07:21:10 +0000 (04:21 -0300)]
upstream: [media] e4000: get rid of DVB i2c_gate_ctrl()

Gate control is now implemented by rtl2832 I2C adapter so we do not
need proprietary DVB i2c_gate_ctrl() anymore.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] tda18212: add support for ATSC and clearQAM on tda18272
Mauro Carvalho Chehab [Mon, 3 Mar 2014 19:27:38 +0000 (16:27 -0300)]
upstream: [media] tda18212: add support for ATSC and clearQAM on tda18272

tda18272 is programmed just like tda18212, but it also
supports ClearQAM and ATSC.

Add support for them. Tested with a Kworld UB435-Q on both
8VSB and 256QAM modes.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] tda9887: remove an warning when compiling for alpha
Mauro Carvalho Chehab [Fri, 1 Nov 2013 15:40:40 +0000 (12:40 -0300)]
upstream: [media] tda9887: remove an warning when compiling for alpha

There's no need to zero the buffer, as if the routine gets an error,
rc will be different than one.
That fixes the following warning:
drivers/media/tuners/tda9887.c: In function 'tda9887_status':
drivers/media/tuners/tda9887.c:539:2: warning: value computed is not used [-Wunused-value]
While here, make fix the CodingStyle on this function.

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>
9 years agoupstream: [media] r820t: add support for R828D
Antti Palosaari [Wed, 30 Oct 2013 03:17:02 +0000 (00:17 -0300)]
upstream: [media] r820t: add support for R828D

Small changes in order to support tuner version R828D @ 16 MHz clock.
There was 'vco_fine_tune' check, which seems to adjust synthesizer
output divider (mixer dix / LO div / Rout) by one. R828D seems to
return vco_fine_tune=1 every time and that condition causes tuning
fail as output divider was increased by one.
Resolve problem by skipping whole condition in case of R828D tuner.
Just to mention, other tuner, R820T, seems to return 2 here.
Synthesizer maximum frequency check was hard coded to check synthesizer N
and thus worked correctly only for clock frequencies around 30 MHz.
As whole test is quite useless in any case, I removed it totally.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: staging: media: omap24xx: tcm825x.c Fix that open brace { should be on...
Aybuke Ozdemir [Sun, 16 Mar 2014 05:27:54 +0000 (07:27 +0200)]
upstream: staging: media: omap24xx: tcm825x.c Fix that open brace { should be on the previous line

The patch fixes the following checkpatch.pl errors:
ERROR: that open brace { should be on the previous line.

Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoupstream: [media] omap24xx/tcm825x: move to staging for future removal
Hans Verkuil [Thu, 12 Dec 2013 12:04:44 +0000 (09:04 -0300)]
upstream: [media] omap24xx/tcm825x: move to staging for future removal

The omap24xx driver and the tcm825x sensor driver are the only two
remaining drivers to still use the old deprecated v4l2-int-device API.

Nobody maintains these drivers anymore. But unfortunately the v4l2-int-device
API is used by out-of-tree drivers (MXC platform). This is a very bad situation
since as long as this deprecated API stays in the kernel there is no reason for
those out-of-tree drivers to convert.

This patch moves v4l2-int-device and the two drivers that depend on it to
staging in preparation for their removal.

If someone would be interested in getting these drivers to work, then start with
this since it's not very far from the state where they used to work:

<URL:http://vihersipuli.retiisi.org.uk/cgi-bin/gitweb.cgi?p=~sailus/linux-omap/.git;a=summary>

The branch is n800-cam. Porting to up-to-date APIs can then be done. David
might have done some work in that area, so check with him first.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Cc: David Cohen <dacohen@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
drivers/staging/media/Kconfig
drivers/staging/media/Makefile

9 years agoupstream: [media] DocBook media: v4l2_format_sdr was renamed to v4l2_sdr_format
Hans Verkuil [Fri, 14 Mar 2014 11:57:06 +0000 (08:57 -0300)]
upstream: [media] DocBook media: v4l2_format_sdr was renamed to v4l2_sdr_format

Update the DocBook files accordingly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] DocBook media: clarify v4l2_buffer/plane fields
Hans Verkuil [Fri, 7 Mar 2014 13:16:48 +0000 (10:16 -0300)]
upstream: [media] DocBook media: clarify v4l2_buffer/plane fields

Be more specific as to who has to fill in each field/flag: the driver
or the application.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: rename v4l2_format_sdr to v4l2_sdr_format
Antti Palosaari [Mon, 10 Mar 2014 13:43:24 +0000 (10:43 -0300)]
upstream: [media] v4l: rename v4l2_format_sdr to v4l2_sdr_format

Rename v4l2_format_sdr to v4l2_sdr_format in order to keep it in
line with other formats.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] DocBook: V4L: add V4L2_SDR_FMT_CU8 - 'CU08'
Antti Palosaari [Fri, 31 Jan 2014 02:44:59 +0000 (23:44 -0300)]
upstream: [media] DocBook: V4L: add V4L2_SDR_FMT_CU8 - 'CU08'

Document V4L2_SDR_FMT_CU8 SDR format.
It is complex unsigned 8-bit IQ sample. Used by software defined
radio devices.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl28xxu: add USB ID for Genius TVGo DVB-T03
Jan Vcelak [Wed, 26 Feb 2014 00:30:45 +0000 (21:30 -0300)]
upstream: [media] rtl28xxu: add USB ID for Genius TVGo DVB-T03

0458:707f KYE Systems Corp. (Mouse Systems) TVGo DVB-T03 [RTL2832]

The USB dongle uses RTL2832U demodulator and FC0012 tuner.

Signed-off-by: Jan Vcelak <jv@fcelda.cz>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc-main: fix missing unlock if no devno left
James Hogan [Sat, 1 Mar 2014 22:52:25 +0000 (19:52 -0300)]
upstream: [media] rc-main: fix missing unlock if no devno left

While playing with make coccicheck I noticed this message:
drivers/media/rc/rc-main.c:1245:3-9: preceding lock on line 1238

It was introduced by commit 587d1b06e07b ([media] rc-core: reuse device
numbers) which returns -ENOMEM after a mutex_lock without first
unlocking it when there are no more device numbers left. The added code
doesn't depend on the device lock, so move it before the lock is taken.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc-main: automatically refresh filter on protocol change
James Hogan [Fri, 28 Feb 2014 23:17:06 +0000 (20:17 -0300)]
upstream: [media] rc-main: automatically refresh filter on protocol change

When either of the normal or wakeup filter protocols are changed,
refresh the corresponding scancode filter, i.e. try and set the same
scancode filter with the new protocol. If that fails clear the filter
instead.

If no protocol was selected the filter is just cleared, and if no
s_filter callback exists the filter is left unmodified.

Similarly clear the filter mask when the filter is set if no protocol is
currently selected.

This simplifies driver code which no longer has to explicitly worry
about modifying the filter on a protocol change. This also allows the
change_wakeup_protocol callback to be omitted entirely if there is only
a single available wakeup protocol at a time, since selecting no
protocol will automatically clear the wakeup filter, disabling wakeup.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc: add wakeup_protocols sysfs file
James Hogan [Fri, 28 Feb 2014 23:17:05 +0000 (20:17 -0300)]
upstream: [media] rc: add wakeup_protocols sysfs file

Add a wakeup_protocols sysfs file which controls the new
rc_dev::enabled_protocols[RC_FILTER_WAKEUP], which is the mask of
protocols that are used for the wakeup filter.

A new RC driver callback change_wakeup_protocol() is called to change
the wakeup protocol mask.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
Documentation/ABI/testing/sysfs-class-rc
Documentation/DocBook/media/v4l/remote_controllers.xml

9 years agoupstream: [media] rc-core: do not change 32bit NEC scancode format for now
David Härdeman [Fri, 4 Apr 2014 22:05:56 +0000 (19:05 -0300)]
upstream: [media] rc-core: do not change 32bit NEC scancode format for now

This reverts 18bc17448147e93f31cc9b1a83be49f1224657b2 and changes
the code at img-ir-nec.c to use the order used by the other NEC decoders.

The original patch ignored the fact that NEC32 scancodes are generated not
only in the NEC raw decoder but also directly in some drivers. Whichever
approach is chosen it should be consistent across drivers and this patch
needs more discussion.

Furthermore, I'm convinced that we have to stop playing games trying to
decipher the "meaning" of NEC scancodes (what's the customer/vendor/address,
which byte is the MSB, etc).

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>
9 years agoupstream: [media] rc: img-ir: hw: Fix min/max bits setup
James Hogan [Thu, 13 Mar 2014 10:29:22 +0000 (07:29 -0300)]
upstream: [media] rc: img-ir: hw: Fix min/max bits setup

The calculated values for the minlen and maxlen fields, which were
rounded to multiples of 2 and clamped to a valid range, were left
unused. Use them in the calculation of the register value rather than
using the raw input minlen and maxlen.

This fixes the following warning with a W=1 build:
drivers/media/rc/img-ir/img-ir-hw.c In function ‘img_ir_free_timing’:
drivers/media/rc/img-ir/img-ir-hw.c +228 :23: warning: variable ‘maxlen’ set but not used [-Wunused-but-set-variable]
drivers/media/rc/img-ir/img-ir-hw.c +228 :15: warning: variable ‘minlen’ set but not used [-Wunused-but-set-variable]

Reported-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc: img-ir: jvc: Remove unused no-leader timings
James Hogan [Thu, 13 Mar 2014 10:29:23 +0000 (07:29 -0300)]
upstream: [media] rc: img-ir: jvc: Remove unused no-leader timings

The JVC timings included timings intended for the secondary decoder
(which matches messages with no leader), however they were in the wrong
part of the timings structure, repeating s00 and s01 rather than being
in s10 and s11.

Distinct repeat timings can't be properly supported yet for JVC anyway
since the scancode callback cannot determine which decoder matched the
message, so for now remove these timings and don't bother to enable the
secondary decoder.

This fixes the following warnings with W=1:
drivers/media/rc/img-ir/img-ir-jvc.c +76 :3: warning: initialized field overwritten [-Woverride-init]
drivers/media/rc/img-ir/img-ir-jvc.c +76 :3: warning: (near initialization for ‘img_ir_jvc.timings.s00’) [-Woverride-init]
drivers/media/rc/img-ir/img-ir-jvc.c +81 :3: warning: initialized field overwritten [-Woverride-init]
drivers/media/rc/img-ir/img-ir-jvc.c +81 :3: warning: (near initialization for ‘img_ir_jvc.timings.s01’) [-Woverride-init]

Reported-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc: img-ir: add Sanyo decoder module
James Hogan [Fri, 28 Feb 2014 23:29:00 +0000 (20:29 -0300)]
upstream: [media] rc: img-ir: add Sanyo decoder module

Add an img-ir module for decoding the Sanyo infrared protocol.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc: img-ir: add Sharp decoder module
James Hogan [Fri, 28 Feb 2014 23:28:59 +0000 (20:28 -0300)]
upstream: [media] rc: img-ir: add Sharp decoder module

Add an img-ir module for decoding the Sharp infrared protocol.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc: img-ir: add Sony decoder module
James Hogan [Fri, 28 Feb 2014 23:28:58 +0000 (20:28 -0300)]
upstream: [media] rc: img-ir: add Sony decoder module

Add an img-ir module for decoding the Sony infrared protocol.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc: img-ir: add JVC decoder module
James Hogan [Fri, 28 Feb 2014 23:28:57 +0000 (20:28 -0300)]
upstream: [media] rc: img-ir: add JVC decoder module

Add an img-ir module for decoding the JVC infrared protocol.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc: img-ir: add NEC decoder module
James Hogan [Fri, 28 Feb 2014 23:28:56 +0000 (20:28 -0300)]
upstream: [media] rc: img-ir: add NEC decoder module

Add an img-ir module for decoding the NEC and extended NEC infrared
protocols.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc: img-ir: add to build
James Hogan [Fri, 28 Feb 2014 23:28:55 +0000 (20:28 -0300)]
upstream: [media] rc: img-ir: add to build

Add ImgTec IR decoder driver to the build system.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc: img-ir: add base driver
James Hogan [Fri, 28 Feb 2014 23:28:52 +0000 (20:28 -0300)]
upstream: [media] rc: img-ir: add base driver

Add base driver for the ImgTec Infrared decoder block. The driver is
split into separate components for raw (software) decode and hardware
decoder which are in following commits.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] media: rc: change 32bit NEC scancode format
James Hogan [Fri, 17 Jan 2014 13:58:50 +0000 (10:58 -0300)]
upstream: [media] media: rc: change 32bit NEC scancode format

Change 32bit NEC scancode format (used by Apple and TiVo remotes) to
encode the data with the correct bit order. Previously the raw bits were
used without being bit reversed, now each 16bit half is bit reversed
compared to before.

So for the raw NEC data:
  (LSB/First) 0xAAaaCCcc (MSB/Last)
(where traditionally AA=address, aa=~address, CC=command, cc=~command)

We now generate the scancodes:
  (MSB) 0x0000AACC (LSB) (normal NEC)
  (MSB) 0x00AAaaCC (LSB) (extended NEC, address check wrong)
  (MSB) 0xaaAAccCC (LSB) (32-bit NEC, command check wrong)

Note that the address byte order in 32-bit NEC scancodes is different to
that of the extended NEC scancodes. I chose this way as it maintains the
order of the bits in the address/command fields, and CC is clearly
intended to be the LSB of the command if the TiVo codes are anything to
go by so it makes sense for AA to also be the LSB.

The TiVo keymap is updated accordingly.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Jarod Wilson <jarod@redhat.com>
Cc: linux-media@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc: ir-raw: Load ir-sharp-decoder module at init
James Hogan [Wed, 5 Feb 2014 22:15:16 +0000 (19:15 -0300)]
upstream: [media] rc: ir-raw: Load ir-sharp-decoder module at init

Commit 1d184b0bc13d ([media] media: rc: add raw decoder for Sharp
protocol) added a new raw IR decoder for the sharp protocol, but didn't
add the code to load the module at init as is done for other raw
decoders, so add that code now.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>