platform/kernel/linux-3.10.git
9 years agoupstream: [media] videobuf2: Add missing lock held on vb2_fop_release
Ricardo Ribalda [Mon, 25 Nov 2013 08:49:02 +0000 (05:49 -0300)]
upstream: [media] videobuf2: Add missing lock held on vb2_fop_release

vb2_fop_release does not hold the lock although it is modifying the
queue->owner field.
This could lead to race conditions on the vb2_perform_io function
when multiple applications are accessing the video device via
read/write API:
[ 308.297741] BUG: unable to handle kernel NULL pointer dereference at
0000000000000260
[ 308.297759] IP: [<ffffffffa07a9fd2>] vb2_perform_fileio+0x372/0x610
[videobuf2_core]
[ 308.297794] PGD 159719067 PUD 158119067 PMD 0
[ 308.297812] Oops: 0000 #1 SMP
[ 308.297826] Modules linked in: qt5023_video videobuf2_dma_sg
qtec_xform videobuf2_vmalloc videobuf2_memops videobuf2_core
qtec_white qtec_mem gpio_xilinx qtec_cmosis qtec_pcie fglrx(PO)
spi_xilinx spi_bitbang qt5023
[ 308.297888] CPU: 1 PID: 2189 Comm: java Tainted: P O 3.11.0-qtec-standard #1
[ 308.297919] Hardware name: QTechnology QT5022/QT5022, BIOS
PM_2.1.0.309 X64 05/23/2013
[ 308.297952] task: ffff8801564e1690 ti: ffff88014dc02000 task.ti:
ffff88014dc02000
[ 308.297962] RIP: 0010:[<ffffffffa07a9fd2>] [<ffffffffa07a9fd2>]
vb2_perform_fileio+0x372/0x610 [videobuf2_core]
[ 308.297985] RSP: 0018:ffff88014dc03df8 EFLAGS: 00010202
[ 308.297995] RAX: 0000000000000000 RBX: ffff880158a23000 RCX: dead000000100100
[ 308.298003] RDX: 0000000000000000 RSI: dead000000200200 RDI: 0000000000000000
[ 308.298012] RBP: ffff88014dc03e58 R08: 0000000000000000 R09: 0000000000000001
[ 308.298020] R10: ffffea00051e8380 R11: ffff88014dc03fd8 R12: ffff880158a23070
[ 308.298029] R13: ffff8801549040b8 R14: 0000000000198000 R15: 0000000001887e60
[ 308.298040] FS: 00007f65130d5700(0000) GS:ffff88015ed00000(0000)
knlGS:0000000000000000
[ 308.298049] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 308.298057] CR2: 0000000000000260 CR3: 0000000159630000 CR4: 00000000000007e0
[ 308.298064] Stack:
[ 308.298071] ffff880156416c00 0000000000198000 0000000000000000
ffff880100000001
[ 308.298087] ffff88014dc03f50 00000000810a79ca 0002000000000001
ffff880154904718
[ 308.298101] ffff880156416c00 0000000000198000 ffff880154904338
ffff88014dc03f50
[ 308.298116] Call Trace:
[ 308.298143] [<ffffffffa07aa3c4>] vb2_read+0x14/0x20 [videobuf2_core]
[ 308.298198] [<ffffffffa07aa494>] vb2_fop_read+0xc4/0x120 [videobuf2_core]
[ 308.298252] [<ffffffff8154ee9e>] v4l2_read+0x7e/0xc0
[ 308.298296] [<ffffffff8116e639>] vfs_read+0xa9/0x160
[ 308.298312] [<ffffffff8116e882>] SyS_read+0x52/0xb0
[ 308.298328] [<ffffffff81784179>] tracesys+0xd0/0xd5
[ 308.298335] Code: e5 d6 ff ff 83 3d be 24 00 00 04 89 c2 4c 8b 45 b0
44 8b 4d b8 0f 8f 20 02 00 00 85 d2 75 32 83 83 78 03 00 00 01 4b 8b
44 c5 48 <8b> 88 60 02 00 00 85 c9 0f 84 b0 00 00 00 8b 40 58 89 c2 41
89
[ 308.298487] RIP [<ffffffffa07a9fd2>] vb2_perform_fileio+0x372/0x610
[videobuf2_core]
[ 308.298507] RSP <ffff88014dc03df8>
[ 308.298514] CR2: 0000000000000260
[ 308.298526] ---[ end trace e8f01717c96d1e41 ]---

Signed-off-by: Ricardo Ribalda <ricardo.ribalda@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] videobuf2: Add log for size checking error in __qbuf_dmabuf
Seung-Woo Kim [Fri, 29 Nov 2013 07:50:29 +0000 (04:50 -0300)]
upstream: [media] videobuf2: Add log for size checking error in __qbuf_dmabuf

__qbuf_dmabuf checks whether size of provided dmabuf is large
enough, and it returns error without any log. So this patch adds
error log in the case.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] vb2: Return 0 when streamon and streamoff are already on/off
Ricardo Ribalda [Fri, 8 Nov 2013 10:08:45 +0000 (07:08 -0300)]
upstream: [media] vb2: Return 0 when streamon and streamoff are already on/off

According to the doc:
If VIDIOC_STREAMON is called when streaming is already in progress,
or if VIDIOC_STREAMOFF is called when streaming is already stopped,
then the ioctl does nothing and 0 is returned.
The current implementation was returning -EINVAL instead.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] smiapp: Fix BUG_ON() on an impossible condition
Ricardo Ribalda Delgado [Wed, 6 Nov 2013 14:21:30 +0000 (11:21 -0300)]
upstream: [media] smiapp: Fix BUG_ON() on an impossible condition

internal_csi_format_idx and csi_format_idx are unsigned integers,
therefore they can never be nevative.
CC      drivers/media/i2c/smiapp/smiapp-core.o
In file included from include/linux/err.h:4:0,
                 from include/linux/clk.h:15,
                 from drivers/media/i2c/smiapp/smiapp-core.c:29:
drivers/media/i2c/smiapp/smiapp-core.c: In function ‘smiapp_update_mbus_formats’:
include/linux/kernel.h:669:20: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
 #define min(x, y) ({    \
                    ^
include/linux/compiler.h:153:42: note: in definition of macro ‘unlikely’
 # define unlikely(x) __builtin_expect(!!(x), 0)
                                          ^
drivers/media/i2c/smiapp/smiapp-core.c:402:2: note: in expansion of macro ‘BUG_ON’
  BUG_ON(min(internal_csi_format_idx, csi_format_idx) < 0);
  ^
drivers/media/i2c/smiapp/smiapp-core.c:402:9: note: in expansion of macro ‘min’
  BUG_ON(min(internal_csi_format_idx, csi_format_idx) < 0);
         ^

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] bcm2048: add TODO file for this staging driver
Hans Verkuil [Mon, 4 Nov 2013 11:37:34 +0000 (08:37 -0300)]
upstream: [media] bcm2048: add TODO file for this staging driver

Describe the tasks to be done for this driver to be promoted to a
non-staging one.

[m.chehab@samsung.com: Add a patch description; add a note about the
 CodingStyle issues and make sure that the README lines are not bigger
 than 80 cols.]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] This adds support for the BCM2048 radio module found in Nokia N900
Hans Verkuil [Mon, 4 Nov 2013 11:34:42 +0000 (08:34 -0300)]
upstream: [media] This adds support for the BCM2048 radio module found in Nokia N900

Add suport for Nokia N900 radio. This driver is far from being ready
to be added at the main tree, as it creates its own sysfs interface,
and violates lots of Coding Style rules, doing even evil things like
returning from a function inside a macro.

So, it is being added at staging with the condition that it will be
soon be fixed.

[m.chehab@samsung.com: added a description for the patch]
Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: Nils Faerber <nils.faerber@kernelconcepts.de>
Signed-off-by: Joni Lapilainen <joni.lapilainen@gmail.com>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: moved to staging, added slab.h include]

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] cx24117: Fix LNB set_voltage function
Luis Alves [Wed, 13 Nov 2013 18:06:44 +0000 (15:06 -0300)]
upstream: [media] cx24117: Fix LNB set_voltage function

This patch should fix/enhance the set_voltage function for
the cx24117 demodulator.

Signed-off-by: Luis Alves <ljalvs@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] cx24117: Add complete demod command list
Luis Alves [Wed, 13 Nov 2013 18:02:28 +0000 (15:02 -0300)]
upstream: [media] cx24117: Add complete demod command list

This patch adds the complete list of all the commands known
for the cx24117 demodulator.

Signed-off-by: Luis Alves <ljalvs@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] omap3isp: Add resizer data rate configuration to resizer_link_validate
Sakari Ailus [Wed, 2 Oct 2013 23:17:53 +0000 (20:17 -0300)]
upstream: [media] omap3isp: Add resizer data rate configuration to resizer_link_validate

The configuration of many other blocks depend on resizer maximum data rate.
Get the value from resizer at link validation time.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] omap3isp: Mark which pads must connect
Sakari Ailus [Wed, 2 Oct 2013 23:17:52 +0000 (20:17 -0300)]
upstream: [media] omap3isp: Mark which pads must connect

Mark pads that must be connected.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] media: Check for active links on pads with MEDIA_PAD_FL_MUST_CONNEC...
Sakari Ailus [Sun, 13 Oct 2013 11:00:26 +0000 (08:00 -0300)]
upstream: [media] media: Check for active links on pads with MEDIA_PAD_FL_MUST_CONNECT flag

Do not allow streaming if a pad with MEDIA_PAD_FL_MUST_CONNECT flag is not
connected by an active link.
This patch makes it possible to avoid drivers having to check for the most
common case of link state validation: a sink pad that must be connected.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] media: Add pad flag MEDIA_PAD_FL_MUST_CONNECT
Sakari Ailus [Sun, 13 Oct 2013 10:58:43 +0000 (07:58 -0300)]
upstream: [media] media: Add pad flag MEDIA_PAD_FL_MUST_CONNECT

Pads that set this flag must be connected by an active link for the entity
to stream.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: omap3isp: Modify clocks registration to avoid circular references
Sylwester Nawrocki [Tue, 29 Oct 2013 19:51:04 +0000 (20:51 +0100)]
upstream: omap3isp: Modify clocks registration to avoid circular references

The clock core code is going to be modified so clk_get() takes
reference on the clock provider module. Until the potential circular
reference issue is properly addressed, we pass NULL as the first
argument to clk_register(), in order to disallow sub-devices taking
a reference on the ISP module back trough clk_get(). This should
prevent locking the modules in memory.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
9 years agoupstream: [media] v4l: omap4iss: Implement VIDIOC_S_INPUT
Laurent Pinchart [Mon, 4 Nov 2013 09:59:26 +0000 (06:59 -0300)]
upstream: [media] v4l: omap4iss: Implement VIDIOC_S_INPUT

The ioctl is (at least currently) mandatory.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Move code out of mutex-protected section
Laurent Pinchart [Mon, 4 Nov 2013 09:52:10 +0000 (06:52 -0300)]
upstream: [media] v4l: omap4iss: Move code out of mutex-protected section

The pad::get_fmt call must be protected by a mutex, but preparing its
arguments doesn't need to be. Move the non-critical code out of the
mutex-protected section.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Translate -ENOIOCTLCMD to -ENOTTY
Laurent Pinchart [Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)]
upstream: [media] v4l: omap4iss: Translate -ENOIOCTLCMD to -ENOTTY

Translating -ENOIOCTLCMD to -EINVAL is invalid, the correct ioctl return
value is -ENOTTY.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Don't check for missing get_fmt op on remote subdev
Laurent Pinchart [Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)]
upstream: [media] v4l: omap4iss: Don't check for missing get_fmt op on remote subdev

The remote subdev of any video node in the OMAP4 ISS is an internal
subdev that is guaranteed to implement get_fmt. Don't check the return
value for -ENOIOCTLCMD, as this can't happen.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Simplify error paths
Laurent Pinchart [Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)]
upstream: [media] v4l: omap4iss: Simplify error paths

Get rid of a goto statement for a simple error path that can be inlined,
and split spaghetti error code to a separate section.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Don't initialize fields to 0 manually
Laurent Pinchart [Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)]
upstream: [media] v4l: omap4iss: Don't initialize fields to 0 manually

The iss_device structure is allocated with kzalloc, there's no need to
initialize its fields to 0 explicitly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Make loop counters unsigned where appropriate
Laurent Pinchart [Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)]
upstream: [media] v4l: omap4iss: Make loop counters unsigned where appropriate

Loop counters that can only take positive values should be unsigned.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Make omap4iss_isp_subclk_(en|dis)able() functions...
Laurent Pinchart [Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)]
upstream: [media] v4l: omap4iss: Make omap4iss_isp_subclk_(en|dis)able() functions void

The functions always succeed, there's no need to return an error value.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Replace udelay/msleep with usleep_range
Laurent Pinchart [Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)]
upstream: [media] v4l: omap4iss: Replace udelay/msleep with usleep_range

The only udelay() call takes place in a sleepable context, we can sleep
instead. Use usleep_range().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Remove unneeded status variable
Laurent Pinchart [Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)]
upstream: [media] v4l: omap4iss: Remove unneeded status variable

The failure variable is initialized with 0 and used as a return value
without ever being modified. Remove it and return 0 directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Remove duplicate video_is_registered() check
Laurent Pinchart [Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)]
upstream: [media] v4l: omap4iss: Remove duplicate video_is_registered() check

The video_unregister_device() function checks if the video device is
registered before proceeding, remote the duplicate check from the
driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Set the vb2 timestamp type
Laurent Pinchart [Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)]
upstream: [media] v4l: omap4iss: Set the vb2 timestamp type

Timestamps use the monotonic clock, configure the vb2 queue accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Remove iss_video streaming field
Laurent Pinchart [Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)]
upstream: [media] v4l: omap4iss: Remove iss_video streaming field

The vb2 queue already keeps track of the streaming state, there's no
need to duplicate that in the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Report device caps in response to VIDIOC_QUERYCAP
Laurent Pinchart [Sun, 3 Nov 2013 23:28:24 +0000 (20:28 -0300)]
upstream: [media] v4l: omap4iss: Report device caps in response to VIDIOC_QUERYCAP

Set the v4l2_capability capabilities and device_caps fields correctly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Move common code out of switch...case
Laurent Pinchart [Sun, 3 Nov 2013 23:17:51 +0000 (20:17 -0300)]
upstream: [media] v4l: omap4iss: Move common code out of switch...case

Code common to all cases can be moved out of the switch...case
statement.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Don't use v4l2_g_ext_ctrls() internally
Laurent Pinchart [Sun, 3 Nov 2013 23:13:32 +0000 (20:13 -0300)]
upstream: [media] v4l: omap4iss: Don't use v4l2_g_ext_ctrls() internally

Instead of using the extended control API internally to get the sensor
pixel rate, use the dedicated in-kernel APIs (find the control with
v4l2_ctrl_find() and get its value with v4l2_ctrl_g_ctrl_int64()).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Add support for OMAP4 camera interface - Build system
Laurent Pinchart [Wed, 2 Oct 2013 23:27:07 +0000 (20:27 -0300)]
upstream: [media] v4l: omap4iss: Add support for OMAP4 camera interface - Build system

This adds a very simplistic driver to utilize the CSI2A interface inside
the ISS subsystem in OMAP4, and dump the data to memory.
Check Documentation/video4linux/omap4_camera.txt for details.
This commit adds and updates Kconfig's and Makefile's, as well as a TODO
list.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Add support for OMAP4 camera interface - Resizer
Sergio Aguirre [Mon, 24 Jan 2011 18:48:19 +0000 (15:48 -0300)]
upstream: [media] v4l: omap4iss: Add support for OMAP4 camera interface - Resizer

This adds a very simplistic driver to utilize the CSI2A interface inside
the ISS subsystem in OMAP4, and dump the data to memory.
Check Documentation/video4linux/omap4_camera.txt for details.
This commit adds resizer support.
[Port the driver to v3.12-rc3, including the following changes
- Don't include plat/ headers
- Don't use cpu_is_omap44xx() macro
- Don't depend on EXPERIMENTAL
- Fix s_crop operation prototype
- Update link_notify prototype
- Rename media_entity_remote_source to media_entity_remote_pad]

Signed-off-by: Sergio Aguirre <sergio.a.aguirre@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Add support for OMAP4 camera interface - IPIPE(IF)
Sergio Aguirre [Mon, 24 Jan 2011 18:48:19 +0000 (15:48 -0300)]
upstream: [media] v4l: omap4iss: Add support for OMAP4 camera interface - IPIPE(IF)

This adds a very simplistic driver to utilize the CSI2A interface inside
the ISS subsystem in OMAP4, and dump the data to memory.
Check Documentation/video4linux/omap4_camera.txt for details.
This commit adds the IPIPEIF and IPIPE processing blocks support.

Signed-off-by: Sergio Aguirre <sergio.a.aguirre@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Add support for OMAP4 camera interface - CSI receivers
Sergio Aguirre [Mon, 24 Jan 2011 18:48:19 +0000 (15:48 -0300)]
upstream: [media] v4l: omap4iss: Add support for OMAP4 camera interface - CSI receivers

This adds a very simplistic driver to utilize the CSI2A interface inside
the ISS subsystem in OMAP4, and dump the data to memory.
Check Documentation/video4linux/omap4_camera.txt for details.
This commit adds CSI receivers support.

Signed-off-by: Sergio Aguirre <sergio.a.aguirre@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Add support for OMAP4 camera interface - Video devices
Sergio Aguirre [Mon, 24 Jan 2011 18:48:19 +0000 (15:48 -0300)]
upstream: [media] v4l: omap4iss: Add support for OMAP4 camera interface - Video devices

This adds a very simplistic driver to utilize the CSI2A interface inside
the ISS subsystem in OMAP4, and dump the data to memory.
Check Documentation/video4linux/omap4_camera.txt for details.
This commit adds video devices support.

Signed-off-by: Sergio Aguirre <sergio.a.aguirre@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l: omap4iss: Add support for OMAP4 camera interface - Core
Sergio Aguirre [Mon, 24 Jan 2011 18:48:19 +0000 (15:48 -0300)]
upstream: [media] v4l: omap4iss: Add support for OMAP4 camera interface - Core

This adds a very simplistic driver to utilize the CSI2A interface inside
the ISS subsystem in OMAP4, and dump the data to memory.
Check Documentation/video4linux/omap4_camera.txt for details.
This commit adds the driver core, registers definitions and
documentation.

Signed-off-by: Sergio Aguirre <sergio.a.aguirre@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] mt9p031: Include linux/of.h header
Sachin Kamat [Fri, 18 Oct 2013 03:07:11 +0000 (00:07 -0300)]
upstream: [media] mt9p031: Include linux/of.h header

'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] ths7303: Declare as static a private function
Ricardo Ribalda [Wed, 6 Nov 2013 14:40:18 +0000 (11:40 -0300)]
upstream: [media] ths7303: Declare as static a private function

git grep shows that the function is only called from ths7303.c
Fix this build warning:
CC      drivers/media/i2c/ths7303.o
drivers/media/i2c/ths7303.c:86:5: warning: no previous prototype for  ‘ths7303_setval’ [-Wmissing-prototypes]
   int ths7303_setval(struct v4l2_subdev *sd, enum ths7303_filter_mode mode)
        ^

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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>
9 years agoupstream: [media] marvell-ccic: drop resource free in driver remove
Libin Yang [Tue, 5 Nov 2013 02:18:15 +0000 (23:18 -0300)]
upstream: [media] marvell-ccic: drop resource free in driver remove

The mmp-driver is using devm_* to allocate the resource. The old
resource release methods are not appropriate here.

Signed-off-by: Libin Yang <lbyang@marvell.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org # for v3.12 and up
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] tef6862/radio-tea5764: actually assign clamp result
Hans Verkuil [Mon, 4 Nov 2013 09:28:57 +0000 (06:28 -0300)]
upstream: [media] tef6862/radio-tea5764: actually assign clamp result

When adding frequency clamping to the tef6862 and radio-tea5764 drivers
I forgot to actually *assign* the clamp result to the frequency.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Hans Petter Selasky <hps@bitfrost.no>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: stable@vger.kernel.org # for 3.11 and up
9 years agoupstream: [media] videobuf2: Add support for file access mode flags for DMABUF exporting
Philipp Zabel [Tue, 21 May 2013 08:11:35 +0000 (05:11 -0300)]
upstream: [media] videobuf2: Add support for file access mode flags for DMABUF exporting

Currently it is not possible for userspace to map a DMABUF exported buffer
with write permissions. This patch allows to also pass O_RDONLY/O_RDWR when
exporting the buffer, so that userspace may map it with write permissions.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] cxd2820r_c: fix if_ctl calculation
Evgeny Plehov [Sat, 9 Nov 2013 21:45:41 +0000 (18:45 -0300)]
upstream: [media] cxd2820r_c: fix if_ctl calculation

fixes tuning for DVB-C

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] technisat-usb2: fix typo in variable name
Felipe Pena [Sat, 9 Nov 2013 21:36:22 +0000 (18:36 -0300)]
upstream: [media] technisat-usb2: fix typo in variable name

The variable txlen was used instead of rxlen in boundary check.
(copy-paste error)

Signed-off-by: Felipe Pena <felipensp@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] dvb_demux: clean up whitespace in comments from previous patch...
Michael Krufky [Sat, 9 Nov 2013 21:30:13 +0000 (18:30 -0300)]
upstream: [media] dvb_demux: clean up whitespace in comments from previous patch (trivial)

removes trailing whitespace and rebalance line length in comment block

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] dvb_demux: fix deadlock in dmx_section_feed_release_filter()
Alexey Khoroshilov [Sat, 9 Nov 2013 21:28:43 +0000 (18:28 -0300)]
upstream: [media] dvb_demux: fix deadlock in dmx_section_feed_release_filter()

dmx_section_feed_release_filter() locks dvbdmx->mutex and
if the feed is still filtering, it calls feed->stop_filtering(feed).
stop_filtering() is implemented by dmx_section_feed_stop_filtering()
that first of all try to lock the same mutex: dvbdmx->mutex.
That leads to a deadlock.
It does not happen often in practice because all callers of
release_filter() stop filtering by themselves.
So the problem can happen in case of race condition only.
The patch releases dvbdmx->mutex before call to feed->stop_filtering(feed)
and reacquires the mutex after that.
Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] gspca_sunplus: Add new usb-id for 06d6:0041
Hans de Goede [Sun, 24 Nov 2013 13:03:57 +0000 (10:03 -0300)]
upstream: [media] gspca_sunplus: Add new usb-id for 06d6:0041

Reported-by: mjs <mjstork@gmail.com>
Tested-by: mjs <mjstork@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] radio-shark2: Mark shark_resume_leds() inline to kill compiler...
Hans de Goede [Sun, 17 Nov 2013 13:48:29 +0000 (10:48 -0300)]
upstream: [media] radio-shark2: Mark shark_resume_leds() inline to kill compiler warning

This mirrors the patch to the radio-shark driver by Geert Uytterhoeven.
If SHARK_USE_LEDS=1, but CONFIG_PM=n:
drivers/media/radio/radio-shark2.c:240: warning: ‘shark_resume_leds’ defined but not used
Instead of making the #ifdef logic even more complicated (there are already
two definitions of shark_resume_leds()), mark shark_resume_leds() inline to
kill the compiler warning. shark_resume_leds() is small and it has only one
caller.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] gspca-stk1135: Add delay after configuring clock
Ondrej Zary [Sun, 3 Nov 2013 00:09:07 +0000 (21:09 -0300)]
upstream: [media] gspca-stk1135: Add delay after configuring clock

Add a small delay at the end of configure_clock() to allow sensor to initialize.
This is needed by Asus VX2S laptop webcam to detect sensor type properly (the already-supported MT9M112).

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>
9 years agoupstream: [media] radio-shark: Mark shark_resume_leds() inline to kill compiler warning
Geert Uytterhoeven [Mon, 28 Oct 2013 12:16:05 +0000 (09:16 -0300)]
upstream: [media] radio-shark: Mark shark_resume_leds() inline to kill compiler warning

If SHARK_USE_LEDS=1, but CONFIG_PM=n:
drivers/media/radio/radio-shark.c:275: warning: ‘shark_resume_leds’ defined but not used
Instead of making the #ifdef logic even more complicated (there are already
two definitions of shark_resume_leds()), mark shark_resume_leds() inline to
kill the compiler warning. shark_resume_leds() is small and it has only one
caller.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: vsp1: Fix error return code in vsp1_video_init()
Wei Yongjun [Wed, 11 Sep 2013 14:10:24 +0000 (11:10 -0300)]
upstream: [media] v4l: vsp1: Fix error return code in vsp1_video_init()

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>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: Staging: go7007: fix up some remaining go->dev issues
Greg Kroah-Hartman [Mon, 25 Nov 2013 17:29:32 +0000 (09:29 -0800)]
upstream: Staging: go7007: fix up some remaining go->dev issues

This fixes up the remaining "dev is used before it is set" issues in the
go7007 driver that were originally caused by commit
b6ea5ef80aa7fd6f4b18ff2e4174930e8772e812 but not fixed up by reverting
it due to other patches later on adding these "fixes".

Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: 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: Staging: lirc: fix line over 80 characters
Matina Maria Trompouki [Mon, 11 Nov 2013 00:29:12 +0000 (00:29 +0000)]
upstream: Staging: lirc: fix line over 80 characters

This patch removes the following warning reported by checkpatch.pl

WARNING: line over 80 characters
drivers/staging/media/lirc/lirc_imon.c

Signed-off-by: Matina Maria Trompouki <mtrompou@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoupstream: Staging: lirc: fix quoted string split across lines
Matina Maria Trompouki [Mon, 11 Nov 2013 01:11:22 +0000 (01:11 +0000)]
upstream: Staging: lirc: fix quoted string split across lines

This patch removes the following warning reported by checkpatch.pl

WARNING: quoted string split across lines

drivers/staging/media/lirc/lirc_igorplugusb.c
drivers/staging/media/lirc/lirc_imon.c
drivers/staging/media/lirc/lirc_serial.c
drivers/staging/media/lirc/lirc_zilog.c

Signed-off-by: Matina Maria Trompouki <mtrompou@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoupstream: staging: media: davinci_vpfe:Removed space before semicolon in dm365_ipipe_hw.c
Archana kumari [Sun, 3 Nov 2013 06:21:31 +0000 (11:51 +0530)]
upstream: staging: media: davinci_vpfe:Removed space before semicolon in dm365_ipipe_hw.c

This patch fixes "space prohibted before semicolon" warning in dm365_ipipe_hw.cdetected via checkpatch.pl

Signed-off-by: Archana kumari <archanakumari959@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoupstream: staging:media:go7007:saa7134-go7007.c: Remove space before tabs
Himangi Saraogi [Sat, 2 Nov 2013 17:12:22 +0000 (22:42 +0530)]
upstream: staging:media:go7007:saa7134-go7007.c: Remove space before tabs

This patch removes the checkpatch.pl warning "please, no space before
tabs" in saa7134-go7007.c by converting space followed by tab to tab
followed by tab.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoupstream: staging:media:go7007:go7007-fw.c: move trailing statement to next line
Himangi Saraogi [Sat, 2 Nov 2013 12:20:56 +0000 (17:50 +0530)]
upstream: staging:media:go7007:go7007-fw.c: move trailing statement to next line

This patch removes the checkpatch.pl error "trailing statements should
be on next line" in go7007-fw.c.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoupstream: Staging: media: fix space prohibited before semicolon
Ebru Akagunduz [Fri, 1 Nov 2013 17:00:38 +0000 (19:00 +0200)]
upstream: Staging: media: fix space prohibited before semicolon

Fix checkpatch.pl issues with space prohibited before semicolon in dm365_ipipe.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoupstream: staging: media: lirc: fixed sparse warnings by adding __user annotations...
Archana kumari [Fri, 1 Nov 2013 08:35:44 +0000 (14:05 +0530)]
upstream: staging: media: lirc: fixed sparse warnings by adding __user annotations in lirc_serial.c

This patch fixes sparse warning by adding __user annotations in
lirc_serial.c

Signed-off-by: Archana kumari <archanakumari959@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoupstream: [media] v4l2-async: Don't use dynamic static allocation
Mauro Carvalho Chehab [Sat, 2 Nov 2013 09:20:16 +0000 (06:20 -0300)]
upstream: [media] v4l2-async: Don't use dynamic static allocation

Dynamic static allocation is evil, as Kernel stack is too low, and
compilation complains about it on some archs:
drivers/media/v4l2-core/v4l2-async.c:238:1: warning: 'v4l2_async_notifier_unregister' uses dynamic stack allocation [enabled by default]
Instead, let's enforce a limit for the buffer.
In this specific case, there's a hard limit imposed by V4L2_MAX_SUBDEVS,
with is currently 128. That means that the buffer size can be up to
128x8 = 1024 bytes (on a 64bits kernel), with is too big for stack.
Worse than that, someone could increase it and cause real troubles.
So, let's use dynamically allocated data, instead.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] uvc/lirc_serial: Fix some warnings on parisc arch
Mauro Carvalho Chehab [Fri, 1 Nov 2013 18:39:53 +0000 (15:39 -0300)]
upstream: [media] uvc/lirc_serial: Fix some warnings on parisc arch

On this arch, usec is not unsigned long. So, we need to typecast,
in order to remove those warnings:
drivers/media/usb/uvc/uvc_video.c: In function 'uvc_video_clock_update':
drivers/media/usb/uvc/uvc_video.c:678:2: warning: format '%lu' expects argument of type 'long unsigned int', but argument 9 has type '__kernel_suseconds_t' [-Wformat]
drivers/staging/media/lirc/lirc_serial.c: In function 'irq_handler':
drivers/staging/media/lirc/lirc_serial.c:707:5: warning: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type '__kernel_suseconds_t' [-Wformat]
drivers/staging/media/lirc/lirc_serial.c:707:5: warning: format '%lx' expects argument of type 'long unsigned int', but argument 7 has type '__kernel_suseconds_t' [-Wformat]
drivers/staging/media/lirc/lirc_serial.c:719:5: warning: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type '__kernel_suseconds_t' [-Wformat]
drivers/staging/media/lirc/lirc_serial.c:719:5: warning: format '%lx' expects argument of type 'long unsigned int', but argument 7 has type '__kernel_suseconds_t' [-Wformat]
drivers/staging/media/lirc/lirc_serial.c:728:6: warning: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type '__kernel_suseconds_t' [-Wformat]
drivers/staging/media/lirc/lirc_serial.c:728:6: warning: format '%lx' expects argument of type 'long unsigned int', but argument 7 has type '__kernel_suseconds_t' [-Wformat]

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-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] rc: Fir warnings on m68k arch
Mauro Carvalho Chehab [Fri, 1 Nov 2013 17:37:17 +0000 (14:37 -0300)]
upstream: [media] rc: Fir warnings on m68k arch

Fix the following warnings:
drivers/media/rc/fintek-cir.c: In function 'fintek_cr_write':
drivers/media/rc/fintek-cir.c:45:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/fintek-cir.c:46:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/fintek-cir.c: In function 'fintek_cr_read':
drivers/media/rc/fintek-cir.c:54:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/fintek-cir.c:55:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/fintek-cir.c: In function 'fintek_config_mode_enable':
drivers/media/rc/fintek-cir.c:80:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/fintek-cir.c:81:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/fintek-cir.c: In function 'fintek_config_mode_disable':
drivers/media/rc/fintek-cir.c:87:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/nuvoton-cir.c: In function 'nvt_cr_write':
drivers/media/rc/nuvoton-cir.c:45:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/nuvoton-cir.c:46:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/nuvoton-cir.c: In function 'nvt_cr_read':
drivers/media/rc/nuvoton-cir.c:52:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/nuvoton-cir.c:53:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/nuvoton-cir.c: In function 'nvt_efm_enable':
drivers/media/rc/nuvoton-cir.c:74:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/nuvoton-cir.c:75:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/nuvoton-cir.c: In function 'nvt_efm_disable':
drivers/media/rc/nuvoton-cir.c:81:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/nuvoton-cir.c: In function 'nvt_select_logical_dev':
drivers/media/rc/nuvoton-cir.c:91:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/media/rc/nuvoton-cir.c:92:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Those are caused because the I/O port is u32, instead of u8.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] radio-si470x-i2c: fix a warning on ia64
Mauro Carvalho Chehab [Fri, 1 Nov 2013 17:24:21 +0000 (14:24 -0300)]
upstream: [media] radio-si470x-i2c: fix a warning on ia64

on ia64, those warnings appear:
drivers/media/radio/si470x/radio-si470x-i2c.c:470:12: warning: 'si470x_i2c_suspend' defined but not used [-Wunused-function]
drivers/media/radio/si470x/radio-si470x-i2c.c:487:12: warning: 'si470x_i2c_resume' defined but not used [-Wunused-function]
They're caused because the PM logic uses this define:
#define SET_SYSTEM_SLEEP_PM_OPS()
With is only defined for CONFIG_PM_SLEEP.
So, change the logic there to test for CONFIG_PM_SLEEP, instead of
CONFIG_PM.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] iguanair: simplify calculation of carrier delay cycles
Sean Young [Sun, 3 Nov 2013 22:13:57 +0000 (19:13 -0300)]
upstream: [media] iguanair: simplify calculation of carrier delay cycles

Simplify the logic that calculates the carrier, and removes a warning
on avr32 arch:
        drivers/media/rc/iguanair.c: In function 'iguanair_set_tx_carrier':
        drivers/media/rc/iguanair.c:304: warning: 'sevens' may be used uninitialized in this function

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] zoran: don't build it on alpha
Mauro Carvalho Chehab [Fri, 1 Nov 2013 15:55:20 +0000 (12:55 -0300)]
upstream: [media] zoran: don't build it on alpha

This driver uses virt_to_bus() with is deprecated on Alpha:
drivers/media/pci/zoran/zoran_device.c: In function 'zr36057_set_vfe':
drivers/media/pci/zoran/zoran_device.c:451:3: warning: 'virt_to_bus' is deprecated (declared at /devel/v4l/ktest-build/arch/alpha/include/asm/io.h:114) [-Wdeprecated-declarations]
drivers/media/pci/zoran/zoran_device.c:453:3: warning: 'virt_to_bus' is deprecated (declared at /devel/v4l/ktest-build/arch/alpha/include/asm/io.h:114) [-Wdeprecated-declarations]
drivers/media/pci/zoran/zoran_device.c: In function 'zr36057_set_jpg':
drivers/media/pci/zoran/zoran_device.c:796:2: warning: 'virt_to_bus' is deprecated (declared at /devel/v4l/ktest-build/arch/alpha/include/asm/io.h:114) [-Wdeprecated-declarations]
drivers/media/pci/zoran/zoran_driver.c: In function 'v4l_fbuffer_alloc':
drivers/media/pci/zoran/zoran_driver.c:241:3: warning: 'virt_to_bus' is deprecated (declared at /devel/v4l/ktest-build/arch/alpha/include/asm/io.h:114) [-Wdeprecated-declarations]
drivers/media/pci/zoran/zoran_driver.c:245:3: warning: 'virt_to_bus' is deprecated (declared at /devel/v4l/ktest-build/arch/alpha/include/asm/io.h:114) [-Wdeprecated-declarations]
drivers/media/pci/zoran/zoran_driver.c: In function 'jpg_fbuffer_alloc':
drivers/media/pci/zoran/zoran_driver.c:334:3: warning: 'virt_to_bus' is deprecated (declared at /devel/v4l/ktest-build/arch/alpha/include/asm/io.h:114) [-Wdeprecated-declarations]
drivers/media/pci/zoran/zoran_driver.c:347:5: warning: 'virt_to_bus' is deprecated (declared at /devel/v4l/ktest-build/arch/alpha/include/asm/io.h:114) [-Wdeprecated-declarations]
drivers/media/pci/zoran/zoran_driver.c:366:6: warning: 'virt_to_bus' is deprecated (declared at /devel/v4l/ktest-build/arch/alpha/include/asm/io.h:114) [-Wdeprecated-declarations]
As we're not even sure if it works on Alpha, better to just disable its compilation there.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] radio-shark: remove a warning when CONFIG_PM is not defined
Mauro Carvalho Chehab [Fri, 1 Nov 2013 15:44:54 +0000 (12:44 -0300)]
upstream: [media] radio-shark: remove a warning when CONFIG_PM is not defined

On alpha, allyesconfig doesn't have CONFIG_PM, and produces the following warnings:
drivers/media/radio/radio-shark.c:274:13: warning: 'shark_resume_leds' defined but not used [-Wunused-function]
drivers/media/radio/radio-shark2.c:240:13: warning: 'shark_resume_leds' defined but not used [-Wunused-function]
That's because those functions are used only at device resume.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: DMA-API: media: dt3155v4l: replace dma_set_mask()+dma_set_coherent_mask...
Russell King [Wed, 26 Jun 2013 22:49:11 +0000 (23:49 +0100)]
upstream: DMA-API: media: dt3155v4l: replace dma_set_mask()+dma_set_coherent_mask() with new helper

Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
9 years agoupstream: [media] media: st-rc: Add ST remote control driver
Srinivas Kandagatla [Fri, 18 Oct 2013 09:01:14 +0000 (06:01 -0300)]
upstream: [media] media: st-rc: Add ST remote control driver

This patch adds support to ST RC driver, which is basically a IR/UHF
receiver and transmitter. This IP (IRB) is common across all the ST
parts for settop box platforms. IRB is embedded in ST COMMS IP block.
It supports both Rx & Tx functionality.
This driver adds only Rx functionality via LIRC codec.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Acked-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] gpio-ir-recv: Include linux/of.h header
Sachin Kamat [Fri, 18 Oct 2013 03:07:15 +0000 (00:07 -0300)]
upstream: [media] gpio-ir-recv: Include linux/of.h header

'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] tvp7002: Include linux/of.h header
Sachin Kamat [Fri, 18 Oct 2013 03:07:14 +0000 (00:07 -0300)]
upstream: [media] tvp7002: Include linux/of.h header

'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] tvp514x: Include linux/of.h header
Sachin Kamat [Fri, 18 Oct 2013 03:07:13 +0000 (00:07 -0300)]
upstream: [media] tvp514x: Include linux/of.h header

'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] ths8200: Include linux/of.h header
Sachin Kamat [Fri, 18 Oct 2013 03:07:12 +0000 (00:07 -0300)]
upstream: [media] ths8200: Include linux/of.h header

'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] adv7343: Include linux/of.h header
Sachin Kamat [Fri, 18 Oct 2013 03:07:10 +0000 (00:07 -0300)]
upstream: [media] adv7343: Include linux/of.h header

'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: Fix typo in v4l2_subdev_get_try_crop()
Laurent Pinchart [Mon, 26 Aug 2013 09:17:51 +0000 (06:17 -0300)]
upstream: [media] v4l: Fix typo in v4l2_subdev_get_try_crop()

The helper function is defined by a macro that is erroneously called
with the compose rectangle instead of the crop rectangle. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl28xxu: add RTL2832P + R828D support
Antti Palosaari [Wed, 30 Oct 2013 03:45:38 +0000 (00:45 -0300)]
upstream: [media] rtl28xxu: add RTL2832P + R828D support

RTL2832P is version of RTL2832U with extra TS interface.
As for now, we support only integrated RTL2832 demod.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] rtl2832: add new tuner R828D
Antti Palosaari [Wed, 30 Oct 2013 03:36:38 +0000 (00:36 -0300)]
upstream: [media] rtl2832: add new tuner R828D

Use R820T config for R828D too as those are about same tuner.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] ddbridge: Remove casting the return value which is a void pointer
Jingoo Han [Mon, 9 Sep 2013 05:56:07 +0000 (02:56 -0300)]
upstream: [media] ddbridge: Remove casting the return value which is a void pointer

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] ngene: Remove casting the return value which is a void pointer
Jingoo Han [Mon, 9 Sep 2013 05:55:14 +0000 (02:55 -0300)]
upstream: [media] ngene: Remove casting the return value which is a void pointer

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] dm1105: remove unneeded not-null test
Alexandru Juncu [Wed, 4 Sep 2013 14:41:34 +0000 (11:41 -0300)]
upstream: [media] dm1105: remove unneeded not-null test

i2c_adap is a field of a struct and will always be allocated so
its address will never be null.
Suggested by coccinelle, manually verified.

Signed-off-by: Alexandru Juncu <alexj@rosedu.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] V4L2: (cosmetic) remove redundant use of unlikely()
Guennadi Liakhovetski [Thu, 18 Apr 2013 21:35:22 +0000 (18:35 -0300)]
upstream: [media] V4L2: (cosmetic) remove redundant use of unlikely()

BUG*() and WARN*() macros specify their conditions as unlikely, using
BUG_ON(unlikely(condition)) is redundant, remove it.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] platform: Kconfig: Select SRAM for VIDEO_CODA
Fabio Estevam [Mon, 30 Sep 2013 14:12:22 +0000 (11:12 -0300)]
upstream: [media] platform: Kconfig: Select SRAM for VIDEO_CODA

Running the coda driver without CONFIG_SRAM selected leads to the following
probe error:
coda 63ff4000.vpu: iram pool not available
coda: probe of 63ff4000.vpu failed with error -12
In order to avoid it, select CONFIG_SRAM inside VIDEO_CODA.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] coda: v4l2-compliance fix: zero pixel format priv field
Philipp Zabel [Mon, 30 Sep 2013 13:34:53 +0000 (10:34 -0300)]
upstream: [media] coda: v4l2-compliance fix: zero pixel format priv field

If unused, the pixel format priv field has to be cleared by the driver
in try_fmt.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] coda: v4l2-compliance fix: implement try_decoder_cmd
Philipp Zabel [Mon, 30 Sep 2013 13:34:52 +0000 (10:34 -0300)]
upstream: [media] coda: v4l2-compliance fix: implement try_decoder_cmd

Implement try_decoder_cmd to let userspace determine available commands
and flags.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] coda: v4l2-compliance fix: overwrite invalid pixel formats with...
Philipp Zabel [Mon, 30 Sep 2013 13:34:51 +0000 (10:34 -0300)]
upstream: [media] coda: v4l2-compliance fix: overwrite invalid pixel formats with the current setting

This patch fixes the v4l2-compliance "TRY_FMT(G_FMT) != G_FMT" issue.
The driver now overwrites invalid formats with the current setting, using
coda_get_max_dimensions to find device specific max width/height.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] coda: prefix v4l2_ioctl_ops with coda_ instead of vidioc_
Philipp Zabel [Mon, 30 Sep 2013 13:34:50 +0000 (10:34 -0300)]
upstream: [media] coda: prefix v4l2_ioctl_ops with coda_ instead of vidioc_

Moving the ioctl handler callbacks into the coda namespace helps
tremendously to make sense of backtraces.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
[k.debski@samsung.com: fix whitespace error near coda_subscribe_event]
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] coda: use picture type returned from hardware
Philipp Zabel [Mon, 30 Sep 2013 13:34:49 +0000 (10:34 -0300)]
upstream: [media] coda: use picture type returned from hardware

Instead of copying v4l2_buf.flags from the source buffer, set
the destination buffer flags as reported by the hardware codec.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] coda: move coda_product_name above vidioc_querycap
Philipp Zabel [Mon, 30 Sep 2013 13:34:48 +0000 (10:34 -0300)]
upstream: [media] coda: move coda_product_name above vidioc_querycap

Use the product name (currently CodaDx6 or CODA7541)
to fill the v4l2_capabilities.name field.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] coda: fix FMO value setting for CodaDx6
Philipp Zabel [Mon, 30 Sep 2013 13:34:47 +0000 (10:34 -0300)]
upstream: [media] coda: fix FMO value setting for CodaDx6

The register is only written on CodaDx6, so the temporary variable
to be written only needs to be initialized on CodaDx6. Also, drop
two no-op lines.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] coda: add compressed flag to format enumeration output
Philipp Zabel [Mon, 30 Sep 2013 13:34:46 +0000 (10:34 -0300)]
upstream: [media] coda: add compressed flag to format enumeration output

Correctly flag compressed formats in the ENUM_FMT ioctl output.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] coda: only set buffered input queue for decoder
Philipp Zabel [Mon, 30 Sep 2013 13:34:45 +0000 (10:34 -0300)]
upstream: [media] coda: only set buffered input queue for decoder

Allow device_run with no buffers queued after streamoff only when
the current instance is a decoder.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
[k.debski@samsung.com: Add commit description]
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] coda: allow more than four instances on CODA7541
Philipp Zabel [Mon, 30 Sep 2013 13:34:44 +0000 (10:34 -0300)]
upstream: [media] coda: allow more than four instances on CODA7541

With the new firmware, there are not anymore four register sets,
but a single register set, which the driver has to conserve across
context switches. This allows to handle more than four instances
at the same time.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l2-mem2mem: Don't schedule the context if abort job is called
Shaik Ameer Basha [Fri, 20 Sep 2013 06:26:18 +0000 (03:26 -0300)]
upstream: [media] v4l2-mem2mem: Don't schedule the context if abort job is called

When the current context is running,
1] If release is called, it waits until the job is finished.
2] As soon as the job is finished, v4l2_mem_ctx_release()tries to
   release the vb2 queues.
3] But if the current context can be scheduled in the v4l2_m2m_job_finish()
   it schedules the context and tries to call device_run().
4] As the release() and device_run() sequence can't be predicted sometimes
   device_run() may get empty vb2 buffers.

This patch adds the ABORT state to the job_flags. Once the job_abort() or
release() is called on the context, the same context will not be scheduled in
the v4l2_m2m_job_finish().

Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l2-mem2mem: clear m2m queue ready counter in v4l2_m2m_streamoff
Philipp Zabel [Thu, 19 Sep 2013 07:53:21 +0000 (04:53 -0300)]
upstream: [media] v4l2-mem2mem: clear m2m queue ready counter in v4l2_m2m_streamoff

v4l2_m2m_streamoff drops the list of ready buffers but failed to reset the
num_rdy counter to zero. This would lead to v4l2_m2m_num_src/dst_bufs_ready
reporting wrong values after streamoff.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l2-mem2mem: fix context removal from job queue in v4l2_m2m_streamoff
Philipp Zabel [Thu, 19 Sep 2013 07:40:32 +0000 (04:40 -0300)]
upstream: [media] v4l2-mem2mem: fix context removal from job queue in v4l2_m2m_streamoff

Just clearing the m2m_ctx->queue list_head will leave the m2m_dev->job_queue
in a broken state and can cause scheduling of device_runs after streamoff was
called.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] mem2mem_testdev: Remove casting the return value which is a void...
Jingoo Han [Mon, 9 Sep 2013 05:54:27 +0000 (02:54 -0300)]
upstream: [media] mem2mem_testdev: Remove casting the return value which is a void pointer

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] m2m-deinterlace: Remove casting the return value which is a void...
Jingoo Han [Mon, 9 Sep 2013 05:53:39 +0000 (02:53 -0300)]
upstream: [media] m2m-deinterlace: Remove casting the return value which is a void pointer

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: ti-vpe: Add de-interlacer support in VPE
Archit Taneja [Wed, 16 Oct 2013 05:36:48 +0000 (02:36 -0300)]
upstream: [media] v4l: ti-vpe: Add de-interlacer support in VPE

Add support for the de-interlacer block in VPE. For de-interlacer to
work, we need to enable 2 more sets of VPE input ports which fetch data
from the 'last' and 'last to last' fields of the interlaced video. Apart
from that, we need to enable the Motion vector output and input ports,
and also allocate DMA buffers for them.

We need to make sure that two most recent fields in the source queue are
available and in the 'READY' state. Once a mem2mem context gets access
to the VPE HW(in device_run), it extracts the addresses of the 3
buffers, and provides it to the data descriptors for the 3 sets of input
ports((LUMA1, CHROMA1), (LUMA2, CHROMA2), and (LUMA3, CHROMA3))
respectively for the 3 consecutive fields. The motion vector and output
port descriptors are configured and the list is submitted to VPDMA.

Once the transaction is done, the v4l2 buffer corresponding to the
oldest field(the 3rd one) is changed to the state 'DONE', and the
buffers corresponding to 1st and 2nd fields become the 2nd and 3rd field
for the next de-interlace operation. This way, for each deinterlace
operation, we have the 3 most recent fields. After each transaction, we
also swap the motion vector buffers, the new input motion vector buffer
contains the resultant motion information of all the previous frames,
and the new output motion vector buffer will be used to hold the updated
motion vector to capture the motion changes in the next field. The
motion vector buffers are allocated using the DMA allocation API.

The de-interlacer is removed from bypass mode, it requires some extra
default configurations which are now added. The chrominance upsampler
coefficients are added for interlaced frames. Some VPDMA parameters like
frame start event and line mode are configured for the 2 extra sets of
input ports.

Signed-off-by: Archit Taneja <archit@ti.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: ti-vpe: Add VPE mem to mem driver
Archit Taneja [Wed, 16 Oct 2013 05:36:47 +0000 (02:36 -0300)]
upstream: [media] v4l: ti-vpe: Add VPE mem to mem driver

VPE is a block which consists of a single memory to memory path which
can perform chrominance up/down sampling, de-interlacing, scaling, and
color space conversion of raster or tiled YUV420 coplanar, YUV422
coplanar or YUV422 interleaved video formats.

We create a mem2mem driver based primarily on the mem2mem-testdev
example. The de-interlacer, scaler and color space converter are all
bypassed for now to keep the driver simple. Chroma up/down sampler
blocks are implemented, so conversion beteen different YUV formats is
possible.

Each mem2mem context allocates a buffer for VPE MMR values which it will
use when it gets access to the VPE HW via the mem2mem queue, it also
allocates a VPDMA descriptor list to which configuration and data
descriptors are added.

Based on the information received via v4l2 ioctls for the source and
destination queues, the driver configures the values for the MMRs, and
stores them in the buffer. There are also some VPDMA parameters like
frame start and line mode which needs to be configured, these are
configured by direct register writes via the VPDMA helper functions.

The driver's device_run() mem2mem op will add each descriptor based on
how the source and destination queues are set up for the given ctx, once
the list is prepared, it's submitted to VPDMA, these descriptors when
parsed by VPDMA will upload MMR registers, start DMA of video buffers on
the various input and output clients/ports.

When the list is parsed completely(and the DMAs on all the output ports
done), an interrupt is generated which we use to notify that the source
and destination buffers are done. The rest of the driver is quite
similar to other mem2mem drivers, we use the multiplane v4l2 ioctls as
the HW support coplanar formats.

Signed-off-by: Archit Taneja <archit@ti.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: ti-vpe: Add helpers for creating VPDMA descriptors
Archit Taneja [Wed, 16 Oct 2013 05:36:46 +0000 (02:36 -0300)]
upstream: [media] v4l: ti-vpe: Add helpers for creating VPDMA descriptors

Create functions which the VPE driver can use to create a VPDMA
descriptor and add it to a VPDMA descriptor list. These functions take a
pointer to an existing list, and append the configuration/data/control
descriptor header to the list.

In the case of configuration descriptors, the creation of a payload
block may be required(the payloads can hold VPE MMR values, or scaler
coefficients). The allocation of the payload buffer and it's content is
left to the VPE driver. However, the VPDMA library provides helper
macros to create payload in the correct format.

Add debug functions to dump the descriptors in a way such that it's easy
to see the values of different fields in the descriptors.

Signed-off-by: Archit Taneja <archit@ti.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: [media] v4l: ti-vpe: Create a vpdma helper library
Archit Taneja [Wed, 16 Oct 2013 05:36:45 +0000 (02:36 -0300)]
upstream: [media] v4l: ti-vpe: Create a vpdma helper library

The primary function of VPDMA is to move data between external memory
and internal processing modules(in our case, VPE) that source or sink
data. VPDMA is capable of buffering this data and then delivering the
data as demanded to the modules as programmed. The modules that source
or sink data are referred to as clients or ports. A channel is setup
inside the VPDMA to connect a specific memory buffer to a specific
client. The VPDMA centralizes the DMA control functions and buffering
required to allow all the clients to minimize the effect of long latency
times.

Add the following to the VPDMA helper:

- A data struct which describe VPDMA channels. For now, these channels
  are the ones used only by VPE, the list of channels will increase when
  VIP(Video Input Port) also uses the VPDMA library. This channel
  information will be used to populate fields required by data
  descriptors.

- Data structs which describe the different data types supported by
  VPDMA. This data type information will be used to populate fields
  required by data descriptors and used by the VPE driver to map a V4L2
  format to the corresponding VPDMA data type.

- Provide VPDMA register offset definitions, functions to read, write
  and modify VPDMA registers.

- Functions to create and submit a VPDMA list. A list is a group of
  descriptors that makes up a set of DMA transfers that need to be
  completed. Each descriptor will either perform a DMA transaction to
  fetch input buffers and write to output buffers(data descriptors), or
  configure the MMRs of sub blocks of VPE(configuration descriptors), or
  provide control information to VPDMA (control descriptors).

- Functions to allocate, map and unmap buffers needed for the descriptor
  list, payloads containing MMR values and scaler coefficients. These use
  the DMA mapping APIs to ensure exclusive access to VPDMA.

- Functions to enable VPDMA interrupts. VPDMA can trigger an interrupt
  on the VPE interrupt line when a descriptor list is parsed completely
  and the DMA transactions are completed. This requires masking the events
  in VPDMA registers and configuring some top level VPE interrupt
  registers.

- Enable some VPDMA specific parameters: frame start event(when to start
  DMA for a client) and line mode(whether each line fetched should be
  mirrored or not).

- Function to load firmware required by VPDMA. VPDMA requires a firmware
  for it's internal list manager. We add the required request_firmware
  apis to fetch this firmware from user space.

- Function to dump VPDMA registers.

- A function to initialize and create a VPDMA instance, this will be
  called by the VPE driver with it's platform device pointer, this
  function will take care of loading VPDMA firmware and returning a
  vpdma_data instance back to the VPE driver. The VIP driver will also
  call the same init function to initialize it's own VPDMA instance.

Signed-off-by: Archit Taneja <archit@ti.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
9 years agoupstream: staging:media: Use dev_dbg() instead of pr_debug()
Dulshani Gunawardhana [Sun, 20 Oct 2013 17:28:28 +0000 (22:58 +0530)]
upstream: staging:media: Use dev_dbg() instead of pr_debug()

Use dev_dbg() instead of pr_debug() in go7007-usb.c.

Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoupstream: staging:media: Use dev_info() instead of pr_info()
Dulshani Gunawardhana [Sun, 20 Oct 2013 17:27:19 +0000 (22:57 +0530)]
upstream: staging:media: Use dev_info() instead of pr_info()

Use dev_info instead of pr_info() in go7007-usb.c.

Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>