firefly-linux-kernel-4.4.55.git
9 years ago[media] media: blackfin: bfin_capture: use vb2_ioctl_* helpers
Lad, Prabhakar [Sun, 8 Mar 2015 14:40:44 +0000 (11:40 -0300)]
[media] media: blackfin: bfin_capture: use vb2_ioctl_* helpers

this patch adds support to vb2_ioctl_* helpers.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: blackfin: bfin_capture: use v4l2_fh_open and vb2_fop_release
Lad, Prabhakar [Sun, 8 Mar 2015 14:40:43 +0000 (11:40 -0300)]
[media] media: blackfin: bfin_capture: use v4l2_fh_open and vb2_fop_release

this patch adds support to use v4l2_fh_open() and vb2_fop_release,
which allows to drop driver specific struct bcap_fh, as this is handled
by core.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: blackfin: bfin_capture: use vb2_fop_mmap/poll
Lad, Prabhakar [Sun, 8 Mar 2015 14:40:42 +0000 (11:40 -0300)]
[media] media: blackfin: bfin_capture: use vb2_fop_mmap/poll

No need to reinvent the wheel. Just use the already existing
functions provided by vb2.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: blackfin: bfin_capture: improve queue_setup() callback
Lad, Prabhakar [Sun, 8 Mar 2015 14:40:41 +0000 (11:40 -0300)]
[media] media: blackfin: bfin_capture: improve queue_setup() callback

This patch does the following:
a: returns -EINVAL in case format image size is less
   then current image size.
b: assigns nbuffers to two in case the total of vq->num_buffers
   and nbuffers is less then the number of buffers required by driver.
c: sets the sizes[0] of plane according to the fmt passed or which is
   being set in the device.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: blackfin: bfin_capture: set vb2 buffer field
Lad, Prabhakar [Sun, 8 Mar 2015 14:40:40 +0000 (11:40 -0300)]
[media] media: blackfin: bfin_capture: set vb2 buffer field

set the vb2 buffer field in buf_prepare() callback,
alongside drop local variable buf as we already have
a pointer to vb2 buffer.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: blackfin: bfin_capture: set min_buffers_needed
Lad, Prabhakar [Sun, 8 Mar 2015 14:40:39 +0000 (11:40 -0300)]
[media] media: blackfin: bfin_capture: set min_buffers_needed

this patch sets the min_buffers_needed field of the vb2 queue
so that the vb2 core will make sure start_streaming() callback
is called only when we have minimum buffers queued.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: blackfin: bfin_capture: release buffers in case start_streaming()...
Lad, Prabhakar [Sun, 8 Mar 2015 14:40:38 +0000 (11:40 -0300)]
[media] media: blackfin: bfin_capture: release buffers in case start_streaming() call back fails

this patch adds support to release the buffer by calling
vb2_buffer_done(), with state marked as VB2_BUF_STATE_QUEUED
if start_streaming() call back fails.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: blackfin: bfin_capture: drop buf_init() callback
Lad, Prabhakar [Sun, 8 Mar 2015 14:40:37 +0000 (11:40 -0300)]
[media] media: blackfin: bfin_capture: drop buf_init() callback

this patch drops the buf_init() callback as init
of buf list is not required.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vivid: BT.2020 R'G'B' is limited range
Hans Verkuil [Sun, 8 Mar 2015 07:53:33 +0000 (04:53 -0300)]
[media] vivid: BT.2020 R'G'B' is limited range

According to the standard the R'G'B' BT.2020 colorspace is limited
range, not full range. Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] videodev2.h: fix comment
Hans Verkuil [Sun, 8 Mar 2015 07:53:32 +0000 (04:53 -0300)]
[media] videodev2.h: fix comment

The quantization comment in the header was incorrect w.r.t. BT.2020.
Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook media: BT.2020 RGB uses limited quantization range
Hans Verkuil [Sun, 8 Mar 2015 07:53:31 +0000 (04:53 -0300)]
[media] DocBook media: BT.2020 RGB uses limited quantization range

In contrast to all other colorspaces, the BT.2020 colorspace uses
limited range R'G'B' quantization as the default.

This was incorrected documented, so fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook media: fix xv601/709 formulas
Hans Verkuil [Sun, 8 Mar 2015 07:53:30 +0000 (04:53 -0300)]
[media] DocBook media: fix xv601/709 formulas

The denominator for the scaling and offsets is 256, not 255. Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-ioctl: tidy up debug messages
Hans Verkuil [Sun, 8 Mar 2015 07:30:47 +0000 (04:30 -0300)]
[media] v4l2-ioctl: tidy up debug messages

Make sure the format fields are reported consistently.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-framework.txt: debug -> dev_debug
Hans Verkuil [Sun, 8 Mar 2015 07:30:03 +0000 (04:30 -0300)]
[media] v4l2-framework.txt: debug -> dev_debug

The debug attribute was renamed to dev_debug. Update the doc accordingly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: am437x-vpfe: embed video_device struct in vpfe_device
Lad, Prabhakar [Sat, 7 Mar 2015 16:12:09 +0000 (13:12 -0300)]
[media] media: am437x-vpfe: embed video_device struct in vpfe_device

Embed video_device struct (video_dev) in vpfe_device and
Unregister path doesn't need to free the video_device
structure, hence, change the video_device.release callback
point to video_device_release_empty.

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@osg.samsung.com>
9 years ago[media] media: am437x-vpfe: return error in case memory allocation failure
Lad, Prabhakar [Sat, 7 Mar 2015 15:30:50 +0000 (12:30 -0300)]
[media] media: am437x-vpfe: return error in case memory allocation failure

return error in case devm_kzalloc() fails.

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@osg.samsung.com>
9 years ago[media] media: am437x-vpfe: match the OF node/i2c addr instead of name
Lad, Prabhakar [Sat, 7 Mar 2015 15:30:49 +0000 (12:30 -0300)]
[media] media: am437x-vpfe: match the OF node/i2c addr instead of name

Instead of matching the subdevs with their name, match
it with OF node/ i2c address and adapter number.

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@osg.samsung.com>
9 years ago[media] drivers: media: platform: vivid: Fix possible null derefrence
Tapasweni Pathak [Fri, 6 Mar 2015 02:39:40 +0000 (23:39 -0300)]
[media] drivers: media: platform: vivid: Fix possible null derefrence

Check for dev_fmt being null before derefrencing it, to assign it
to planes.

Found using Coccinelle.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] am437x: include linux/videodev2.h for expanding BASE_VIDIOC_PRIVATE
Masatake YAMATO [Wed, 4 Mar 2015 20:13:24 +0000 (17:13 -0300)]
[media] am437x: include linux/videodev2.h for expanding BASE_VIDIOC_PRIVATE

In am437x-vpfe.h BASE_VIDIOC_PRIVATE is used for
making the name of ioctl command(VIDIOC_AM437X_CCDC_CFG).
The definition of BASE_VIDIOC_PRIVATE is in linux/videodev2.h.
However, linux/videodev2.h is not included in am437x-vpfe.h.
As the result an application using has to include both
am437x-vpfe.h and linux/videodev2.h.

With this patch, the application can include just am437x-vpfe.h.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] vb2: check if vb2_fop_write/read is allowed
Hans Verkuil [Tue, 3 Mar 2015 11:23:59 +0000 (08:23 -0300)]
[media] vb2: check if vb2_fop_write/read is allowed

Return -EINVAL if read() or write() is not supported by the queue. This
makes it possible to provide both vb2_fop_read and vb2_fop_write in a
struct v4l2_file_operations since the vb2_fop_* function will check if
the file operation is allowed.

A similar check exists in __vb2_init_fileio() which is called from
__vb2_perform_fileio(), but that check is only done if no file I/O is
active. So the sequence of read() followed by write() would be allowed,
which is obviously a bug.

In addition, vb2_fop_write/read should always return -EINVAL if the
operation is not allowed, and by putting the check in the lower levels
of the code it is possible that other error codes are returned (EBUSY
or ERESTARTSYS).

All these issues are avoided by just doing a quick explicit check.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: am437x: Don't release OF node reference twice
Laurent Pinchart [Mon, 23 Feb 2015 14:49:21 +0000 (11:49 -0300)]
[media] media: am437x: Don't release OF node reference twice

The remote port reference is released both at the end of the OF graph
parsing loop, and in the error code path at the end of the function.
Those two calls will release the same reference, causing the reference
count to go negative.

Fix the problem by removing the second call.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Validate index during step-wise frame intervals enumeration
Laurent Pinchart [Fri, 6 Mar 2015 12:54:47 +0000 (09:54 -0300)]
[media] uvcvideo: Validate index during step-wise frame intervals enumeration

Frame intervals exposed as an interval and step (so-called step-wise)
are restricted by the V4L2 API to a single enumeration entry. Return an
error when the index is not zero.

Reported-by: Alexey Smirnoff <fling@member.fsf.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[mchehab@osg.samsung.com: add a missing collon at the end of the return
 statement, in order to avoid compilation breakage]
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Recognize the Tasco USB microscope
Laurent Pinchart [Mon, 16 Feb 2015 18:30:10 +0000 (15:30 -0300)]
[media] uvcvideo: Recognize the Tasco USB microscope

The device is based on an Aveo chipset, implements UVC but advertises a
vendor-specific class on all interfaces.

Support it by listing the USB VID:PID explicitly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] uvcvideo: Don't call vb2 mmap and get_unmapped_area with queue lock held
Laurent Pinchart [Mon, 16 Feb 2015 17:38:28 +0000 (14:38 -0300)]
[media] uvcvideo: Don't call vb2 mmap and get_unmapped_area with queue lock held

videobuf2 has long been subject to AB-BA style deadlocks due to the
queue lock and mmap_sem being taken in different orders for the mmap and
get_unmapped_area operations. The problem has been fixed by making those
two operations callable without taking the queue lock, using an
mmap_lock internal to videobuf2.

The uvcvideo driver still calls the mmap and get_unmapped_area
operations with the queue lock held, resulting in a potential deadlock.
As the operations can now be called without locking the queue, fix it.

Reported-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] smiapp: Make pixel_order_str static
Sakari Ailus [Sun, 1 Feb 2015 00:11:46 +0000 (21:11 -0300)]
[media] smiapp: Make pixel_order_str static

pixel_order_str is only referred to in smiapp-core.c, it should be thus
static. Thanks to Hans Verkuil for pointing this out.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] smiapp: Use of_property_read_u64_array() to read a 64-bit number array
Sakari Ailus [Sun, 30 Nov 2014 15:33:55 +0000 (12:33 -0300)]
[media] smiapp: Use of_property_read_u64_array() to read a 64-bit number array

of_property_read_u64_array() wasn't yet part of the kernel tree when the
functionality was needed. Do use it now.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] Revert "[media] smiapp: Don't compile of_read_number() if CONFIG_OF isn't...
Sakari Ailus [Mon, 16 Feb 2015 10:45:01 +0000 (07:45 -0300)]
[media] Revert "[media] smiapp: Don't compile of_read_number() if CONFIG_OF isn't defined"

This reverts commit cb88d7384e5e05f90c1daa7750bdb467fd026261.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: s5p-mfc: fix broken pointer cast on 64bit arch
Marek Szyprowski [Wed, 4 Mar 2015 13:55:22 +0000 (10:55 -0300)]
[media] media: s5p-mfc: fix broken pointer cast on 64bit arch

Unsigned int cannot be used to store casted pointer on 64bit
architecture, so correct such casts to properly use unsigned long
variables.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
[k.debski@samsung.com: removed volatile and __iomem from cast]

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: s5p-mfc: fix mmap support for 64bit arch
Marek Szyprowski [Wed, 4 Mar 2015 13:55:21 +0000 (10:55 -0300)]
[media] media: s5p-mfc: fix mmap support for 64bit arch

TASK_SIZE is depends on the systems architecture (32 or 64 bits) and it
should not be used for defining offset boundary for mmaping buffers for
CAPTURE and OUTPUT queues. This patch fixes support for MMAP calls on
the CAPTURE queue on 64bit architectures (like ARM64).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] omap3isp: Deprecate platform data support
Sakari Ailus [Wed, 25 Mar 2015 22:57:39 +0000 (19:57 -0300)]
[media] omap3isp: Deprecate platform data support

Print a warning when the driver is used with platform data. Existing
platform data users should move to DT now.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] omap3isp: Add support for the Device Tree
Sakari Ailus [Wed, 25 Mar 2015 22:57:38 +0000 (19:57 -0300)]
[media] omap3isp: Add support for the Device Tree

Add the ISP device to omap3 DT include file and add support to the driver to
use it.

Also obtain information on the external entities and the ISP configuration
related to them through the Device Tree in addition to the platform data.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l: of: Read lane-polarities endpoint property
Sakari Ailus [Wed, 25 Mar 2015 22:57:37 +0000 (19:57 -0300)]
[media] v4l: of: Read lane-polarities endpoint property

Add lane_polarities field to struct v4l2_of_bus_mipi_csi2 and write the
contents of the lane-polarities property to it. The field tells the polarity
of the physical lanes starting from the first one. Any unused lanes are
ignored, i.e. only the polarity of the used lanes is specified.

Also rework reading the "data-lanes" property a little.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] dt: bindings: Add lane-polarity property to endpoint nodes
Sakari Ailus [Wed, 25 Mar 2015 22:57:36 +0000 (19:57 -0300)]
[media] dt: bindings: Add lane-polarity property to endpoint nodes

Add lane-polarity property to endpoint nodes. This essentially tells that
the order of the differential signal wires is inverted.

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@osg.samsung.com>
9 years ago[media] omap3isp: Replace many MMIO regions by two
Sakari Ailus [Wed, 25 Mar 2015 22:57:35 +0000 (19:57 -0300)]
[media] omap3isp: Replace many MMIO regions by two

The omap3isp MMIO register block is contiguous in the MMIO register space
apart from the fact that the ISP IOMMU register block is in the middle of
the area. Ioremap it at two occasions, and keep the rest of the layout of
the register space internal to the omap3isp driver.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] omap3isp: Move the syscon register out of the ISP register maps
Sakari Ailus [Wed, 25 Mar 2015 22:57:34 +0000 (19:57 -0300)]
[media] omap3isp: Move the syscon register out of the ISP register maps

The syscon register isn't part of the ISP, use it through the syscom driver
regmap instead. The syscom block is considered to be from 343x on ISP
revision 2.0 whereas 15.0 is assumed to have 3630 syscon.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] omap3isp: Replace mmio_base_phys array with the histogram block base
Sakari Ailus [Wed, 25 Mar 2015 22:57:33 +0000 (19:57 -0300)]
[media] omap3isp: Replace mmio_base_phys array with the histogram block base

Only the histogram sub-block driver uses the physical address. Do not store
it for other sub-blocks.

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@osg.samsung.com>
9 years ago[media] omap3isp: Calculate vpclk_div for CSI-2
Sakari Ailus [Wed, 25 Mar 2015 22:57:32 +0000 (19:57 -0300)]
[media] omap3isp: Calculate vpclk_div for CSI-2

The video port clock is l3_ick divided by vpclk_div. This clock must be high
enough for the external pixel rate. The video port requires two clock cycles
to process a pixel.

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@osg.samsung.com>
9 years ago[media] omap3isp: Rename regulators to better suit the Device Tree
Sakari Ailus [Wed, 25 Mar 2015 22:57:31 +0000 (19:57 -0300)]
[media] omap3isp: Rename regulators to better suit the Device Tree

Rename VDD_CSIPHY1 as vdd-csiphy1 and VDD_CSIPHY2 as vdd-csiphy2.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] omap3isp: Refactor device configuration structs for Device Tree
Sakari Ailus [Wed, 25 Mar 2015 22:57:30 +0000 (19:57 -0300)]
[media] omap3isp: Refactor device configuration structs for Device Tree

Make omap3isp configuration data structures more suitable for consumption by
the DT by separating the I2C bus information of all the sub-devices in a
group and the ISP bus information from each other. The ISP bus information
is made a pointer instead of being directly embedded in the struct.

In the case of the DT only the sensor specific information on the ISP bus
configuration is retained. The structs are renamed to reflect that.

After this change the structs needed to describe device configuration can be
allocated and accessed separately without those needed only in the case of
platform data. The platform data related structs can be later removed once
the support for platform data can be removed.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Igor Grinberg <grinberg@compulab.co.il> (for cm-t35)
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] omap3isp: Platform data could be NULL
Sakari Ailus [Wed, 25 Mar 2015 22:57:29 +0000 (19:57 -0300)]
[media] omap3isp: Platform data could be NULL

Only check for call platform data callback functions if there's platform
data. Also take care of a few other cases where the NULL pdata pointer could
have been accessed, and remove the check for NULL dev->platform_data
pointer.

Removing the check for NULL dev->platform_data isn't strictly needed by the
DT support but there's no harm from that either: the device now can be used
without sensors, for instance.

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@osg.samsung.com>
9 years ago[media] omap3isp: DT support for clocks
Laurent Pinchart [Wed, 25 Mar 2015 22:57:28 +0000 (19:57 -0300)]
[media] omap3isp: DT support for clocks

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] omap3isp: Separate external link creation from platform data parsing
Sakari Ailus [Wed, 25 Mar 2015 22:57:27 +0000 (19:57 -0300)]
[media] omap3isp: Separate external link creation from platform data parsing

Move the code which connects the external entity to an ISP entity into a
separate function. This disconnects it from parsing the platform data.

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@osg.samsung.com>
9 years ago[media] omap3isp: Avoid a BUG_ON() in media_entity_create_link()
Sakari Ailus [Wed, 25 Mar 2015 22:57:26 +0000 (19:57 -0300)]
[media] omap3isp: Avoid a BUG_ON() in media_entity_create_link()

If an uninitialised v4l2_subdev struct was passed to
media_entity_create_link(), one of the BUG_ON()'s in the function will be
hit since media_entity.num_pads will be zero. Avoid this by checking whether
the num_pads field is non-zero for the interface.

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@osg.samsung.com>
9 years ago[media] omap3isp: Fix error handling in probe
Sakari Ailus [Wed, 25 Mar 2015 22:57:25 +0000 (19:57 -0300)]
[media] omap3isp: Fix error handling in probe

The mutex was not destroyed correctly if dma_coerce_mask_and_coherent()
failed for some reason.

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@osg.samsung.com>
9 years ago[media] media: omap3isp: hist: Move histogram DMA to DMA engine
Laurent Pinchart [Sat, 21 Feb 2015 20:59:54 +0000 (17:59 -0300)]
[media] media: omap3isp: hist: Move histogram DMA to DMA engine

Replace the custom OMAP DMA API usage by DMA engine. Feature-wise the
driver has lost the ability to get notified of DMA transfers failure
through the completion handler, as the DMA engine API doesn't expose
that status information.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: omap3isp: video: Use v4l2_get_timestamp()
Laurent Pinchart [Thu, 26 Feb 2015 18:58:19 +0000 (15:58 -0300)]
[media] media: omap3isp: video: Use v4l2_get_timestamp()

Replace the open-coded copy by a function call.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: omap3isp: video: drop setting of vb2 buffer state to VB2_BUF_STATE_ACTIVE
Lad, Prabhakar [Mon, 23 Feb 2015 20:19:31 +0000 (17:19 -0300)]
[media] media: omap3isp: video: drop setting of vb2 buffer state to VB2_BUF_STATE_ACTIVE

There isn't a need to assign the state of vb2_buffer to active
as this is already done by the core.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: omap3isp: video: Don't call vb2 mmap with queue lock held
Laurent Pinchart [Tue, 24 Feb 2015 10:39:49 +0000 (07:39 -0300)]
[media] media: omap3isp: video: Don't call vb2 mmap with queue lock held

videobuf2 has long been subject to AB-BA style deadlocks due to the
queue lock and mmap_sem being taken in different orders for the mmap
operation. The problem has been fixed by making this operation callable
without taking the queue lock, using an mmap_lock internal to videobuf2.

The omap3isp driver still calls the mmap operation with the queue lock
held, resulting in a potential deadlock. As the operation can now be
called without locking the queue, 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 <mchehab@osg.samsung.com>
9 years ago[media] mn88472: One function call less in mn88472_init() after error detection
Markus Elfring [Sun, 1 Feb 2015 18:34:37 +0000 (15:34 -0300)]
[media] mn88472: One function call less in mn88472_init() after error detection

The release_firmware() function was called in three cases by the mn88472_init()
function during error handling even if the passed variable "fw" contained still
a null pointer.

This implementation detail could be improved by the introduction of another
jump label.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] mn88472: Deletion of an unnecessary check before the function call "release_f...
Markus Elfring [Sun, 1 Feb 2015 18:12:56 +0000 (15:12 -0300)]
[media] mn88472: Deletion of an unnecessary check before the function call "release_firmware"

The release_firmware() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] si2157: extend frequency range for ATSC
Olli Salonen [Tue, 3 Mar 2015 16:28:35 +0000 (13:28 -0300)]
[media] si2157: extend frequency range for ATSC

The Si2157 tuner supports ATSC in addition to DVB-T and DVB-C. Extend
minimum frequency range to cover the complete ATSC/QAM-B range.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-subdev: remove enum_framesizes/intervals
Hans Verkuil [Wed, 4 Mar 2015 09:48:01 +0000 (01:48 -0800)]
[media] v4l2-subdev: remove enum_framesizes/intervals

The video and pad ops are duplicates, so get rid of the more limited video op.

The whole point of the subdev API is to allow reuse of subdev drivers by
bridge drivers. Having duplicate ops makes that much harder. We should never
have allowed duplicate ops in the first place. A lesson for the future.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-subdev: add support for the new enum_frame_interval 'which' field
Hans Verkuil [Wed, 4 Mar 2015 09:48:00 +0000 (01:48 -0800)]
[media] v4l2-subdev: add support for the new enum_frame_interval 'which' field

Support the new 'which' field in the enum_frame_interval ops. Most drivers do not
need to be changed since they always returns the same enumeration regardless
of the 'which' field.

Tested for ov7670 and marvell-ccic on a OLPC XO-1 laptop.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook media: document the new 'which' field
Hans Verkuil [Wed, 4 Mar 2015 09:47:59 +0000 (01:47 -0800)]
[media] DocBook media: document the new 'which' field

The subdev enum ioctls now have a new 'which' field. Document this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-subdev: add support for the new enum_frame_size 'which' field
Hans Verkuil [Wed, 4 Mar 2015 09:47:58 +0000 (01:47 -0800)]
[media] v4l2-subdev: add support for the new enum_frame_size 'which' field

Support the new 'which' field in the enum_frame_size ops. Most drivers do not
need to be changed since they always returns the same enumeration regardless
of the 'which' field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-subdev: support new 'which' field in enum_mbus_code
Hans Verkuil [Wed, 4 Mar 2015 09:47:57 +0000 (01:47 -0800)]
[media] v4l2-subdev: support new 'which' field in enum_mbus_code

Support the new 'which' field in the enum_mbus_code ops. Most drivers do not
need to be changed since they always return the same enumeration regardless
of the 'which' field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-subdev.c: add 'which' checks for enum ops
Hans Verkuil [Wed, 4 Mar 2015 09:47:56 +0000 (01:47 -0800)]
[media] v4l2-subdev.c: add 'which' checks for enum ops

Return an error if an invalid 'which' valid is passed in.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-subdev.h: add 'which' field for the enum structs
Hans Verkuil [Wed, 4 Mar 2015 09:47:55 +0000 (01:47 -0800)]
[media] v4l2-subdev.h: add 'which' field for the enum structs

While all other pad ops allow you to select whether to use the 'try' or
the 'active' formats, the enum ops didn't have that option and always used
'try'.

However, this will fail if a simple (e.g. PCI) bridge driver wants to use
the enum pad op of a subdev that's also used in a complex platform driver
like the omap3. Such a bridge driver generally wants to enum formats based
on the active format.

So add a new 'which' field to these structs. Note that V4L2_SUBDEV_FORMAT_TRY
is 0, so the default remains TRY (applications need to set reserved to 0).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2-subdev: replace v4l2_subdev_fh by v4l2_subdev_pad_config
Hans Verkuil [Wed, 4 Mar 2015 09:47:54 +0000 (01:47 -0800)]
[media] v4l2-subdev: replace v4l2_subdev_fh by v4l2_subdev_pad_config

If a subdevice pad op is called from a bridge driver, then there is
no v4l2_subdev_fh struct that can be passed to the subdevice. This
made it hard to use such subdevs from a bridge driver.

This patch replaces the v4l2_subdev_fh pointer by a v4l2_subdev_pad_config
pointer in the pad ops. This allows bridge drivers to use the various
try_ pad ops by creating a v4l2_subdev_pad_config struct and passing it
along to the pad op.

The v4l2_subdev_get_try_* macros had to be changed because of this, so
I also took the opportunity to use the full name of the v4l2_subdev_get_try_*
functions in the __V4L2_SUBDEV_MK_GET_TRY macro arguments: if you now do
'git grep v4l2_subdev_get_try_format' you will actually find the header
where it is defined.

One remark regarding the drivers/staging/media/davinci_vpfe patches: the
*_init_formats() functions assumed that fh could be NULL. However, that's
not true for this driver, it's always set. This is almost certainly a copy
and paste from the omap3isp driver. I've updated the code to reflect the
fact that fh is never NULL.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] mn88473: simplify bandwidth registers setting code
Benjamin Larsson [Mon, 12 Jan 2015 23:23:26 +0000 (20:23 -0300)]
[media] mn88473: simplify bandwidth registers setting code

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] mn88473: calculate the IF register values
Benjamin Larsson [Mon, 12 Jan 2015 23:23:25 +0000 (20:23 -0300)]
[media] mn88473: calculate the IF register values

Add xtal as a configuration parameter so it can be used
in the IF register value calculation. If not set in the
configuration then use a default value.

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: adv7604: improve usage of gpiod API
Uwe Kleine-König [Mon, 2 Mar 2015 07:00:44 +0000 (04:00 -0300)]
[media] media: adv7604: improve usage of gpiod API

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.
Simplify accordingly.

Moreover use devm_gpiod_get_index_optional instead of
devm_gpiod_get_index with ignoring all errors.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx18: Fix bytes_per_line
Simon Farnsworth [Wed, 25 Feb 2015 16:47:34 +0000 (13:47 -0300)]
[media] cx18: Fix bytes_per_line

Current GStreamer userspace respects the bytes_per_line from the driver. Set
it to something reasonable for the format chosen.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: omap/omap_vout: fix type of input members to omap_vout_setup_vrfb_bufs()
Lad, Prabhakar [Tue, 24 Feb 2015 18:25:00 +0000 (15:25 -0300)]
[media] media: omap/omap_vout: fix type of input members to omap_vout_setup_vrfb_bufs()

the declaration for omap_vout_setup_vrfb_bufs() said it
needed 'u32 static_vrfb_allocation' but definition
took 'bool static_vrfb_allocation', this patch fixes the
declaration so that it matches with the definition and
pass a bool instead of int to the call, also included
omap_vout_vrfb.h in omap_vout_vrfb.c file so that sparse doesn't
complain of making omap_vout_setup_vrfb_bufs() as static function.

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@osg.samsung.com>
9 years ago[media] DocBook media: fix typos in YUV420M description
Hans Verkuil [Tue, 3 Mar 2015 08:47:29 +0000 (05:47 -0300)]
[media] DocBook media: fix typos in YUV420M description

NV12M -> YUV420M
YVU420M -> YUV420M

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: i2c: ths7303: drop module param debug
Lad, Prabhakar [Mon, 2 Mar 2015 15:22:19 +0000 (12:22 -0300)]
[media] media: i2c: ths7303: drop module param debug

this patch drops module param 'debug' as it was never used.

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@osg.samsung.com>
9 years ago[media] media: drop call to v4l2_device_unregister_subdev()
Lad, Prabhakar [Mon, 2 Mar 2015 14:54:07 +0000 (11:54 -0300)]
[media] media: drop call to v4l2_device_unregister_subdev()

These drivers are moved to support asynchronous probing,
v4l2_async_unregister_subdev() unregisters the subdev so
there isn't a need to explicitly call v4l2_device_unregister_subdev().

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@osg.samsung.com>
9 years ago[media] Basic support for the Elgato EyeTV Hybrid INT 2008 USB Stick
Gilles Risch [Sun, 1 Mar 2015 20:11:05 +0000 (17:11 -0300)]
[media] Basic support for the Elgato EyeTV Hybrid INT 2008 USB Stick

This patch will add basic support for the Elgato EyeTV Hybrid INT
2008 USB Stick.

Signed-off-by: Gilles Risch <gilles.risch@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] v4l2: remove unused including <linux/version.h>
Wei Yongjun [Fri, 27 Feb 2015 11:42:23 +0000 (08:42 -0300)]
[media] v4l2: remove unused including <linux/version.h>

Remove including <linux/version.h> that don't need it.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: au0828 - embed vdev and vbi_dev structs in au0828_dev
Shuah Khan [Thu, 26 Feb 2015 22:33:13 +0000 (19:33 -0300)]
[media] media: au0828 - embed vdev and vbi_dev structs in au0828_dev

Embed video_device structs vdev and vbi_dev in au0828_dev.
With this change, dynamic allocation and error path logic
in au0828_analog_register() is removed as it doesn't need
to allocate and handle allocation errors. Unregister path
doesn't need to free the now static video_device structures,
hence, changed video_device.release in au0828_video_template
to point to video_device_release_empty.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] media: au0828: drop vbi_buffer_filled() and re-use buffer_filled()
Lad, Prabhakar [Tue, 24 Feb 2015 13:00:29 +0000 (10:00 -0300)]
[media] media: au0828: drop vbi_buffer_filled() and re-use buffer_filled()

The vbi_buffer_filled() and buffer_filled() did the same functionality
except for incrementing the buffer sequence, this patch drops the
vbi_buffer_filled() and re-uses buffer_filled() for vbi buffers
as well by adding the check for vb2-queue type while incrementing
the sequence numbers. Along side this patch aligns the input parameters
of buffer_filled() function appropriately.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] drivers: media: i2c : s5c73m3: Replace dev_err with pr_err
Tapasweni Pathak [Tue, 24 Feb 2015 04:47:32 +0000 (01:47 -0300)]
[media] drivers: media: i2c : s5c73m3: Replace dev_err with pr_err

Replace dev_err statement with pr_err to fix null dereference.

Found by Coccinelle.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] saa7164: free_irq before pci_disable_device
Olli Salonen [Sat, 21 Feb 2015 21:45:26 +0000 (18:45 -0300)]
[media] saa7164: free_irq before pci_disable_device

Free the IRQ before disabling the device. Otherwise errors like this when unloading the module:

[21135.458560] ------------[ cut here ]------------
[21135.458569] WARNING: CPU: 4 PID: 1696 at /home/apw/COD/linux/fs/proc/generic.c:521 remove_proc_entry+0x1a1/0x1b0()
[21135.458572] remove_proc_entry: removing non-empty directory 'irq/47', leaking at least 'saa7164[0]'

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] saa7146: replace current->state by set_current_state()
Fabian Frederick [Fri, 20 Feb 2015 18:12:54 +0000 (15:12 -0300)]
[media] saa7146: replace current->state by set_current_state()

Use helper functions to access current->state.
Direct assignments are prone to races and therefore buggy.

current->state = TASK_RUNNING can be replaced by __set_current_state()

Thanks to Peter Zijlstra for the exact definition of the problem.

Suggested-By: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] cx231xx: Hauppauge HVR-955Q ATSC/QAM tuner
Olli Salonen [Sat, 28 Feb 2015 15:25:24 +0000 (12:25 -0300)]
[media] cx231xx: Hauppauge HVR-955Q ATSC/QAM tuner

Hauppauge HVR-955Q is a ATSC/QAM USB tuner with LGDT3306A demodulator and SiLabs Si2157-A30 tuner.

Only digital TV has been tested (both ATSC and QAM256).

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] si2157: IF frequency for ATSC and QAM
Olli Salonen [Sat, 28 Feb 2015 15:25:23 +0000 (12:25 -0300)]
[media] si2157: IF frequency for ATSC and QAM

For supporting ATSC and QAM modes the driver should use a smaller IF frequency than 5 MHz.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: Minor source code cleanups
Mauro Carvalho Chehab [Tue, 28 Oct 2014 14:40:20 +0000 (12:40 -0200)]
[media] lgdt3306a: Minor source code cleanups

Fix a few minor CodingStyle issues at the source code:
- Use proper multi-line comments;
- Align the log tables;
- Remove the .type from dvb_frontend_ops, since this is not
  needed anymore (since the drivers conversion to DVBv5);
- Remove emacs format macro.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: Break long lines
Mauro Carvalho Chehab [Tue, 28 Oct 2014 14:35:18 +0000 (12:35 -0200)]
[media] lgdt3306a: Break long lines

Fix most of checkpatch warnings like:
WARNING: line over 80 characters

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: constify log tables
Mauro Carvalho Chehab [Tue, 28 Oct 2014 14:30:44 +0000 (12:30 -0200)]
[media] lgdt3306a: constify log tables

Ideally, we should be replacing this function by intlog10().

While we don't do that, let's at least constify the tables,
in order to remove its code footfrint, and get rid of nelems.

This also fixes a few 80-cols CodingStyle warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lbdt3306a: remove uneeded braces
Mauro Carvalho Chehab [Tue, 28 Oct 2014 14:07:52 +0000 (12:07 -0200)]
[media] lbdt3306a: remove uneeded braces

WARNING: braces {} are not necessary for any arm of this statement
+ if (ret == 0) {
[...]
+ } else {
[...]

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: Don't use else were not needed
Mauro Carvalho Chehab [Tue, 28 Oct 2014 14:05:35 +0000 (12:05 -0200)]
[media] lgdt3306a: Don't use else were not needed

Get rid of the remaining checkpatch.pl warnings:
WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lbdt3306a: simplify the lock status check
Mauro Carvalho Chehab [Tue, 28 Oct 2014 14:00:48 +0000 (12:00 -0200)]
[media] lbdt3306a: simplify the lock status check

The logic there is too complex and it looks like an inifite
loop.

So, simplify the logic and implement it as a for loop.

This gets rid of the following checkpatch.pl warnings:

WARNING: else is not generally useful after a break or return
+ return LG3306_UNLOCK;
+ } else {

WARNING: else is not generally useful after a break or return
+ return LG3306_UNLOCK;
+ } else {

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lbdt3306a: rework at printk macros
Mauro Carvalho Chehab [Tue, 28 Oct 2014 13:35:16 +0000 (11:35 -0200)]
[media] lbdt3306a: rework at printk macros

Use pr_foo() where there's a direct replacement. For debug, use
custom-made macros, for now, as there are 3 different debug levels.

We should get rid of those some day, specially since several such
macros can be just removed, as Kernel trace would provide about
the same output.

This gets rid of some checkpatch errors:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...
+#define lg_info(fmt, arg...) printk(KERN_INFO "lgdt3306a: " fmt, ##arg)

ERROR: Macros with complex values should be enclosed in parentheses
+#define lg_dbg(fmt, arg...) if (debug & DBG_INFO) \
+ lg_printk(KERN_DEBUG,         fmt, ##arg)

ERROR: Macros with complex values should be enclosed in parentheses
+#define lg_reg(fmt, arg...) if (debug & DBG_REG) \
+ lg_printk(KERN_DEBUG,         fmt, ##arg)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: Remove FSF address
Mauro Carvalho Chehab [Tue, 28 Oct 2014 13:27:34 +0000 (11:27 -0200)]
[media] lgdt3306a: Remove FSF address

Fix this CodingStyle error:

ERROR: Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so ag$
#56: FILE: drivers/media/dvb-frontends/lgdt3306a.c:19:
+ *    along with this program; if not, write to the Free Software$

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: properly handle I/O errors
Mauro Carvalho Chehab [Tue, 28 Oct 2014 13:21:48 +0000 (11:21 -0200)]
[media] lgdt3306a: properly handle I/O errors

Fixes the following smatch errors:

drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_set_if':
drivers/media/dvb-frontends/lgdt3306a.c:695:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_monitor_vsb':
drivers/media/dvb-frontends/lgdt3306a.c:1033:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_check_oper_mode':
drivers/media/dvb-frontends/lgdt3306a.c:1082:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_check_lock_status':
drivers/media/dvb-frontends/lgdt3306a.c:1109:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_check_neverlock_status':
drivers/media/dvb-frontends/lgdt3306a.c:1185:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_pre_monitoring':
drivers/media/dvb-frontends/lgdt3306a.c:1199:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_get_packet_error':
drivers/media/dvb-frontends/lgdt3306a.c:1310:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: don't go past the buffer
Mauro Carvalho Chehab [Tue, 28 Oct 2014 13:07:03 +0000 (11:07 -0200)]
[media] lgdt3306a: don't go past the buffer

As warned by smatch:
drivers/media/dvb-frontends/lgdt3306a.c:1354 log10_x1000() error: buffer overflow 'valx_x10' 14 <= 14
drivers/media/dvb-frontends/lgdt3306a.c:1355 log10_x1000() error: buffer overflow 'log10x_x1000' 14 <= 14

There's a potential of returning a value out of the buffer. Fix it.

While here, remove the ugly braced block.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: one bit fields should be unsigned
Mauro Carvalho Chehab [Tue, 28 Oct 2014 13:02:13 +0000 (11:02 -0200)]
[media] lgdt3306a: one bit fields should be unsigned

Fix two smatch warnings:
drivers/media/dvb-frontends/lgdt3306a.h:53:28: error: dubious one-bit signed bitfield
drivers/media/dvb-frontends/lgdt3306a.h:56:33: error: dubious one-bit signed bitfield

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: Use IS_ENABLED() for attach function
Mauro Carvalho Chehab [Tue, 28 Oct 2014 12:56:10 +0000 (10:56 -0200)]
[media] lgdt3306a: Use IS_ENABLED() for attach function

Simplify the check if CONFIG_DVB_LGDT3306A is enabled, use the
IS_ENABLED() macro, just like the other frontend modules.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: Use hexadecimal values in lowercase
Mauro Carvalho Chehab [Tue, 28 Oct 2014 12:50:36 +0000 (10:50 -0200)]
[media] lgdt3306a: Use hexadecimal values in lowercase

While this is not a mandatory rule at the CodingStyle, we prefer
hexadecimal values in lowercase. Currently, there's a mix of lowercase
and uppercase ons at lgdt3306a. So, convert all to lowercase with this
small script:

perl -ne 'if (m,0x([\dA-F]+),) { $o=$1; $n=lc $1; s,0x($o),0x$n, } print $_'

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: more small whitespace cleanups
Michael Ira Krufky [Sat, 25 Oct 2014 14:26:15 +0000 (11:26 -0300)]
[media] lgdt3306a: more small whitespace cleanups

Just CodingStyle. No functional changes.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: typo fix
Michael Ira Krufky [Sat, 25 Oct 2014 14:20:57 +0000 (11:20 -0300)]
[media] lgdt3306a: typo fix

fix WARNING: 'supress' may be misspelled - perhaps 'suppress'?

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: fix WARNING: please, no spaces at the start of a line
Michael Ira Krufky [Sat, 25 Oct 2014 14:12:25 +0000 (11:12 -0300)]
[media] lgdt3306a: fix WARNING: please, no spaces at the start of a line

Properly indent register initialization tables.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: fix ERROR: do not use C99 // comments
Michael Ira Krufky [Sat, 25 Oct 2014 14:05:05 +0000 (11:05 -0300)]
[media] lgdt3306a: fix ERROR: do not use C99 // comments

Replace C99 comments by /* */ blocks.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: do not add new typedefs
Michael Ira Krufky [Sun, 3 Aug 2014 18:29:04 +0000 (15:29 -0300)]
[media] lgdt3306a: do not add new typedefs

We should not be using typedefs at the Kernel, as this makes harder
for reviewers to understand the code.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: fix ERROR: do not use assignment in if condition
Michael Ira Krufky [Sun, 3 Aug 2014 18:18:23 +0000 (15:18 -0300)]
[media] lgdt3306a: fix ERROR: do not use assignment in if condition

Just CodingStyle fix.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: move EXPORT_SYMBOL to be just after function
Michael Ira Krufky [Sun, 3 Aug 2014 18:05:59 +0000 (15:05 -0300)]
[media] lgdt3306a: move EXPORT_SYMBOL to be just after function

Fixes CodingStyle error:
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: remove unnecessary 'else'
Michael Ira Krufky [Sun, 3 Aug 2014 17:51:49 +0000 (14:51 -0300)]
[media] lgdt3306a: remove unnecessary 'else'

No need for an else, as the previous if will return.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] lgdt3306a: clean up whitespace & unneeded brackets
Michael Ira Krufky [Sun, 27 Jul 2014 22:24:24 +0000 (19:24 -0300)]
[media] lgdt3306a: clean up whitespace & unneeded brackets

No functional changes.

Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DVB: add support for LG Electronics LGDT3306A ATSC/QAM-B Demodulator
Fred Richter [Mon, 24 Mar 2014 22:56:00 +0000 (19:56 -0300)]
[media] DVB: add support for LG Electronics LGDT3306A ATSC/QAM-B Demodulator

This ATSC/QAM-B demodulator is used by several new devices.

Add support for it. Other patches will fix CodingStyle issues.

Signed-off-by: Fred Richter <frichter@hauppauge.com>
Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years ago[media] DocBook media: fix xvYCC601 documentation
Hans Verkuil [Thu, 19 Feb 2015 13:49:40 +0000 (10:49 -0300)]
[media] DocBook media: fix xvYCC601 documentation

The documentation of the xvYCC601 Y'CbCr encoding was part of the SMPTE 170M
(SDTV) colorspace, but it should have been part of the Rec. 709 (HDTV) colorspace
as per the xvYCC standard.

This change only affects the documentation and not any code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>