platform/kernel/linux-rpi.git
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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 years ago[media] vivid: Add support for HSV encoding
Ricardo Ribalda Delgado [Mon, 18 Jul 2016 12:16:15 +0000 (09:16 -0300)]
[media] vivid: Add support for HSV encoding

Support HSV encoding. Most of the logic is replicated from ycbcr_enc.

Signed-off-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>
7 years ago[media] Documentation: Add HSV encodings
Ricardo Ribalda Delgado [Thu, 18 Aug 2016 14:33:37 +0000 (11:33 -0300)]
[media] Documentation: Add HSV encodings

Describe the hsv_enc field and its use.

Signed-off-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>
7 years ago[media] videodev2.h Add HSV encoding
Ricardo Ribalda Delgado [Mon, 22 Aug 2016 09:28:07 +0000 (06:28 -0300)]
[media] videodev2.h Add HSV encoding

Some hardware maps the Hue between 0 and 255 instead of 0-179. Support
this format with a new field hsv_enc.

Signed-off-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>
7 years ago[media] vivid: Local optimization
Ricardo Ribalda Delgado [Sat, 16 Jul 2016 09:34:19 +0000 (06:34 -0300)]
[media] vivid: Local optimization

Avoid duplicated clamps when possible.

Suggested-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-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>
7 years ago[media] vivid: Fix YUV555 and YUV565 handling
Ricardo Ribalda Delgado [Sat, 16 Jul 2016 09:26:23 +0000 (06:26 -0300)]
[media] vivid: Fix YUV555 and YUV565 handling

precalculate_color() had a optimization that avoided duplicated
conversion for YUV formats. This optimization did not take into
consideration YUV444, YUV555, YUV565 or limited range quantization.

This patch keeps the optimization, but fixes the wrong handling.

Signed-off-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>
7 years ago[media] vivid: Introduce TPG_COLOR_ENC_LUMA
Ricardo Ribalda Delgado [Sat, 16 Jul 2016 08:58:09 +0000 (05:58 -0300)]
[media] vivid: Introduce TPG_COLOR_ENC_LUMA

Simplifies handling of Gray formats.

Signed-off-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>
7 years ago[media] vivid: Rename variable
Ricardo Ribalda Delgado [Fri, 15 Jul 2016 13:21:46 +0000 (10:21 -0300)]
[media] vivid: Rename variable

r_y and g_u now also contain the H and V components on the HSV formats.
Rename the variables to reflect this.

Signed-off-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>
7 years ago[media] vivid: Add support for HSV formats
Ricardo Ribalda Delgado [Fri, 15 Jul 2016 13:20:08 +0000 (10:20 -0300)]
[media] vivid: Add support for HSV formats

This patch adds support for V4L2_PIX_FMT_HSV24 and V4L2_PIX_FMT_HSV32.

Signed-off-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>
7 years ago[media] vivid: Code refactor for color encoding
Ricardo Ribalda Delgado [Fri, 15 Jul 2016 09:09:47 +0000 (06:09 -0300)]
[media] vivid: Code refactor for color encoding

Replace is_yuv with color_enc Which can be used by other
color encodings such us HSV.

This change should ease the review of the following patches.

Signed-off-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>
7 years ago[media] Documentation: Add Ricardo Ribalda
Ricardo Ribalda Delgado [Fri, 15 Jul 2016 16:04:51 +0000 (13:04 -0300)]
[media] Documentation: Add Ricardo Ribalda

My initials were on the Changelog, but there was no link to my name.

Signed-off-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>
7 years ago[media] Documentation: Add HSV format
Ricardo Ribalda Delgado [Thu, 18 Aug 2016 14:33:28 +0000 (11:33 -0300)]
[media] Documentation: Add HSV format

Describe the HSV formats

Signed-off-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>
7 years ago[media] videodev2.h Add HSV formats
Ricardo Ribalda Delgado [Thu, 18 Aug 2016 14:33:27 +0000 (11:33 -0300)]
[media] videodev2.h Add HSV formats

These formats store the color information of the image
in a geometrical representation. The colors are mapped into a
cylinder, where the angle is the HUE, the height is the VALUE
and the distance to the center is the SATURATION. This is a very
useful format for image segmentation algorithms.

Signed-off-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>
7 years ago[media] smiapp: Implement support for autosuspend
Sakari Ailus [Wed, 14 Sep 2016 15:29:23 +0000 (12:29 -0300)]
[media] smiapp: Implement support for autosuspend

Delay suspending the device by 1000 ms by default. This is done on
explicit power off through s_power() callback, through releasing the
file descriptor, NVM read or when the probe finishes.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] smiapp: Use runtime PM
Sakari Ailus [Tue, 13 Sep 2016 13:01:03 +0000 (10:01 -0300)]
[media] smiapp: Use runtime PM

Switch to runtime PM in sensor power management. The internal power count
is thus removed.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] smiapp: Set use suspend and resume ops for other functions
Sakari Ailus [Wed, 14 Sep 2016 14:58:17 +0000 (11:58 -0300)]
[media] smiapp: Set use suspend and resume ops for other functions

Use the suspend and resume ops for freeze, thaw, poweroff and restore
callbacks as well.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] smiapp: Set device for pixel array and binner
Sakari Ailus [Tue, 13 Sep 2016 22:16:32 +0000 (19:16 -0300)]
[media] smiapp: Set device for pixel array and binner

The dev field of the v4l2_subdev was left NULL for the pixel array and
binner sub-devices. Fix this.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] smiapp: Drop BUG_ON() in suspend path
Sakari Ailus [Tue, 13 Sep 2016 14:25:42 +0000 (11:25 -0300)]
[media] smiapp: Drop BUG_ON() in suspend path

Checking that the mutex is not acquired is unnecessary for user processes
are stopped by this point. Drop the check.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] smiapp-pll: Don't complain aloud about failing PLL calculation
Sakari Ailus [Thu, 8 Sep 2016 13:50:07 +0000 (10:50 -0300)]
[media] smiapp-pll: Don't complain aloud about failing PLL calculation

Don't complain about a failure to compute the pre_pll divisor. The
function is used to determine whether a particular combination of bits per
sample value and a link frequency can be used, in which case there are
lots of unnecessary driver messages. During normal operation the failure
generally does not happen. Use dev_dbg() instead.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] smiapp: Drop a debug print on frame size and bit depth
Sakari Ailus [Thu, 8 Sep 2016 12:08:26 +0000 (09:08 -0300)]
[media] smiapp: Drop a debug print on frame size and bit depth

The first time the sensor is powered on, the information is not yet
available.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] smiapp: Obtain correct media bus code for try format
Sakari Ailus [Thu, 8 Sep 2016 08:49:27 +0000 (05:49 -0300)]
[media] smiapp: Obtain correct media bus code for try format

The media bus code obtained for try format may have been a code that the
sensor did not even support. Use a supported code with the current pixel
order.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] smiapp: Remove useless newlines and other small cleanups
Sakari Ailus [Thu, 8 Sep 2016 08:46:47 +0000 (05:46 -0300)]
[media] smiapp: Remove useless newlines and other small cleanups

The code probably has been unindented at some point but rewrapping has not
been done. Do it now.

Also remove a useless memory allocation failure message.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago[media] smiapp: Improve debug messages from frame layout reading
Sakari Ailus [Wed, 7 Sep 2016 12:53:42 +0000 (09:53 -0300)]
[media] smiapp: Improve debug messages from frame layout reading

Provide more debugging information on reading the frame layout.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>