[media] pwc: Fix comment wrt lock ordering

With all the changes to handle the locking in the v4l2-core rather then at
the driver level, the order in which the 2 pwc locks need to be taken has
changed, update the comment in the header file to correctly reflect this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] gspca-sonixb: Adjust hstart on sn9c103 + pas202

For some unknown reason we need to increase hstart by 1 on when using the
PAS202 on the sn9c103 (versus on the sn9c102), otherwise we get the wrong
colors, due to shifting of the bayer pattern.

Reported-by: Patrizio Bassi <patrizio.bassi@gmail.com>
Tested-by: Patrizio Bassi <patrizio.bassi@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] media: davinci: vpbe: fix layer availability for NV12 format

For NV12 format, even if display data is single image,
both VIDWIN0 and VIDWIN1 parameters must be used. The start
address of Y data plane and C data plane is configured in
VIDEOWIN0ADH/L and VIDEOWIN1ADH/L respectively.
cuurently only one layer was requested, which is suffice
for yuv422, but for yuv420(NV12) two layers are required and
fix the same by requesting for other layer if pix fmt is NV12
during set_fmt.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] davinci: vpfe: fix error path in probe

The error path on failure was calling mutex_unlock(), but there was
no actuall call before for mutex_lock(). This patch fixes this issue
by pointing it to proper go label.

Reported-by: Jose Pablo Carballo <jose.carballo@ridgerun.com>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] davinci: vpfe: fix error return code in vpfe_probe()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] v4l2: SI476X MFD - Do not use binary constants

Gcc < 4.3 doesn't understand binary constanrs (0b*):
drivers/media/radio/radio-si476x.c:862:20: error: invalid suffix "b10000000" on integer constant
Hence use a hexadecimal constant (0x*) instead.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] radio-si476x: depend on SND_SOC

It is not possible to select SND_SOC_SI476X if we have not also
enabled SND_SOC.
warning: (RADIO_SI476X) selects SND_SOC_SI476X which has unmet
	 direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC)

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[hans.verkuil@cisco.com: fixed wrong driver name in subject]
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] DocBook: media: update codec section, drop obsolete 'suspended' state

The Codec section in the V4L2 specification was marked as 'suspended', even
though codec support has been around for quite some time. Update this
section, explaining a bit about memory-to-memory devices and pointing to
the MPEG controls section.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] vpfe-capture.c: remove unused label probe_free_lock

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] exynos4-is: Fix potential null pointer dereference in mipi-csis.c

When 'node' is NULL, the print statement tries to dereference it.
Hence replace the variable with the one that is accessible.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] s3c-camif: Fix incorrect variable type

'rotation' was an 8 bit variable and hence could not have values
greater than 255. Since we need higher values, change it to 16
bit type.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] s5c73m3: Fix off-by-one valid range checking for fie->index

Current code uses fie->index as array subscript, thus the valid value range
is 0 ... ARRAY_SIZE(s5c73m3_intervals) - 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] exynos4-is: Fix off-by-one valid range checking for is->config_index

Current code uses is->config_index as array subscript, thus the valid value
range is 0 ... ARRAY_SIZE(cmd) - 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] exynos4-is: Correct fimc-lite compatible property description

Ensure the compatible property for FIMC-LITE IP blocks is properly
documented, a cut&paste error fix.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] drivers/staging: davinci: vpfe: fix dependency for building the driver

from commit 3778d05036cc7ddd983ae2451da579af00acdac2
[media: davinci: kconfig: fix incorrect selects]
VIDEO_VPFE_CAPTURE was removed but there was a negative
dependancy for building the DM365 VPFE MC based capture driver
(VIDEO_DM365_VPFE), This patch fixes this dependency by replacing
the VIDEO_VPFE_CAPTURE with VIDEO_DM365_ISIF, so as when older DM365
ISIF v4l driver is selected the newer media controller driver for
DM365 isnt visible.

Reported-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] staging/solo6x10: select the desired font

Make sure FONT_8x16 can be found by find_font().

Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] s5p-mfc: Update v6 encoder buffer alloc

MFC v6 needs minimum number of output buffers to be queued
for encoder depending on the stream type and profile.
The patch modifies the driver so that encoding cannot be
started with lesser number of OUTPUT buffers than required.
This also fixes the crash happeninig during multi instance
encoder-decoder simultaneous run due to memory allocation
happening from interrupt context.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] media: vb2: return for polling if a buffer is available

The vb2_poll() does not need to wait next vb_buffer_done() if there is already
a buffer in done_list of queue, but current vb2_poll() always waits.
So done_list is checked before calling poll_wait().

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] media: v4l2-mem2mem: return for polling if a buffer is available

The v4l2_m2m_poll() does not need to wait if there is already a buffer in
done_list of source and destination queues, but current v4l2_m2m_poll() always
waits. So done_list of each queue is checked before calling poll_wait().

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] v4l2-mem2mem: add v4l2_m2m_create_bufs helper

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>