platform/kernel/linux-3.10.git
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 years agoupstream: [media] omap_vout: avoid sleep_on race
Arnd Bergmann [Thu, 2 Jan 2014 12:07:29 +0000 (09:07 -0300)]
upstream: [media] omap_vout: avoid sleep_on race

sleep_on and its variants are broken and going away soon. This changes
the omap vout driver to use wait_event_interruptible_timeout instead,
which fixes potential race where the dma is complete before we
schedule.

[hans.verkuil@cisco.com: replaced interruptible_sleep_on_timeout by
wait_event_interruptible_timeout in the commit msg, obvious typo]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] radio-cadet: avoid interruptible_sleep_on race
Hans Verkuil [Mon, 10 Feb 2014 10:21:36 +0000 (07:21 -0300)]
upstream: [media] radio-cadet: avoid interruptible_sleep_on race

interruptible_sleep_on is racy and going away. This replaces
one use in the radio-cadet driver with a wait_event_interruptible
call. Special care was taken that accesses to the rdsin and rdsout
indices are always done with dev->lock held.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] ths8200: Format adjustment
Martin Bugge [Fri, 7 Feb 2014 08:11:05 +0000 (05:11 -0300)]
upstream: [media] ths8200: Format adjustment

Closer inspection on exact transmitted format showed that
we needed to add 1 on vertical sync.

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] ths8200: Corrected sync polarities setting
Martin Bugge [Fri, 7 Feb 2014 08:11:04 +0000 (05:11 -0300)]
upstream: [media] ths8200: Corrected sync polarities setting

HS_IN/VS_IN was always set to positive.

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] ths8200: Zero blanking level for RGB
Martin Bugge [Fri, 7 Feb 2014 08:11:03 +0000 (05:11 -0300)]
upstream: [media] ths8200: Zero blanking level for RGB

Currently only RGB444 input data is supported so set to zero.

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] s2255drv: cleanup of s2255_fh
Dean Anderson [Wed, 5 Feb 2014 20:38:42 +0000 (17:38 -0300)]
upstream: [media] s2255drv: cleanup of s2255_fh

Removal of unnecessary parameters from s2255_fh.

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>
9 years agoupstream: [media] s2255drv: fix for return code not checked
Dean Anderson [Wed, 5 Feb 2014 18:58:20 +0000 (15:58 -0300)]
upstream: [media] s2255drv: fix for return code not checked

Start acquisition return code was not being checked.  Return error
if start acquisition fails.

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>
9 years agoupstream: [media] s2255drv: dynamic memory allocation efficiency fix
Dean Anderson [Wed, 5 Feb 2014 18:43:51 +0000 (15:43 -0300)]
upstream: [media] s2255drv: dynamic memory allocation efficiency fix

Driver was allocating a kernel buffer each time it was sending a command.
It is better to allocate this buffer once at startup.

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>
9 years agoupstream: [media] s2255drv: remove redundant parameter
Dean Anderson [Wed, 5 Feb 2014 18:18:55 +0000 (15:18 -0300)]
upstream: [media] s2255drv: remove redundant parameter

Removing duplicate fmt from buffer structure.

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>
9 years agoupstream: [media] s2255drv: buffer setup fix
Dean Anderson [Wed, 5 Feb 2014 17:58:06 +0000 (14:58 -0300)]
upstream: [media] s2255drv: buffer setup fix

Buffer setup should check if minimum number of buffers is used.

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>
9 years agoupstream: [media] s2255drv: refactoring s2255_channel to s2255_vc
Dean Anderson [Tue, 4 Feb 2014 21:16:24 +0000 (18:16 -0300)]
upstream: [media] s2255drv: refactoring s2255_channel to s2255_vc

Renaming s2255_channel and all instances of channel to vc (video channel).

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>
9 years agoupstream: [media] s2255drv: removal of s2255_dmaqueue structure
Dean Anderson [Tue, 4 Feb 2014 20:18:03 +0000 (17:18 -0300)]
upstream: [media] s2255drv: removal of s2255_dmaqueue structure

Removal of unused and unnecessary s2255dma_queue structure.

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>
9 years agoupstream: [media] davinci: vpfe: remove deprecated IRQF_DISABLED
Michael Opdenacker [Mon, 9 Dec 2013 10:16:22 +0000 (07:16 -0300)]
upstream: [media] davinci: vpfe: remove deprecated IRQF_DISABLED

This patch proposes to remove the use of the IRQF_DISABLED flag

It's a NOOP since 2.6.35 and it will be removed one day.

Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] staging: davinci_vpfe: fix error check
Levente Kurusa [Sat, 15 Feb 2014 10:17:11 +0000 (07:17 -0300)]
upstream: [media] staging: davinci_vpfe: fix error check

The check would check the pointer, which is never less than 0.
According to the error message, the correct check would be
to check the return value of ipipe_mode. Check that instead.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Levente Kurusa <levex@linux.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] uvcvideo: Enable VIDIOC_CREATE_BUFS
Philipp Zabel [Wed, 29 Jan 2014 16:13:52 +0000 (13:13 -0300)]
upstream: [media] uvcvideo: Enable VIDIOC_CREATE_BUFS

This patch enables the ioctl to create additional buffers on the
videobuf2 capture queue.

[laurent.pinchart@ideasonboard.com: Acquire privileges instead of just
checking them in VIDIOC_CREATE_BUFS implementation]

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
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] uvcvideo: Remove duplicate check for number of buffers in queue_setup
Laurent Pinchart [Tue, 18 Feb 2014 13:02:50 +0000 (10:02 -0300)]
upstream: [media] uvcvideo: Remove duplicate check for number of buffers in queue_setup

videobuf2 already ensures that the number of buffers will not exceed
VIDEO_MAX_FRAME, which is equal to our arbitraty limit of
UVC_MAX_VIDEO_BUFFERS. Remove the duplicate check.

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] uvcvideo: Update uvc_endpoint_max_bpi to handle USB_SPEED_WIRELESS...
Thomas Pugliese [Fri, 24 Jan 2014 21:17:28 +0000 (18:17 -0300)]
upstream: [media] uvcvideo: Update uvc_endpoint_max_bpi to handle USB_SPEED_WIRELESS devices

Isochronous endpoints on devices with speed == USB_SPEED_WIRELESS can
have a max packet size ranging from 1-3584 bytes.  Add a case to
uvc_endpoint_max_bpi to handle USB_SPEED_WIRELESS.  Otherwise endpoints
for those devices will fall to the default case which masks off any
values > 2047.  This causes uvc_init_video to underestimate the
bandwidth available and fail to find a suitable alt setting for high
bandwidth video streams.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] uvcvideo: Simplify redundant check
Oliver Neukum [Thu, 23 Jan 2014 10:28:24 +0000 (07:28 -0300)]
upstream: [media] uvcvideo: Simplify redundant check

x < constant implies x + unsigned < constant
That check just obfuscates the code

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mt9v032: Check return value of clk_prepare_enable/clk_set_rate
Lad, Prabhakar [Fri, 17 Jan 2014 09:22:47 +0000 (06:22 -0300)]
upstream: [media] mt9v032: Check return value of clk_prepare_enable/clk_set_rate

clk_set_rate(), clk_prepare_enable() functions can fail, so check the return
values to avoid surprises.

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>
9 years agoupstream: [media] mt9p031: Check return value of clk_prepare_enable/clk_set_rate
Lad, Prabhakar [Tue, 21 Jan 2014 05:20:57 +0000 (02:20 -0300)]
upstream: [media] mt9p031: Check return value of clk_prepare_enable/clk_set_rate

clk_set_rate(), clk_prepare_enable() functions can fail, so check the return
values to avoid surprises.

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>
9 years agoupstream: [media] mt9p031: Add support for PLL bypass
Laurent Pinchart [Sun, 9 Feb 2014 20:31:47 +0000 (17:31 -0300)]
upstream: [media] mt9p031: Add support for PLL bypass

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

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mt9p031: Fix typo in comment
Laurent Pinchart [Sat, 8 Feb 2014 16:31:58 +0000 (13:31 -0300)]
upstream: [media] mt9p031: Fix typo in comment

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mt9t001: Add clock support
Laurent Pinchart [Sat, 8 Feb 2014 16:33:46 +0000 (13:33 -0300)]
upstream: [media] mt9t001: Add clock support

The sensor needs a master clock, handle it explictly in the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mt9t001: Add regulator support
Laurent Pinchart [Sat, 8 Feb 2014 16:33:46 +0000 (13:33 -0300)]
upstream: [media] mt9t001: Add regulator support

The sensor needs two power supplies, VAA and VDD. Require a regulator
for each of them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] omap3isp: Don't ignore failure to locate external subdev
Laurent Pinchart [Sat, 15 Feb 2014 00:45:50 +0000 (21:45 -0300)]
upstream: [media] omap3isp: Don't ignore failure to locate external subdev

A failure to locate the external subdev for a non memory-to-memory
pipeline is a fatal error, don't ignore it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Tested-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] vivi: queue_setup improvements
Hans Verkuil [Mon, 10 Feb 2014 11:08:47 +0000 (08:08 -0300)]
upstream: [media] vivi: queue_setup improvements

Drop the vid_limit module option: there is really no need to limit this.
No other driver does that. If you try to allocate more buffers then vb2
will automatically reduce the number of buffers anyway.

Also add sanity checks if the size in the fmt argument is going to be
used and drop the code that checks against *nbuffers == 0: this can
never happen (the vb2 framework ensures that) and the code was wrong
anyway since *nbuffers should have been set to the minimum number of
required buffers which is 1 for this driver.

Since vivi is often used as a template driver it is good to have this
driver be as compliant as possible. This broken code was for example
copied to the s2255 driver (which is being fixed as well).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] vivi: drop unused field
Hans Verkuil [Mon, 10 Feb 2014 11:08:46 +0000 (08:08 -0300)]
upstream: [media] vivi: drop unused field

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] radio-usb-si4713: make array of structs const
Hans Verkuil [Mon, 10 Feb 2014 11:08:43 +0000 (08:08 -0300)]
upstream: [media] radio-usb-si4713: make array of structs const

The start_seq[] should be const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] it913x-fe: Dead code remove driver
Malcolm Priestley [Thu, 13 Feb 2014 21:29:33 +0000 (18:29 -0300)]
upstream: [media] it913x-fe: Dead code remove driver

This driver has been replaced by af9033 and tuner_it913x

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] it913x: dead code Remove driver
Malcolm Priestley [Thu, 13 Feb 2014 21:28:28 +0000 (18:28 -0300)]
upstream: [media] it913x: dead code Remove driver

Following moving ids to af9035.

This driver is no longer in use.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] af9035: use default i2c slave address for af9035 too
Antti Palosaari [Wed, 12 Feb 2014 18:50:17 +0000 (15:50 -0300)]
upstream: [media] af9035: use default i2c slave address for af9035 too

Some device vendors has forgotten set correct slave demod I2C address
to eeprom. Use default I2C address when eeprom has no address at all.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] af9035: Add remaining it913x dual ids to af9035
Malcolm Priestley [Sun, 9 Feb 2014 13:04:06 +0000 (10:04 -0300)]
upstream: [media] af9035: Add remaining it913x dual ids to af9035

As follow on to patch
af9035: Move it913x single devices to af9035
and patch 1.

SNR is reported as db/10 values.

All dual ids are added to af9035 and it913x driver disabled.

it913x/it913x-fe removal patches to follow.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] af9035: add default 0x9135 slave I2C address
Malcolm Priestley [Sun, 9 Feb 2014 13:02:49 +0000 (10:02 -0300)]
upstream: [media] af9035: add default 0x9135 slave I2C address

On some devices the vendor has not set EEPROM_2ND_DEMOD_ADDR.

Checks tmp is not zero after call to get EEPROM_2ND_DEMOD_ADDR and sets the
default slave address of 0x3a on 0x9135 devices.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] af9035: Move it913x single devices to af9035
Malcolm Priestley [Sat, 8 Feb 2014 16:11:16 +0000 (13:11 -0300)]
upstream: [media] af9035: Move it913x single devices to af9035

The generic v1 and v2 devices have been all tested.

IDs tested
USB_PID_ITETECH_IT9135 v1 & v2
USB_PID_ITETECH_IT9135_9005 v1
USB_PID_ITETECH_IT9135_9006 v2

Current Issues
There is no signal  on
USB_PID_ITETECH_IT9135 v2

No SNR reported all devices.

All single devices tune and scan fine.

All remotes tested okay.

Dual device failed to register second adapter
USB_PID_KWORLD_UB499_2T_T09
It is not clear what the problem is at the moment.

So only single IDs are transferred in this patch.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] tda10071: coding style issues
Antti Palosaari [Tue, 11 Feb 2014 18:13:46 +0000 (15:13 -0300)]
upstream: [media] tda10071: coding style issues

Fix some coding style issues, mostly reported by checkpatch.pl.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] tda10071: do not check tuner PLL lock on read_status()
Antti Palosaari [Tue, 11 Feb 2014 03:17:37 +0000 (00:17 -0300)]
upstream: [media] tda10071: do not check tuner PLL lock on read_status()

Tuner PLL lock flag was mapped to FE_HAS_SIGNAL, which is wrong. PLL
lock has nothing to do with received signal. In real life that flag
is always set.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] tda10071: remove a duplicative test
Dan Carpenter [Thu, 30 Jan 2014 12:00:34 +0000 (09:00 -0300)]
upstream: [media] tda10071: remove a duplicative test

"ret" is an error code here, we already tested that.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl28xxu: add ID [0ccd:00b4] TerraTec NOXON DAB Stick (rev 3)
Till Dörges [Tue, 11 Feb 2014 20:27:57 +0000 (17:27 -0300)]
upstream: [media] rtl28xxu: add ID [0ccd:00b4] TerraTec NOXON DAB Stick (rev 3)

I've got the following DAB USB stick that also works fine with the
DVB_USB_RTL28XXU driver after I added its USB ID:
Bus 001 Device 009: ID 0ccd:00b4 TerraTec Electronic GmbH

[crope@iki.fi: apply patch partly manually]
Signed-off-by: Till Dörges <till@doerges.net>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: dma-buf: avoid using IS_ERR_OR_NULL
Colin Cross [Sat, 21 Dec 2013 00:43:50 +0000 (16:43 -0800)]
upstream: dma-buf: avoid using IS_ERR_OR_NULL

dma_buf_map_attachment and dma_buf_vmap can return NULL or
ERR_PTR on a error.  This encourages a common buggy pattern in
callers:
sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL);
if (IS_ERR_OR_NULL(sgt))
                return PTR_ERR(sgt);

This causes the caller to return 0 on an error.  IS_ERR_OR_NULL
is almost always a sign of poorly-defined error handling.

This patch converts dma_buf_map_attachment to always return
ERR_PTR, and fixes the callers that incorrectly handled NULL.
There are a few more callers that were not checking for NULL
at all, which would have dereferenced a NULL pointer later.
There are also a few more callers that correctly handled NULL
and ERR_PTR differently, I left those alone but they could also
be modified to delete the NULL check.

This patch also converts dma_buf_vmap to always return NULL.
All the callers to dma_buf_vmap only check for NULL, and would
have dereferenced an ERR_PTR and panic'd if one was ever
returned. This is not consistent with the rest of the dma buf
APIs, but matches the expectations of all of the callers.

Signed-off-by: Colin Cross <ccross@android.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoupstream: [media, edac] Change my email address
Mauro Carvalho Chehab [Fri, 7 Feb 2014 10:03:07 +0000 (08:03 -0200)]
upstream: [media, edac] Change my email address

There are several left overs with my old email address.
Remove their occurrences and add myself at CREDITS, to
allow people to be able to reach me on my new addresses.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] nuvoton-cir: Don't touch PS/2 interrupts while initializing
Antti Seppälä [Sat, 25 Jan 2014 09:57:46 +0000 (06:57 -0300)]
upstream: [media] nuvoton-cir: Don't touch PS/2 interrupts while initializing

There are reports[1] that on some motherboards loading the nuvoton-cir
disables PS/2 keyboard input. This is caused by an erroneous write of
CIR_INTR_MOUSE_IRQ_BIT to ACPI control register.

According to datasheet the write enables mouse power management event
interrupts which will probably have ill effects if the motherboard has
only one PS/2 port with keyboard in it.

The cir hardware does not need mouse interrupts to function and should
not touch them. This patch removes the illegal writes and registry
definitions.

[1] http://ubuntuforums.org/showthread.php?t=2106277&p=12461912&mode=threaded#post12461912

Reported-by: Bruno Maire <bruno.maire@besonet.ch>
Tested-by: Bruno Maire <bruno.maire@besonet.ch>
Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] cx23885: Fix tuning regression for TeVii S471
Joakim Hernberg [Fri, 31 Jan 2014 10:15:48 +0000 (07:15 -0300)]
upstream: [media] cx23885: Fix tuning regression for TeVii S471

When tuning to 10818V on Astra 28E2, the system tunes to 11343V
instead. This is a regression in the S471 driver introduced with the
changeset: b43ea8068d2090cb1e44632c8a938ab40d2c7419 [media] cx23885:
Fix TeVii S471 regression since introduction of ts2020.

Suggested-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Joakim Hernberg <jhernberg@alchemy.lu>
Tested-by: Mark Clarkstone <hello@markclarkstone.co.uk>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mceusb: improve error logging
Sean Young [Mon, 20 Jan 2014 22:10:44 +0000 (19:10 -0300)]
upstream: [media] mceusb: improve error logging

A number of recent bug reports involve usb_submit_urb() failing which was
only reported with debug parameter on. In addition, remove custom debug
function.

[m.chehab@samsung.com: patch rebased, as one of the patches on this
 series need changes]
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] iguanair: simplify tx loop
Sean Young [Mon, 20 Jan 2014 22:10:39 +0000 (19:10 -0300)]
upstream: [media] iguanair: simplify tx loop

Make the code simpler.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] iguanair: explain tx carrier setup
Sean Young [Mon, 20 Jan 2014 22:10:38 +0000 (19:10 -0300)]
upstream: [media] iguanair: explain tx carrier setup

Just comments. No functional changes.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx-i2c: fix the error code for unknown errors
Frank Schaefer [Sun, 19 Jan 2014 21:48:35 +0000 (18:48 -0300)]
upstream: [media] em28xx-i2c: fix the error code for unknown errors

Commit e63b009d6e "em28xx-i2c: Fix error code for I2C error transfers"
changed the code to return -ETIMEDOUT on all unknown errors.
But the proper error code for unknown errors is -EIO.
So only report -ETIMEDOUT in case of the errors 0x02 and 0x04, which
are according to Mauro Carvalho Chehab's tests related to i2c clock
stretching and return -EIO for the rest.

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-i2c: fix the i2c error description strings for -ENXIO
Frank Schaefer [Sun, 19 Jan 2014 21:48:34 +0000 (18:48 -0300)]
upstream: [media] em28xx-i2c: fix the i2c error description strings for -ENXIO

Commit d845fb3ae5 "em28xx-i2c: add timeout debug information if i2c_debug enabled"
has added wrong error descriptions for -ENXIO.
The strings are also missing terminating newline characters, which breaks the
output format.

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: do not call em28xx_init_camera() if the device has...
Frank Schaefer [Fri, 17 Jan 2014 17:45:32 +0000 (14:45 -0300)]
upstream: [media] em28xx-v4l: do not call em28xx_init_camera() if the device has no sensor

This avoids the unnecessary temporary registration of a dummy V4L2 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-camera: fix return value checks on sensor probing
Frank Schaefer [Fri, 17 Jan 2014 17:45:31 +0000 (14:45 -0300)]
upstream: [media] em28xx-camera: fix return value checks on sensor probing

Since commit e63b009d6e the returned error code in case of not connected/responding
i2c clients is ENXIO isntead of ENODEV, which causes several error messages on
sensor probing.
Fix the i2c return value checks on sensor probing to silence these warnings.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] media: rc: add raw decoder for Sharp protocol
James Hogan [Fri, 17 Jan 2014 13:58:48 +0000 (10:58 -0300)]
upstream: [media] media: rc: add raw decoder for Sharp protocol

Add a raw decoder for the Sharp protocol. It uses a pulse distance
modulation with a pulse of 320us and a bit period of 2ms for a logical 1
and 1ms for a logical 0. The first part of the message consists of a
5-bit address, an 8-bit command, and two other bits, followed by a 40ms
gap before the echo message which is an inverted version of the main
message except for the address bits.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] media: rc: add Sharp infrared protocol
James Hogan [Fri, 17 Jan 2014 13:58:47 +0000 (10:58 -0300)]
upstream: [media] media: rc: add Sharp infrared protocol

Add Sharp infrared protocol constants RC_TYPE_SHARP and RC_BIT_SHARP.

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: only turn on LED if keypress generated
James Hogan [Thu, 16 Jan 2014 22:56:22 +0000 (19:56 -0300)]
upstream: [media] media: rc: only turn on LED if keypress generated

Since v3.12, specifically 153a60bb0fac ([media] rc: add feedback led
trigger for rc keypresses), an LED trigger is activated on IR keydown
whether or not a keypress is generated (i.e. even if there's no matching
keycode). However the repeat and keyup logic isn't used unless there is
a keypress, which results in non-keypress keydown events turning on the
LED and not turning it off again.

On the assumption that the intent was for the LED only to light up on
valid key presses (you probably don't want it lighting up for the wrong
remote control for example), move the led_trigger_event() call inside
the keycode check.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] FE_READ_SNR and FE_READ_SIGNAL_STRENGTH docs
Georgi Chorbadzhiyski [Thu, 16 Jan 2014 15:07:11 +0000 (12:07 -0300)]
upstream: [media] FE_READ_SNR and FE_READ_SIGNAL_STRENGTH docs

Around 01/14/2014 06:07 PM, Mauro Carvalho Chehab scribbled:
> Em Tue, 14 Jan 2014 17:55:19 +0200
> Georgi Chorbadzhiyski <gf@unixsol.org> escreveu:
>> Around 01/14/2014 05:30 PM, Mauro Carvalho Chehab scribbled:
>>> Em Tue, 14 Jan 2014 17:16:10 +0200
>>> Georgi Chorbadzhiyski <gf@unixsol.org> escreveu:
>>>
>>>> Hi guys, I'm confused the documentation on:
>>>>
>>>> http://linuxtv.org/downloads/v4l-dvb-apis/frontend_fcalls.html#FE_READ_SNR
>>>> http://linuxtv.org/downloads/v4l-dvb-apis/frontend_fcalls.html#FE_READ_SIGNAL_STRENGTH
>>>>
>>>> states that these ioctls return int16_t values but frontend.h states:
>>>>
>>>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/dvb/frontend.h
>>>>
>>>> #define FE_READ_SIGNAL_STRENGTH  _IOR('o', 71, __u16)
>>>> #define FE_READ_SNR              _IOR('o', 72, __u16)
>>>>
>>>> So which one is true?
>>>
>>> Documentation is wrong. The returned values are unsigned. Would you mind send
>>> us a patch fixing it?
>>
>> I would be happy to, but I can't find the repo that holds the documentation.
>
> It is in the Kernel tree, under Documentation/DocBook/media/dvb.

The attached file contains the discussed documentation fixes.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] DocBook media: drop the old incorrect packed RGB table
Hans Verkuil [Tue, 7 Jan 2014 13:01:27 +0000 (10:01 -0300)]
upstream: [media] DocBook media: drop the old incorrect packed RGB table

The old table is most definitely wrong. All applications and all
drivers that I have ever tested follow the corrected table. Furthermore,
that's what all applications expect as well. Any drivers that do not
follow the corrected table are broken and should be fixed.

This patch drops the old table and replaces it with the corrected
table. This should prevent a lot of confusion.

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 three sections of common.xml
Hans Verkuil [Tue, 7 Jan 2014 12:39:57 +0000 (09:39 -0300)]
upstream: [media] DocBook media: update three sections of common.xml

Updates for the "Tuners and Modulators", "Video Standards" and
"Digital Video (DV) Timings" sections.

Besides lots of trivial little fixes the main changes are:

- Remove two footnotes from "Video Standards": the first is a discussion
  of alternative methods of setting standards, which is pretty pointless
  since the standards API is effectively frozen anyway, and the second
  points to 'rationale' that makes little or no sense to me.

- Clarify a few things in the "Digital Video (DV) Timings" section.
  It was awkwardly formatted as well: there used to be a list with
  multiple bullets that has been reduced to a single item, so drop the
  list and rewrite that text.

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: Cleanup some sections at common.xml
Hans Verkuil [Tue, 7 Jan 2014 11:17:35 +0000 (08:17 -0300)]
upstream: [media] DocBook media: Cleanup some sections at common.xml

Updates sections "Querying Capabilities", "Application Priority",
"Video Inputs and Outputs" and "Audio Inputs and Outputs".

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 copyright years and Introduction
Hans Verkuil [Tue, 7 Jan 2014 09:46:37 +0000 (06:46 -0300)]
upstream: [media] DocBook media: update copyright years and Introduction

It's now 2014, so update those copyright years. Also fix a typo in the introduction
and mention that this document also covers output, codec and remote control
devices.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l2-dv-timings.h: add new 4K DMT resolutions
Hans Verkuil [Fri, 31 Jan 2014 13:32:15 +0000 (10:32 -0300)]
upstream: [media] v4l2-dv-timings.h: add new 4K DMT resolutions

VESA added two new DMT timings in their latest standard document. Add these
to v4l2-dv-timings.h.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] s2255drv: checkpatch fix: coding style fix
sensoray-dev [Wed, 29 Jan 2014 18:24:07 +0000 (15:24 -0300)]
upstream: [media] s2255drv: checkpatch fix: coding style fix

Fixes all style warnings from scripts/checkpatch -f

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>
9 years agoupstream: [media] radio-keene: Use module_usb_driver
Sachin Kamat [Mon, 27 Jan 2014 11:56:02 +0000 (08:56 -0300)]
upstream: [media] radio-keene: Use module_usb_driver

module_usb_driver eliminates the boilerplate and makes the code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] s3c-camif: Remove use of deprecated V4L2_CTRL_FLAG_DISABLED
Hans Verkuil [Mon, 20 Jan 2014 09:27:09 +0000 (06:27 -0300)]
upstream: [media] s3c-camif: Remove use of deprecated V4L2_CTRL_FLAG_DISABLED

I came across this while checking the kernel use of V4L2_CTRL_FLAG_DISABLED.

This flag should not be used with the control framework. Instead, just don't
add the control at all.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] hdpvr: Fix memory leak in debug
Masanari Iida [Fri, 17 Jan 2014 16:38:00 +0000 (13:38 -0300)]
upstream: [media] hdpvr: Fix memory leak in debug

cppcheck reported memory leak in device_authorizatio()
within hdpvr-core.c.
When the debug option is specified and the code jump to
"unlock:" label, print_buf was not freed.
Confirm the module succesfully compiled without error.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mxl111sf: Fix unintentional garbage stack read
Dave Jones [Thu, 30 Jan 2014 03:11:33 +0000 (00:11 -0300)]
upstream: [media] mxl111sf: Fix unintentional garbage stack read

mxl111sf_read_reg takes an address of a variable to write to as an argument.
drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c:mxl111sf_config_pin_mux_modes
passes several uninitialized stack variables to this routine, expecting
them to be filled in.  In the event that something unexpected happens when
reading from the chip, we end up doing a pr_debug of the value passed in,
revealing whatever garbage happened to be on the stack.

Change the pr_debug to match what happens in the 'success' case, where we
assign buf[1] to *data.

Spotted with Coverity (Bugs 731910 through 731917)

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] cx24117: use a valid dev pointer for dev_err printout
Andi Shyti [Thu, 30 Jan 2014 03:06:41 +0000 (00:06 -0300)]
upstream: [media] cx24117: use a valid dev pointer for dev_err printout

Don't use '&state->priv->i2c->dev' reference to device because
state is still 'NULL'. Use '&i2c->dev' instead.

This bug has been reported by scan.coverity.com

Signed-off-by: Andi Shyti <andi@etezian.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Cc: vger@stable.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>