1
0
Fork 0
Commit Graph

23995 Commits (45f186becfcfa12a98acdfa2af513018d8b086e0)

Author SHA1 Message Date
Hans Verkuil 56a263aaa0 [media] cec: Kconfig cleanup
The Kconfig options for the CEC subsystem were a bit messy. In
addition there were two cec sources (cec-edid.c and cec-notifier.c)
that were outside of the media/cec directory, which was weird.

Move those sources to media/cec as well.

The cec-edid and cec-notifier functionality is now part of the cec
module and these are no longer separate modules.

Also remove the MEDIA_CEC_EDID config option and include it with the
main CEC config option (which defined CEC_EDID anyway).

Added static inlines to cec-edid.h for dummy functions when CEC_CORE
isn't defined.

CEC drivers should now depend on CEC_CORE.

CEC drivers that need the cec-notifier functionality must explicitly
select CEC_NOTIFIER.

The s5p-cec and stih-cec drivers depended on VIDEO_DEV instead of
CEC_CORE, fix that as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-19 06:50:52 -03:00
Alyssa Milburn ee0fe833d9 [media] zr364xx: enforce minimum size when reading header
This code copies actual_length-128 bytes from the header, which will
underflow if the received buffer is too small.

Signed-off-by: Alyssa Milburn <amilburn@zall.org>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-18 12:57:29 -03:00
Alyssa Milburn 821117dc21 [media] digitv: limit messages to buffer size
Return an error rather than memcpy()ing beyond the end of the buffer.
Internal callers use appropriate sizes, but digitv_i2c_xfer may not.

Signed-off-by: Alyssa Milburn <amilburn@zall.org>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-18 12:52:41 -03:00
Ezequiel Garcia e8357cdec3 [media] media: stk1160: Add Kconfig help on snd-usb-audio requirement
The Kconfig currently makes no reference to the snd-usb-audio
driver, which supports audio capture for this type of devices.
Just in case, let's make sure the requirement is mentioned
in the description.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-18 12:15:45 -03:00
Daniel Scheller 158f0328af [media] dvb-frontends/cxd2841er: define symbol_rate_min/max in T/C fe-ops
Fixes "w_scan -f c" complaining with

  This dvb driver is *buggy*: the symbol rate limits are undefined - please
  report to linuxtv.org)

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Acked-by: Abylay Ospan <aospan@netup.ru>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-18 12:10:42 -03:00
Frank Schaefer 495ab569d0 [media] em28xx: add support for V4L2_PIX_FMT_SRGGB8
Adding support for SRGGB8 is as simple as adding a new entry at
struct em28xx_fmt.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 17:33:53 -03:00
Frank Schaefer a7b8e9a5b3 [media] em28xx: shed some light on video input formats
CbYCrY has been identified by looking into the tvp5150 driver and the
saa7115 datasheet.
YUV formats have been verified with em2765 + ov2640 (VAD Laplace webcam).
RGB8 formats have been verified with em2710/em2820 + mt9v011 (Silvercrest
webcam 1.3mpix).
I also did some cross-checking with these two camera devices and 0x08-0x0b
are at least 16 bits per pixel formats on em2710/em2820, too, and
0x0c-0x0f are at least 8 bits per pixel formats on em2765, too.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 17:32:44 -03:00
Frank Schaefer 85316cf8da [media] em28xx: don't treat device as webcam if an unknown sensor is detected
With an unknown sensor, norm_maxw() and norm_maxh() return 0 as max.
height and width values, which causes a devide by zero in size_to_scale().
Of course we could use speculative default values for unknown sensors,
but the chance that the device works at this resolution without any
driver/setup is very low and therefore not worth the efforts.
Instead, just don't treat the device as camera.
A message will then be printed to the log that the device isn't supported.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 17:32:15 -03:00
Frank Schaefer bb42fc4ad4 [media] em28xx: add missing auto-selections for build
With MEDIA_SUBDRV_AUTOSELECT enabled in the kernel config, the em28xx
driver currently does't select some used subdrivers.
Fix this by adding the missing auto-selections to the Kconfig file.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 17:31:46 -03:00
Frank Schaefer 2437aeb497 [media] em28xx: get rid of the dummy clock source
The v4l2 dummy clock has been added with commit fc5d0f8a88
("V4L2: em28xx: register a V4L2 clock source") to be able to use the ov2640
soc_camera driver.
Since commit 46796cfcd3 ("ov2640: use standard clk and enable it") it is
no longer required.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 17:30:54 -03:00
Frank Schaefer 4d58443696 [media] em28xx: simplify ID-reading from Micron sensors
Use i2c_smbus_read_word_data() instead of i2c_master_send() and
i2c_master_recv() for reading the ID of Micorn sensors.

i2c_smbus_read_word_data() assumes that byes are in little-endian,
so, it uses:
	data->word = msgbuf1[0] | (msgbuf1[1] << 8);

However, Micron datasheet describes the ID as if they were read
in big-endian. So, we need to change the byte order in order to
match the ID number as described on their datasheets.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 17:29:51 -03:00
Jasmin J e7080d4471 [media] media/dvb-core: Race condition when writing to CAM
It started with a sporadic message in syslog: "CAM tried to send a
buffer larger than the ecount size" This message is not the fault
itself, but a consecutive fault, after a read error from the CAM. This
happens only on several CAMs, several hardware, and of course sporadic.

It is a consecutive fault, if the last read from the CAM did fail. I
guess this will not happen on all CAMs, but at least it did on mine.
There was a write error to the CAM and during the re-initialization
procedure, the CAM finished the last read, although it got a RS.

The write error to the CAM happened because a race condition between HC
write, checking DA and FR.

This patch added an additional check for DA(RE), just after checking FR.
It is important to read the CAMs status register again, to give the CAM
the necessary time for a proper reaction to HC. Please note the
description within the source code (patch below).

[mchehab@s-opensource.com: make checkpatch happy]

Signed-off-by: Jasmin jessich <jasmin@anw.at>
Tested-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 17:20:23 -03:00
Daniel Scheller b73bb2ab97 [media] dvb-frontends/drxk: don't log errors on unsupported operation mode
When fe_ops.read_status is called and no channel is tuned (yet), the
subsequent calls to get_lock_status() causes the kernel log to be filled
with

    drxk: Error -22 on get_lock_status

which either means a NULL pointer was passed for the p_lock_status var,
or neither QAM nor OFDM/DVBT operation mode are active. Instead of
filling the kernel log in the latter case, print out a message to the debug
level and return 0 (this isn't used in the calling drxk_get_stats() anyway).

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 17:07:57 -03:00
Sakari Ailus 6eb1951d53 [media] docs-rst: media: better document refcount in struct dvb_frontend
The refcount field was added to the struct but it was not
properly documented.

Document it.

[mchehab@s-opensource.com: fix a merge conflict]

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 16:55:38 -03:00
Alexandre-Xavier Labonté-Lamoureux 1c13f7aaaa [media] em28xx: Add new USB ID eb1a:5051
Add new usbid eb1a:5051 for the Ion Video 2 PC MKII, Startech svid2usb23
and Raygo R12-41373.

Signed-off-by: Alexandre-Xavier Labonté-Lamoureux <alexandrexavier@live.ca>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 13:13:01 -03:00
Christophe JAILLET f81a18d860 [media] tm6000: Fix resource freeing in 'tm6000_prepare_isoc()'
'usb_free_urb(urb)' is a no-op, because urb is known to be NULL.

It is likelly that releasing resources allocated by
'tm6000_alloc_urb_buffers()' just a few lines above is expected here.

This has been spotted by the following coccinelle script:
@@
expression ret, x, e;
identifier f;
@@

*   if (x == NULL)
    {
     ... when != x = e;
(
*    f(<+...x...+>);
|
*    ret = f(<+...x...+>);
)
     ...
    }

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 13:11:45 -03:00
Javier Martinez Canillas c0746c1ad3 [media] tc358743: Add OF device ID table
The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.

But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 13:11:06 -03:00
Gustavo A. R. Silva 609d0468b4 [media] media: pci: saa7164: remove dead code
Remove dead code. The following line of code is never reached:
return SAA_OK;

Addresses-Coverity-ID: 114283

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 13:07:50 -03:00
Gustavo A. R. Silva 393a8e76dc [media] media: pci: saa7164: remove unnecessary code
Remove unnecessary variable 'loop'.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 13:06:55 -03:00
Javier Martinez Canillas 9ae05fd1e7 [media] et8ek8: Export OF device ID as module aliases
The I2C core always reports a MODALIAS of the form i2c:<foo> even if the
device was registered via OF, this means that exporting the OF device ID
table device aliases in the module is not needed. But in order to change
how the core reports modaliases to user-space, it's better to export it.

Before this patch:

$ modinfo drivers/media/i2c/et8ek8/et8ek8.ko | grep alias
alias:          i2c:et8ek8

After this patch:

$ modinfo drivers/media/i2c/et8ek8/et8ek8.ko | grep alias
alias:          i2c:et8ek8
alias:          of:N*T*Ctoshiba,et8ek8C*
alias:          of:N*T*Ctoshiba,et8ek8

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 13:05:00 -03:00
Bhumika Goyal 650497f1ef [media] media: pci: constify stv0299_config structures
Declare stv0299_config structures as const as they are only passed as
an argument to the function dvb_attach. dvb_attach
calls its first argument on the rest of its arguments. The first
argument of dvb_attach in the changed cases is stv0299_attach and
the parameter of this function to which the object references are passed
is of type const. So, stv0299_config structures having this property
can be made const.

First line shows the file size before patching and second one shows size
after patching.

   text	   data	    bss	    dec	    hex	filename
   9572	    926	     40	  10538	   292a media/pci/dm1105/dm1105.o
   9636	    862	     40	  10538	   292a media/pci/dm1105/dm1105.o

  15133	   5408	      0	  20541	   503d	media/pci/ttpci/budget-av.o
  15389	   5152	      0	  20541	   503d media/pci/ttpci/budget-av.o

  15703	   2326	     36	  18065	   4691	media/pci/ttpci/budget-ci.o
  15767	   2262	     36	  18065	   4691 media/pci/ttpci/budget-ci.o

  10555	   1918	      4	  12477	   30bd	drivers/media/pci/ttpci/budget.o
  10683	   1822	      4	  12509	   30dd	drivers/media/pci/ttpci/budget.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 13:04:18 -03:00
Bhumika Goyal 713be96a89 [media] pci: mantis: constify mb86a16_config structure
Declare mb86a16_config structure as const as it is either passed as
an argument to the function dvb_attach or is dereferenced. dvb_attach
calls its first argument on the rest of its arguments. The first argument
of dvb_attach in the changed case is mb86a16_attach and the parameter of
this function to which the object reference is passed is of type
const. So, mb86a16_config structures having this property can be made
const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 12:53:03 -03:00
Bhumika Goyal 0244fd7823 [media] cx88: constify mb86a16_config structure
Declare mb86a16_config structure as const as it is only passed as
an argument to the function dvb_attach. dvb_attach calls its first
argument on the rest of its arguments. The first argument of
dvb_attach in the changed case is mb86a16_attach and the parameter of
this function to which the object reference is passed is of type
const. So, mb86a16_config structures having this property can be made
const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 12:52:41 -03:00
Bhumika Goyal f558461335 [media] saa7134: constify nxt200x_config structures
Declare nxt200x_config structures as const as they are only passed as
an argument to the function dvb_attach. dvb_attach calls its first
argument on the rest of its arguments. The first argument of
dvb_attach in the changed cases is nxt200x_attach and the parameter of
this function to which the object references are passed is of type
const. So, nxt200x_config structures having this property can be made
const.

File size before:
   text	   data	    bss	    dec	    hex	filename
  21320	   3776	     16	  25112	   6218	saa7134/saa7134-dvb.o

File size after:
   text	   data	    bss	    dec	    hex	filename
  21384	   3744	     16	  25144	   6238	saa7134/saa7134-dvb.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 12:18:52 -03:00
Bhumika Goyal c5db7475a8 [media] b2c2: constify nxt200x_config structure
Declare nxt200x_config structure as const as it is only passed as
an argument to the function dvb_attach. dvb_attach calls its first
argument on the rest of its arguments. The first argument of
dvb_attach in the changed case is nxt200x_attach and the parameter of
this function to which the object reference is passed is of type
const. So, nxt200x_config structures having this property can be made
const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   7566	    568	      0	   8134	   1fc6	common/b2c2/flexcop-fe-tuner.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   7582	    536	      0	   8118	   1fb6	common/b2c2/flexcop-fe-tuner.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 12:18:18 -03:00
Ben Hutchings bf05b65a9f [media] dvb-usb-dibusb-mc-common: Add MODULE_LICENSE
dvb-usb-dibusb-mc-common is licensed under GPLv2, and if we don't say
so then it won't even load since it needs a GPL-only symbol.

Fixes: e91455a149 ("[media] dvb-usb: split out common parts of dibusb")

Reported-by: Dominique Dumont <dod@debian.org>
Cc: stable@vger.kernel.org # 4.9+
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 12:11:13 -03:00
Joe Perches 56b27d4dd3 [media] drivers/media: Convert remaining use of pr_warning to pr_warn
To enable eventual removal of pr_warning

This makes pr_warn use consistent for drivers/media

Prior to this patch, there was 1 use of pr_warning and
310 uses of pr_warn in drivers/media

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-17 10:39:59 -03:00
Helen Koike f2fe89061d [media] vimc: Virtual Media Controller core, capture and sensor
First version of the Virtual Media Controller.
Add a simple version of the core of the driver, the capture and
sensor nodes in the topology, generating a grey image in a hardcoded
format.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: fix small typo in Kconfig]

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 23:05:13 -03:00
Ramiro Oliveira 3c2472a3c5 [media] media: i2c: Add support for OV5647 sensor
The OV5647 sensor from Omnivision supports up to 2592x1944 @ 15 fps, RAW 8
and RAW 10 output formats, and MIPI CSI-2 interface.

The driver adds support for 640x480 RAW 8.

Signed-off-by: Ramiro Oliveira <roliveir@synopsys.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 23:02:15 -03:00
Todor Tomov 9cae97221a [media] media: Add a driver for the ov5645 camera sensor
The ov5645 sensor from Omnivision supports up to 2592x1944
and CSI2 interface.

The driver adds support for the following modes:
- 1280x960
- 1920x1080
- 2592x1944

Output format is packed 8bit UYVY.

Signed-off-by: Todor Tomov <todor.tomov@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 23:00:26 -03:00
Hans Verkuil 6c1c0afd19 [media] vsp1: set V4L2_CTRL_FLAG_MODIFY_LAYOUT for histogram controls
The two histogram controls will modify the layout of the
metadata, so this flag should be set.

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@s-opensource.com>
2017-04-14 22:55:54 -03:00
Hans Verkuil c0e681f5b0 [media] v4l2-ctrls.c: set V4L2_CTRL_FLAG_MODIFY_LAYOUT for ROTATE
The rotate control will modify the layout by definition. Always
set this flag.

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@s-opensource.com>
2017-04-14 22:54:35 -03:00
Niklas Söderlund 0ac702d5b9 [media] v4l: vsp1: Add HGT support
The HGT is a Histogram Generator Two-Dimensions. It computes a weighted
frequency histograms for hue and saturation areas over a configurable
region of the image with optional subsampling.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:53:00 -03:00
Niklas Söderlund 5deb1c04c9 [media] v4l: Define a pixel format for the R-Car VSP1 2-D histogram engine
The format is used on the R-Car VSP1 video queues that carry
2-D histogram statistics data.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:49:06 -03:00
Laurent Pinchart f2421521de [media] v4l: vsp1: Add HGO support
The HGO is a Histogram Generator One-Dimension. It computes per-channel
histograms over a configurable region of the image with optional
subsampling.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:48:33 -03:00
Laurent Pinchart 14d6653871 [media] v4l: Define a pixel format for the R-Car VSP1 1-D histogram engine
The format is used on the R-Car VSP1 video queues that carry
1-D histogram statistics data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:43:58 -03:00
Laurent Pinchart 98eee2550f [media] v4l: vsp1: Fix HGO and HGT routing register addresses
The addresses are incorrect, fix them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:43:17 -03:00
Laurent Pinchart c8663c8e15 [media] v4l: vsp1: Support histogram generators in pipeline configuration
Histogram generators are single-pad entities that branch as leaf nodes
at any point in the pipeline. Make sure that pipeline traversal and
routing configuration support them correctly.

Support for the actual HGO and HGT operation will come later.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:42:50 -03:00
Laurent Pinchart 99362e3233 [media] v4l: vsp1: Add histogram support
The histogram common code will be used to implement support for both the
HGO and HGT histogram computation engines.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:42:14 -03:00
Laurent Pinchart fb9ffa6a7f [media] v4l: Add metadata buffer type and format
The metadata buffer type is used to transfer metadata between userspace
and kernelspace through a V4L2 buffers queue. It comes with a new
metadata capture capability and format description.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: removed left-over 'experimental' note]
[hans.verkuil@cisco.com: add newline after _v4l2-meta-format label]

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:37:02 -03:00
Laurent Pinchart 3e9a0e0bfa [media] v4l: vsp1: wpf: Implement rotation support
Some WPF instances, on Gen3 devices, can perform 90° rotation when
writing frames to memory. Implement support for this using the
V4L2_CID_ROTATE control.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:36:03 -03:00
Hans Verkuil aa23c0533c [media] ov2640: avoid calling ov2640_select_win() twice
Simplify ov2640_set_params and ov2640_set_fmt.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:32:56 -03:00
Hans Verkuil 34b92def75 [media] ov9740: avoid calling ov9740_res_roundup() twice
Simplify ov9740_s_fmt.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:32:26 -03:00
Hans Verkuil 137526904b [media] ov9640: avoid calling ov9640_res_roundup() twice
Simplify ov9640_s_fmt and ov9640_set_fmt

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:31:47 -03:00
Hans Verkuil 08c4627c79 [media] ov772x: avoid calling ov772x_select_params() twice
Merge ov772x_s_fmt into ov772x_set_fmt.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:31:03 -03:00
Hans Verkuil b174eb750e [media] ov5642: avoid calling ov5642_find_datafmt() twice
Simplify ov5642_set_fmt().

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:30:21 -03:00
Hans Verkuil 20efc1e9fc [media] mt9v022: avoid calling mt9v022_find_datafmt() twice
Simplify mt9v022_s_fmt and mt9v022_set_fmt.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:29:57 -03:00
Hans Verkuil 961f0ab75e [media] mt9m001: avoid calling mt9m001_find_datafmt() twice
Simplify mt9m001_s_fmt and mt9m001_set_fmt.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:29:13 -03:00
Hans Verkuil 1d3d64370e [media] imx074: avoid calling imx074_find_datafmt() twice
Simplify imx074_set_fmt().

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:28:34 -03:00
Stefan Brüns 3a2824c72a [media] si2157: Add support for Si2141-A10
The Si2141 needs two distinct commands for powerup/reset, otherwise it
will not respond to chip revision requests. It also needs a firmware
to run properly.

Cc: Evgeny Plehov <EvgenyPlehov@ukr.net>
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:27:47 -03:00
Antti Palosaari 297e14d5c6 [media] si2157: revert si2157: Si2141/2151 tuner support
'Reset' loop does not look correct. I tested it very many times and
it never repeated those commands. If problem, it tries to solve,
really occurs on some situations better solution should be find out.

There is another patch which does not have such hackish looking loop.
Lets change to it.

Cc: Evgeny Plehov <EvgenyPlehov@ukr.net>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-14 22:27:10 -03:00
Hans Verkuil 4aed35ca73 [media] v4l2-tpg: don't clamp XV601/709 to lim range
The XV601/709 encodings are special: they signal limited range, but use the full range
to encode a larger gamut with R', G' and B' values outside the [0-1] range.

So don't clamp to limited range for these two encodings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:58:06 -03:00
Geliang Tang bd742c6586 [media] imon: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:56:57 -03:00
Geliang Tang 729dee30dd [media] wl128x: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:56:37 -03:00
Geliang Tang 13bfc6728f [media] c8sectpfe: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:56:17 -03:00
Geliang Tang 8ae73ed608 [media] fsl-viu: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:55:57 -03:00
Geliang Tang b4e80f3c45 [media] av7110: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:55:37 -03:00
Geliang Tang 20bdb04d95 [media] netup_unidvb: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:50:50 -03:00
Geliang Tang f563607ae9 [media] ivtv: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:50:15 -03:00
Geliang Tang d720e05594 [media] cx18: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:48:01 -03:00
Geliang Tang 60221ffd87 [media] bt8xx: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:46:46 -03:00
Geliang Tang d5d116c4db [media] saa7146: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:46:12 -03:00
Geliang Tang 9e2abdd5ba [media] saa7134: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:45:05 -03:00
Alexey Khoroshilov 4130927144 [media] m2m-deinterlace: don't return zero on failure paths in deinterlace_probe()
If DMA does not support INTERLEAVE, deinterlace_probe() breaks off
initialization, releases dma channel, but returns zero.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:43:31 -03:00
Philipp Zabel 9d826ce812 [media] coda: do not enumerate YUYV if VDOA is not available
TRY_FMT already disables the YUYV format if the VDOA is not available.
ENUM_FMT must do the same.

Fixes: d40e98c13b ("[media] coda: support YUYV output if VDOA is used")

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:42:45 -03:00
Philipp Zabel 0866df8dff [media] tvp5150: fix pad format frame height
Even if field order is set to V4L2_FIELD_ALTERNATE, the width and height
values in struct v4l2_mbus_framefmt still refer to frame size, not field
size.

Fixes: 4f57d27be2 ("[media] tvp5150: fix tvp5150_fill_fmt()")

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@s-opensource.com>
2017-04-10 14:42:19 -03:00
Philipp Zabel f6f0e2f5d7 [media] tvp5150: allow get/set_fmt on the video source pad
To let userspace propagate formats downstream in a media controller
scenario, the video source pad (now pad 1, DEMOD_PAD_VID_OUT) must allow
setting and getting the format. Incidentally, tvp5150_fill_fmt was
implemented for this pad, not for the new analog input pad (now pad 0,
DEMOD_PAD_IF_INPUT).

Fixes: 55606310e7 ("[media] tvp5150: create the expected number of pads")

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@s-opensource.com>
2017-04-10 14:41:30 -03:00
Colin Ian King 678bc0adf7 [media] coda: remove redundant call to v4l2_m2m_get_vq
The call to v4ls_m2m_get_vq is only used to get the return value
which is not being used, so it appears to be redundant and can
be removed.

Detected with CoverityScan, CID#1420674 ("Useless call")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 14:38:40 -03:00
Hans Verkuil a9b99bbeda [media] em28xx: drop last soc_camera link
The em28xx driver still used the soc_camera.h header for the ov2640
driver. Since this driver no longer uses soc_camera, that include can
be removed.

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@s-opensource.com>
2017-04-10 14:28:39 -03:00
Hans Verkuil ff0e9c1d6d [media] ov2640: add MC support
The MC support is needed by the em28xx driver.

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@s-opensource.com>
2017-04-10 14:26:50 -03:00
Hans Verkuil 46796cfcd3 [media] ov2640: use standard clk and enable it
Convert v4l2_clk to normal clk and enable the clock.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 13:42:28 -03:00
Hans Verkuil 34aa88790b [media] ov2640: convert from soc-camera to a standard subdev sensor driver
Convert ov2640 to a standard subdev driver. The soc-camera driver no longer
uses this driver, so it can safely be converted.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 13:38:17 -03:00
Hans Verkuil ee044f5be1 [media] cec: fix confusing CEC_CAP_RC and IS_REACHABLE(CONFIG_RC_CORE) code
It is a bit confusing how CEC_CAP_RC and IS_REACHABLE(CONFIG_RC_CORE)
interact. By stripping CEC_CAP_RC at the beginning rather than after #else
it should be a bit clearer what is going on.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 13:15:29 -03:00
Lee Jones 43c0c03961 [media] cec: Fix runtime BUG when (CONFIG_RC_CORE && !CEC_CAP_RC)
Currently when the RC Core is enabled (reachable) core code located
in cec_register_adapter() attempts to populate the RC structure with
a pointer to the 'parent' passed in by the caller.

Unfortunately if the caller did not specify RC capability when calling
cec_allocate_adapter(), then there will be no RC structure to populate.

This causes a "NULL pointer dereference" error.

Fixes: f51e80804f ("[media] cec: pass parent device in register(), not allocate()")

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Cc: <stable@vger.kernel.org>      # for v4.10 and up
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 13:14:53 -03:00
Hans Verkuil a93d429b51 [media] s5p-cec: add cec-notifier support, move out of staging
By using the CEC notifier framework there is no longer any reason
to manually set the physical address. This was the one blocking
issue that prevented this driver from going out of staging, so do
this move as well.

Update the bindings documenting the new hdmi phandle and
update exynos4.dtsi accordingly.

Tested with my Odroid U3.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
CC: linux-samsung-soc@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 13:14:03 -03:00
Benjamin Gaignard fc4e009c6c [media] stih-cec: add CEC notifier support
By using the CEC notifier framework there is no longer any reason
to manually set the physical address. This was the one blocking
issue that prevented this driver from going out of staging, so do
this move as well.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 12:53:51 -03:00
Hans Verkuil e3a93adcc4 [media] cec: integrate CEC notifier support
Support the CEC notifier framework, simplifying drivers that
depend on this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 12:49:19 -03:00
Hans Verkuil 6917a7b774 [media] media: add CEC notifier support
Add support for CEC notifiers, which is used to convey CEC physical address
information from video drivers to their CEC counterpart driver(s).

Based on an earlier version from Russell King:

https://patchwork.kernel.org/patch/9277043/

The cec_notifier is a reference counted object containing the CEC physical address
state of a video device.

When a new notifier is registered the current state will be reported to
that notifier at registration time.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 12:48:28 -03:00
Antti Palosaari 0fc66c1949 [media] mn88472: implement PER statistics
Implement DVBv5 PER.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 12:44:26 -03:00
Antti Palosaari c635a5e2cf [media] mn88472: implement cnr statistics
Implement DVBv5 CNR.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 12:43:54 -03:00
Antti Palosaari 61d7c6aa4f [media] mn88472: implement signal strength statistics
Implement DVBv5 signal strength on relative scale.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 12:43:12 -03:00
Hans Verkuil 0f314f6c2e [media] rainshadow-cec: new RainShadow Tech HDMI CEC driver
This driver supports the RainShadow Tech USB HDMI CEC adapter.

See: http://rainshadowtech.com/HdmiCecUsb.html

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 12:42:10 -03:00
Kieran Bingham 1531a208ed [media] v4l: vsp1: Register pipe with output WPF
The DRM object does not register the pipe with the WPF object. This is
used internally throughout the driver as a means of accessing the pipe.
As such this breaks operations which require access to the pipe from WPF
interrupts.

Register the pipe inside the WPF object after it has been declared as
the output.

Fixes: ff7e97c94d ("[media] v4l: vsp1: Store pipeline pointer in rwpf")

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 08:33:10 -03:00
Kieran Bingham 1b8ce4060b [media] v4l: vsp1: Fix struct vsp1_drm documentation
The struct vsp1_drm references a member 'planes' which doesn't exist.
Correctly identify this documentation against the 'inputs'

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 08:32:47 -03:00
Laurent Pinchart 40ad34d8eb [media] v4l: vsp1: Disable HSV formats on Gen3 hardware
While all VSP instances can process HSV internally, on Gen3 hardware
reading or writing HSV24 or HSV32 from/to memory causes the device to
hang. Disable those pixel formats on Gen3 hardware.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 08:32:21 -03:00
Laurent Pinchart 9dbed95ba6 [media] v4l: vsp1: Fix multi-line comment style
Fix all multi-line comments to comply with the kernel coding style.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 08:31:39 -03:00
Kieran Bingham f2074708ee [media] v4l: vsp1: Remove redundant pipe->dl usage from drm
The pipe->dl is used only inside vsp1_du_atomic_flush(), and can be
obtained and stored locally to simplify the code.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 08:29:57 -03:00
Kieran Bingham 4461c84b52 [media] v4l: vsp1: Prevent multiple streamon race commencing pipeline early
With multiple inputs through the BRU it is feasible for the streams to
race each other at stream-on.

Multiple VIDIOC_STREAMON calls racing each other could have process
N-1 skipping over the pipeline setup section and then start the pipeline
early, if videobuf2 has already enqueued buffers to the driver for
process N but not called the .start_streaming() operation yet

In the case of the video pipelines, this
can present two serious issues.

 1) A null-dereference if the pipe->dl is committed at the same time as
    the vsp1_video_setup_pipeline() is processing

 2) A hardware hang, where a display list is committed without having
    called vsp1_video_setup_pipeline() first

Repair this issue, by ensuring that only the stream which configures the
pipeline is able to start it.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 08:28:50 -03:00
Laurent Pinchart 3425382288 [media] v4l: vsp1: Fix RPF/WPF U/V order in 3-planar formats on Gen3
The RPF and WPF U/V order bits have no effect for 3-planar formats on
Gen3 hardware. Swap the U and V planes addresses manually instead in
that case.

Fixes: b915bd24a0 ("[media] v4l: vsp1: Add tri-planar memory formats support")

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 08:28:19 -03:00
Shailendra Verma dadc3be66c [media] v4l: vsp1: Clean up file handle in open() error path
v4l2_fh_init is already done. So call the v4l2_fh_exit in error
condition before returing from the function.

Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 08:27:25 -03:00
Kieran Bingham f145016254 [media] v4l: vsp1: Fix format-info documentation
Minor tweaks to document the swap register and make the documentation
match the struct ordering

Signed-off-by: Kieran Bingham <kieran@bingham.xyz>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 08:25:07 -03:00
Hans Verkuil 9823f003b9 [media] ov2640: fix colorspace handling
The colorspace is independent of whether YUV or RGB is sent to the SoC.
Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 08:00:34 -03:00
Hans Verkuil c1d82b8953 [media] atmel-isi: move out of soc_camera to atmel
Move this out of the soc_camera directory into the atmel directory
where it belongs.

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@s-opensource.com>
2017-04-10 08:00:06 -03:00
Hans Verkuil d12c9088c0 [media] atmel-isi: remove dependency of the soc-camera framework
This patch converts the atmel-isi driver from a soc-camera driver to a driver
that is stand-alone.

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@s-opensource.com>
2017-04-10 07:58:58 -03:00
Hans Verkuil a0c4164e0e [media] ov7670: add devicetree support
Add DT support. Use it to get the reset and pwdn pins (if there are any).
Tested with one sensor requiring reset/pwdn and one sensor that doesn't
have reset/pwdn pins.

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@s-opensource.com>
2017-04-10 07:54:06 -03:00
Hans Verkuil 0a024d634c [media] ov7670: get xclk
Get the clock for this sensor.

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@s-opensource.com>
2017-04-10 07:53:27 -03:00
Hans Verkuil d569e90bb7 [media] ov7670: fix g/s_parm
Drop unnecesary memset. Drop the unnecessary extendedmode check and
set the V4L2_CAP_TIMEPERFRAME capability.

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@s-opensource.com>
2017-04-10 07:52:59 -03:00
Hans Verkuil 7d1b8619ea [media] ov7670: call v4l2_async_register_subdev
Add v4l2-async support for this driver.

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@s-opensource.com>
2017-04-10 07:52:31 -03:00
Daniel Patrick Johnson c4a0968aea [media] uvcvideo: Add support for Intel SR300 depth camera
Add support for Intel SR300 depth camera in uvc driver.
This includes adding three uvc GUIDs for the required pixel formats
and updating the uvc driver GUID-to-4cc tables with the new formats.

Signed-off-by: Daniel Patrick Johnson <teknotus@teknot.us>
Signed-off-by: Aviv Greenberg <avivgr@gmail.com>
Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 07:47:34 -03:00
Evgeni Raikhel 5df082e231 [media] Documentation: Intel SR300 Depth camera INZI format
Provide the frame structure and data layout of V4L2-PIX-FMT-INZI
format utilized by Intel SR300 Depth camera.

Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10 07:46:42 -03:00