]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/log
mirror_ubuntu-hirsute-kernel.git
8 years ago[media] mn88473: move out of staging
Antti Palosaari [Fri, 5 Feb 2016 06:04:48 +0000 (08:04 +0200)]
[media] mn88473: move out of staging

Move driver to drivers.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] saa7134: Add support for Snazio TvPVR PRO
GEORGE [Sun, 14 Feb 2016 21:23:15 +0000 (19:23 -0200)]
[media] saa7134: Add support for Snazio TvPVR PRO

This board has PCI ID: 1779:13cf

[mchehab@osg.samsung.com: Make scripts/checkpatch.pl happy]
Signed-off-by: Pojar George <geoubuntu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 set ctrl_input in au0828_s_input()
Shuah Khan [Fri, 12 Feb 2016 23:18:03 +0000 (21:18 -0200)]
[media] media: au0828 set ctrl_input in au0828_s_input()

dev->ctrl_input is set in vidioc_s_input() and doesn't get set in
au0828_s_input(). As a result, dev->ctrl_input is left uninitialized
until user space calls s_input.

It works correctly because the default input value is 0 and which is
what dev->ctrl_input gets initialized via kzalloc().

Change to set dev->ctrl_input in au0828_s_input(). Also optimize
vidioc_s_input() to return if the new input value is same as the
current.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] Fix AverMedia RM-KS remote keymap
Philippe Valembois [Tue, 9 Feb 2016 08:09:32 +0000 (06:09 -0200)]
[media] Fix AverMedia RM-KS remote keymap

Fix AverMedia RM-KS keymap using user guide to meet LinuxTV wiki rules.
The remote command didn't seem to change in itself since its creation: it's
just to make keys more standard and remove the FIXME.

Signed-off-by: Philippe Valembois <lephilousophe@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] Add support for Avermedia AverTV Volar HD 2 (TD110)
Philippe Valembois [Tue, 9 Feb 2016 08:08:01 +0000 (06:08 -0200)]
[media] Add support for Avermedia AverTV Volar HD 2 (TD110)

Signed-off-by: Philippe Valembois <lephilousophe@users.sourceforge.net>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: rc: nuvoton: support reading / writing wakeup sequence via sysfs
Heiner Kallweit [Mon, 8 Feb 2016 19:25:59 +0000 (17:25 -0200)]
[media] media: rc: nuvoton: support reading / writing wakeup sequence via sysfs

This patch adds a binary attribute /sys/class/rc/rc?/wakeup_data which
allows to read / write the wakeup sequence.

In combination with the core extension for exposing the most recent raw
packet this allows to easily define and set a wakeup sequence.

At least on my Zotac CI321 the BIOS resets the wakeup sequence at each boot
to a factory default. Therefore I use a udev rule
SUBSYSTEM=="rc", DRIVERS=="nuvoton-cir", ACTION=="add", RUN+="<script>"
with the script basically doing
cat <stored wakeup sequence> >/sys${DEVPATH}/wakeup_data

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] soc_camera/mx3_camera.c: move to staging in preparation, for removal
Hans Verkuil [Tue, 23 Feb 2016 16:39:10 +0000 (13:39 -0300)]
[media] soc_camera/mx3_camera.c: move to staging in preparation, for removal

This driver is deprecated: it should become a stand-alone driver
instead of using the soc-camera framework.

Unless someone is willing to take this on (unlikely with such
ancient hardware) it is going to be removed from the kernel
soon.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] soc_camera/mx2_camera.c: move to staging in preparation, for removal
Hans Verkuil [Tue, 23 Feb 2016 16:38:43 +0000 (13:38 -0300)]
[media] soc_camera/mx2_camera.c: move to staging in preparation, for removal

This driver is deprecated: it should become a stand-alone driver
instead of using the soc-camera framework.

Unless someone is willing to take this on (unlikely with such
ancient hardware) it is going to be removed from the kernel
soon.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] soc_camera/omap1: move to staging in preparation for removal
Hans Verkuil [Tue, 23 Feb 2016 12:13:04 +0000 (09:13 -0300)]
[media] soc_camera/omap1: move to staging in preparation for removal

This driver is deprecated: it needs to be converted to vb2 and
it should become a stand-alone driver instead of using the
soc-camera framework.

Unless someone is willing to take this on (unlikely with such
ancient hardware) it is going to be removed from the kernel
soon.

Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] vivid: support new multiplanar YUV formats
Hans Verkuil [Sat, 20 Feb 2016 08:57:38 +0000 (06:57 -0200)]
[media] vivid: support new multiplanar YUV formats

Add support for the new YUV422M, YVU422M, YUV444M and YVU444M formats.
This allows applications to check their support for these formats.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] coda: add support for firmware files named as distributed by NXP
Philipp Zabel [Fri, 19 Feb 2016 09:18:57 +0000 (07:18 -0200)]
[media] coda: add support for firmware files named as distributed by NXP

Try loading the firmware from firmware files named vpu_fw_imx*.bin, as
they are originally distributed by NXP. Fall back to v4l-coda*-imx6*.bin.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] adv7604: fix SPA register location for ADV7612
Ulrich Hecht [Wed, 17 Feb 2016 14:57:56 +0000 (12:57 -0200)]
[media] adv7604: fix SPA register location for ADV7612

SPA location LSB register is at 0x70.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] coda: add support for native order firmware files with Freescale header
Philipp Zabel [Wed, 17 Feb 2016 13:21:10 +0000 (11:21 -0200)]
[media] coda: add support for native order firmware files with Freescale header

Freescale distribute their VPU firmware files with a 16 byte header
in BIT processor native order. This patch allows to detect the header
and to reorder the firmware on the fly.
With this patch it should be possible to use the distributed
vpu_fw_imx{53,6q,6d}.bin files directly after renaming them to
v4l-coda*-imx{53,6q,6dl}.bin.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] V4L: fix a confusing function name
Guennadi Liakhovetski [Sun, 21 Feb 2016 16:34:59 +0000 (13:34 -0300)]
[media] V4L: fix a confusing function name

is_state_active_or_queued() actually returns true if the buffer's state
is neither active nore queued. Rename it for clarity.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] atmel-isi: Fix bad usage of IS_ERR_VALUE
Guenter Roeck [Tue, 9 Feb 2016 14:43:42 +0000 (12:43 -0200)]
[media] atmel-isi: Fix bad usage of IS_ERR_VALUE

IS_ERR_VALUE() assumes that its parameter is an unsigned long.
It can not be used to check if an unsigned int reflects an error.
Doing so can result in the following build warning.

drivers/media/platform/soc_camera/atmel-isi.c:
In function "atmel_isi_probe":
include/linux/err.h:21:38: warning:
comparison is always false due to limited range of data type
drivers/media/platform/soc_camera/atmel-isi.c:1089:6: note:
in expansion of macro "IS_ERR_VALUE"

If that warning is seen, the return value from platform_get_irq() is not
checked for errors.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pxa_camera: conversion to dmaengine
Robert Jarzmik [Sun, 6 Sep 2015 11:42:13 +0000 (08:42 -0300)]
[media] pxa_camera: conversion to dmaengine

Convert pxa_camera to dmaengine. This removes all DMA registers
manipulation in favor of the more generic dmaengine API.

The functional level should be the same as before. The biggest change is
in the sg_split() function, which splits a videobuf-dma into several
scatterlists for 3 planes captures (Y, U, V).

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
[g.liakhovetski@gmx.de: fix a function prototype, use bool, struct init]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pxa_camera: trivial move of dma irq functions
Robert Jarzmik [Sun, 6 Sep 2015 11:42:12 +0000 (08:42 -0300)]
[media] pxa_camera: trivial move of dma irq functions

This moves the dma irq handling functions up in the source file, so that
they are available before DMA preparation functions. It prepares the
conversion to DMA engine, where the descriptors are populated with these
functions as callbacks.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pxa_camera: move interrupt to tasklet
Robert Jarzmik [Sun, 6 Sep 2015 11:42:11 +0000 (08:42 -0300)]
[media] pxa_camera: move interrupt to tasklet

In preparation for dmaengine conversion, move the camera interrupt
handling into a tasklet. This won't change the global flow, as this
interrupt is only used to detect the end of frame and activate DMA fifos
handling.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pxa_camera: fix the buffer free path
Robert Jarzmik [Sun, 6 Sep 2015 11:42:10 +0000 (08:42 -0300)]
[media] pxa_camera: fix the buffer free path

Fix the error path where the video buffer wasn't allocated nor
mapped. In this case, in the driver free path don't try to unmap memory
which was not mapped in the first place.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] mx3_camera: use %pad format string for dma_ddr_t
Arnd Bergmann [Mon, 1 Feb 2016 16:45:39 +0000 (14:45 -0200)]
[media] mx3_camera: use %pad format string for dma_ddr_t

The mx3_camera driver prints DMA addresses using the "%x" format
string, which is wrong when using a 64-bit dma_addr_t definition:

media/platform/soc_camera/mx3_camera.c: In function 'mx3_cam_dma_done':
media/platform/soc_camera/mx3_camera.c:149:125: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=]
media/platform/soc_camera/mx3_camera.c: In function 'mx3_videobuf_queue':
media/platform/soc_camera/mx3_camera.c:317:119: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=]
media/platform/soc_camera/mx3_camera.c: In function 'mx3_videobuf_release':
media/platform/soc_camera/mx3_camera.c:346:119: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=]

This changes the code to use the special %pad format string, which
always does the right thing.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] soc_camera: rcar_vin: Add ARGB8888 caputre format support
Koji Matsuoka [Sun, 24 Jan 2016 16:13:29 +0000 (14:13 -0200)]
[media] soc_camera: rcar_vin: Add ARGB8888 caputre format support

This patch adds ARGB8888 capture format support for R-Car Gen3.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] UVC: Add support for R200 depth camera
Aviv Greenberg [Wed, 3 Feb 2016 17:08:52 +0000 (15:08 -0200)]
[media] UVC: Add support for R200 depth camera

Add support for Intel R200 depth camera in uvc driver.
This includes adding new uvc GUIDs for the new pixel formats,
adding new V4L pixel format definition to user api headers,
and updating the uvc driver GUID-to-4cc tables with the new formats.

Tested-by: Greenberg, Aviv D <aviv.d.greenberg@intel.com>
Signed-off-by: Aviv Greenberg <aviv.d.greenberg@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] V4L: add Y12I, Y8I and Z16 pixel format documentation
Guennadi Liakhovetski [Tue, 15 Dec 2015 16:35:33 +0000 (14:35 -0200)]
[media] V4L: add Y12I, Y8I and Z16 pixel format documentation

Add documentation for 3 formats, used by RealSense cameras like R200.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] au0828: use v4l2_mc_create_media_graph()
Mauro Carvalho Chehab [Wed, 2 Mar 2016 13:11:41 +0000 (10:11 -0300)]
[media] au0828: use v4l2_mc_create_media_graph()

There's no reason to implement its own function to create the
media graph. So, use the core one.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] au0828: use standard demod pads struct
Mauro Carvalho Chehab [Wed, 2 Mar 2016 12:48:36 +0000 (09:48 -0300)]
[media] au0828: use standard demod pads struct

As we want au0828 to use the core function to create the MC
graphs, use enum demod_pad_index instead of
enum au8522_media_pads.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] rc-core: allow calling rc_open with device not initialized
Mauro Carvalho Chehab [Wed, 2 Mar 2016 11:00:15 +0000 (08:00 -0300)]
[media] rc-core: allow calling rc_open with device not initialized

The device initialization completes only after calling
input_register_device(). However, rc_open() can be called while
the device is being registered by the input/evdev core. So, we
can't expect that rc_dev->initialized to be true.

Change the logic to don't require initialized == true at rc_open
and change the type of initialized to be atomic.

this way, we can check for it earlier where it is really needed,
without needing to lock the mutex just for testing it.

Tested with nuvoton_cir driver on a NUC5i7RYB with CIR integrated on it.

Reported-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media.h: use hex values for IF and AUDIO entities too
Hans Verkuil [Mon, 29 Feb 2016 08:02:47 +0000 (05:02 -0300)]
[media] media.h: use hex values for IF and AUDIO entities too

Make the base offset hexadecimal to simplify debugging since the base
addresses are hex too.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years agoMerge branch 'v4l_for_linus' into patchwork
Mauro Carvalho Chehab [Thu, 3 Mar 2016 09:07:04 +0000 (06:07 -0300)]
Merge branch 'v4l_for_linus' into patchwork

We need to import the changes at media.h, as we have a
followup patch that depends on it.

* v4l_for_linus:
  [media] media.h: use hex values for range offsets,  move connectors base up.
  [media] adv7604: fix tx 5v detect regression

8 years ago[media] media.h: use hex values for range offsets, move connectors base up.
Hans Verkuil [Mon, 29 Feb 2016 08:02:47 +0000 (09:02 +0100)]
[media] media.h: use hex values for range offsets,  move connectors base up.

Make the base offset hexadecimal to simplify debugging since the base
addresses are hex too.

The offsets for connectors is also changed to start after the 'reserved'
range 0x10000-0x2ffff.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media-device.h: fix compiler warning
Hans Verkuil [Fri, 26 Feb 2016 07:44:35 +0000 (04:44 -0300)]
[media] media-device.h: fix compiler warning

Fix these compiler warnings:

media-git/include/media/media-device.h: In function 'media_device_pci_init':
media-git/include/media/media-device.h:610:9: warning: 'return' with a value, in function returning void
  return NULL;
         ^
media-git/include/media/media-device.h: In function '__media_device_usb_init':
media-git/include/media/media-device.h:618:9: warning: 'return' with a value, in function returning void
  return NULL;
         ^

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] lirc_dev: avoid double mutex unlock
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:13 +0000 (07:51 -0300)]
[media] lirc_dev: avoid double mutex unlock

We can only unlock if mutex_lock() succeeds.

Fixes the following warning:
drivers/media/rc/lirc_dev.c:535 lirc_dev_fop_close() error: double unlock 'mutex:&lirc_dev_lock'

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] ati_remote: Put timeouts at the accel array
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:12 +0000 (07:51 -0300)]
[media] ati_remote: Put timeouts at the accel array

Instead of having the timeouts hardcoded, and getting only the
accel value from the array, put everything in the same place.

That simplifies the logic.

As a side effect, it also cleans several smatch errors:
include/linux/jiffies.h:359:41: error: strange non-value function or array
include/linux/jiffies.h:361:42: error: strange non-value function or array
(one per time_after/time_before line)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pt3: fix device identification
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:11 +0000 (07:51 -0300)]
[media] pt3: fix device identification

As warned by smatch:
drivers/media/pci/pt3/pt3.c:398 pt3_attach_fe() error: strncmp() '"tc90522sat"' too small (11 vs 20)

Clearly, the logic is doing the wrong thing, as it is not comparing the strings
on the right way.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] technisat-usb2: don't do DMA on the stack
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:10 +0000 (07:51 -0300)]
[media] technisat-usb2: don't do DMA on the stack

As warned by smatch:
drivers/media/usb/dvb-usb/technisat-usb2.c:263 technisat_usb2_set_led() error: doing dma on the stack (led)
drivers/media/usb/dvb-usb/technisat-usb2.c:280 technisat_usb2_set_led_timer() error: doing dma on the stack (&b)
drivers/media/usb/dvb-usb/technisat-usb2.c:341 technisat_usb2_identify_state() error: doing dma on the stack (version)
drivers/media/usb/dvb-usb/technisat-usb2.c:609 technisat_usb2_get_ir() error: doing dma on the stack (buf)
drivers/media/usb/dvb-usb/technisat-usb2.c:619 technisat_usb2_get_ir() error: doing dma on the stack (buf)

Create a buffer at the device state and use it for all the DMA
transfers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dib0090: Do the right check for state->rf_ramp
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:09 +0000 (07:51 -0300)]
[media] dib0090: Do the right check for state->rf_ramp

Smatch with -pkernel --no-data keeps complaining about rf_ramp:
drivers/media/dvb-frontends/dib0090.c:1119 dib0090_pwm_gain_reset() error: we previously assumed 'state->rf_ramp' could be null (see line 1086)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] drxj: don't do math if not needed
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:08 +0000 (07:51 -0300)]
[media] drxj: don't do math if not needed

While there's no risk of divison by zero, the logic there is akward, as it
does the calculus for the numerator and denominator before checking
if this will be used.

Change the order to check first if the denominator is zero, and only
calculating the numerator/denominator if not.

This should also avoid those smatch errors:
drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero
drivers/media/dvb-frontends/drx39xyj/drxj.c:9605 ctrl_get_qam_sig_quality() debug: sval_binop_unsigned: divide by zero

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] airspy: fix bit set/clean mess on s->flags
Mauro Carvalho Chehab [Sat, 27 Feb 2016 10:51:07 +0000 (07:51 -0300)]
[media] airspy: fix bit set/clean mess on s->flags

As warned by smatch:
drivers/media/usb/airspy/airspy.c:541 airspy_start_streaming() warn: test_bit() takes a bit number
drivers/media/usb/airspy/airspy.c:569 airspy_start_streaming() warn: test_bit() takes a bit number
drivers/media/usb/airspy/airspy.c:605 airspy_stop_streaming() warn: test_bit() takes a bit number

set_bit/clear_bit argument is the bit number, and not 1 << bit.

Thankfully, one of the bits was not used (URB_BUF), with would
otherwise cause a driver misfunctioning.

Clean this mess by always using set_bit/clear_bit/test_bit and
removing the unused bit.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] gspca: Remove unused ovfx2_vga_mode/ovfx2_cif_mode arrays
Hans de Goede [Mon, 29 Feb 2016 19:00:01 +0000 (16:00 -0300)]
[media] gspca: Remove unused ovfx2_vga_mode/ovfx2_cif_mode arrays

Remove the unused ovfx2_vga_mode/ovfx2_cif_mode arrays from the ov519
driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] gspca: Fix ov519 i2c r/w not working when connected to a xhci host
Wesley Post [Mon, 29 Feb 2016 18:39:10 +0000 (15:39 -0300)]
[media] gspca: Fix ov519 i2c r/w not working when connected to a xhci host

Fix the ov519 driver not working (unable to talk to the sensor) when
plugged into a xhci host. The root cause here is that uhci/ohci/ehci
hosts typically will send any pending async requests every milli-second
and then go to sleep for the rest if the milli-second, where as xhci hosts
send them immediately, causing things to go too fast for the ov519 bridge.

This commit adds a few delays fixing this.

Signed-off-by: Wesley Post <pa4wdh@xs4all.nl>
[hdegoede@redhat.com: Also add delays to w996Xcf.c, as that needs them too]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] bttv: Width must be a multiple of 16 when capturing planar formats
Hans de Goede [Sun, 7 Feb 2016 11:24:29 +0000 (09:24 -0200)]
[media] bttv: Width must be a multiple of 16 when capturing planar formats

On my bttv card "Hauppauge WinTV [card=10]" capturing in YV12 fmt at max
size results in a solid green rectangle being captured (all colors 0 in
YUV).

This turns out to be caused by max-width (924) not being a multiple of 16.

We've likely never hit this problem before since normally xawtv / tvtime,
etc. will prefer packed pixel formats. But when using a video card which
is using xf86-video-modesetting + glamor, only planar XVideo fmts are
available, and xawtv will chose a matching capture format to avoid needing
to do conversion, triggering the solid green window problem.

Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 video change to use v4l_enable_media_source()
Shuah Khan [Thu, 11 Feb 2016 23:41:37 +0000 (21:41 -0200)]
[media] media: au0828 video change to use v4l_enable_media_source()

Change au0828 to check if tuner is free or not before changing tuner
configuration.

vidioc_g_tuner(), and au0828_v4l2_close() now call v4l-core interface
v4l_enable_media_source() before changing tuner configuration.

Remove au0828_enable_analog_tuner() as it is no longer needed because
v4l2-core implements common interfaces to check for media source
availability.

In addition, queue_setup() no longer needs the tuner availability check
since v4l2-core does it.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: dvb-frontend invoke enable/disable_source handlers
Shuah Khan [Thu, 11 Feb 2016 23:41:36 +0000 (21:41 -0200)]
[media] media: dvb-frontend invoke enable/disable_source handlers

Change dvb frontend to check if tuner is free when device opened in RW
mode.

Call to enable_source handler either returns with an active pipeline to
tuner or error if tuner is busy.

Tuner is released when frontend is released calling the disable_source
handler.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 add enable, disable source handlers
Shuah Khan [Thu, 11 Feb 2016 23:41:35 +0000 (21:41 -0200)]
[media] media: au0828 add enable, disable source handlers

Add enable_source and disable_source handlers. The enable source handler
is called from v4l2-core, dvb-core, and ALSA drivers to check if the
shared media source is free.

The disable source handler is called to release the shared media
source.

[mchehab@osg.samsung.com: fix merge conflicts]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828-core register entity_notify hook
Shuah Khan [Thu, 11 Feb 2016 23:41:34 +0000 (21:41 -0200)]
[media] media: au0828-core register entity_notify hook

Register entity_notify async hook to create links between existing
bridge driver entities and a newly added non-bridge driver entities. For
example, this handler creates link between V4L decoder entity and ALSA
mixer entity.

[mchehab@osg.samsung.com: fix merge conflicts and make
 au0828_media_graph_notify static to shut up a warning]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 disable tuner to demod link
Shuah Khan [Thu, 11 Feb 2016 23:41:33 +0000 (21:41 -0200)]
[media] media: au0828 disable tuner to demod link

Change au0828_create_media_graph() to find and disable
tuner and demod link. This helps avoid an additional
disable step when tuner is requested by video or audio.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 create tuner to decoder link in disabled state
Shuah Khan [Thu, 11 Feb 2016 23:41:32 +0000 (21:41 -0200)]
[media] media: au0828 create tuner to decoder link in disabled state

Create tuner to demod pad link in disabled state to avoid disable step
when tuner resource is requested by dvb.

[mchehab@osg.samsung.com: fix a merge conflict]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 handle media_init and media_register window
Shuah Khan [Thu, 11 Feb 2016 23:41:31 +0000 (21:41 -0200)]
[media] media: au0828 handle media_init and media_register window

Media device initialization and registration steps are split. There is a
window between media device init and media device register during usb
probe.

au0828 bridge driver and snd-usb-audio could try to initialize the media
device, if they simply checked, whether the device has been registered.
They also need to check whether the device has been initialized.

Change the au0828-core to check if media device is already initialized
during initialization step and check if media device is already
registered during the registration step.

[mchehab@osg.samsung.com: fix a merge conflict]
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 change to use Managed Media Controller API
Shuah Khan [Thu, 11 Feb 2016 23:41:30 +0000 (21:41 -0200)]
[media] media: au0828 change to use Managed Media Controller API

Change au0828 to use Managed Media Controller API to share media device
and coordinate creating/deleting the shared media device with the
snd-usb-audio driver. The shared media device is created as device
resource of the parent usb device of the two drivers.

Populate media device model with USB Device product name instead of
au0828 device board name. This change is necessary because, if the media
device is registered by the snd-usb-audio driver first, and it doesn't
know the au0828 board name.

[mchehab@osg.samsung.com: Fix merge conflicts]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Change v4l-core to check if source is free
Shuah Khan [Thu, 11 Feb 2016 23:41:29 +0000 (21:41 -0200)]
[media] media: Change v4l-core to check if source is free

Change s_input, s_fmt, s_tuner, s_frequency, querystd, s_hw_freq_seek,
and vb2_core_streamon interfaces that alter the tuner configuration to
check if it is free, by calling v4l_enable_media_source().

If source isn't free, return -EBUSY.

v4l_disable_media_source() is called from v4l2_fh_exit() to release
tuner (source).

vb2_core_streamon() uses v4l_vb2q_enable_media_source().

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au0828 Use au8522_media_pads enum for pad defines
Shuah Khan [Thu, 11 Feb 2016 23:41:28 +0000 (21:41 -0200)]
[media] media: au0828 Use au8522_media_pads enum for pad defines

Change au0828-core to use au8522_media_pads enum defines
instead of hard-coding the pad values.

[mchehab@osg.samsung.com: patch rebased, as the code was
 moved to au0828-video.c. Also added AU8522_PAD_INPUT to the list
 of pad number replacements]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: au8522 change to create MC pad for ALSA Audio Out
Shuah Khan [Thu, 11 Feb 2016 23:41:27 +0000 (21:41 -0200)]
[media] media: au8522 change to create MC pad for ALSA Audio Out

Add new pad for ALSA Audio Out to au8522_media_pads.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Move au8522_media_pads enum to au8522.h from au8522_priv.h
Shuah Khan [Thu, 11 Feb 2016 23:41:26 +0000 (21:41 -0200)]
[media] media: Move au8522_media_pads enum to au8522.h from au8522_priv.h

Move the au8522_media_pads enum to au8522.h from au8522_priv.h to export
them. This will allow au0828-core to use these defines instead of
hard-coding them them.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: v4l-core add enable/disable source common interfaces
Shuah Khan [Thu, 11 Feb 2016 23:41:25 +0000 (21:41 -0200)]
[media] media: v4l-core add enable/disable source common interfaces

Add a new interfaces to be used by v4l-core to invoke enable
source and disable_source handlers in the media_device. The
enable_source helper function invokes the enable_source handler
to find media source entity connected to the entity and check
is it is available or busy. If source is available, link is
activated and pipeline is started. The disable_source helper
function invokes the disable_source handler to deactivate and
stop the pipeline.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Media Controller non-locking __media_entity_pipeline_start/stop()
Shuah Khan [Thu, 11 Feb 2016 23:41:24 +0000 (21:41 -0200)]
[media] media: Media Controller non-locking __media_entity_pipeline_start/stop()

Add non-locking __media_entity_pipeline_start/stop()
interfaces to be called from code paths that hold the
graph_mutex.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Media Controller export non locking __media_entity_setup_link()
Shuah Khan [Thu, 11 Feb 2016 23:41:23 +0000 (21:41 -0200)]
[media] media: Media Controller export non locking __media_entity_setup_link()

Export __media_entity_setup_link() to be used from code paths
that hold the graph_mutex.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Media Controller enable/disable source handler API
Shuah Khan [Thu, 11 Feb 2016 23:41:22 +0000 (21:41 -0200)]
[media] media: Media Controller enable/disable source handler API

Add new fields to struct media_device to add enable_source, and
disable_source handlers, and source_priv to stash driver private
data that is used to run these handlers. The enable_source handler
finds source entity for the passed in entity and checks if it is
available. When link is found, it activates it. Disable source
handler deactivates the link.

Bridge driver is expected to implement and set these handlers.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Media Controller register/unregister entity_notify API
Shuah Khan [Thu, 11 Feb 2016 23:41:21 +0000 (21:41 -0200)]
[media] media: Media Controller register/unregister entity_notify API

Add new interfaces to register and unregister entity_notify
hook to media device. These interfaces allow drivers to add
hooks to take appropriate actions when new entities get added
to a shared media device. For example, au0828 bridge driver
registers an entity_notify hook to create links as needed
between media graph nodes.

[mchehab@osg.samsung.com: simple comments should be /* and not /**]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Add ALSA Media Controller function entities
Shuah Khan [Thu, 11 Feb 2016 23:41:20 +0000 (21:41 -0200)]
[media] media: Add ALSA Media Controller function entities

Add ALSA Media Controller capture, playback, and mixer
function entity defines.

[mchehab@osg.samsung.com: fix a trivial merge conflict and start
 MEDIA_ENT_AUDIO_F from 3000]

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] Docbook: media-types.xml: Add Audio Function Entities
Shuah Khan [Thu, 11 Feb 2016 23:41:19 +0000 (21:41 -0200)]
[media] Docbook: media-types.xml: Add Audio Function Entities

Add Audio Function Entities

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] uapi/media.h: Declare interface types for ALSA
Shuah Khan [Thu, 11 Feb 2016 23:41:18 +0000 (21:41 -0200)]
[media] uapi/media.h: Declare interface types for ALSA

Declare the interface types to be used on alsa for
the new G_TOPOLOGY ioctl.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] Docbook: media-types.xml: Add ALSA Media Controller Intf types
Shuah Khan [Thu, 11 Feb 2016 23:41:17 +0000 (21:41 -0200)]
[media] Docbook: media-types.xml: Add ALSA Media Controller Intf types

Add ALSA Media Controller Intf types

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] tc358743: use - instead of non-ascii wide-dash character
Hans Verkuil [Sat, 20 Feb 2016 08:48:23 +0000 (06:48 -0200)]
[media] tc358743: use - instead of non-ascii wide-dash character

smatch complains about non-ascii characters. It turns out that a wide-dash character
was used instead of the more common '-' character.

Replace those dashes with -.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] ttpci: cleanup a bogus smatch warning
Mauro Carvalho Chehab [Mon, 22 Feb 2016 17:22:04 +0000 (14:22 -0300)]
[media] ttpci: cleanup a bogus smatch warning

Cleanup this bogus smatch warning:
drivers/media/pci/ttpci/budget.c:635 frontend_init() warn: missing break? reassigning 'budget->dvb_frontend'

And document the fall through logic at the switch().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] av7110: remove a bogus smatch warning
Mauro Carvalho Chehab [Mon, 22 Feb 2016 17:14:41 +0000 (14:14 -0300)]
[media] av7110: remove a bogus smatch warning

Remove this bogus smatch warning:
drivers/media/pci/ttpci/av7110.c:2211 frontend_init() warn: missing break? reassigning 'av7110->fe'

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] drxj: set_param_parameters array is too short
Mauro Carvalho Chehab [Mon, 22 Feb 2016 16:40:14 +0000 (13:40 -0300)]
[media] drxj: set_param_parameters array is too short

Fixes this smatch warning:
drivers/media/dvb-frontends/drx39xyj/drxj.c:4151 drxj_dap_scu_atomic_read_write_block() error: buffer overflow 'set_param_parameters' 15 <= 17

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dib9000: read16/write16 could return an error code
Mauro Carvalho Chehab [Mon, 22 Feb 2016 16:43:57 +0000 (13:43 -0300)]
[media] dib9000: read16/write16 could return an error code

Both dib9000_read16_attr and dib9000_write16_attr can return an
error code. However, they currently return an u16. This produces the
following warnings on smatch:

drivers/media/dvb-frontends/dib9000.c:262 dib9000_read16_attr() warn: signedness bug returning '(-121)'
drivers/media/dvb-frontends/dib9000.c:321 dib9000_write16_attr() warn: signedness bug returning '(-22)'
drivers/media/dvb-frontends/dib9000.c:353 dib9000_write16_attr() warn: signedness bug returning '(-121)'

Reviewed-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] ivtv: steal could be NULL
Mauro Carvalho Chehab [Mon, 22 Feb 2016 16:27:20 +0000 (13:27 -0300)]
[media] ivtv: steal could be NULL

ivtv_flush_queues() calls ivtv_queue_move() with steal == NULL.
However, part of the code assumes that steal could be not null, as
pointed by smatch:
drivers/media/pci/ivtv/ivtv-queue.c:145 ivtv_queue_move() error: we previously assumed 'steal' could be null (see line 138)

This has the potential of causing an OOPS when the queue is
flushed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] stv0900: avoid going past array
Mauro Carvalho Chehab [Mon, 22 Feb 2016 16:12:00 +0000 (13:12 -0300)]
[media] stv0900: avoid going past array

Fix the following smatch warnings:
drivers/media/dvb-frontends/stv0900_core.c:1183 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
drivers/media/dvb-frontends/stv0900_core.c:1185 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
drivers/media/dvb-frontends/stv0900_core.c:1187 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
drivers/media/dvb-frontends/stv0900_core.c:1189 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13
drivers/media/dvb-frontends/stv0900_core.c:1191 stv0900_get_optim_carr_loop() error: buffer overflow 'cllas2' 11 <= 13

Reviewed-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pvrusb2: don't go past buf array
Mauro Carvalho Chehab [Mon, 22 Feb 2016 16:22:35 +0000 (13:22 -0300)]
[media] pvrusb2: don't go past buf array

That fixes the following smatch warning:
drivers/media/usb/pvrusb2/pvrusb2-hdw.c:4909 pvr2_hdw_state_log_state() error: buffer overflow 'buf' 256 <= 4294967294

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pvrusb2-io: no need to check if sp is not NULL
Mauro Carvalho Chehab [Mon, 22 Feb 2016 16:02:36 +0000 (13:02 -0300)]
[media] pvrusb2-io: no need to check if sp is not NULL

The buffer_complete() routine assumes that sp is not NULL,
otherwise it will fail completely. Btw, this is also
assumed at pvr2_buffer_queue(), with is the routine that
setups the URB handling.

So, remove the bogus for the callback at buffer_complete.

This fix this smatch warning:
drivers/media/usb/pvrusb2/pvrusb2-io.c:476 buffer_complete() warn: variable dereferenced before check 'sp' (see line 472)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media_device: move allocation out of media_device_*_init
Mauro Carvalho Chehab [Mon, 22 Feb 2016 15:10:49 +0000 (12:10 -0300)]
[media] media_device: move allocation out of media_device_*_init

Right now, media_device_pci_init and media_device_usb_init does
media_device allocation internaly. That preents its usage when
the media_device struct is embedded on some other structure.

Move memory allocation outside it, to make it more generic.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media-device: move PCI/USB helper functions from v4l2-mc
Mauro Carvalho Chehab [Mon, 22 Feb 2016 14:42:04 +0000 (11:42 -0300)]
[media] media-device: move PCI/USB helper functions from v4l2-mc

Those ancillary functions could be called even when compiled
without V4L2 support, as warned by ktest build robot:

All errors (new ones prefixed by >>):

>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb/dvb-usb.ko] undefined!
>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb-v2/dvb_usb_v2.ko] undefined!
>> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/au0828/au0828.ko] undefined!

Also, there's nothing there that are specific to V4L2. So, move
those ancillary functions to MC core.

No functional changes. Just function rename.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: ti-vpe: cal: Fix warning: variable dereference before being checked
Benoit Parrot [Fri, 19 Feb 2016 20:00:30 +0000 (18:00 -0200)]
[media] media: ti-vpe: cal: Fix warning: variable dereference before being checked

As reported ctx->sensor is being dereferenced before being checked
in cal_get_external_info(). That being the case it was also checked
twice in multiple other location where v4l2_subdev_call is already
checking it so no need to explicitly check it again.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: ti-vpe: cal: Fix unreachable code in enum_frame_interval
Benoit Parrot [Fri, 19 Feb 2016 19:24:45 +0000 (17:24 -0200)]
[media] media: ti-vpe: cal: Fix unreachable code in enum_frame_interval

As reported, the current cal_enum_frameintervals() is confusing
and does not have the intended behavior.
Fix this by re-implementing to properly propagate the enum_frame_interval
request to the subdevice.

[mchehab@osg.samsung.com: remove a now bogus "ret = 0" statement]
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dib0090: do the right thing if rf_ramp is NULL
Mauro Carvalho Chehab [Mon, 22 Feb 2016 14:12:41 +0000 (11:12 -0300)]
[media] dib0090: do the right thing if rf_ramp is NULL

As warned by smatch:
drivers/media/dvb-frontends/dib0090.c:1118 dib0090_pwm_gain_reset() error: we previously assumed 'state->rf_ramp' could be null (see line 1086)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] saa7134: fix detection of external decoders
Mauro Carvalho Chehab [Fri, 19 Feb 2016 17:03:54 +0000 (15:03 -0200)]
[media] saa7134: fix detection of external decoders

As warned by smatch:
drivers/media/pci/saa7134/saa7134-core.c:840 saa7134_create_entities() info: ignoring unreachable code.
drivers/media/pci/saa7134/saa7134-core.c:843 saa7134_create_entities() warn: curly braces intended?

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] tvp5150: don't go past decoder->input_ent array
Mauro Carvalho Chehab [Fri, 19 Feb 2016 17:02:30 +0000 (15:02 -0200)]
[media] tvp5150: don't go past decoder->input_ent array

drivers/media/i2c/tvp5150.c:1394 tvp5150_parse_dt() warn: buffer overflow 'decoder->input_ent' 3 <= 3

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l2-mc: fix hardware version for PCI devices
Mauro Carvalho Chehab [Fri, 19 Feb 2016 14:28:19 +0000 (12:28 -0200)]
[media] v4l2-mc: fix hardware version for PCI devices

It should be a bitwise or, and not a logical one. Also, add
parenthesis, to make sure it will be applied in the right order.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] xc4000: shut up a bogus smatch message
Mauro Carvalho Chehab [Fri, 19 Feb 2016 14:22:30 +0000 (12:22 -0200)]
[media] xc4000: shut up a bogus smatch message

smatch complains about:
drivers/media/tuners/xc4000.c:1511 xc4000_get_signal() warn: '~value << 3' 524280 can't fit into 65535 'value'

Remove the bogus complain.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Use all bits of an enumeration
Sakari Ailus [Wed, 27 Jan 2016 14:47:54 +0000 (12:47 -0200)]
[media] media: Use all bits of an enumeration

The allocation takes place in longs. Assign the size of the enum
accordingly.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] vsp1_drm.h: add missing prototypes
Mauro Carvalho Chehab [Fri, 19 Feb 2016 12:02:53 +0000 (10:02 -0200)]
[media] vsp1_drm.h: add missing prototypes

drivers/media/platform/vsp1/vsp1_drm.c:47:5: warning: no previous prototype for 'vsp1_du_init' [-Wmissing-prototypes]
 int vsp1_du_init(struct device *dev)
     ^
drivers/media/platform/vsp1/vsp1_drm.c:76:5: warning: no previous prototype for 'vsp1_du_setup_lif' [-Wmissing-prototypes]
 int vsp1_du_setup_lif(struct device *dev, unsigned int width,
     ^
drivers/media/platform/vsp1/vsp1_drm.c:221:6: warning: no previous prototype for 'vsp1_du_atomic_begin' [-Wmissing-prototypes]
 void vsp1_du_atomic_begin(struct device *dev)
      ^
drivers/media/platform/vsp1/vsp1_drm.c:273:5: warning: no previous prototype for 'vsp1_du_atomic_update' [-Wmissing-prototypes]
 int vsp1_du_atomic_update(struct device *dev, unsigned int rpf_index,
     ^
drivers/media/platform/vsp1/vsp1_drm.c:451:6: warning: no previous prototype for 'vsp1_du_atomic_flush' [-Wmissing-prototypes]
 void vsp1_du_atomic_flush(struct device *dev)
      ^

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Configure device based on IP version
Laurent Pinchart [Sat, 5 Dec 2015 22:17:10 +0000 (20:17 -0200)]
[media] v4l: vsp1: Configure device based on IP version

The IP version number carries enough information to identify the exact
device instance features. Drop the related DT properties and use the IP
version instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Add display list support
Takashi Saito [Mon, 7 Sep 2015 04:40:25 +0000 (01:40 -0300)]
[media] v4l: vsp1: Add display list support

Display lists contain lists of registers and associated values to be
applied atomically by the hardware. They lower the pressure on interrupt
processing delays when reprogramming the device as settings can be
prepared well in advance and queued to the hardware without waiting for
the end of the current frame.

Display list support is currently limited to the DRM pipeline.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Add support for the R-Car Gen3 VSP2
Laurent Pinchart [Mon, 7 Sep 2015 11:05:39 +0000 (08:05 -0300)]
[media] v4l: vsp1: Add support for the R-Car Gen3 VSP2

Add DT compatible strings for the VSP2 instances found in the R-Car Gen3
SoCs and support them in the vsp1 driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Implement atomic update for the DRM driver
Laurent Pinchart [Thu, 10 Sep 2015 12:28:39 +0000 (09:28 -0300)]
[media] v4l: vsp1: Implement atomic update for the DRM driver

Add two API functions named vsp1_du_atomic_begin() and
vsp1_du_atomic_flush() to signal the start and end of an atomic update.
The vsp1_du_setup_rpf() function is renamed to vsp1_du_atomic_update()
for consistency.

With this new API, the driver will reprogram all modified inputs
atomically before restarting the video stream.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Disconnect unused RPFs from the DRM pipeline
Laurent Pinchart [Thu, 10 Sep 2015 18:56:29 +0000 (15:56 -0300)]
[media] v4l: vsp1: Disconnect unused RPFs from the DRM pipeline

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Add VSP+DU support
Laurent Pinchart [Sun, 2 Aug 2015 21:37:01 +0000 (18:37 -0300)]
[media] v4l: vsp1: Add VSP+DU support

Implement internal control of the VSP pipeline to be used by the DU
DRM/KMS driver when using the VSP as an internal composer handled
through DRM/KMS only.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Don't validate links when the userspace API is disabled
Laurent Pinchart [Wed, 5 Aug 2015 20:14:41 +0000 (17:14 -0300)]
[media] v4l: vsp1: Don't validate links when the userspace API is disabled

As the pipeline is configured internally by the driver when the
userspace API is disabled its configuration can be trusted and link
validation isn't needed.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Set the alpha value manually in RPF and WPF s_stream handlers
Laurent Pinchart [Wed, 5 Aug 2015 19:57:35 +0000 (16:57 -0300)]
[media] v4l: vsp1: Set the alpha value manually in RPF and WPF s_stream handlers

The RPF and WPF alpha values are set through V4L2 controls and applied
when starting the video stream by a call to v4l2_ctrl_handler_setup().
As that function uses the control handler mutex it can't be called in
interrupt context, where the VSP+DU pipeline handler might need to
reconfigure the pipeline.

Set the alpha value manually in the RPF and WPF s_stream handler to
ensure that the hardware is properly configured even when controlled
without the userspace API. If the userspace API is enabled protect that
with the control lock to avoid race conditions with userspace.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Make pipeline inputs array index by RPF index
Laurent Pinchart [Wed, 5 Aug 2015 19:40:31 +0000 (16:40 -0300)]
[media] v4l: vsp1: Make pipeline inputs array index by RPF index

The pipeline inputs array stores pointers to all RPFs contained in the
pipeline. It's currently indexed contiguously by adding RPFs in the
order they are found during graph walk. This can't easily support
dynamic addition and removal of RPFs while streaming, which will be
required for combined VSP+DU support.

Make the array indexed by RPF index instead and skip NULL elements when
iterating over RPFs.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Make the userspace API optional
Laurent Pinchart [Tue, 28 Jul 2015 19:16:05 +0000 (16:16 -0300)]
[media] v4l: vsp1: Make the userspace API optional

The R-Car Gen3 SoCs include VSP instances dedicated to the DU that will
be controlled entirely by the rcar-du-drm driver through the KMS API. To
support that use case make the userspace V4L2 API optional.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Move format info to vsp1_pipe.c
Laurent Pinchart [Mon, 3 Aug 2015 13:21:49 +0000 (10:21 -0300)]
[media] v4l: vsp1: Move format info to vsp1_pipe.c

Format information and the related helper function are not specific to
the V4L2 API, move them from vsp1_video.c to vsp1_pipe.c.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Make the BRU optional
Laurent Pinchart [Fri, 14 Aug 2015 16:53:45 +0000 (13:53 -0300)]
[media] v4l: vsp1: Make the BRU optional

Not all VSP instances have a BRU on R-Car Gen3, make it optional. Set
the feature unconditionally for now, this will be fixed when adding Gen3
support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Make number of BRU inputs configurable
Laurent Pinchart [Mon, 3 Aug 2015 12:46:26 +0000 (09:46 -0300)]
[media] v4l: vsp1: Make number of BRU inputs configurable

The R-Car Gen3 family has 5-inputs BRUs, support them by making the
number of BRU inputs configurable.

As the driver assumes that the number of BRU inputs is equal to the
number of RPFs, replace the BRU_MAX_INPUTS macro with VSP1_MAX_RPF to
make the assumption apparent.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Move entity route setup function to vsp1_entity.c
Laurent Pinchart [Sun, 2 Aug 2015 21:58:31 +0000 (18:58 -0300)]
[media] v4l: vsp1: Move entity route setup function to vsp1_entity.c

The function will be used by the DU code, move it out of vsp1_video.c.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Remove unused module read functions
Laurent Pinchart [Wed, 9 Sep 2015 14:32:06 +0000 (11:32 -0300)]
[media] v4l: vsp1: Remove unused module read functions

Several module read functions are not used, remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Set the SRU CTRL0 register when starting the stream
Laurent Pinchart [Wed, 9 Sep 2015 14:38:56 +0000 (11:38 -0300)]
[media] v4l: vsp1: Set the SRU CTRL0 register when starting the stream

Commit 58f896d859ce ("[media] v4l: vsp1: sru: Make the intensity
controllable during streaming") refactored the stream start code and
removed the SRU CTRL0 register write by mistake. Add it back.

Fixes: 58f896d859ce ("[media] v4l: vsp1: sru: Make the intensity controllable during streaming")
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Fix typo in VI6_DISP_IRQ_STA_DST register bit name
Laurent Pinchart [Thu, 10 Sep 2015 07:55:46 +0000 (04:55 -0300)]
[media] v4l: vsp1: Fix typo in VI6_DISP_IRQ_STA_DST register bit name

Rename the VI6_DISP_IRQ_STA_DSE register bit to VI6_DISP_IRQ_STA_DST to
fix a typo and match the datasheet.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Document the vsp1_pipeline structure
Laurent Pinchart [Sun, 2 Aug 2015 21:24:55 +0000 (18:24 -0300)]
[media] v4l: vsp1: Document the vsp1_pipeline structure

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Extract link creation to separate function
Laurent Pinchart [Sun, 2 Aug 2015 21:21:12 +0000 (18:21 -0300)]
[media] v4l: vsp1: Extract link creation to separate function

Link creation will be handled differently for the DU pipeline.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>