platform/kernel/linux-3.10.git
9 years agoupstream: [media] drx-j: put under 3-clause BSD license
Devin Heitmueller [Sun, 4 Jul 2010 21:42:11 +0000 (18:42 -0300)]
upstream: [media] drx-j: put under 3-clause BSD license

Relicense the drx-j driver under a standard 3-clause BSD license, which makes
it GPL compatible.

This was done explicitly with permission from Trident Microsystems.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] drx-j: add a driver for Trident drx-j frontend
Devin Heitmueller [Tue, 14 Aug 2012 00:18:02 +0000 (21:18 -0300)]
upstream: [media] drx-j: add a driver for Trident drx-j frontend

Add support for the Trident DRX-J driver, including a card profile for the
PCTV 80e which uses the chip.

Thanks to Trident for allowing the release of this code under a BSD license,
and of course Hauppauge/PCTV for pushing for its release to the community.

[pdickeybeta@gmail.com: modified to fix compilation errors and also to move
 the driver files from the drx39xy subdirectory to the frontends directory]

[m.chehab@samsung.com: fix merge conflicts, commented drx-j compilation and
 added EM28XX_R06_I2C_CLK setup also to the board setup]

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] drxk: remove the option to load firmware asynchronously
Mauro Carvalho Chehab [Mon, 13 Jan 2014 07:31:31 +0000 (04:31 -0300)]
upstream: [media] drxk: remove the option to load firmware asynchronously

The option to load firmware asynchronously were added due to
a requirement with a few versions of udev. It turns that this was
a bad idea and caused regressions on drxk-based devices.

So, we end by only letting the firmware to be loaded syncronously
everywhere.

So, let's remove the bad code.

This patch partially reverts the changeset 8e30783b0b3.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] dib8000: fix compilation error
Mauro Carvalho Chehab [Fri, 20 Dec 2013 10:11:31 +0000 (08:11 -0200)]
upstream: [media] dib8000: fix compilation error

As reported by  kbuild test robot <fengguang.wu@intel.com>:

with a random config:

   drivers/built-in.o: In function `dib8000_get_time_us.isra.16':
>> dib8000.c:(.text+0x3075aa): undefined reference to `__udivdi3'

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] m88ds3103: fix possible i2c deadlock
Antti Palosaari [Sun, 8 Dec 2013 22:19:11 +0000 (19:19 -0300)]
upstream: [media] m88ds3103: fix possible i2c deadlock

Adapter is locked by I2C core already. Use unlocked i2c_transfer()
version __i2c_transfer() to avoid deadlock.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] drxd_hard: fix sparse warnings
Hans Verkuil [Fri, 4 Oct 2013 14:01:44 +0000 (11:01 -0300)]
upstream: [media] drxd_hard: fix sparse warnings

drivers/media/dvb-frontends/drxd_hard.c:1017:70: warning: Using plain integer as NULL pointer
drivers/media/dvb-frontends/drxd_hard.c:1038:69: warning: Using plain integer as NULL pointer
drivers/media/dvb-frontends/drxd_hard.c:2836:33: warning: Using plain integer as NULL pointer
drivers/media/dvb-frontends/drxd_hard.c:2972:30: warning: Using plain integer as NULL pointer

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] stb0899: restore minimal rate to 5Mbauds
Mauro Carvalho Chehab [Fri, 5 Jul 2013 13:31:43 +0000 (10:31 -0300)]
upstream: [media] stb0899: restore minimal rate to 5Mbauds

According with Manu Abraham, stb0899 seek algorithm is broken
for symbol rates bellow to 5Mbauds. So, revert those patches:

55b3318 [media] stb0899: allow minimum symbol rate of 2000000
2eeed77 [media] stb0899: allow minimum symbol rate of 1000000

Requested-by: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] drxk_hard.h: don't use more than 80 columns
Mauro Carvalho Chehab [Sun, 28 Apr 2013 14:47:49 +0000 (11:47 -0300)]
upstream: [media] drxk_hard.h: don't use more than 80 columns

X-Patchwork-Delegate: mchehab@redhat.com
Almost all 80-col warnings are related to comments. There's
one, however, that it is due to a one-line enum declaration
for enum agc_ctrl_mode.
Break it into one line per enumered data.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] drxk_hard: use usleep_range()
Mauro Carvalho Chehab [Sun, 28 Apr 2013 14:47:47 +0000 (11:47 -0300)]
upstream: [media] drxk_hard: use usleep_range()

X-Patchwork-Delegate: mchehab@redhat.com
Fixes the following checkpatch.pl warnings:
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(10);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] drxk_hard: use pr_info/pr_warn/pr_err/... macros
Mauro Carvalho Chehab [Sun, 28 Apr 2013 14:47:45 +0000 (11:47 -0300)]
upstream: [media] drxk_hard: use pr_info/pr_warn/pr_err/... macros

X-Patchwork-Delegate: mchehab@redhat.com
replace all occurrences of  printk(KERN_* by
pr_info/pr_warn/pr_err/pr_debug/pr_cont macros.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] stb0899: allow minimum symbol rate of 2000000
Zoran Turalija [Sun, 2 Jun 2013 17:56:33 +0000 (14:56 -0300)]
upstream: [media] stb0899: allow minimum symbol rate of 2000000

Looks like product datasheets for tuners containing STB0899 are
suggesting specification for min. symbol rate of 2MS/s.
Some specs found here, all suggesting 2MS/s for min. symbol rate:
    Comtech DVBS2-6899
      http://comtech.sg1002.myweb.hinet.net/pdf/dvbs2-6899.pdf
    TechniSat SkyStar HD2
      http://www.scaistar.com/skystar2/skystarhd2.htm
    Azurewave AD-SP400
      http://www.pulsat.com/products/AzureWave-AD%252dSP400-High-Definition-PC-Card.html
New patch:
This makes minimum symbol rate driver capabilities on par with some
accessible datasheet specifications*, and allows tuning on linux to
transponders that have symbol rate between 2000000-5000000, too.
Patch was tested successfully on Eutelsat 16A transponders that
became reachable with it (2000000 < symbol rate < 5000000):
      * DVB/S  12507050 V  2532000 3/4
      * DVB/S2 12574000 V  4355000 3/4 8PSK
      * DVB/S  12593000 V  2500000 2/3
      * DVB/S  12596940 V  2848000 2/3
      * DVB/S  12600750 V  2500000 1/2
      * DVB/S  12675590 H  4248000 3/4
(*) Datasheet: http://comtech.sg1002.myweb.hinet.net/pdf/dvbs2-6899.pdf
        Maximum Symbol Rate
        QPSK/LDPC/PCH: 20-30Mbps
        8PSK/LDPC/BCH: 10-30Mbps
        DVB: 2-45Mbps
             ^--------- min. symbol rate

Signed-off-by: Zoran Turalija <zoran.turalija@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] stb0899: allow minimum symbol rate of 1000000
Zoran Turalija [Sun, 2 Jun 2013 17:40:51 +0000 (14:40 -0300)]
upstream: [media] stb0899: allow minimum symbol rate of 1000000

This makes minimum symbol rate driver capabilities on par with
windows driver, and allows tuning on linux to transponders that
have symbol rate below 5000000, too.
Patch was tested successfully on Eutelsat 16A transponders that
became reachable with it (1000000 < symbol rate < 5000000):
      * DVB/S  12507050 V  2532000 3/4
      * DVB/S2 12574000 V  4355000 3/4 8PSK
      * DVB/S  12593000 V  2500000 2/3
      * DVB/S  12596940 V  2848000 2/3
      * DVB/S  12600750 V  2500000 1/2
      * DVB/S  12675590 H  4248000 3/4

Signed-off-by: Zoran Turalija <zoran.turalija@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] rtl28xxu: add [1b80:d3af] Sveon STV27
Alessandro Miceli [Sun, 4 May 2014 10:50:31 +0000 (07:50 -0300)]
upstream: [media] rtl28xxu: add [1b80:d3af] Sveon STV27

Added support for Sveon STV27 device (rtl2832u + FC0013 tuner)

Signed-off-by: Alessandro Miceli <angelofsky1980@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl28xxu: add [1b80:d39d] Sveon STV20
Alessandro Miceli [Sun, 4 May 2014 10:37:15 +0000 (07:37 -0300)]
upstream: [media] rtl28xxu: add [1b80:d39d] Sveon STV20

Added Sveon STV20 device based on Realtek RTL2832U and FC0012 tuner

Signed-off-by: Alessandro Miceli <angelofsky1980@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl28xxu: add 1b80:d395 Peak DVB-T USB
Brian Healy [Sun, 4 May 2014 21:43:39 +0000 (18:43 -0300)]
upstream: [media] rtl28xxu: add 1b80:d395 Peak DVB-T USB

Add USB ID for Peak DVB-T USB.

[crope@iki.fi: fix Brian email address and indentation]
Signed-off-by: Brian Healy <healybrian@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl28xxu: do not hard depend on staging SDR module
Antti Palosaari [Wed, 9 Apr 2014 15:42:35 +0000 (12:42 -0300)]
upstream: [media] rtl28xxu: do not hard depend on staging SDR module

RTL2832 SDR extension module is currently on staging. SDR module
headers were included from staging causing direct dependency staging
directory. As a solution, add needed headers to main driver.
Motivation of that change comes from Luis / driver backports project.

Reported-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Cc: backports@vger.kernel.org
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl28xxu: remove duplicate ID 0458:707f Genius TVGo DVB-T03
Antti Palosaari [Wed, 26 Mar 2014 22:20:30 +0000 (19:20 -0300)]
upstream: [media] rtl28xxu: remove duplicate ID 0458:707f Genius TVGo DVB-T03

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

Revert commit 1c1b8734094551eb4075cf68cf76892498c0da61

Reported-by: Jan Vcelak <jv@fcelda.cz>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl28xxu: add USB ID for Genius TVGo DVB-T03
Jan Vcelak [Wed, 26 Feb 2014 00:30:45 +0000 (21:30 -0300)]
upstream: [media] rtl28xxu: add USB ID for Genius TVGo DVB-T03

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

The USB dongle uses RTL2832U demodulator and FC0012 tuner.

Signed-off-by: Jan Vcelak <jv@fcelda.cz>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rc: abstract access to allowed/enabled protocols
James Hogan [Fri, 28 Feb 2014 23:17:03 +0000 (20:17 -0300)]
upstream: [media] rc: abstract access to allowed/enabled protocols

The allowed and enabled protocol masks need to be expanded to be per
filter type in order to support wakeup filter protocol selection. To
ease that process abstract access to the rc_dev::allowed_protos and
rc_dev::enabled_protocols members with inline functions.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl2832: remove unused if_dvbt config parameter
Antti Palosaari [Sun, 13 Oct 2013 02:45:34 +0000 (23:45 -0300)]
upstream: [media] rtl2832: remove unused if_dvbt config parameter

All used tuners has get_if_frequency() callback and that parameter
is not needed and will not needed as all upcoming tuner drivers
should implement get_if_frequency().

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl28xxu: add module parameter to disable IR
Antti Palosaari [Fri, 22 Nov 2013 17:20:14 +0000 (14:20 -0300)]
upstream: [media] rtl28xxu: add module parameter to disable IR

Disable IR interrupts in order to avoid SDR sample loss.
IR interrupts causes some extra load for device and it seems
be one reason to loss samples when sampling rate is high.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl28xxu: add chipset version comments into device list
Jan Vcelak [Wed, 26 Feb 2014 18:33:40 +0000 (15:33 -0300)]
upstream: [media] rtl28xxu: add chipset version comments into device list

Signed-off-by: Jan Vcelak <jv@fcelda.cz>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl28xxu: add USB ID for Genius TVGo DVB-T03
Jan Vcelak [Wed, 26 Feb 2014 18:33:39 +0000 (15:33 -0300)]
upstream: [media] rtl28xxu: add USB ID for Genius TVGo DVB-T03

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

The USB dongle uses RTL2832U demodulator and FC0012 tuner.

Signed-off-by: Jan Vcelak <jv@fcelda.cz>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] af9035: add ID [2040:f900] Hauppauge WinTV-MiniStick 2
Antti Palosaari [Thu, 16 Jan 2014 11:59:30 +0000 (08:59 -0300)]
upstream: [media] af9035: add ID [2040:f900] Hauppauge WinTV-MiniStick 2

Add USB ID [2040:f900] for Hauppauge WinTV-MiniStick 2.
Device is build upon IT9135 chipset.

Tested-by: Stefan Becker <schtefan@gmx.net>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl28xxu: remove redundant IS_ENABLED macro
Antti Palosaari [Tue, 4 Jun 2013 19:50:54 +0000 (16:50 -0300)]
upstream: [media] rtl28xxu: remove redundant IS_ENABLED macro

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: media: dvb_core: slight optimization of addr compare
dingtianhong [Thu, 26 Dec 2013 11:41:10 +0000 (19:41 +0800)]
upstream: media: dvb_core: slight optimization of addr compare

Use possibly more efficient ether_addr_equal
instead of memcmp.

Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoupstream: [media] media: dvb-core: prepare for enabling irq in complete()
Ming Lei [Sat, 17 Aug 2013 15:25:07 +0000 (12:25 -0300)]
upstream: [media] media: dvb-core: prepare for enabling irq in complete()

Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().
These functions may be called inside URB->complete(), so use
spin_lock_irqsave().

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: Revert "[media] dvb_frontend: return -ENOTTY for unimplement IOCTL"
Mauro Carvalho Chehab [Fri, 15 Feb 2013 15:39:31 +0000 (13:39 -0200)]
upstream: Revert "[media] dvb_frontend: return -ENOTTY for unimplement IOCTL"

As reported by Klaus Schmidinger:
 "In VDR I use an ioctl() call with FE_READ_UNCORRECTED_BLOCKS on a
  device (using stb0899).  After this call I check 'errno' for
  EOPNOTSUPP to determine whether this device supports this call.  This
  used to work just fine, until a few months ago I noticed that my
  devices using stb0899 didn't display their signal quality in VDR's OSD
  any more.  After further investigation I found that
  ioctl(FE_READ_UNCORRECTED_BLOCKS) no longer returns EOPNOTSUPP, but
  rather ENOTTY.  And since I stop getting the signal quality in case
  any unknown errno value appears, this broke my signal quality query
  function."

While the changes reflect what is there at:

  http://comments.gmane.org/gmane.linux.kernel/1235728

it does cause regression on userspace.  So, revert it to stop the
damage.

This reverts commit 177ffe506cf8 ("[media] dvb_frontend: return -ENOTTY
for unimplement IOCTL").

Reported-by: Klaus Schmidinger <Klaus.Schmidinger@tvdr.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoupstream: [media] dvb_frontend: return -ENOTTY for unimplement IOCTL
Antti Palosaari [Wed, 15 Aug 2012 23:28:38 +0000 (20:28 -0300)]
upstream: [media] dvb_frontend: return -ENOTTY for unimplement IOCTL

Earlier it was returning -EOPNOTSUPP.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] V4L2: add a v4l2-clk helper macro to produce an I2C device ID
Guennadi Liakhovetski [Wed, 28 Aug 2013 13:28:27 +0000 (10:28 -0300)]
upstream: [media] V4L2: add a v4l2-clk helper macro to produce an I2C device ID

To obtain a clock reference consumers supply their device object to the
V4L2 clock framework. The latter then uses the consumer device name to
find a matching clock. For that to work V4L2 clock providers have to
provide the same device name, when registering clocks. This patch adds
a helper macro to generate a suitable device name for I2C devices.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] V4L2: add v4l2-clock helpers to register and unregister a fixed...
Guennadi Liakhovetski [Wed, 28 Aug 2013 13:28:26 +0000 (10:28 -0300)]
upstream: [media] V4L2: add v4l2-clock helpers to register and unregister a fixed-rate clock

Many bridges and video host controllers supply fixed rate always on clocks
to their I2C devices. This patch adds two simple helpers to register and
unregister such a clock.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: Revert "staging:media: Use dev_dbg() instead of pr_debug()"
Greg Kroah-Hartman [Mon, 25 Nov 2013 17:21:55 +0000 (09:21 -0800)]
upstream: Revert "staging:media: Use dev_dbg() instead of pr_debug()"

This reverts commit b6ea5ef80aa7fd6f4b18ff2e4174930e8772e812.

Turns out to have lots of run-time issues in that the structure is not
initialized before it is used in the debugging messages.

Reported-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoupstream: [media] staging: media: go7007: i2c GPIO initialization Reset i2c stuff...
Volokh Konstantin [Wed, 16 Jan 2013 12:00:50 +0000 (09:00 -0300)]
upstream: [media] staging: media: go7007: i2c GPIO initialization Reset i2c stuff for GO7007_BOARDID_ADLINK_MPG24 need reset GPIO always when encoder initialize

Signed-off-by: Volokh Konstantin <volokh84@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] au0828: Fix sparse non static symbol warning
Wei Yongjun [Wed, 15 Jan 2014 02:49:23 +0000 (23:49 -0300)]
upstream: [media] au0828: Fix sparse non static symbol warning

Fixes the following sparse warning:

drivers/media/usb/au0828/au0828-dvb.c:36:5: warning:
 symbol 'preallocate_big_buffers' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] au0828: Add option to preallocate digital transfer buffers
Tim Mester [Tue, 7 Jan 2014 04:29:25 +0000 (01:29 -0300)]
upstream: [media] au0828: Add option to preallocate digital transfer buffers

Added command line parameter preallocate_big_buffers so that the digital
transfer buffers can be allocated when the driver is registered. They
do not have to be allocated every time a feed is started.

Signed-off-by: Tim Mester <tmester@ieee.org>
Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] au8028: Fix cleanup on kzalloc fail
Tim Mester [Tue, 7 Jan 2014 04:29:24 +0000 (01:29 -0300)]
upstream: [media] au8028: Fix cleanup on kzalloc fail

Free what was allocated if there is a failure allocating
transfer buffers.

Stop the feed on a start feed error.  The stop feed is not always called
if start feed fails.  If the feed is not stopped on error, then the driver
will be stuck so that it can never start feeding again.

[m.chehab@samsung.com: CodingStyle cleanup]
Signed-off-by: Tim Mester <tmester@ieee.org>
Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx: rename I2C timeout to EM28XX_I2C_XFER_TIMEOUT
Mauro Carvalho Chehab [Sun, 5 Jan 2014 12:45:50 +0000 (09:45 -0300)]
upstream: [media] em28xx: rename I2C timeout to EM28XX_I2C_XFER_TIMEOUT

This macro is used by all em28xx devices, and not just em2800.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx: use a better value for I2C timeouts
Mauro Carvalho Chehab [Sat, 28 Dec 2013 10:42:47 +0000 (07:42 -0300)]
upstream: [media] em28xx: use a better value for I2C timeouts

In the lack of a better spec, let's assume the timeout
values compatible with SMBus spec:
http://smbus.org/specs/smbus110.pdf

at chapter 8 - Electrical Characteristics of SMBus devices

Ok, SMBus is a subset of I2C, and not all devices will be
following it, but the timeout value before this patch was not
even following the spec.

So, while we don't have a better guess for it, use 35 + 1
ms as the timeout.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] media: soc_camera: rcar_vin: Add preliminary R-Car M2 support
Valentine Barshak [Thu, 26 Dec 2013 15:31:49 +0000 (12:31 -0300)]
upstream: [media] media: soc_camera: rcar_vin: Add preliminary R-Car M2 support

This adds R-Car M2 (R8A7791) VIN support. Both H2 and M2
variants look the same from the driver's point of view,
so use GEN2 id for both.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[g.liakhovetski@gmx.de: removed changelog from commit message]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] videodev2: Set vb2_rect's width and height as unsigned
Ricardo Ribalda [Tue, 26 Nov 2013 08:31:42 +0000 (05:31 -0300)]
upstream: [media] videodev2: Set vb2_rect's width and height as unsigned

As discussed on the media summit 2013, there is no reason for the width
and height to be signed.

Therefore this patch is an attempt to convert those fields from __s32 to
__u32.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi> (documentation and smiapp)
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>
Conflicts:
Documentation/DocBook/media/v4l/compat.xml
Documentation/DocBook/media/v4l/v4l2.xml
drivers/media/i2c/soc_camera/mt9m111.c

9 years agoupstream: [media] saa7134: remove fmt from saa7134_buf
Hans Verkuil [Thu, 17 Apr 2014 08:00:39 +0000 (05:00 -0300)]
upstream: [media] saa7134: remove fmt from saa7134_buf

This is already available from saa7134_dev.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: store VBI hlen/vlen globally
Hans Verkuil [Thu, 17 Apr 2014 07:55:43 +0000 (04:55 -0300)]
upstream: [media] saa7134: store VBI hlen/vlen globally

Don't calculate this for every buffer, store it globally instead.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: fix regression with tvtime
Hans Verkuil [Thu, 17 Apr 2014 10:24:31 +0000 (07:24 -0300)]
upstream: [media] saa7134: fix regression with tvtime

This solves this bug:

https://bugzilla.kernel.org/show_bug.cgi?id=73361

The problem is that when you quit tvtime it calls STREAMOFF, but then it queues a
bunch of buffers for no good reason before closing the file descriptor.

In the past closing the fd would free the vb queue since that was part of the file
handle struct. Since that was moved to the global struct that no longer happened.

This wouldn't be a problem, but the extra QBUF calls that tvtime does meant that
the buffer list in videobuf (q->stream) contained buffers, so REQBUFS would fail
with -EBUSY.

The solution is to init the list head explicitly when releasing the file
descriptor and to not free the video resource when calling streamoff.

The real fix will hopefully go into kernel 3.16 when the vb2 conversion is
merged. Basically the saa7134 driver with the old videobuf is so full of holes it
ain't funny anymore, so consider this a band-aid for kernels 3.14 and 15.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org # for v3.14 and up
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: drop log_status for radio
Hans Verkuil [Sat, 14 Dec 2013 11:28:33 +0000 (08:28 -0300)]
upstream: [media] saa7134: drop log_status for radio

There are no controls for the radio node, so just drop support for this ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa6752hs: move to media/i2c
Hans Verkuil [Sat, 14 Dec 2013 11:28:31 +0000 (08:28 -0300)]
upstream: [media] saa6752hs: move to media/i2c

This driver is independent from saa7134, so there is no reason why this
shouldn't be in media/i2c like all other i2c media drivers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: rename empress_tsq to empress_vbq
Hans Verkuil [Thu, 17 Apr 2014 08:56:42 +0000 (05:56 -0300)]
upstream: [media] saa7134: rename empress_tsq to empress_vbq

Create consistent _vbq suffix for videobuf_queue fields.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: swap ts_init_encoder and ts_reset_encoder
Hans Verkuil [Thu, 17 Apr 2014 07:23:07 +0000 (04:23 -0300)]
upstream: [media] saa7134: swap ts_init_encoder and ts_reset_encoder

This will make the next patch a bit easier to read.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: drop abuse of low-level videobuf functions
Hans Verkuil [Thu, 17 Apr 2014 06:57:14 +0000 (03:57 -0300)]
upstream: [media] saa7134: drop abuse of low-level videobuf functions

saa7134-alsa used low-level videobuf functions to allocate and sync
DMA buffers. Replace this with saa7134-specific code. These functions
will not be available when we convert to vb2.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: coding style cleanups
Hans Verkuil [Thu, 17 Apr 2014 06:48:50 +0000 (03:48 -0300)]
upstream: [media] saa7134: coding style cleanups

Just white space and coding style changes to reduce the noise in the
following patches.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa6752hs.h: drop empty header
Hans Verkuil [Sat, 14 Dec 2013 11:28:32 +0000 (08:28 -0300)]
upstream: [media] saa6752hs.h: drop empty header

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: add support for control events
Hans Verkuil [Sat, 14 Dec 2013 11:28:28 +0000 (08:28 -0300)]
upstream: [media] saa7134: add support for control events

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: share resource management between normal and empress nodes
Hans Verkuil [Sat, 14 Dec 2013 11:28:27 +0000 (08:28 -0300)]
upstream: [media] saa7134: share resource management between normal and empress nodes

The empress video node can share resource management with the normal
video nodes, thus allowing for code sharing and making the empress node
non-exclusive.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: remove dev from saa7134_fh, use saa7134_fh for empress...
Hans Verkuil [Sat, 14 Dec 2013 11:28:26 +0000 (08:28 -0300)]
upstream: [media] saa7134: remove dev from saa7134_fh, use saa7134_fh for empress node

Use the saa7134_fh struct for the empress video node as well, drop the dev
pointer from that struct since we can use drvdata for that.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: cleanup radio/video/empress ioctl handling
Hans Verkuil [Sat, 14 Dec 2013 11:28:25 +0000 (08:28 -0300)]
upstream: [media] saa7134: cleanup radio/video/empress ioctl handling

The video and empress nodes can share various ioctls.

Drop the input/std ioctls from the radio node (out of spec).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: convert to the control framework
Hans Verkuil [Sat, 14 Dec 2013 11:28:24 +0000 (08:28 -0300)]
upstream: [media] saa7134: convert to the control framework

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: move the queue data from saa7134_fh to saa7134_dev
Hans Verkuil [Sat, 14 Dec 2013 11:28:23 +0000 (08:28 -0300)]
upstream: [media] saa7134: move the queue data from saa7134_fh to saa7134_dev

These fields are global, not per-filehandle.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] saa7134: Fix crash when device is closed before streamoff
Simon Farnsworth [Fri, 20 Sep 2013 16:15:28 +0000 (13:15 -0300)]
upstream: [media] saa7134: Fix crash when device is closed before streamoff

pm_qos_remove_request was not called on video_release, resulting in the PM
core's list of requests being corrupted when the file handle was freed.
This has no immediate symptoms, but later in operation, the kernel will
panic as the PM core dereferences a dangling pointer.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Acked-by: Hans Verkuil <hans.verkuil@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] v4l2: move tracepoints to video_usercopy
Hans Verkuil [Mon, 16 Dec 2013 08:45:37 +0000 (05:45 -0300)]
upstream: [media] v4l2: move tracepoints to video_usercopy

The (d)qbuf ioctls were traced in the low-level v4l2 ioctl function. The
trace was outside the serialization lock, so that can affect the usefulness
of the timing. In addition, the __user pointer was expected instead of a
proper kernel pointer.

By moving the tracepoints to video_usercopy we ensure that the trace calls
use the correct kernel pointer, and that it happens right after the ioctl
call to the driver, so certainly inside the serialization lock.

In addition, we only trace if the call was successful.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Wade Farnsworth <wade_farnsworth@mentor.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: add stream format for SDR receiver
Antti Palosaari [Thu, 12 Dec 2013 16:34:30 +0000 (13:34 -0300)]
upstream: [media] v4l: add stream format for SDR receiver

Add new V4L2 stream format definition, V4L2_BUF_TYPE_SDR_CAPTURE,
for SDR receiver.

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] v4l2-dev: Add tracepoints for QBUF and DQBUF
Wade Farnsworth [Fri, 22 Nov 2013 19:48:28 +0000 (16:48 -0300)]
upstream: [media] v4l2-dev: Add tracepoints for QBUF and DQBUF

Add tracepoints to the QBUF and DQBUF ioctls to enable rudimentary
performance measurements using standard kernel tracers.

[m.chehab@samsung.com: CodingStyle fixes (whitespacing)]
Signed-off-by: Wade Farnsworth <wade_farnsworth@mentor.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] adv7842: Disable access to EDID DDC lines before chip power up
Martin Bugge [Wed, 19 Mar 2014 09:43:45 +0000 (06:43 -0300)]
upstream: [media] adv7842: Disable access to EDID DDC lines before chip power up

In core_init make sure access to EDID DDC lines are disabled
before chip is powered up. Also DISABLE_AUTO_EDID before power up.
The correct setting is applied later when setting the EDID.
Some sources (MAC) kept on reading EDID even when Hotplug was low
and in the short period in core_init before the DDC lines was enabled
read a corrupt EDID.

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] adv7842: update RGB quantization range on HDMI/DVI-D mode irq
Martin Bugge [Wed, 19 Mar 2014 09:43:43 +0000 (06:43 -0300)]
upstream: [media] adv7842: update RGB quantization range on HDMI/DVI-D mode irq

This was the reason for enabling the HDMI/DVI-D mode irq in the first place.

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] adv*: replace the deprecated v4l2_subdev_edid by v4l2_edid
Hans Verkuil [Tue, 4 Mar 2014 11:05:19 +0000 (08:05 -0300)]
upstream: [media] adv*: replace the deprecated v4l2_subdev_edid by v4l2_edid

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] adv7842: platform-data for Hotplug Active (HPA) manual/auto
Martin Bugge [Fri, 24 Jan 2014 13:50:06 +0000 (10:50 -0300)]
upstream: [media] adv7842: platform-data for Hotplug Active (HPA) manual/auto

This applies to HDMI-map register 0x69.
So far we have been using HPA manual mode.
This way we had control of HPA which could be
set after EDID had been programmed.

Using a Mac Mini with mini-displayport to DVI-D converter as source
caused the adv7842 to lock up and fail to detect any further signals.

After experimenting with different configurations it was found that
using the HPA auto mode and in addition letting RX-termination
be controlled by HPA prevented this error from occuring.

I was not able to re-create this problem on the adv7604.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@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] adv7842: log-status for Audio Video Info frames (AVI)
Martin Bugge [Fri, 24 Jan 2014 13:50:05 +0000 (10:50 -0300)]
upstream: [media] adv7842: log-status for Audio Video Info frames (AVI)

Clear any pending AVI checksum-errors.
To be able to display last received AVI.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@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] adv7842: pixelclock read-out
Martin Bugge [Fri, 24 Jan 2014 13:50:04 +0000 (10:50 -0300)]
upstream: [media] adv7842: pixelclock read-out

Incorrect registers used for pixelclock read-out.
Same registers as for adv7604 which actually gave an almost
correct read-out, even they are not documented for adv7842.
Corrected deep-color pixel-clock correction.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@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] adv7842: adjust gain and offset for DVI-D signals
Martin Bugge [Fri, 24 Jan 2014 13:50:03 +0000 (10:50 -0300)]
upstream: [media] adv7842: adjust gain and offset for DVI-D signals

If the input signal is DVI-D and quantization range is RGB full range,
gain and offset must be adjusted to get the right range on the output.
Copied and adopted from adv7604.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@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] adv7842: Composite free-run platfrom-data fix
Martin Bugge [Wed, 29 Jan 2014 09:50:20 +0000 (06:50 -0300)]
upstream: [media] adv7842: Composite free-run platfrom-data fix

Incorrectly setting of free-run for Composite.
Copy/paste regression fix.

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] adv7842: add drive strength enum and sync names with adv7604
Hans Verkuil [Fri, 20 Dec 2013 09:15:13 +0000 (06:15 -0300)]
upstream: [media] adv7842: add drive strength enum and sync names with adv7604

Add a proper driver strength enum and use the same names in the platform
data as with adv7604.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] adv7842: initialize timings to CEA 640x480p59.94
Hans Verkuil [Tue, 17 Dec 2013 13:09:51 +0000 (10:09 -0300)]
upstream: [media] adv7842: initialize timings to CEA 640x480p59.94

This timing must be supported by all HDMI equipment, so that's a
reasonable default.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] adv7842: set LLC DLL phase from platform_data
Hans Verkuil [Fri, 20 Dec 2013 09:03:58 +0000 (06:03 -0300)]
upstream: [media] adv7842: set LLC DLL phase from platform_data

The correct LLC DLL phase depends on the board layout, so this
should be part of the platform_data.

Also updated the platform_data in ezkit to ensure that what was the old
default value is now explicitly specified, so the behavior for that board
is unchanged.

Tested-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] adv7842: return 0 if no change in s_dv_timings
Martin Bugge [Thu, 12 Dec 2013 13:10:57 +0000 (10:10 -0300)]
upstream: [media] adv7842: return 0 if no change in s_dv_timings

Return 0 if the new timings are equal to the current timings as
it caused extra cp-loss/lock interrupts.

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] adv7842: Composite sync adjustment
Martin Bugge [Thu, 5 Dec 2013 15:22:53 +0000 (12:22 -0300)]
upstream: [media] adv7842: Composite sync adjustment

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] adv7842: obtain free-run mode from the platform_data
Martin Bugge [Fri, 20 Dec 2013 09:02:24 +0000 (06:02 -0300)]
upstream: [media] adv7842: obtain free-run mode from the platform_data

The free-run mode can be board-specific.

Also updated the platform_data in ezkit to ensure that what was the old
default value is now explicitly specified, so the behavior for that board
is unchanged.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] adv7842: composite sd-ram test, clear timings before setting
Martin Bugge [Thu, 5 Dec 2013 15:18:14 +0000 (12:18 -0300)]
upstream: [media] adv7842: composite sd-ram test, clear timings before setting

Must clear timings before setting after test to recover.

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] adv7842: enable HDMI/DVI mode irq
Martin Bugge [Tue, 10 Dec 2013 15:01:59 +0000 (12:01 -0300)]
upstream: [media] adv7842: enable HDMI/DVI mode irq

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] adv7842: i2c dummy clients registration
Martin Bugge [Thu, 5 Dec 2013 15:14:45 +0000 (12:14 -0300)]
upstream: [media] adv7842: i2c dummy clients registration

Clear i2c_clients ptr when unregistered.
Warn if configured i2c-addr is zero.

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] adv7842: support g_edid ioctl
Martin Bugge [Thu, 5 Dec 2013 15:14:02 +0000 (12:14 -0300)]
upstream: [media] adv7842: support g_edid ioctl

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] adv7842: restart STDI once if format is not found
Martin Bugge [Tue, 10 Dec 2013 15:00:06 +0000 (12:00 -0300)]
upstream: [media] adv7842: restart STDI once if format is not found

The STDI block may measure wrong values, especially for lcvs and lcf.
If the driver can not find any valid timing, the STDI block is restarted
to measure the video timings again. The function will return an error,
but the restart of STDI will generate a new STDI interrupt and the format
detection process will restart.

Copied from adv7604.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@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] adv7842: clear edid, if no edid just disable Edid-DDC access
Martin Bugge [Thu, 5 Dec 2013 15:09:51 +0000 (12:09 -0300)]
upstream: [media] adv7842: clear edid, if no edid just disable Edid-DDC access

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@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] adv7842: mute audio before switching inputs to avoid noise/pops
Mats Randgaard [Thu, 5 Dec 2013 15:08:45 +0000 (12:08 -0300)]
upstream: [media] adv7842: mute audio before switching inputs to avoid noise/pops

Signed-off-by: Mats Randgaard <matrandg@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] adv7842: Use defines to select EDID port
Mats Randgaard [Tue, 10 Dec 2013 14:24:35 +0000 (11:24 -0300)]
upstream: [media] adv7842: Use defines to select EDID port

Signed-off-by: Mats Randgaard <matrandg@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] adv7842: remove connector type. Never used for anything useful
Mats Randgaard [Thu, 5 Dec 2013 14:58:08 +0000 (11:58 -0300)]
upstream: [media] adv7842: remove connector type. Never used for anything useful

May also be wrong if the receiver is connected to more than one connector.

Signed-off-by: Mats Randgaard <matrandg@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] adv7842: increase wait time
Martin Bugge [Thu, 5 Dec 2013 14:56:32 +0000 (11:56 -0300)]
upstream: [media] adv7842: increase wait time

Wait 5ms after main reset. The data-sheet doesn't specify the wait
after i2c-controlled reset, so using same value as after pin-controlled
reset.

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] adv7842: set default input in platform-data
Martin Bugge [Thu, 5 Dec 2013 14:55:48 +0000 (11:55 -0300)]
upstream: [media] adv7842: set default input in platform-data

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] adv7842: 625/525 line standard jitter fix
Martin Bugge [Thu, 5 Dec 2013 14:52:39 +0000 (11:52 -0300)]
upstream: [media] adv7842: 625/525 line standard jitter fix

Both the PAL and NTSC standards are interlaced where a
frame consist of two fields. Total number of lines in a frame in both systems
are an odd number so the two fields will have different length.

In the 625 line standard ("PAL") the odd field of the frame is transmitted first,
while in the 525 standard ("NTSC") the even field is transmitted first.

This adds the possibility to change output config between the fields and standards.

This setting will reduce the "format-jitter" on the signal sent by the pixelport
moving the difference between the fields to vertical front/back-porch only.

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] adv7842: set defaults spa-location
Martin Bugge [Thu, 5 Dec 2013 14:46:21 +0000 (11:46 -0300)]
upstream: [media] adv7842: set defaults spa-location

For edid with no Source Physical Address (spa), set
spa-location to default and use correct values from edid.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@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] adv7842: support YCrCb analog input, receive CEA formats as RGB...
Hans Verkuil [Fri, 20 Dec 2013 08:44:27 +0000 (05:44 -0300)]
upstream: [media] adv7842: support YCrCb analog input, receive CEA formats as RGB on VGA input

Added support for YCrCb analog input.

If input is ADV7842_MODE_RGB and RGB quantization range is set to
V4L2_DV_RGB_RANGE_AUTO, then video with CEA timings will be received
as RGB. For ADV7842_MODE_COMP, automatic CSC mode will be selected.

See table 48 on page 281 in "ADV7842 Hardware Manual, Rev. 0, January 2011"
for details.

Make sure that when switching inputs the RGB quantization range is
updated as well.

Also updated the platform_data in ezkit to ensure that what was the old
default value is now explicitly specified, so the behavior for that board
is unchanged.

Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] adv7842: added DE vertical position in SDP-io-sync
Martin Bugge [Thu, 5 Dec 2013 14:40:43 +0000 (11:40 -0300)]
upstream: [media] adv7842: added DE vertical position in SDP-io-sync

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] adv7842: save platform data in state struct
Martin Bugge [Thu, 5 Dec 2013 14:39:37 +0000 (11:39 -0300)]
upstream: [media] adv7842: save platform data in state struct

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] adv7842: properly enable/disable the irqs
Martin Bugge [Tue, 10 Dec 2013 14:14:26 +0000 (11:14 -0300)]
upstream: [media] adv7842: properly enable/disable the irqs

The method of disabling the irq-output pin caused many "empty"
interrupts. Instead, actually disable/enable the interrupts by
changing the interrupt masks.

Also enable STORE_MASKED_IRQ in INT1 configuration, otherwise when HDMI
events happen while the interrupt is masked those events will be ignored
when the interrupt is unmasked.

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] adv7842: corrected setting of cp-register 0x91 and 0x8f
Martin Bugge [Tue, 10 Dec 2013 14:01:00 +0000 (11:01 -0300)]
upstream: [media] adv7842: corrected setting of cp-register 0x91 and 0x8f

Bit 6 of register 0x8f was cleared incorrectly (must be 1), and bit 4
of register 0x91 was set incorrectly (must be 0).

These bits are undocumented, so we shouldn't modify them to values different
from what the datasheet specifies.

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] adv7842: Re-worked query_dv_timings()
Martin Bugge [Tue, 10 Dec 2013 13:57:03 +0000 (10:57 -0300)]
upstream: [media] adv7842: Re-worked query_dv_timings()

This simplified the code quite a bit.

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] adv7842: fix compilation with GCC < 4.4.6
Gianluca Gennari [Fri, 30 Aug 2013 11:29:22 +0000 (08:29 -0300)]
upstream: [media] adv7842: fix compilation with GCC < 4.4.6

Signed-off-by: Gianluca Gennari <gennarone@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] adv7842: add new video decoder driver
Hans Verkuil [Thu, 22 Aug 2013 09:14:22 +0000 (06:14 -0300)]
upstream: [media] adv7842: add new video decoder driver

This is a Analog Devices Component/Graphics/SD Digitizer with 2:1
Multiplexed HDMI Receiver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] adv7604: initialize timings to CEA 640x480p59.94
Hans Verkuil [Tue, 17 Dec 2013 13:05:13 +0000 (10:05 -0300)]
upstream: [media] adv7604: initialize timings to CEA 640x480p59.94

This timing must be supported by all HDMI equipment, so that's a
reasonable default.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] adv7604: sync polarities from platform data
Martin Bugge [Fri, 20 Dec 2013 08:14:57 +0000 (05:14 -0300)]
upstream: [media] adv7604: sync polarities from platform data

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] adv7604: Enable HDMI_MODE interrupt
Mats Randgaard [Tue, 10 Dec 2013 13:15:13 +0000 (10:15 -0300)]
upstream: [media] adv7604: Enable HDMI_MODE interrupt

Some sources are initially detected as DVI, and change to HDMI later.
This must be detected to set the right RGB quantization range.

Signed-off-by: Mats Randgaard <matrandg@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] adv7604: adjust gain and offset for DVI-D signals
Mats Randgaard [Thu, 5 Dec 2013 13:39:04 +0000 (10:39 -0300)]
upstream: [media] adv7604: adjust gain and offset for DVI-D signals

If the input signal is DVI-D and quantization range is RGB full range,
gain and offset must be adjusted to get the right range on the output.

Signed-off-by: Mats Randgaard <matrandg@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] adv7604: improve HDMI audio handling
Mats Randgaard [Thu, 5 Dec 2013 13:33:41 +0000 (10:33 -0300)]
upstream: [media] adv7604: improve HDMI audio handling

- Mute audio before switching inputs to avoid noise/pops
- Mute audio if audio FIFO over-/underflows (AD Recommended setting)
- Reset FIFO if it over-/underflows (AD Recommended setting)

Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>