platform/kernel/linux-3.10.git
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>
9 years agoupstream: [media] adv7604: remove debouncing of ADV7604_FMT_CHANGE events
Mats Randgaard [Thu, 5 Dec 2013 13:26:11 +0000 (10:26 -0300)]
upstream: [media] adv7604: remove debouncing of ADV7604_FMT_CHANGE events

ADV7604_FMT_CHANGE events was debounced in adv7604_isr() to avoid
that a receiver with a unstable input signal would block the event
handling for other inputs. This solution was prone to errors.

A better protection agains interrupt blocking is to delay the call
of the interrupt service routine in the adv7604 driver if too many
interrupts are received within a given time.

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: return immediately if the new input is equal to what is...
Mats Randgaard [Thu, 5 Dec 2013 13:24:05 +0000 (10:24 -0300)]
upstream: [media] adv7604: return immediately if the new input is equal to what is configured

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: remove connector type. Never used for anything useful
Mats Randgaard [Thu, 5 Dec 2013 13:23:03 +0000 (10:23 -0300)]
upstream: [media] adv7604: 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] adv7604: improve EDID handling
Mats Randgaard [Tue, 10 Dec 2013 12:57:09 +0000 (09:57 -0300)]
upstream: [media] adv7604: improve EDID handling

- split edid_write_block()
- do not use edid->edid before the validity check
- Return -EINVAL if edid->pad is invalid
- Save both registers for SPA port A
- Set SPA location to default value if it is not found

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: set CEC address (SPA) in EDID
Mats Randgaard [Tue, 10 Dec 2013 12:55:18 +0000 (09:55 -0300)]
upstream: [media] adv7604: set CEC address (SPA) in EDID

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: select YPbPr if RGB_RANGE_FULL/LIMITED is set for VGA_COMP...
Mats Randgaard [Thu, 5 Dec 2013 13:17:15 +0000 (10:17 -0300)]
upstream: [media] adv7604: select YPbPr if RGB_RANGE_FULL/LIMITED is set for VGA_COMP inputs

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: Receive CEA formats as RGB on VGA (RGB) input
Mats Randgaard [Thu, 5 Dec 2013 13:05:58 +0000 (10:05 -0300)]
upstream: [media] adv7604: Receive CEA formats as RGB on VGA (RGB) input

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

See table 44 on page 205 in "ADV7604 Hardware Manual, Rev. F, August 2010"
for details.

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: add hdmi driver strength adjustment
Mikhail Khelik [Fri, 20 Dec 2013 08:12:00 +0000 (05:12 -0300)]
upstream: [media] adv7604: add hdmi driver strength adjustment

The driver strength is board dependent, so set it from the platform_data.

Signed-off-by: Mikhail Khelik <mkhelik@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: add support for all the digital input ports
Mats Randgaard [Tue, 10 Dec 2013 12:45:00 +0000 (09:45 -0300)]
upstream: [media] adv7604: add support for all the digital input ports

The adv7604 supports four digital input ports. This patch adds support
for all of them, instead of just port A.

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/ad9389b/ths8200: decrease min_pixelclock to 25MHz
Hans Verkuil [Mon, 19 Aug 2013 11:07:26 +0000 (08:07 -0300)]
upstream: [media] adv7604/ad9389b/ths8200: decrease min_pixelclock to 25MHz

The CEA-861 standard allows for the 640x480 format at 25.175 MHz.
Ensure that that's allowed according to the struct v4l2_bt_timings_cap.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] ad9389b/adv7604/ths8200: use new v4l2_print_dv_timings helper
Hans Verkuil [Thu, 15 Aug 2013 11:05:59 +0000 (08:05 -0300)]
upstream: [media] ad9389b/adv7604/ths8200: use new v4l2_print_dv_timings helper

These three drivers all have code to log the dv_timings contents. Replace
that code with the new helper function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] adv7604: debounce "format change" notifications
Mats Randgaard [Wed, 14 Aug 2013 10:58:45 +0000 (07:58 -0300)]
upstream: [media] adv7604: debounce "format change" notifications

The bridge driver is only notified when the input status has changed
since the previous interrupt.

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] sn9c102: prepare for removal by moving it to staging
Hans Verkuil [Thu, 12 Dec 2013 10:35:22 +0000 (07:35 -0300)]
upstream: [media] sn9c102: prepare for removal by moving it to staging

During the last media summit meeting it was decided to move this driver to
staging as the first step to removing it altogether.

Most webcams covered by this driver are now supported by gspca. Nobody has the
hardware to convert the remaining devices to gspca.

This driver needs a major overhaul to have it conform to the latest frameworks
and compliancy tests.

Without hardware, however, this is next to impossible. Given the fact that
this driver seems to be pretty much unused (it has been removed from Fedora
several versions ago and nobody complained about that), we decided to drop
this driver.

This patch moves it to staging. Some time in 2014 we will drop it completely.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
drivers/staging/media/Kconfig

9 years agoupstream: treewide: Fix typos in printk
Masanari Iida [Sun, 8 Dec 2013 15:22:53 +0000 (00:22 +0900)]
upstream: treewide: Fix typos in printk

Correct spelling typo in various part of kernel

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Conflicts:
arch/arm64/kvm/handle_exit.c
arch/mips/ralink/cevt-rt3352.c
arch/mips/ralink/timer.c
drivers/gpu/drm/exynos/exynos_drm_fimc.c
drivers/i2c/busses/i2c-exynos5.c
drivers/iio/adc/twl6030-gpadc.c
fs/btrfs/tests/free-space-tests.c
net/nfc/digital_dep.c

9 years agoupstream: [media] m88ts2022: convert to Kernel I2C driver model
Mauro Carvalho Chehab [Fri, 16 May 2014 13:55:55 +0000 (10:55 -0300)]
upstream: [media] m88ts2022: convert to Kernel I2C driver model

Convert driver from proprietary DVB driver model to standard I2C
driver model.

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

Conflicts:
drivers/media/tuners/m88ts2022.c

9 years agoupstream: [media] m88ts2022: do not use dynamic stack allocation
Antti Palosaari [Thu, 7 Nov 2013 20:01:31 +0000 (17:01 -0300)]
upstream: [media] m88ts2022: do not use dynamic stack allocation

I2C transfer were using dynamic stack allocation. Get rid of it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] em28xx: add support for PCTV DVB-S2 Stick (461e) [2013:0258]
Antti Palosaari [Mon, 25 Feb 2013 12:01:13 +0000 (09:01 -0300)]
upstream: [media] em28xx: add support for PCTV DVB-S2 Stick (461e) [2013:0258]

Device has following chips: Empia EM28178, Montage M88DS3103,
Montage M88TS2022, Allegro A8293.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si470x: add check to test if this is really a si470x
Hans Verkuil [Fri, 13 Dec 2013 11:06:38 +0000 (08:06 -0300)]
upstream: [media] si470x: add check to test if this is really a si470x

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] si470x: don't use buffer on the stack for USB transfers
Hans Verkuil [Fri, 13 Dec 2013 11:06:07 +0000 (08:06 -0300)]
upstream: [media] si470x: don't use buffer on the stack for USB transfers

You shouldn't use buffers allocated on the stack for USB transfers,
always kmalloc them.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] media: Include linux/kernel.h for DIV_ROUND_UP()
Sakari Ailus [Fri, 13 Dec 2013 11:58:37 +0000 (08:58 -0300)]
upstream: [media] media: Include linux/kernel.h for DIV_ROUND_UP()

DIV_ROUND_UP() is defined in kernel.h which was not included by
media-entity.h. Do exactly that.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
include/media/media-entity.h

9 years agoupstream: staging: delete non-required instances of include <linux/init.h>
Paul Gortmaker [Tue, 10 Dec 2013 20:23:48 +0000 (15:23 -0500)]
upstream: staging: delete non-required instances of include <linux/init.h>

None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Conflicts:
drivers/staging/comedi/drivers/dt9812.c
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
drivers/staging/gdm724x/gdm_tty.c
drivers/staging/lustre/include/linux/libcfs/linux/kp30.h
drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h
drivers/staging/lustre/lustre/lmv/lmv_fld.c
drivers/staging/lustre/lustre/lmv/lmv_intent.c
drivers/staging/lustre/lustre/lvfs/lvfs_linux.c
drivers/staging/lustre/lustre/mdc/mdc_locks.c
drivers/staging/lustre/lustre/obdclass/capa.c
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
drivers/staging/lustre/lustre/ptlrpc/gss/gss_bulk.c
drivers/staging/lustre/lustre/ptlrpc/gss/gss_generic_token.c
drivers/staging/lustre/lustre/ptlrpc/gss/gss_mech_switch.c
drivers/staging/lustre/lustre/ptlrpc/gss/lproc_gss.c
drivers/staging/ozwpan/ozpd.c
drivers/staging/ozwpan/ozproto.c
drivers/staging/ozwpan/ozusbsvc.c
drivers/staging/rtl8188eu/include/osdep_service.h
drivers/staging/rtl8192u/r8192U.h
drivers/staging/rts5208/rtsx.h
drivers/staging/zsmalloc/zsmalloc-main.c

9 years agoupstream: [media] em28xx: add support for the SpeedLink Vicious And Devine Laplace...
Frank Schaefer [Sun, 1 Dec 2013 21:06:57 +0000 (18:06 -0300)]
upstream: [media] em28xx: add support for the SpeedLink Vicious And Devine Laplace webcams

The SpeedLink Vicious And Devine Laplace webcam is using an EM2765 bridge and
an OV2640 sensor. It has a built-in microphone (USB standard device class)
and provides 3 buttons (snapshot, illumination, mute) and 2 LEDs (capturing/mute
and illumination/flash). It is also equipped with an eeprom.
The device is available in two colors: white (1ae7:9003) and black (1ae7:9004).
For further details see http://linuxtv.org/wiki/index.php/VAD_Laplace.
Please note the following limitations that need to be addressed later:
- resolution limited to 640x480 (sensor supports 1600x1200)
- picture quality needs to be improved
- AV-mute button doesn't work yet

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] Add support for KWorld UB435-Q V2
Jean-Francois Thibert [Wed, 9 Oct 2013 14:18:05 +0000 (11:18 -0300)]
upstream: [media] Add support for KWorld UB435-Q V2

This patch adds support for the UB435-Q V2. You might need to
use the device once with the Windows driver provided by KWorld
in order to permanently reprogram the device descriptors. Thanks
to Jarod Wilson for the initial attempt at adding support for this
device.

[m.chehab@samsung.com: Fixed Whitespace mangling, Coding Style and
 improved the error handling at DVB attach]
Signed-off-by: Jean-Francois Thibert <jfthibert@google.com>
Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] dw2102: Use RC Core instead of the legacy RC (second edition)
Evgeny Plehov [Fri, 15 Nov 2013 19:43:33 +0000 (16:43 -0300)]
upstream: [media] dw2102: Use RC Core instead of the legacy RC (second edition)

Use RC Core instead of the legacy RC.
DVBWorld, TBS, TeVii, Prof hardware decode only NEC remotes (one byte code).
Geniatech hardware decode only RC5 (two bytes).
+ New keymap for Geniatech HDStar (SU3000).

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] dw2102: Geniatech T220 support
Evgeny Plehov [Wed, 13 Nov 2013 23:53:59 +0000 (20:53 -0300)]
upstream: [media] dw2102: Geniatech T220 support

Support for Geniatech T220 DVB-T/T2/C USB stick.

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] media_tree: Fix spelling errors
Jonathan McCrohan [Mon, 21 Oct 2013 00:34:01 +0000 (21:34 -0300)]
upstream: [media] media_tree: Fix spelling errors

Fix various spelling errors in strings and comments throughout the media
tree. The majority of these were found using Lucas De Marchi's codespell
tool.

[m.chehab@samsung.com: discard hunks with conflicts]

Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
drivers/media/dvb-frontends/drxk_hard.c
drivers/media/i2c/adv7842.c
drivers/media/i2c/s5c73m3/s5c73m3-core.c

9 years agoupstream: [media] videobuf2-dma-sg: Support io userptr operations on io memory
Ricardo Ribalda [Tue, 26 Nov 2013 12:58:44 +0000 (09:58 -0300)]
upstream: [media] videobuf2-dma-sg: Support io userptr operations on io memory

Memory exported via remap_pfn_range cannot be remapped via
get_user_pages.
Other videobuf2 methods (like the dma-contig) supports io memory.
This patch adds support for this kind of memory.
v2: Comments by Marek Szyprowski
-Use vb2_get_vma and vb2_put_vma

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
drivers/media/v4l2-core/videobuf2-dma-sg.c

9 years agoupstream: [media] usbtv: Add support for PAL video source
Georg Kaindl [Mon, 21 Oct 2013 15:01:36 +0000 (12:01 -0300)]
upstream: [media] usbtv: Add support for PAL video source

Signed-off-by: Georg Kaindl <gkaindl@mac.com>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
Tested-by: Marcin Nowak <marcin.nowak@simplusnet.pl>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] af9035: add [0413:6a05] Leadtek WinFast DTV Dongle Dual
Antti Palosaari [Thu, 8 Aug 2013 22:41:06 +0000 (19:41 -0300)]
upstream: [media] af9035: add [0413:6a05] Leadtek WinFast DTV Dongle Dual

It is IT9135 dual design.
Thanks to Michael Piko for reporting that!

Reported-by: Michael Piko <michael@piko.com.au>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
drivers/media/usb/dvb-usb-v2/af9035.c

9 years agoupstream: [media] rtl28xxu: add 15f4:0131 Astrometa DVB-T2
Antti Palosaari [Wed, 30 Oct 2013 05:33:42 +0000 (02:33 -0300)]
upstream: [media] rtl28xxu: add 15f4:0131 Astrometa DVB-T2

Components are RTL2832P + R828D + MN88472.
Currently support only DVB-T as there is no driver for MN88472 demod.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] media: rcar_vin: Add preliminary r8a7790 support
Valentine Barshak [Fri, 4 Oct 2013 14:20:52 +0000 (11:20 -0300)]
upstream: [media] media: rcar_vin: Add preliminary r8a7790 support

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] V4L2: soc_camera: Renesas R-Car VIN driver
Vladimir Barinov [Thu, 25 Jul 2013 20:23:10 +0000 (17:23 -0300)]
upstream: [media] V4L2: soc_camera: Renesas R-Car VIN driver

Add Renesas R-Car VIN (Video In) V4L2 driver.
Based on the patch by Phil Edworthy <phil.edworthy@renesas.com>.
[Sergei: removed deprecated IRQF_DISABLED flag, reordered/renamed 'enum chip_id'
values, reordered rcar_vin_id_table[] entries,  removed senseless parens from
to_buf_list() macro, used ALIGN() macro in rcar_vin_setup(), added {} to the
*if* statement  and used 'bool' values instead of 0/1 where necessary, removed
unused macros, done some reformatting and clarified some comments.]

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] drxk_hard: fix sparse warnings
Hans Verkuil [Fri, 4 Oct 2013 14:01:45 +0000 (11:01 -0300)]
upstream: [media] drxk_hard: fix sparse warnings

drivers/media/dvb-frontends/drxk_hard.c:1086:62: warning: Using plain integer as NULL pointer
drivers/media/dvb-frontends/drxk_hard.c:2784:63: 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: treewide: Fix typo in Kconfig
Masanari Iida [Sun, 29 Sep 2013 11:54:15 +0000 (20:54 +0900)]
upstream: treewide: Fix typo in Kconfig

Correct spelling typo in Kconfig.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Conflicts:
arch/arm/mach-sti/Kconfig
drivers/fmc/Kconfig

9 years agoupstream: [media] gspca: Support variable resolution
Ondrej Zary [Fri, 30 Aug 2013 20:54:24 +0000 (17:54 -0300)]
upstream: [media] gspca: Support variable resolution

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

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
drivers/media/usb/gspca/gspca.c

9 years agoupstream: [media] videobuf2-dc: Fix support for mappings without struct page in userp...
Marek Szyprowski [Wed, 19 Jun 2013 11:56:46 +0000 (08:56 -0300)]
upstream: [media] videobuf2-dc: Fix support for mappings without struct page in userptr mode

Earlier version of dma-contig allocator in user ptr mode assumed that in
all cases DMA address equals physical address. This was just a special case.
Commit e15dab752d4c588544ccabdbe020a7cc092e23c8 introduced correct support
for converting userpage to dma address, but unfortunately it broke the
support for simple dma address = physical address for the case, when given
physical frame has no struct page associated with it (this happens if one
use for example dma_declare_coherent api or other reserved memory approach).
This commit restores support for such cases.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
[s.nawrocki@samsung.com: replaced #elsif with #elif]
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
drivers/media/v4l2-core/videobuf2-dma-contig.c

9 years agoupstream: [media] v4l2-dv-timings: fill in type field
Hans Verkuil [Mon, 19 Aug 2013 11:38:29 +0000 (08:38 -0300)]
upstream: [media] v4l2-dv-timings: fill in type field

The detect_cvt/gtf functions didn't fill in the type field.

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: rename v4l_match_dv_timings to v4l2_match_dv_timings
Hans Verkuil [Thu, 15 Aug 2013 11:28:47 +0000 (08:28 -0300)]
upstream: [media] v4l2-dv-timings: rename v4l_match_dv_timings to v4l2_match_dv_timings

It's the only function in v4l2-dv-timings.c with the v4l prefix instead
of v4l2. Make it consistent with the other functions.

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: add v4l2_print_dv_timings helper
Hans Verkuil [Thu, 15 Aug 2013 11:02:40 +0000 (08:02 -0300)]
upstream: [media] v4l2-dv-timings: add v4l2_print_dv_timings helper

Drivers often have to log the contents of a dv_timings struct. Adding
this helper will make it easier for drivers to do so.

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: fix CVT calculation
Martin Bugge [Wed, 14 Aug 2013 07:58:38 +0000 (04:58 -0300)]
upstream: [media] v4l2-dv-timings: fix CVT calculation

This patch fixes two errors that caused incorrect format detections:
The first bug is in the calculation of the vertical backporch: the combined
period of vsync and backporch must *exceed* a certain minimum value, and not
be equal to it.
The second bug is a rounding error in the reduced blanking calculation:
expand the ideal_duty_cylce to be in parts per ten thousand to avoid
rounding errors.

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] v4l2: move dv-timings related code to v4l2-dv-timings.c
Hans Verkuil [Mon, 29 Jul 2013 11:40:56 +0000 (08:40 -0300)]
upstream: [media] v4l2: move dv-timings related code to v4l2-dv-timings.c

v4l2-common.c contained a bunch of dv-timings related functions.
Move that to the new v4l2-dv-timings.c which is a more appropriate
place for them.
There aren't many drivers that do HDTV, so it is a good idea to separate
common code related to that into a module of its own.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Conflicts:
drivers/media/i2c/ths8200.c

9 years agoupstream: [media] usbtv: Throw corrupted frames away
Lubomir Rintel [Tue, 2 Jul 2013 10:56:39 +0000 (07:56 -0300)]
upstream: [media] usbtv: Throw corrupted frames away

Ignore out of order data and mark incomplete buffers as errored.
This gets rid of annoying flicker due to occassional garbage from hardware.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: linux-kernel@vger.kernel.org
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>
Conflicts:
drivers/media/usb/usbtv/usbtv.c

9 years agoupstream: [media] usbtv: Fix deinterlacing
Lubomir Rintel [Tue, 2 Jul 2013 10:56:38 +0000 (07:56 -0300)]
upstream: [media] usbtv: Fix deinterlacing

The image data is laid out a bit more weirdly and thus needs more work to
properly interlace. What we get from hardware is V4L2_FIELD_ALTERNATE, but
since userspace support for it is practically nonexistent, thus we make
V4L2_FIELD_INTERLACED from it so that it's more easily interpreted.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: stable@vger.kernel.org
9 years agoupstream: cx88: fix register mask
Hans Verkuil [Wed, 29 May 2013 09:22:02 +0000 (06:22 -0300)]
upstream: cx88: fix register mask

Ensure that the register is aligned to a dword, otherwise the read could
read out-of-range data.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] drxk_hard: remove needless parenthesis
Mauro Carvalho Chehab [Sun, 28 Apr 2013 14:47:50 +0000 (11:47 -0300)]
upstream: [media] drxk_hard: remove needless parenthesis

X-Patchwork-Delegate: mchehab@redhat.com
There are several places where: state->var = (some_var)
The parenthesis there are doing nothing but making it
harder to read and breaking the 80 columns soft limits.
Just get rid of it.

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

X-Patchwork-Delegate: mchehab@redhat.com
The comments markup language used on Kernel is defined at:
Documentation/kernel-doc-nano-HOWTO.txt
Remove invalid markups from the header file.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] drxk_hard: don't split strings across lines
Mauro Carvalho Chehab [Sun, 28 Apr 2013 14:47:46 +0000 (11:47 -0300)]
upstream: [media] drxk_hard: don't split strings across lines

X-Patchwork-Delegate: mchehab@redhat.com
WARNING: quoted string split across lines
#5416: FILE: media/dvb-frontends/drxk_hard.c:5416:
+ dprintk(1, "Could not set demodulator parameters. Make "
+ "sure qam_demod_parameter_count (%d) is correct for "
WARNING: quoted string split across lines
#5423: FILE: media/dvb-frontends/drxk_hard.c:5423:
+ dprintk(1, "Auto-probing the correct QAM demodulator command "
+ "parameters was successful - using %d parameters.\n",

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

X-Patchwork-Delegate: mchehab@redhat.com
Thare are lots of CamelCase warnings produced by checkpatch.pl.
This weren't fixed at the time the driver got submitted due
to the lack of manpower do to such cleanup.
Now that I have one script that automates this task, cleans
it. That makes the driver almost checkpatch-compliant,
except for 80 column warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Conflicts:
drivers/media/dvb-frontends/drxk_hard.c

9 years agoupstream: [media] rtl28xxu: correct latest device name
Antti Palosaari [Tue, 4 Jun 2013 22:43:30 +0000 (19:43 -0300)]
upstream: [media] rtl28xxu: correct latest device name

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] Add support for Crypto Redi PC50A device (rtl2832u + FC0012 tuner)
Alessandro Miceli [Tue, 4 Jun 2013 19:10:34 +0000 (16:10 -0300)]
upstream: [media] Add support for Crypto Redi PC50A device (rtl2832u + FC0012 tuner)

The device has been tested on a MIPSel box with kernel 3.1.1 and backported media_tree drivers
The kernel detects the device with the following output:
usbcore: registered new interface driver dvb_usb_rtl28xxu
usb 1-2: dvb_usb_v2: found a 'Crypto Redi PC50A' in warm state
usb 1-2: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
DVB: registering new adapter (Crypto Redi PC50A)
usb 1-2: DVB: registering adapter 1 frontend 0 (Realtek RTL2832 (DVB-T))...
i2c i2c-4: fc0012: Fitipower FC0012 successfully identified
usb 1-2: dvb_usb_v2: 'Crypto Redi PC50A' successfully initialized and connected

[crope@iki.fi: fix trivial merge conflict]
Signed-off-by: Alessandro Miceli <angelofsky1980@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] rtl28xxu: use masked reg write where possible
Antti Palosaari [Tue, 4 Jun 2013 21:26:54 +0000 (18:26 -0300)]
upstream: [media] rtl28xxu: use masked reg write where possible

Use masked register write inside rtl2832u_power_ctrl().

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] rtl28xxu: reimplement rtl2832u remote controller
Antti Palosaari [Tue, 4 Jun 2013 12:17:03 +0000 (09:17 -0300)]
upstream: [media] rtl28xxu: reimplement rtl2832u remote controller

Thanks to Rodrigo for original implementation!

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] rtl2832u: restore ir remote control support
Rodrigo Tartajo [Sat, 20 Apr 2013 23:02:12 +0000 (20:02 -0300)]
upstream: [media] rtl2832u: restore ir remote control support

Hi,
This patch uses the driver from openpli[1] as a template to restore the remote control support.
I had to divert from the original to use the in kernel rc protocol decoder. The key repetition does,
not seem to work but I cant find the problem in the driver. As a raw rc provider, no key table is
hardcoded.
Rodrigo.
[1]: https://aur.archlinux.org/packages/dvb-usb-rtl2832u-openpli/?comments=all

Signed-off-by: Rodrigo Tartajo <rtarty@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] bttv: Add CyberVision CV06
Ondrej Zary [Sun, 14 Apr 2013 20:26:21 +0000 (17:26 -0300)]
upstream: [media] bttv: Add CyberVision CV06

Add CyberVision CV06 4-camera card (from CyberVision SV card kit):
http://www.cybervision.com.tw/products-swcard_kits-sv.html
There are some interesting things on the card but they're not supported:
4 LEDs, a connector with 4 IN and 4 OUT pins, RESET IN and RESET OUT
connectors, a relay and CyberVision CV8088-SV16 chip

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: saa7134-alsa: include vmalloc.h
Mauro Carvalho Chehab [Wed, 14 May 2014 02:02:14 +0000 (23:02 -0300)]
upstream: saa7134-alsa: include vmalloc.h

Changeset 15e64f0dde77 broke compilation on several archs, as it
forgot to include vmalloc.h.

drivers/media/pci/saa7134/saa7134-alsa.c: In function ‘saa7134_alsa_dma_init’:
  CC [M]  drivers/media/rc/keymaps/rc-behold-columbus.o
drivers/media/pci/saa7134/saa7134-alsa.c:283:2: error: implicit declaration of function ‘vmalloc_32’ [-Werror=implicit-function-declaration]
  dma->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT);
  ^
drivers/media/pci/saa7134/saa7134-alsa.c:283:13: warning: assignment makes pointer from integer without a cast [enabled by default]
  dma->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT);
             ^
drivers/media/pci/saa7134/saa7134-alsa.c:296:2: error: implicit declaration of function ‘vzalloc’ [-Werror=implicit-function-declaration]
  dma->sglist = vzalloc(dma->nr_pages * sizeof(*dma->sglist));
  ^
drivers/media/pci/saa7134/saa7134-alsa.c:296:14: warning: assignment makes pointer from integer without a cast [enabled by default]
  dma->sglist = vzalloc(dma->nr_pages * sizeof(*dma->sglist));
              ^
drivers/media/pci/saa7134/saa7134-alsa.c:310:2: error: implicit declaration of function ‘vfree’ [-Werror=implicit-function-declaration]
  vfree(dma->sglist);

Add it to avoid such breakages.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] tw9910: add g_tvnorms video op
Hans Verkuil [Mon, 17 Feb 2014 11:44:13 +0000 (08:44 -0300)]
upstream: [media] tw9910: add g_tvnorms video op

Report to soc_camera which standards are supported by tw9910.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l2-subdev.h: add g_tvnorms video op
Hans Verkuil [Mon, 17 Feb 2014 11:44:12 +0000 (08:44 -0300)]
upstream: [media] v4l2-subdev.h: add g_tvnorms video op

While there was already a g_tvnorms_output video op, it's counterpart for
video capture was missing. Add it.

This is necessary for generic bridge drivers like soc-camera to set the
video_device tvnorms field correctly. Otherwise ENUMSTD cannot work.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: Add 12-bit YUV 4:2:2 media bus pixel codes
Laurent Pinchart [Fri, 17 May 2013 15:32:46 +0000 (12:32 -0300)]
upstream: [media] v4l: Add 12-bit YUV 4:2:2 media bus pixel codes

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: Add 12-bit YUV 4:2:0 media bus pixel codes
Laurent Pinchart [Fri, 17 May 2013 15:32:46 +0000 (12:32 -0300)]
upstream: [media] v4l: Add 12-bit YUV 4:2:0 media bus pixel codes

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: Add UYVY10_1X20 and VYUY10_1X20 media bus pixel codes
Laurent Pinchart [Fri, 17 May 2013 15:32:46 +0000 (12:32 -0300)]
upstream: [media] v4l: Add UYVY10_1X20 and VYUY10_1X20 media bus pixel codes

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>