platform/kernel/linux-3.10.git
10 years agoupstream: staging: lirc: Add fallthrough comment
Andreea-Cristina Bernat [Wed, 12 Mar 2014 20:50:01 +0000 (22:50 +0200)]
upstream: staging: lirc: Add fallthrough comment

This patch adds fallthrough comments for the cases not preceded by
break or fallthrough comment

Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
10 years agoupstream: staging/media/solo6x10: Fix coding-style error
Andreea-Cristina Bernat [Tue, 11 Mar 2014 16:46:07 +0000 (18:46 +0200)]
upstream: staging/media/solo6x10: Fix coding-style error

This patch fixes the error "space required after that ';'" for
the file /drivers/staging/media/solo6x10/solo6x10-tx28.c

Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
10 years agoupstream: [media] media: rc-core: use %s in rc_map_get() module load
Kees Cook [Tue, 11 Mar 2014 20:25:53 +0000 (17:25 -0300)]
upstream: [media] media: rc-core: use %s in rc_map_get() module load

rc_map_get() takes a single string literal for the module to load,
so make sure it cannot be used as a format string in the call to
request_module().

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] DocBook: fix incorrect code example
Hans Verkuil [Sun, 23 Feb 2014 23:12:46 +0000 (20:12 -0300)]
upstream: [media] DocBook: fix incorrect code example

The code said for (i = 0; i > 30; ++i) instead of i < 30.

Fix this and clean it up a bit at the same time.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: add control for RF tuner PLL lock flag
Antti Palosaari [Fri, 7 Feb 2014 05:46:16 +0000 (02:46 -0300)]
upstream: [media] v4l: add control for RF tuner PLL lock flag

Add volatile boolean control to indicate if tuner frequency synthesizer
is locked to requested frequency. That means tuner is able to receive
given frequency. Control is named as "PLL lock", since frequency
synthesizers are based of phase-locked-loop. Maybe more general name
could be wise still?

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] DocBook: media: document PLL lock control
Antti Palosaari [Fri, 7 Feb 2014 06:55:32 +0000 (03:55 -0300)]
upstream: [media] DocBook: media: document PLL lock control

Document PLL lock V4L2 control. It is read only RF tuner control
which is used to inform if tuner is receiving frequency or not.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: add enum_freq_bands support to tuner sub-device
Antti Palosaari [Wed, 5 Feb 2014 05:24:35 +0000 (02:24 -0300)]
upstream: [media] v4l: add enum_freq_bands support to tuner sub-device

Add VIDIOC_ENUM_FREQ_BANDS, enumerate supported frequency bands,
IOCTL support for sub-device tuners too.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: uapi: add SDR formats CU8 and CU16LE
Antti Palosaari [Wed, 5 Feb 2014 02:55:25 +0000 (23:55 -0300)]
upstream: [media] v4l: uapi: add SDR formats CU8 and CU16LE

V4L2_SDR_FMT_CU8 — Complex unsigned 8-bit IQ sample
V4L2_SDR_FMT_CU16LE — Complex unsigned 16-bit little endian IQ sample

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] DocBook: media: add some general info about RF tuners
Antti Palosaari [Wed, 26 Feb 2014 23:30:35 +0000 (20:30 -0300)]
upstream: [media] DocBook: media: add some general info about RF tuners

Add some info what is RF tuner in context of V4L RF tuner class.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: reorganize RF tuner control ID numbers
Antti Palosaari [Wed, 5 Feb 2014 01:13:44 +0000 (22:13 -0300)]
upstream: [media] v4l: reorganize RF tuner control ID numbers

It appears that controls are ordered by ID number when enumerating.
That could lead illogical UI as controls are usually enumerated and
drawn by the application at runtime.

Change order of controls by reorganizing assigned IDs now as we can.
It is not reasonable possible after the API is released. Also, leave
some spare space between IDs too for possible future extensions.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: add RF tuner channel bandwidth control
Antti Palosaari [Sat, 1 Feb 2014 02:36:13 +0000 (23:36 -0300)]
upstream: [media] v4l: add RF tuner channel bandwidth control

Modern silicon RF tuners has one or more adjustable filters on
signal path, in order to filter noise from desired radio channel.

Add channel bandwidth control to tell the driver which is radio
channel width we want receive. Filters could be then adjusted by
the driver or hardware, using RF frequency and channel bandwidth
as a base of filter calculations.

On automatic mode (normal mode), bandwidth is calculated from sampling
rate or tuning info got from userspace. That new control gives
possibility to set manual mode and let user have more control for
filters.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: define unit for V4L2_CID_RF_TUNER_BANDWIDTH
Antti Palosaari [Wed, 12 Mar 2014 17:53:39 +0000 (14:53 -0300)]
upstream: [media] v4l: define unit for V4L2_CID_RF_TUNER_BANDWIDTH

Use Hertz as a unit for radio channel bandwidth.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] DocBook: document RF tuner bandwidth controls
Antti Palosaari [Wed, 5 Feb 2014 02:15:22 +0000 (23:15 -0300)]
upstream: [media] DocBook: document RF tuner bandwidth controls

Add documentation for RF tuner bandwidth controls. These controls are
used to set filters on tuner signal path.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] DocBook: Fix typo in xml and template file
Masanari Iida [Wed, 12 Mar 2014 15:57:22 +0000 (12:57 -0300)]
upstream: [media] DocBook: Fix typo in xml and template file

Fix spelling typo under Documentation/DocBook/media.
It is because these files are NOT generated by "make htmldocs",
I have to fix the files.

[m.chehab@samsung.com: fix a merge conflict]
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: vsp1: Update copyright notice
Laurent Pinchart [Thu, 6 Feb 2014 17:42:31 +0000 (14:42 -0300)]
upstream: [media] v4l: vsp1: Update copyright notice

The "Renesas Corporation" listed in the copyright notice doesn't exist.
Replace it with "Renesas Electronics Corporation" and update the
copyright years.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] dvb_frontend: Fix possible read out of bounds
Ole Ernst [Wed, 5 Mar 2014 17:08:15 +0000 (14:08 -0300)]
upstream: [media] dvb_frontend: Fix possible read out of bounds

Check if index is within bounds _before_ accessing the value.

Signed-off-by: Ole Ernst <olebowle@gmx.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] m88ds3103: possible uninitialized scalar variable
Antti Palosaari [Sat, 1 Feb 2014 15:58:28 +0000 (12:58 -0300)]
upstream: [media] m88ds3103: possible uninitialized scalar variable

It was possible that tuner_frequency variable, used for carrier offset
compensation, was uninitialized. That happens when tuner
.get_frequency() callback is not defined.

Currently that case is not possible as only used tuner has this callback.

Coverity CID 1166057: Uninitialized scalar variable (UNINIT)

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] m88ds3103: remove dead code 2nd part
Antti Palosaari [Sat, 1 Feb 2014 15:30:28 +0000 (12:30 -0300)]
upstream: [media] m88ds3103: remove dead code 2nd part

Coverity CID 1166051: Logically dead code (DEADCODE)

TS clock calculation could be more accurate, but as it is not,
remove those unused clock speeds.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] ddbridge: remove unneeded an NULL check
Dan Carpenter [Sat, 1 Mar 2014 13:55:29 +0000 (10:55 -0300)]
upstream: [media] ddbridge: remove unneeded an NULL check

Static checkers complain about the inconsistent NULL check here.

There is an unchecked dereference of "input->fe" in the call to
tuner_attach_tda18271() and there is a second unchecked dereference a
couple lines later when we do:
input->fe2->tuner_priv = input->fe->tuner_priv;

But actually "intput->fe" can't be NULL because if demod_attach_drxk()
fails to allocate it, then we would have return an error code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] av7110_hw: fix a sanity check in av7110_fw_cmd()
Dan Carpenter [Sat, 1 Mar 2014 13:51:36 +0000 (10:51 -0300)]
upstream: [media] av7110_hw: fix a sanity check in av7110_fw_cmd()

ARRAY_SIZE(buf) (8 elements) was intended instead of sizeof(buf) (16
bytes).  But this is just a sanity check and the callers always pass
valid values so this doesn't cause a problem.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] rc: img-ir: add hardware decoder driver
James Hogan [Fri, 28 Feb 2014 23:28:54 +0000 (20:28 -0300)]
upstream: [media] rc: img-ir: add hardware decoder driver

Add remote control input driver for the ImgTec Infrared block hardware
decoder, which is set up with timings for a specific protocol and
supports mask/value filtering and wake events.

The hardware decoder timing values, raw data to scan code conversion
function and scan code filter to raw data filter conversion function
will be provided in separate files for each protocol which this part of
the driver can use. The new generic scan code filter interface is made
use of to reduce interrupts and control wake events.

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

Add raw IR remote control input driver for the ImgTec Infrared decoder
block's raw edge interrupts. Generic software protocol decoders are used
to allow multiple protocols to be supported at a time, including those
not supported by the hardware decoder.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] nuvoton-cir: Activate PNP device when probing
Antti Seppälä [Sun, 16 Feb 2014 10:16:02 +0000 (07:16 -0300)]
upstream: [media] nuvoton-cir: Activate PNP device when probing

On certain motherboards (mainly Intel NUC series) bios keeps the
Nuvoton CIR device disabled at boot.

This patch adds a call to kernel PNP layer to activate the device if it
is not already activated. This will improve the chances of the PNP probe
actually succeeding on Intel NUC platforms.

Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
Cc: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] Siano: smsusb - Add a device id for PX-S1UD
Satoshi Nagahama [Mon, 10 Feb 2014 09:45:29 +0000 (06:45 -0300)]
upstream: [media] Siano: smsusb - Add a device id for PX-S1UD

Add a device id to support for PX-S1UD (PLEX ISDB-T usb dongle) which
has sms2270.

Signed-off-by: Satoshi Nagahama <sattnag@aim.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] mem2mem_testdev: improve field handling
Hans Verkuil [Mon, 10 Mar 2014 13:58:29 +0000 (10:58 -0300)]
upstream: [media] mem2mem_testdev: improve field handling

try_fmt should just set field to NONE and not return an error if
a different field was passed.

buf_prepare should check if the field passed in from userspace has a
supported field value. At the moment only NONE is supported and ANY
is mapped to NONE.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] mem2mem_testdev: add USERPTR support
Hans Verkuil [Mon, 10 Mar 2014 13:58:26 +0000 (10:58 -0300)]
upstream: [media] mem2mem_testdev: add USERPTR support

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

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

v4l2_compliance fix.

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

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

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

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

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

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] adv7180: Add support for power down
Lars-Peter Clausen [Mon, 10 Mar 2014 17:05:39 +0000 (14:05 -0300)]
upstream: [media] adv7180: Add support for power down

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

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

Add support for async device registration to the adv7180 driver.

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l2: add VIDIOC_G/S_EDID support to the v4l2 core
Hans Verkuil [Fri, 7 Mar 2014 10:18:37 +0000 (07:18 -0300)]
upstream: [media] v4l2: add VIDIOC_G/S_EDID support to the v4l2 core

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

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

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

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

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l2-controls.h: Add addtional Flash fault bits
Daniel Jeong [Mon, 3 Mar 2014 09:52:08 +0000 (06:52 -0300)]
upstream: [media] v4l2-controls.h: Add addtional Flash fault bits

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

Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] s2255drv: memory leak fix
sensoray-dev [Fri, 28 Feb 2014 22:19:44 +0000 (19:19 -0300)]
upstream: [media] s2255drv: memory leak fix

Fixes memory leak introduced by
commit 47d8c881c304642a68d398b87d9e8846e643c81a.

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

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

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

This patch fixes the following warning:

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

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] media DocBook: fix NV16M description
Hans Verkuil [Sun, 2 Mar 2014 09:43:12 +0000 (06:43 -0300)]
upstream: [media] media DocBook: fix NV16M description

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

Fixed the text.

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

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

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

If NO_DMA=y:

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

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

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

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

BUG_ON is unnecessarily strict.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Rename to make it explicit.

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

Ensure that these ops are properly balanced.

There are two scenarios:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This code is only enabled if CONFIG_VIDEO_ADV_DEBUG is set.

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

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

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

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

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

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

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

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

This has been tested with both read and write.

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

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

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

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: Staging:media: Fix Sparse warnings incorrect type in lirc_sasem.c
Ebru Akagunduz [Wed, 5 Mar 2014 17:15:30 +0000 (19:15 +0200)]
upstream: Staging:media: Fix Sparse warnings incorrect type in lirc_sasem.c

This patch fixes following sparse warning in dgap.c
drivers/staging/media/lirc/lirc_sasem.c:392:32: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/media/lirc/lirc_sasem.c:392:32:    expected void const [noderef] <asn:1>*<noident>
drivers/staging/media/lirc/lirc_sasem.c:392:32:    got char const *buf
drivers/staging/media/lirc/lirc_sasem.c:123:28: warning: incorrect type in initializer (incompatible argument 2 (different address spaces))
drivers/staging/media/lirc/lirc_sasem.c:123:28:    expected int ( *write )( ... )
drivers/staging/media/lirc/lirc_sasem.c:123:28:    got int ( static [toplevel] *<noident> )( ... )

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoupstream: Staging:media: Fix Sparse Warnings "symbol was not declared. Should it...
Ebru Akagunduz [Wed, 5 Mar 2014 17:15:29 +0000 (19:15 +0200)]
upstream: Staging:media: Fix Sparse Warnings "symbol was not declared. Should it be static?"

This patch fixes the Sparse Warnings "symbol was
not declared. Should it be static?"

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoupstream: Staging: media/cxd2099: Fix line length over 80 characters
Monam Agarwal [Sat, 1 Mar 2014 22:40:04 +0000 (04:10 +0530)]
upstream: Staging: media/cxd2099: Fix line length over 80 characters

This patch fixes the following checkpatch.pl issues in cxd2099.c
WARNING: line length over 80 characters

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoupstream: staging:media: remove assignment in if condition
Himangi Saraogi [Sat, 1 Mar 2014 20:48:38 +0000 (02:18 +0530)]
upstream: staging:media: remove assignment in if condition

This patch removes the assignment in if conditions to do away with the
checkpatch warning :'do not use assignment in if condition'.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoupstream: [media] omap3isp: Fix kerneldoc for _module_sync_is_stopping and isp_isr()
Peter Meerwald [Fri, 28 Feb 2014 17:36:07 +0000 (14:36 -0300)]
upstream: [media] omap3isp: Fix kerneldoc for _module_sync_is_stopping and isp_isr()

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

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

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

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

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

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

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

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l: Use full 32 bits for buffer flags
Sakari Ailus [Sun, 25 Aug 2013 17:00:43 +0000 (14:00 -0300)]
upstream: [media] v4l: Use full 32 bits for buffer flags

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

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

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

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

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

Remove the footnote saying we always use realtime clock.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Luis Alves <ljalvs@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] rtl2832: add muxed I2C adapter for demod itself
Antti Palosaari [Tue, 3 Dec 2013 21:19:39 +0000 (18:19 -0300)]
upstream: [media] rtl2832: add muxed I2C adapter for demod itself

There was a deadlock between master I2C adapter and muxed I2C
adapter. Implement two I2C muxed I2C adapters and leave master
alone, just only for offering I2C adapter for these mux adapters.

Reported-by: Luis Alves <ljalvs@gmail.com>
Reported-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] rtl2832: provide muxed I2C adapter
Antti Palosaari [Tue, 26 Nov 2013 15:53:46 +0000 (12:53 -0300)]
upstream: [media] rtl2832: provide muxed I2C adapter

RTL2832 provides gated / repeater I2C adapter for tuner.
Implement it as a muxed I2C adapter.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] rtl2832: style changes and minor cleanup
Antti Palosaari [Sun, 13 Oct 2013 03:06:44 +0000 (00:06 -0300)]
upstream: [media] rtl2832: style changes and minor cleanup

Most of those were reported by checkpatch.pl...

debug module parameter is not used anywhere so remove it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] xc2028: silence compiler warnings
Antti Palosaari [Sat, 1 Feb 2014 00:55:47 +0000 (21:55 -0300)]
upstream: [media] xc2028: silence compiler warnings

There is now new tuner types which are not handled on that switch-case.
Print error if unknown tuner type is meet.

drivers/media/tuners/tuner-xc2028.c: In function ‘generic_set_freq’:
drivers/media/tuners/tuner-xc2028.c:1037:2: warning: enumeration value ‘V4L2_TUNER_ADC’ not handled in switch [-Wswitch]
  switch (new_type) {
  ^
drivers/media/tuners/tuner-xc2028.c:1037:2: warning: enumeration value ‘V4L2_TUNER_RF’ not handled in switch [-Wswitch]

Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] DocBook: document DVB DMX_[ADD|REMOVE]_PID
Mauro Carvalho Chehab [Tue, 18 Feb 2014 23:35:51 +0000 (20:35 -0300)]
upstream: [media] DocBook: document DVB DMX_[ADD|REMOVE]_PID

Those ioctls were added back in 2009, at changeset 1cb662a3144
but were never documented. Fortunately, the original commit is
good enough to serve as the basis for documenting it. Also, the
support for it is done by dmxdev implementation.

So, add a proper documentation for it, based on the description
of the original changeset.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] dvb_frontend: better handle lna set errors
Mauro Carvalho Chehab [Sun, 16 Feb 2014 09:36:17 +0000 (06:36 -0300)]
upstream: [media] dvb_frontend: better handle lna set errors

If an attempt to set LNA fails, restore the cache to LNA_AUTO,
in order to make it to reflect the current LNA status.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: Display the used DVB alternate
Mauro Carvalho Chehab [Sat, 25 Jan 2014 02:17:00 +0000 (23:17 -0300)]
upstream: [media] em28xx: Display the used DVB alternate

That helps to understand what's going there.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx_dvb: only call the software filter if data
Mauro Carvalho Chehab [Sun, 2 Mar 2014 11:20:54 +0000 (08:20 -0300)]
upstream: [media] em28xx_dvb: only call the software filter if data

Several URBs will be simply not filled. Don't call the DVB
core software filter for those empty URBs.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: implement em28xx_usb_driver suspend, resume, reset_resume...
Shuah Khan [Sat, 22 Feb 2014 00:50:18 +0000 (21:50 -0300)]
upstream: [media] em28xx: implement em28xx_usb_driver suspend, resume, reset_resume hooks

Implement em28xx_usb_driver suspend, resume, and reset_resume hooks.
These hooks will invoke em28xx core em28xx_suspend_extension() and
em28xx_resume_extension() to suspend and resume registered extensions.

Approach:
Add power management support to em28xx usb driver. This driver works in
conjunction with extensions for each of the functions on the USB device
for video/audio/dvb/remote functionality that is present on media USB
devices it supports. During suspend and resume each of these extensions
will have to do their part in suspending the components they control.

Adding suspend and resume hooks to the existing struct em28xx_ops will
enable the extensions the ability to implement suspend and resume hooks
to be called from em28xx driver. The overall approach is as follows:

-- add suspend and resume hooks to em28xx_ops
-- add suspend and resume routines to em28xx-core to invoke suspend
   and resume hooks for all registered extensions.
-- change em28xx dvb, audio, input, and video extensions to implement
   em28xx_ops: suspend and resume hooks. These hooks do what is necessary
   to suspend and resume the devices they control.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-video: implement em28xx_ops: suspend/resume hooks
Shuah Khan [Sat, 22 Feb 2014 00:50:17 +0000 (21:50 -0300)]
upstream: [media] em28xx-video: implement em28xx_ops: suspend/resume hooks

Implement em28xx_ops: suspend/resume hooks. em28xx usb driver will
invoke em28xx_ops: suspend and resume hooks for all its extensions
from its suspend() and resume() interfaces.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-input: implement em28xx_ops: suspend/resume hooks
Shuah Khan [Sat, 22 Feb 2014 00:50:16 +0000 (21:50 -0300)]
upstream: [media] em28xx-input: implement em28xx_ops: suspend/resume hooks

Implement em28xx_ops: suspend/resume hooks. em28xx usb driver will
invoke em28xx_ops: suspend and resume hooks for all its extensions
from its suspend() and resume() interfaces.

[m.chehab@samsung.com: Fix a breakage caused by calling a non-existing
 function call: schedule_delayed_work_sync(), and test if IR was defined
 at suspend/resume]

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-dvb: implement em28xx_ops: suspend/resume hooks
Shuah Khan [Sat, 22 Feb 2014 00:50:15 +0000 (21:50 -0300)]
upstream: [media] em28xx-dvb: implement em28xx_ops: suspend/resume hooks

Implement em28xx_ops: suspend/resume hooks. em28xx usb driver will
invoke em28xx_ops: suspend and resume hooks for all its extensions
from its suspend() and resume() interfaces.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx-audio: implement em28xx_ops: suspend/resume hooks
Shuah Khan [Sat, 22 Feb 2014 00:50:14 +0000 (21:50 -0300)]
upstream: [media] em28xx-audio: implement em28xx_ops: suspend/resume hooks

Implement em28xx_ops: suspend/resume hooks. em28xx usb driver will
invoke em28xx_ops: suspend and resume hooks for all its extensions
from its suspend() and resume() interfaces.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] em28xx: add suspend/resume to em28xx_ops
Shuah Khan [Sat, 22 Feb 2014 00:50:13 +0000 (21:50 -0300)]
upstream: [media] em28xx: add suspend/resume to em28xx_ops

em28xx usb driver will have to suspend and resume its extensions. Adding
suspend and resume to em28xx_ops gives extensions the ability to install
suspend and resume that can be invoked from em28xx_usb driver suspend()
and resume() interfaces.

Approach:
Add power management support to em28xx usb driver. This driver works in
conjunction with extensions for each of the functions on the USB device
for video/audio/dvb/remote functionality that is present on media USB
devices it supports. During suspend and resume each of these extensions
will have to do their part in suspending the components they control.

Adding suspend and resume hooks to the existing struct em28xx_ops will
enable the extensions the ability to implement suspend and resume hooks
to be called from em28xx driver. The overall approach is as follows:

-- add suspend and resume hooks to em28xx_ops
-- add suspend and resume routines to em28xx-core to invoke suspend
   and resume hooks for all registered extensions.
-- change em28xx dvb, audio, input, and video extensions to implement
   em28xx_ops: suspend and resume hooks. These hooks do what is necessary
   to suspend and resume the devices they control.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] au0828: rework GPIO management for HVR-950q
Devin Heitmueller [Mon, 19 Aug 2013 21:25:16 +0000 (18:25 -0300)]
upstream: [media] au0828: rework GPIO management for HVR-950q

Restructure the way we bring the various GPIOs out of reset.  In particular:

1.  we only need to setup the GPIOs as outputs once
2.  there's no point in writing 0x40 to register 0x00 since that's the EEPROM
    write protect and already it's configured as an input
3.  Separate out the act of enabling the power supply and bringing the tuner
    and demod out of reset.  If you don't then the chip may not be properly
    enabled (as the power supply is still ramping up when the chip comes
    out of reset).  This can result in probing failures.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] ds3000: fix reading array out of bound in ds3000_read_snr
Heinrich Schuchardt [Fri, 28 Feb 2014 02:04:08 +0000 (23:04 -0300)]
upstream: [media] ds3000: fix reading array out of bound in ds3000_read_snr

An attempt was made to read dvbs2_snr_tab[80],
though dvbs2_snr_tab has only 80 elements.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] stb6100: fix buffer length check in stb6100_write_reg_range()
Alexander Shiyan [Wed, 26 Feb 2014 02:41:14 +0000 (23:41 -0300)]
upstream: [media] stb6100: fix buffer length check in stb6100_write_reg_range()

We are checking sizeof() the wrong variable!

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] stv0900: remove an unneeded check
Dan Carpenter [Wed, 26 Feb 2014 02:26:41 +0000 (23:26 -0300)]
upstream: [media] stv0900: remove an unneeded check

No need to check lock twice here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] v4l2: Add settings for Horizontal and Vertical MV Search Range
Amit Grover [Tue, 4 Feb 2014 09:59:58 +0000 (06:59 -0300)]
upstream: [media] v4l2: Add settings for Horizontal and Vertical MV Search Range

Adding V4L2 controls for horizontal and vertical search range in pixels
for motion estimation module in video encoder.

Signed-off-by: Swami Nathan <swaminath.p@samsung.com>
Signed-off-by: Amit Grover <amit.grover@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] gspca_topro: Add a couple of missing length check in the packet...
Hans de Goede [Sun, 23 Feb 2014 22:01:58 +0000 (19:01 -0300)]
upstream: [media] gspca_topro: Add a couple of missing length check in the packet parsing code

Reported-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] gspca_kinect: fix messages about kinect_read() return value
Antonio Ospite [Mon, 30 Dec 2013 16:41:46 +0000 (13:41 -0300)]
upstream: [media] gspca_kinect: fix messages about kinect_read() return value

Messages relative to kinect_read() are printing "res" which contains the
return value of a previous kinect_write().

Print the correct value in the messages.

Cc: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] gspca_kinect: fix kinect_read() error path
Antonio Ospite [Mon, 30 Dec 2013 16:41:45 +0000 (13:41 -0300)]
upstream: [media] gspca_kinect: fix kinect_read() error path

The error checking code relative to the invocations of kinect_read()
does not return the actual return code of the function just called, it
returns "res" which still contains the value of the last invocation of
a previous kinect_write().

Return the proper value, and while at it also report with -EREMOTEIO the
case of a partial transfer.

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoupstream: [media] s2255drv: upgrade to videobuf2
sensoray-dev [Wed, 12 Feb 2014 20:25:45 +0000 (17:25 -0300)]
upstream: [media] s2255drv: upgrade to videobuf2

Upgrade to videobuf2 libraries.
No errors reported with "v4l2-compliance -s".

Signed-off-by: Dean Anderson <linux-dev@sensoray.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>