]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
7 years ago[media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()
Markus Elfring [Sun, 6 Nov 2016 19:40:20 +0000 (17:40 -0200)]
[media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()

* A function was called over the pointer "setup_if_config" in the data
  structure "venc_platform_data". But the return value was not used so far.
  Thus assign it to the local variable "ret" which will be checked with
  the next statement.

Fixes: 9a7f95ad1c946efdd7a7a72df27db738260a0fd8 ("[media] davinci vpbe: add dm365 VPBE display driver changes")
* Pass a value to this function call without storing it in an intermediate
  variable before.

* Delete the local variable "if_params" which became unnecessary with
  this refactoring.

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] staging: st-cec: add parentheses around complex macros
Maninder Singh [Fri, 4 Nov 2016 07:58:31 +0000 (05:58 -0200)]
[media] staging: st-cec: add parentheses around complex macros

This patch fixes the following checkpatch.pl error:
ERROR: Macros with complex values should be enclosed in parentheses

Signed-off-by: Maninder Singh <maninder.s2@samsung.com>
Acked-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>
7 years ago[media] adv7604: add vic detect
Hans Verkuil [Thu, 14 Jul 2016 14:53:47 +0000 (11:53 -0300)]
[media] adv7604: add vic detect

Obtain the correct timings based on the VIC code from the AVI InfoFrame.

It does a sanity check to see if at least the measured width and height
are in line with what the VIC code reports. If not, then use the timings
instead of the VIC code (as per the CEA-861 spec).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] cobalt: add cropcap support
Hans Verkuil [Sun, 17 Jul 2016 08:42:07 +0000 (05:42 -0300)]
[media] cobalt: add cropcap support

Now that the timings contain picture aspect ratio information,
we can support cropcap to return the pixel aspect ratio.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l2-dv-timings: add helpers for vic and pixelaspect ratio
Hans Verkuil [Thu, 14 Jul 2016 10:59:12 +0000 (07:59 -0300)]
[media] v4l2-dv-timings: add helpers for vic and pixelaspect ratio

Add a helper to find timings based on the CEA-861 VIC code. Also,
add a helper that returns the pixel aspect ratio based on the
v4l2_dv_timings struct.

[mchehab@s-opensource.com: fix coding style]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l2-dv-timings: add VICs and picture aspect ratio
Hans Verkuil [Thu, 14 Jul 2016 10:59:01 +0000 (07:59 -0300)]
[media] v4l2-dv-timings: add VICs and picture aspect ratio

Add the CEA-861 VIC, the HDMI VIC and the picture aspect ratio information
where applicable.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] vidioc-g-dv-timings.rst: document the new dv_timings flags
Hans Verkuil [Fri, 16 Sep 2016 10:38:04 +0000 (07:38 -0300)]
[media] vidioc-g-dv-timings.rst: document the new dv_timings flags

Document the new flags.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] videodev2.h: add VICs and picture aspect ratio
Hans Verkuil [Thu, 14 Jul 2016 10:58:35 +0000 (07:58 -0300)]
[media] videodev2.h: add VICs and picture aspect ratio

Add picture aspect ratio information, the CEA-861 VIC (Video Identification
Code) and the HDMI VIC to struct v4l2_bt_timings.

The picture aspect was chosen rather than the pixel aspect since 1) the
CEA-861 standard uses picture aspect, and 2) pixel aspect ratio can become
tricky when dealing with pixel repeat timings. While we don't support those
yet at the moment, this might become necessary. And in that case using
picture aspect ratio makes more sense. And converting picture aspect ratio
to pixel aspect ratio is easy enough.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] videodev2.h: checkpatch cleanup
Hans Verkuil [Fri, 16 Sep 2016 10:47:08 +0000 (07:47 -0300)]
[media] videodev2.h: checkpatch cleanup

Format comments according to what checkpatch wants.

No other changes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] hdpvr: fix interrupted recording
Jonathan Sims [Sun, 23 Oct 2016 18:19:07 +0000 (16:19 -0200)]
[media] hdpvr: fix interrupted recording

This is a reworking of a patch originally submitted by Ryley Angus,
modified by Hans Verkuil and then seemingly forgotten before changes
suggested by Keith Pyle here:

http://www.mail-archive.com/linux-media@vger.kernel.org/msg75163.html

were made and tested.

I have implemented the suggested changes and have been testing for the
last 2 months. I am no longer experiencing lockups while recording
(with blue light on, requiring power cycling) which had been a long
standing problem with the HD-PVR. I have not noticed any other problems
since applying the patch.

Signed-off-by: Jonathan Sims <jonathan.625266@earthlink.net>
Reported-by: Ryley Angus <ryleyjangus@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: Document that m2m devices have a file handle specific context
Sakari Ailus [Tue, 18 Oct 2016 13:15:32 +0000 (11:15 -0200)]
[media] v4l: Document that m2m devices have a file handle specific context

Memory-to-memory V4L2 devices all have file handle specific context.
Say this in the API documentation so that the user space may rely on it
being the case.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] st-hva: fix a copy-and-paste variable name error
Colin Ian King [Mon, 19 Sep 2016 06:19:28 +0000 (03:19 -0300)]
[media] st-hva: fix a copy-and-paste variable name error

The second check for an error on hva->lmi_err_reg appears
to be a copy-and-paste error, it should be hva->emi_err_reg
instead.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] squash lines for simple wrapper functions
Masahiro Yamada [Tue, 6 Sep 2016 22:52:24 +0000 (19:52 -0300)]
[media] squash lines for simple wrapper functions

Remove unneeded variables and assignments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] s5p-cec: remove unused including <linux/version.h>
Wei Yongjun [Sat, 29 Oct 2016 16:17:55 +0000 (14:17 -0200)]
[media] s5p-cec: remove unused including <linux/version.h>

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

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] media: fix platform_no_drv_owner.cocci warnings
Fengguang Wu [Thu, 27 Oct 2016 22:34:37 +0000 (20:34 -0200)]
[media] media: fix platform_no_drv_owner.cocci warnings

drivers/media/platform/mtk-mdp/mtk_mdp_core.c:284:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Minghsiu Tsai <minghsiu.tsai@mediatek.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] media: mtk-mdp: NULL-terminate mtk_mdp_comp_dt_ids
Vincent Stehlé [Thu, 27 Oct 2016 20:23:25 +0000 (18:23 -0200)]
[media] media: mtk-mdp: NULL-terminate mtk_mdp_comp_dt_ids

The mtk_mdp_comp_dt_ids[] array should be NULL-terminated; add therefore an
empty entry in the end.

Fixes: c8eb2d7e8202fd9c ("[media] media: Add Mediatek MDP Driver")
Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: Minghsiu Tsai <minghsiu.tsai@mediatek.com>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] media: solo6x10: fix lockup by avoiding delayed register write
Andrey Utkin [Sat, 22 Oct 2016 15:34:36 +0000 (13:34 -0200)]
[media] media: solo6x10: fix lockup by avoiding delayed register write

This fixes a lockup at device probing which happens on some solo6010
hardware samples. This is a regression introduced by commit e1ceb25a1569
("[media] SOLO6x10: remove unneeded register locking and barriers")

The observed lockup happens in solo_set_motion_threshold() called from
solo_motion_config().

This extra "flushing" is not fundamentally needed for every write, but
apparently the code in driver assumes such behaviour at last in some
places.

Actual fix was proposed by Hans Verkuil.

Fixes: e1ceb25a1569 ("[media] SOLO6x10: remove unneeded register locking and barriers")
Cc: stable@vger.kernel.org # 4.3 and up
Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: doc: Fix typo in vidioc-g-tuner.rst
Masanari Iida [Sat, 22 Oct 2016 07:26:37 +0000 (05:26 -0200)]
[media] v4l: doc: Fix typo in vidioc-g-tuner.rst

This patch fix spelling typos found in vidioc-g-tuner.rst

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] st-cec: Fix module autoload
Javier Martinez Canillas [Mon, 17 Oct 2016 15:44:12 +0000 (13:44 -0200)]
[media] st-cec: Fix module autoload

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias
$

After this patch:

$ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias
alias:          of:N*T*Cst,stih-cecC*
alias:          of:N*T*Cst,stih-cec

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-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>
7 years ago[media] s5p-cec: Fix module autoload
Javier Martinez Canillas [Mon, 17 Oct 2016 15:44:11 +0000 (13:44 -0200)]
[media] s5p-cec: Fix module autoload

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/staging/media/s5p-cec/s5p-cec.ko | grep alias
$

After this patch:

$ modinfo drivers/staging/media/s5p-cec/s5p-cec.ko | grep alias
alias:          of:N*T*Csamsung,s5p-cecC*
alias:          of:N*T*Csamsung,s5p-cec

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] rc: meson-ir: Fix module autoload
Javier Martinez Canillas [Mon, 17 Oct 2016 15:44:10 +0000 (13:44 -0200)]
[media] rc: meson-ir: Fix module autoload

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/media/rc/meson-ir.ko | grep alias
$

After this patch:

$ modinfo drivers/media/rc/meson-ir.ko | grep alias
alias:          of:N*T*Camlogic,meson-gxbb-irC*
alias:          of:N*T*Camlogic,meson-gxbb-ir
alias:          of:N*T*Camlogic,meson8b-irC*
alias:          of:N*T*Camlogic,meson8b-ir
alias:          of:N*T*Camlogic,meson6-irC*
alias:          of:N*T*Camlogic,meson6-ir

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: rcar-fcp: Fix module autoload for OF registration
Javier Martinez Canillas [Mon, 17 Oct 2016 15:44:09 +0000 (13:44 -0200)]
[media] v4l: rcar-fcp: Fix module autoload for OF registration

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/media/platform/rcar-fcp.ko | grep alias
alias:          rcar-fcp

After this patch:

$ modinfo drivers/media/platform/rcar-fcp.ko | grep alias
alias:          rcar-fcp
alias:          of:N*T*Crenesas,fcpvC*
alias:          of:N*T*Crenesas,fcpv
alias:          of:N*T*Crenesas,fcpfC*
alias:          of:N*T*Crenesas,fcpf

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] v4l: vsp1: Fix module autoload for OF registration
Javier Martinez Canillas [Mon, 17 Oct 2016 15:44:08 +0000 (13:44 -0200)]
[media] v4l: vsp1: Fix module autoload for OF registration

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/media/platform/vsp1/vsp1.ko | grep alias
alias:          vsp1

After this patch:

$ modinfo drivers/media/platform/vsp1/vsp1.ko | grep alias
alias:          vsp1
alias:          of:N*T*Crenesas,vsp2C*
alias:          of:N*T*Crenesas,vsp2
alias:          of:N*T*Crenesas,vsp1C*
alias:          of:N*T*Crenesas,vsp1

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] usbtv: don't do DMA on stack
Mauro Carvalho Chehab [Wed, 16 Nov 2016 15:13:02 +0000 (13:13 -0200)]
[media] usbtv: don't do DMA on stack

As reported by smatch:
drivers/media/usb/usbtv/usbtv-video.c:716 usbtv_s_ctrl() error: doing dma on the stack (data)
drivers/media/usb/usbtv/usbtv-video.c:758 usbtv_s_ctrl() error: doing dma on the stack (data)

We should not do it, as it won't work on Kernels 4.9 and upper.
So, alloc a buffer for it.

Fixes: c53a846c48f2 ("[media] usbtv: add video controls")
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] usbtv: add video controls
Lubomir Rintel [Sun, 16 Oct 2016 09:38:22 +0000 (07:38 -0200)]
[media] usbtv: add video controls

Brightness, Contrast, Hue and Color Saturation are supported.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] st-hva: fix some error handling in hva_hw_probe()
Dan Carpenter [Fri, 14 Oct 2016 07:32:24 +0000 (04:32 -0300)]
[media] st-hva: fix some error handling in hva_hw_probe()

The devm_ioremap_resource() returns error pointers, never NULL.  The
platform_get_resource() returns NULL on error, never error pointers.
The error code needs to be set, as well.  The current code returns
PTR_ERR(NULL) which is success.

Fixes: 57b2c0628b60 ("[media] st-hva: multi-format video encoder V4L2 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] s5p-cec: mark PM functions as __maybe_unused again
Arnd Bergmann [Thu, 13 Oct 2016 14:39:04 +0000 (11:39 -0300)]
[media] s5p-cec: mark PM functions as __maybe_unused again

A bugfix removed the two callers of s5p_cec_runtime_suspend
and s5p_cec_runtime_resume, leading to the return of a harmless
warning that I had previously fixed in commit aee8937089b1
("[media] s5p_cec: mark suspend/resume as __maybe_unused"):

staging/media/s5p-cec/s5p_cec.c:234:12: error: ‘s5p_cec_runtime_suspend’ defined but not used [-Werror=unused-function]
staging/media/s5p-cec/s5p_cec.c:242:12: error: ‘s5p_cec_runtime_resume’ defined but not used [-Werror=unused-function]

This adds the __maybe_unused annotations to the function that
were not removed and that are now unused when CONFIG_PM
is disabled.

Fixes: 57b978ada073 ("[media] s5p-cec: fix system and runtime PM integration")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in proces...
Markus Elfring [Wed, 12 Oct 2016 13:45:03 +0000 (10:45 -0300)]
[media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in process_progressive_mode()

The local variable "addr" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in vpif_c...
Markus Elfring [Wed, 12 Oct 2016 13:43:12 +0000 (10:43 -0300)]
[media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in vpif_channel_isr()

The local variable "channel_id" will be reassigned with the following
statement at the beginning. Thus omit the explicit initialisation.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPIF-Display: Adjust 11 checks for null pointers
Markus Elfring [Wed, 12 Oct 2016 13:40:32 +0000 (10:40 -0300)]
[media] DaVinci-VPIF-Display: Adjust 11 checks for null pointers

The script "checkpatch.pl" pointed information out like the following.

Comparison to NULL could be written...

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPIF-Display: Delete an error message for a failed memory allocation
Markus Elfring [Wed, 12 Oct 2016 13:38:41 +0000 (10:38 -0300)]
[media] DaVinci-VPIF-Display: Delete an error message for a failed memory allocation

Omit an extra message for a memory allocation failure in this function.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPIF-Display: Use kcalloc() in vpif_probe()
Markus Elfring [Wed, 12 Oct 2016 13:30:44 +0000 (10:30 -0300)]
[media] DaVinci-VPIF-Display: Use kcalloc() in vpif_probe()

* A multiplication for the size determination of a memory allocation
  indicated that an array data structure should be processed.
  Thus use the corresponding function "kcalloc".

  This issue was detected by using the Coccinelle software.

* Replace the specification of a data type by a pointer dereference
  to make the corresponding size determination a bit safer according to
  the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPIF-Capture: Delete an unnecessary variable initialisation in vpif_c...
Markus Elfring [Wed, 12 Oct 2016 13:25:08 +0000 (10:25 -0300)]
[media] DaVinci-VPIF-Capture: Delete an unnecessary variable initialisation in vpif_channel_isr()

The local variable "channel_id" will be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPIF-Capture: Delete an unnecessary variable initialisation in vpif_q...
Markus Elfring [Wed, 12 Oct 2016 13:22:45 +0000 (10:22 -0300)]
[media] DaVinci-VPIF-Capture: Delete an unnecessary variable initialisation in vpif_querystd()

The local variable "ret" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPIF-Capture: Adjust ten checks for null pointers
Markus Elfring [Wed, 12 Oct 2016 13:20:34 +0000 (10:20 -0300)]
[media] DaVinci-VPIF-Capture: Adjust ten checks for null pointers

The script "checkpatch.pl" pointed information out like the following.

Comparison to NULL could be written ...

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPIF-Capture: Delete an error message for a failed memory allocation
Markus Elfring [Wed, 12 Oct 2016 13:18:45 +0000 (10:18 -0300)]
[media] DaVinci-VPIF-Capture: Delete an error message for a failed memory allocation

Omit an extra message for a memory allocation failure in this function.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPIF-Capture: Use kcalloc() in vpif_probe()
Markus Elfring [Wed, 12 Oct 2016 13:15:34 +0000 (10:15 -0300)]
[media] DaVinci-VPIF-Capture: Use kcalloc() in vpif_probe()

* A multiplication for the size determination of a memory allocation
  indicated that an array data structure should be processed.
  Thus use the corresponding function "kcalloc".

  This issue was detected by using the Coccinelle software.

* Replace the specification of a data type by a pointer dereference
  to make the corresponding size determination a bit safer according to
  the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPFE-Capture: Delete an unnecessary return statement in vpfe_unregist...
Markus Elfring [Wed, 12 Oct 2016 13:10:54 +0000 (10:10 -0300)]
[media] DaVinci-VPFE-Capture: Delete an unnecessary return statement in vpfe_unregister_ccdc_device()

The script "checkpatch.pl" pointed information out like the following.

WARNING: void function return statements are not generally useful

Thus remove such a statement here.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPFE-Capture: Delete unnecessary braces in vpfe_isr()
Markus Elfring [Wed, 12 Oct 2016 12:54:21 +0000 (09:54 -0300)]
[media] DaVinci-VPFE-Capture: Delete unnecessary braces in vpfe_isr()

Do not use curly brackets at one source code place
where a single statement should be sufficient.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPFE-Capture: Move two assignments in vpfe_s_input()
Markus Elfring [Wed, 12 Oct 2016 09:22:23 +0000 (06:22 -0300)]
[media] DaVinci-VPFE-Capture: Move two assignments in vpfe_s_input()

Move assignments for two local variables into an else branch so that
their setting will only be performed after corresponding data processing
succeeded by this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in 11...
Markus Elfring [Wed, 12 Oct 2016 08:50:54 +0000 (05:50 -0300)]
[media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in 11 functions

The local variable "ret" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPFE-Capture: Adjust 13 checks for null pointers
Markus Elfring [Wed, 12 Oct 2016 08:46:28 +0000 (05:46 -0300)]
[media] DaVinci-VPFE-Capture: Adjust 13 checks for null pointers

Convert comparisons with the preprocessor symbol "NULL" to condition checks
without it.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_open()
Markus Elfring [Wed, 12 Oct 2016 08:44:05 +0000 (05:44 -0300)]
[media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_open()

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in vpfe_p...
Markus Elfring [Wed, 12 Oct 2016 08:30:28 +0000 (05:30 -0300)]
[media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in vpfe_probe()

* Return an error code as a constant after a failed call of
  the function "vpfe_initialize".

* The local variable "ret" will be set then to an appropriate value
  a bit later. Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_probe()
Markus Elfring [Wed, 12 Oct 2016 08:24:57 +0000 (05:24 -0300)]
[media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_probe()

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPFE-Capture: Delete three error messages for a failed memory allocation
Markus Elfring [Wed, 12 Oct 2016 08:22:47 +0000 (05:22 -0300)]
[media] DaVinci-VPFE-Capture: Delete three error messages for a failed memory allocation

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such a logging statement in two functions.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPFE-Capture: Use kmalloc_array() in vpfe_probe()
Markus Elfring [Wed, 12 Oct 2016 08:20:02 +0000 (05:20 -0300)]
[media] DaVinci-VPFE-Capture: Use kmalloc_array() in vpfe_probe()

* A multiplication for the size determination of a memory allocation
  indicated that an array data structure should be processed.
  Thus use the corresponding function "kmalloc_array".

  This issue was detected by using the Coccinelle software.

* Replace the specification of a data type by a pointer dereference
  to make the corresponding size determination a bit safer according to
  the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPBE: Delete an unnecessary variable initialisation in vpbe_set_output()
Markus Elfring [Wed, 12 Oct 2016 08:16:23 +0000 (05:16 -0300)]
[media] DaVinci-VPBE: Delete an unnecessary variable initialisation in vpbe_set_output()

The local variable "ret" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPBE: Rename a jump label in vpbe_set_output()
Markus Elfring [Wed, 12 Oct 2016 08:10:19 +0000 (05:10 -0300)]
[media] DaVinci-VPBE: Rename a jump label in vpbe_set_output()

Adjust jump labels according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPBE: Reduce the scope for a variable in vpbe_set_default_output()
Markus Elfring [Wed, 12 Oct 2016 07:54:26 +0000 (04:54 -0300)]
[media] DaVinci-VPBE: Reduce the scope for a variable in vpbe_set_default_output()

* Move the definition for the variable "ret" into an if branch
  so that an extra initialisation can be avoided at the beginning
  by this refactoring.

* Return a success code as a constant at the end.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPBE: Return the success indication only as a constant in vpbe_set_mode()
Markus Elfring [Wed, 12 Oct 2016 07:51:29 +0000 (04:51 -0300)]
[media] DaVinci-VPBE: Return the success indication only as a constant in vpbe_set_mode()

* Return a success code without storing it in an intermediate variable.

* Delete the local variable "ret" which became unnecessary with
  this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPBE: Return an error code only as a constant in vpbe_probe()
Markus Elfring [Tue, 11 Oct 2016 11:43:25 +0000 (08:43 -0300)]
[media] DaVinci-VPBE: Return an error code only as a constant in vpbe_probe()

* Return an error code without storing it in an intermediate variable.

* Delete the local variable "ret" which became unnecessary with
  this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPBE: Adjust 16 checks for null pointers
Markus Elfring [Tue, 11 Oct 2016 11:37:10 +0000 (08:37 -0300)]
[media] DaVinci-VPBE: Adjust 16 checks for null pointers

The script "checkpatch.pl" pointed information out like the following.

Comparison to NULL could be written ...

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPBE: Delete two error messages for a failed memory allocation
Markus Elfring [Tue, 11 Oct 2016 07:56:13 +0000 (04:56 -0300)]
[media] DaVinci-VPBE: Delete two error messages for a failed memory allocation

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such a logging statement in two functions.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] DaVinci-VPBE: Use kmalloc_array() in vpbe_initialize()
Markus Elfring [Tue, 11 Oct 2016 07:40:41 +0000 (04:40 -0300)]
[media] DaVinci-VPBE: Use kmalloc_array() in vpbe_initialize()

* A multiplication for the size determination of a memory allocation
  indicated that an array data structure should be processed.
  Thus use the corresponding function "kmalloc_array".

  This issue was detected by using the Coccinelle software.

* Replace the specification of a data type by a pointer dereference
  to make the corresponding size determination a bit safer according to
  the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] blackfin-capture: Delete an error message for a failed memory allocation
Markus Elfring [Sun, 9 Oct 2016 19:30:18 +0000 (16:30 -0300)]
[media] blackfin-capture: Delete an error message for a failed memory allocation

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such a statement here.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] blackfin-capture: Use kcalloc() in bcap_init_sensor_formats()
Markus Elfring [Sun, 9 Oct 2016 19:12:13 +0000 (16:12 -0300)]
[media] blackfin-capture: Use kcalloc() in bcap_init_sensor_formats()

A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus reuse the corresponding function "kcalloc".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] cx88-dsp: Add some spaces for better code readability
Markus Elfring [Fri, 7 Oct 2016 20:30:40 +0000 (17:30 -0300)]
[media] cx88-dsp: Add some spaces for better code readability

Use space characters at some source code places according to
the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] cx88-dsp: Use kmalloc_array() in read_rds_samples()
Markus Elfring [Fri, 7 Oct 2016 20:07:27 +0000 (17:07 -0300)]
[media] cx88-dsp: Use kmalloc_array() in read_rds_samples()

* A multiplication for the size determination of a memory allocation
  indicated that an array data structure should be processed.
  Thus use the corresponding function "kmalloc_array".

  This issue was detected by using the Coccinelle software.

* Replace the specification of a data type by a pointer dereference
  to make the corresponding size determination a bit safer according to
  the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] dvb-tc90522: Rename a jump label in tc90522_probe()
Markus Elfring [Fri, 7 Oct 2016 19:13:57 +0000 (16:13 -0300)]
[media] dvb-tc90522: Rename a jump label in tc90522_probe()

Adjust a jump label according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] dvb-tc90522: Use kmalloc_array() in tc90522_master_xfer()
Markus Elfring [Fri, 7 Oct 2016 19:07:43 +0000 (16:07 -0300)]
[media] dvb-tc90522: Use kmalloc_array() in tc90522_master_xfer()

A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-flash-led-class: remove a now unused var
Mauro Carvalho Chehab [Mon, 24 Oct 2016 20:42:30 +0000 (18:42 -0200)]
[media] v4l2-flash-led-class: remove a now unused var

commit 079933dbcb02 ("[media] v4l: flash led class: Fix of_node release
in probe() error path") removed the need of an ancillary var at
the release function, as reported by smatch:

drivers/media/v4l2-core/v4l2-flash-led-class.c: In function 'v4l2_flash_release':
drivers/media/v4l2-core/v4l2-flash-led-class.c:678:23: warning: variable 'led_cdev' set but not used [-Wunused-but-set-variable]
  struct led_classdev *led_cdev;
                       ^~~~~~~~

Get rid of it.

Fixes: commit 079933dbcb02 ("[media] v4l: flash led class: Fix of_node release in probe() error path")
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l: flash led class: Fix of_node release in probe() error path
Sakari Ailus [Wed, 5 Oct 2016 07:13:10 +0000 (04:13 -0300)]
[media] v4l: flash led class: Fix of_node release in probe() error path

The sub-device's OF node was used (of_node_get()) if it was set, but
device's OF node was always put. Fix this.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] coda: fix the error path in coda_probe()
Fabio Estevam [Tue, 4 Oct 2016 15:41:37 +0000 (12:41 -0300)]
[media] coda: fix the error path in coda_probe()

In the case of coda_firmware_request() failure, we should release the
prevously acquired resources.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] Add Cinergy S2 rev.4 support
Enrico Mioso [Tue, 4 Oct 2016 11:13:27 +0000 (08:13 -0300)]
[media] Add Cinergy S2 rev.4 support

This patch derives from previous one(s) by CrazyCat. I used the commit adding rev.3 to mainline Linux kernel as an example, so credits go to its author(s).
The hardware seems to scan and tune OK.

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] bcm2048: Remove FSF mailing address
Wayne Porter [Sun, 2 Oct 2016 00:06:27 +0000 (21:06 -0300)]
[media] bcm2048: Remove FSF mailing address

FSF address changes, checkpatch recommends removing it

Signed-off-by: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] rc: nuvoton: use managed versions of rc_allocate_device and rc_register_device
Heiner Kallweit [Fri, 30 Sep 2016 20:42:17 +0000 (17:42 -0300)]
[media] rc: nuvoton: use managed versions of rc_allocate_device and rc_register_device

Simplify the remove function and the error path in the probe function by
using the managed versions of rc_allocate_device and rc_register_device.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] rc: core: add managed versions of rc_allocate_device and rc_register_device
Heiner Kallweit [Fri, 30 Sep 2016 20:42:07 +0000 (17:42 -0300)]
[media] rc: core: add managed versions of rc_allocate_device and rc_register_device

Introduce managed versions of both functions.
They allows to simplify the error path in the probe function of
rc drivers, and usually also to simplify the remove function.

New element managed_alloc in struct rc_dev is needed to correctly
handle mixed use, e.g. managed version of rc_register_device and
normal version of rc_allocate_device.

In addition devm_rc_allocate_device sets rc->dev.parent as having a
reference to the parent device might be useful for future extensions.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] stih-cec: remove unused including <linux/version.h>
Wei Yongjun [Wed, 28 Sep 2016 15:13:13 +0000 (12:13 -0300)]
[media] stih-cec: remove unused including <linux/version.h>

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

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] atmel-isc: start dma in some scenario
Songjun Wu [Wed, 28 Sep 2016 05:28:57 +0000 (02:28 -0300)]
[media] atmel-isc: start dma in some scenario

If a new vb buf is added to vb queue, the queue is
empty and steaming, dma should be started.

Signed-off-by: Songjun Wu <songjun.wu@microchip.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] rc: ir-raw: change type of available_protocols to atomic64_t
Heiner Kallweit [Tue, 27 Sep 2016 19:48:47 +0000 (16:48 -0300)]
[media] rc: ir-raw: change type of available_protocols to atomic64_t

Changing available_protocols to atomic64_t allows to get rid of the
mutex protecting access to the variable. This helps to simplify
the code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] VPU: mediatek: Fix return value in case of error
Christophe JAILLET [Fri, 23 Sep 2016 21:19:01 +0000 (18:19 -0300)]
[media] VPU: mediatek: Fix return value in case of error

If 'dma_alloc_coherent()' returns NULL, 'vpu_alloc_ext_mem()' will
return 0 which means success.
Return -ENOMEM instead.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: platform: pxa_camera: add missing sensor power on
Robert Jarzmik [Fri, 23 Sep 2016 18:41:39 +0000 (15:41 -0300)]
[media] media: platform: pxa_camera: add missing sensor power on

During sensors binding, there is a window where the sensor is switched
off, while there is a call it to set a new format, which can end up in
an access to the sensor, especially an I2C based sensor.

Remove this window by activating the sensor.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] tw5864: crop picture width to 704
Andrey Utkin [Thu, 22 Sep 2016 00:04:20 +0000 (21:04 -0300)]
[media] tw5864: crop picture width to 704

Previously, width of 720 was used, but it gives 16-pixel wide black bar
at right side of encoded picture.

Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cx88: fix error return code in cx8802_dvb_probe()
Wei Yongjun [Wed, 21 Sep 2016 15:12:58 +0000 (12:12 -0300)]
[media] cx88: fix error return code in cx8802_dvb_probe()

Fix to return error code -ENODEV from the error handling case
instead of 0(err maybe overwrited to 0 in the for loop), as
done elsewhere in this function.

[mchehab@s-opensource.com: remove a now uneeded set for err = -ENODEV]

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] bdisp: fix error return code in bdisp_probe()
Wei Yongjun [Wed, 21 Sep 2016 15:09:38 +0000 (12:09 -0300)]
[media] bdisp: fix error return code in bdisp_probe()

Fix to return error code -EINVAL from the platform_get_resource() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] gs1662: drop kfree for memory allocated with devm_kzalloc
Wei Yongjun [Wed, 21 Sep 2016 13:09:39 +0000 (10:09 -0300)]
[media] gs1662: drop kfree for memory allocated with devm_kzalloc

It's not necessary to free memory allocated with devm_kzalloc
and using kfree leads to a double free.

Fixes: 7aae6e2df127 ("[media] Add GS1662 driver, a video serializer")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] gs1662: remove .owner field for driver
Wei Yongjun [Wed, 21 Sep 2016 13:09:23 +0000 (10:09 -0300)]
[media] gs1662: remove .owner field for driver

Remove .owner field if calls are used which set it automatically.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] platform: pxa_camera: add VIDEO_V4L2 dependency
Arnd Bergmann [Mon, 19 Sep 2016 12:46:30 +0000 (09:46 -0300)]
[media] platform: pxa_camera: add VIDEO_V4L2 dependency

Moving the pxa_camera driver from soc_camera lots the implied
VIDEO_V4L2 Kconfig dependency, and building the driver without
V4L2 results in a kernel that cannot link:

drivers/media/platform/pxa_camera.o: In function `pxa_camera_remove':
pxa_camera.c:(.text.pxa_camera_remove+0x10): undefined reference to `v4l2_clk_unregister'
pxa_camera.c:(.text.pxa_camera_remove+0x18): undefined reference to `v4l2_device_unregister'
drivers/media/platform/pxa_camera.o: In function `pxa_camera_probe':
pxa_camera.c:(.text.pxa_camera_probe+0x458): undefined reference to `v4l2_of_parse_endpoint'
drivers/media/v4l2-core/videobuf2-core.o: In function `__enqueue_in_driver':
drivers/media/v4l2-core/videobuf2-core.o: In function `vb2_core_streamon':
videobuf2-core.c:(.text.vb2_core_streamon+0x1b4): undefined reference to `v4l_vb2q_enable_media_source'
drivers/media/v4l2-core/videobuf2-v4l2.o: In function `vb2_ioctl_reqbufs':
videobuf2-v4l2.c:(.text.vb2_ioctl_reqbufs+0xc): undefined reference to `video_devdata'

This adds back an explicit dependency.

Fixes: 3050b9985024 ("[media] media: platform: pxa_camera: move pxa_camera out of soc_camera")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] lirc_imon: use complete() instead complete_all()
Daniel Wagner [Fri, 16 Sep 2016 11:18:22 +0000 (08:18 -0300)]
[media] lirc_imon: use complete() instead complete_all()

There is only one waiter for the completion, therefore there
is no need to use complete_all(). Let's make that clear by
using complete() instead of complete_all().

While we are at it, we do a small optimization with the
reinitialization of the completion before we use it.

The usage pattern of the completion is:

waiter context                          waker context

send_packet()
  reinit_completion()
  usb_sumbit_urb()
  wait_for_completion_interruptible()

                                        usb_tx_callback()
                                          complete()

                                        imon_disconnect()
                                          complete()

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] imon: use complete() instead of complete_all()
Daniel Wagner [Fri, 16 Sep 2016 11:18:21 +0000 (08:18 -0300)]
[media] imon: use complete() instead of complete_all()

There is only one waiter for the completion, therefore there is no need
to use complete_all(). Let's make that clear by using complete() instead
of complete_all().

While we are at it, we do a small optimization with the reinitialization
of the completion before we use it.

The usage pattern of the completion is:

waiter context                          waker context

send_packet()
  init_completion()
  usb_submit_urb()
  wait_for_completion_interruptible()

                                        usb_tx_callback()
                                          complete()

                                        imon_disonnect()
                                          complete()

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] ad5820: Fix sparse warning
Sakari Ailus [Fri, 16 Sep 2016 10:16:30 +0000 (07:16 -0300)]
[media] ad5820: Fix sparse warning

Use a type with explicit endianness in machine to big endian conversion.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: adv7604: automatic "default-input" selection
Ulrich Hecht [Thu, 22 Sep 2016 13:19:00 +0000 (10:19 -0300)]
[media] media: adv7604: automatic "default-input" selection

Documentation states that the "default-input" property should reside
directly in the node of the device.  This adjusts the parsing to make the
implementation consistent with the documentation.

Based on patch by William Towle <william.towle@codethink.co.uk>.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: adv7604: fix bindings inconsistency for default-input
Ulrich Hecht [Thu, 22 Sep 2016 13:18:59 +0000 (10:18 -0300)]
[media] media: adv7604: fix bindings inconsistency for default-input

The text states that default-input is an endpoint property, but in the
example it is a device property.

The default input is a property of the chip, not of a particular port, so
the example makes more sense.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: i2c: tvp514x: Reported mbus format should be MEDIA_BUS_FMT_UYVY8_2X8
Benoit Parrot [Wed, 14 Sep 2016 20:03:13 +0000 (17:03 -0300)]
[media] media: i2c: tvp514x: Reported mbus format should be MEDIA_BUS_FMT_UYVY8_2X8

The advertised V4L2 pixel format and Media Bus code don't match.
The current media bud code advertised is MEDIA_BUS_FMT_YUYV8_2X8
which does not reflect what the encoder actually outputs.
This encoder generate MEDIA_BUS_FMT_UYVY8_2X8 so advertise as such.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] ite-cir: initialize use_demodulator before using it
Nicolas Iooss [Sat, 10 Sep 2016 16:59:49 +0000 (13:59 -0300)]
[media] ite-cir: initialize use_demodulator before using it

Function ite_set_carrier_params() uses variable use_demodulator after
having initialized it to false in some if branches, but this variable is
never set to true otherwise.

This bug has been found using clang -Wsometimes-uninitialized warning
flag.

Fixes: 620a32bba4a2 ("[media] rc: New rc-based ite-cir driver for
several ITE CIRs")

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] mb86a20s: always initialize a return value
Nicolas Iooss [Sat, 10 Sep 2016 16:49:01 +0000 (13:49 -0300)]
[media] mb86a20s: always initialize a return value

In mb86a20s_read_status_and_stats(), when mb86a20s_read_status() fails,
the function returns the value in variable rc without initializing it
first. Fix this by propagating the error code from variable status_nr.

This bug has been found using clang and -Wsometimes-uninitialized
warning flag.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] dvb-usb-dvbsky: Add support for TechnoTrend S2-4650 CI
Olli Salonen [Fri, 9 Sep 2016 19:24:54 +0000 (16:24 -0300)]
[media] dvb-usb-dvbsky: Add support for TechnoTrend S2-4650 CI

TechnoTrend TT-connect S2-4650 CI seems to be a variation of
the DVBSky S960CI device.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] variable name is never null, so remove null check
Colin Ian King [Tue, 6 Sep 2016 12:44:09 +0000 (09:44 -0300)]
[media] variable name is never null, so remove null check

The variable name is always assigned to a literal string in the
proceeding switch statement, so it is never null and hence the
null check is redundant. Remove null the check.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
8 years ago[media] coda: add missing header dependencies
Baoyou Xie [Tue, 6 Sep 2016 07:50:56 +0000 (04:50 -0300)]
[media] coda: add missing header dependencies

We get 1 warning when building kernel with W=1:
drivers/media/platform/coda/coda-h264.c:22:5: warning: no previous prototype for 'coda_h264_padding' [-Wmissing-prototypes]

In fact, this function is declared in coda.h, so this patch
add missing header dependencies.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
8 years ago[media] cx24120: do not allow an invalid delivery system types
Colin Ian King [Sat, 3 Sep 2016 17:04:17 +0000 (14:04 -0300)]
[media] cx24120: do not allow an invalid delivery system types

cx24120_set_frontend currently allows invalid delivery system types
other than SYS_DVBS2 and SYS_DVBS.  Fix this by returning -EINVAL
for invalid values.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jemma Denson <jdenson@gmail.com>
8 years ago[media] Add support for EVOLVEO XtraTV stick
CIJOML CIJOMLovic [Mon, 1 Aug 2016 21:55:52 +0000 (18:55 -0300)]
[media] Add support for EVOLVEO XtraTV stick

Add a new USB ID for EVOLVEO XtraTV stick.

[mchehab@s-opensource.org: fix patch and make checkpatch happy]
Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] uvcvideo: uvc_scan_fallback() for webcams with broken chain
Henrik Ingo [Sun, 29 May 2016 20:58:00 +0000 (17:58 -0300)]
[media] uvcvideo: uvc_scan_fallback() for webcams with broken chain

Some devices have invalid baSourceID references, causing uvc_scan_chain()
to fail, but if we just take the entities we can find and put them
together in the most sensible chain we can think of, turns out they do
work anyway. Note: This heuristic assumes there is a single chain.

At the time of writing, devices known to have such a broken chain are
  - Acer Integrated Camera (5986:055a)
  - Realtek rtl157a7 (0bda:57a7)

Signed-off-by: Henrik Ingo <henrik.ingo@avoinelama.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cardlist: convert them to asciiart tables
Mauro Carvalho Chehab [Sun, 23 Oct 2016 10:29:16 +0000 (08:29 -0200)]
[media] cardlist: convert them to asciiart tables

Instead of using codeblock for the cardlists, use tables, in
order to improve their visual when presenting them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] gspca-cardlist.rst: update camera names
Mauro Carvalho Chehab [Sat, 22 Oct 2016 21:51:05 +0000 (19:51 -0200)]
[media] gspca-cardlist.rst: update camera names

For those cameras that were missing descriptions, update using
some web research:
https://cateee.net/lkddb/web-lkddb/USB_GSPCA_STV0680.html
https://cateee.net/lkddb/web-lkddb/USB_GSPCA_ZC3XX.html
https://cateee.net/lkddb/web-lkddb/USB_GSPCA_KINECT.html
https://cateee.net/lkddb/web-lkddb/USB_GSPCA_SPCA561.html
https://cateee.net/lkddb/web-lkddb/USB_GSPCA_VICAM.html
https://cateee.net/lkddb/web-lkddb/USB_GSPCA_DTCS033.html
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/564979
https://cateee.net/lkddb/web-lkddb/USB_GSPCA_PAC7302.html
https://cateee.net/lkddb/web-lkddb/USB_GSPCA_SONIXB.html
https://cateee.net/lkddb/web-lkddb/USB_GSPCA_SONIXJ.html

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] gspca-cardlist.rst: update cardlist from drivers USB IDs
Mauro Carvalho Chehab [Sat, 22 Oct 2016 21:47:30 +0000 (19:47 -0200)]
[media] gspca-cardlist.rst: update cardlist from drivers USB IDs

There are several missing USB IDs that are defined on gspca
drivers. Add them.

The missing entries were found/created using the following script:

<script>
use strict;
use File::Find;

my $src = "drivers/media/usb/gspca/";
my $table = 0;
my %data;

my $id;

my $len = 0;

open IN, "Documentation/media/v4l-drivers/gspca-cardlist.rst";
while (<IN>) {
if (m/^=+\s+=+\s+=+$/) {
$table++;
next;
}
next if ($table != 2);
if (m/^(\S+)\s+(\S+)\s+(.*)/) {
$id = "$1_$2";
$data{$id}->{driver} = $1;
$data{$id}->{usb_id} = $2;
$data{$id}->{name} = $3;
$data{$id}->{valid} = 0;

$len = length($3) if (length($3) > $len);
}
}
close IN;

sub parse_dir {
        my $file = $File::Find::name;

open IN, $file;

my $driver = $file;

$driver =~ s,($src),,;

$driver =~ s,/.*,,;
$driver =~ s,\.c$,,;

while (<IN>) {
next if (m,/\*.*USB_DEVICE,);
if (m/USB_DEVICE[^\(]*\(\s*0x(\S+)\s*\,\s*0x(\S+)\)(.*)/) {
my $n = "$1:$2";
my $o = $3;
$id = "${driver}_$n";

$data{$id}->{valid} = 1;

next if (defined $data{$id}->{driver});

$data{$id}->{driver} = $driver;
$data{$id}->{usb_id} = $n;

if ($o =~ m,\/\*\s*(.*)\*\/,) {
$n = $1;
$n =~ s/\s+//;
$data{$id}->{name} = $n;
} else {
$data{$id}->{name} = "";
}
}
}
close IN;
}

find({wanted => \&parse_dir, no_chdir => 1}, $src);

print "The gspca cards list\n";
print "====================\n\n";
print "The modules for the gspca webcam drivers are:\n\n";
print "- gspca_main: main driver\n";
print "- gspca\\_\\ *driver*: subdriver module with *driver* as follows\n\n";
print "========= ========= " . "=" x $len . "\n";
print "*driver* vend:prod Device\n";
print "========= ========= " . "=" x $len . "\n";

foreach my $id (sort { $data{$a}->{usb_id} . $data{$a}->{driver} cmp $data{$b}->{usb_id} . $data{$b}->{driver} } keys %data) {
next if (!$data{$id}->{valid});

my $s = sprintf "%-15s %s\t%s\n",
$data{$id}->{driver}, $data{$id}->{usb_id}, $data{$id}->{name};

# Replace tabs by spaces
$s =~ s/[ \t]+$//;
        $s =~ s<^ {8}> <\t>;
        $s =~ s<^ {1,7}\t> <\t>;
        $s =~ s< {1,7}\t> <\t>;

printf $s;
}
print "========= ========= " . "=" x $len . "\n";
</script>

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] gspca-cardlist.rst: sort entries and adjust table margins
Mauro Carvalho Chehab [Sat, 22 Oct 2016 21:29:26 +0000 (19:29 -0200)]
[media] gspca-cardlist.rst: sort entries and adjust table margins

Some entries are out of order.

While here, clear spaces/tabs.

The content remains the same, with the exeption of one duplicated
entry from the same driver, where two different brand names share
the same entry. The content of such cell was merged, using a
comma.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] stv06xx: store device name after the USB_DEVICE line
Mauro Carvalho Chehab [Sat, 22 Oct 2016 21:59:57 +0000 (19:59 -0200)]
[media] stv06xx: store device name after the USB_DEVICE line

That makes easier to parse the names, in order to sync it
with gspca-cardlist.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] spca506: rewrite a commented line to avoid wrong parsing
Mauro Carvalho Chehab [Sat, 22 Oct 2016 22:45:23 +0000 (20:45 -0200)]
[media] spca506: rewrite a commented line to avoid wrong parsing

Keeping Documentation/media/v4l-drivers/gspca-cardlist.rst in
sync with the gspca script requires a parser. Simplify the
commented line, to make the parser work better.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l: vsp1: Add support for capture and output in HSV formats
Laurent Pinchart [Wed, 7 Sep 2016 00:04:53 +0000 (21:04 -0300)]
[media] v4l: vsp1: Add support for capture and output in HSV formats

Support both the HSV24 and HSV32 formats. From a hardware point of view
pretend the formats are RGB, the RPF and WPF will just pass the data
through without performing any processing.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>