platform/kernel/linux-rpi.git
3 years agomedia: atomisp: Fix Block Comments
Philipp Gerlesberger [Mon, 14 Dec 2020 11:01:46 +0000 (12:01 +0100)]
media: atomisp: Fix Block Comments

Block comments should use * on subsequent lines and
should use a trailing */ on a separate line.

Link: https://lore.kernel.org/linux-media/20201214110156.6152-3-Philipp.Gerlesberger@fau.de
Co-developed-by: Andrey Khlopkov <ij72uhux@stud.informatik.uni-erlangen.de>
Signed-off-by: Andrey Khlopkov <ij72uhux@stud.informatik.uni-erlangen.de>
Signed-off-by: Philipp Gerlesberger <Philipp.Gerlesberger@fau.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Convert comments to C99 initializers
Philipp Gerlesberger [Mon, 14 Dec 2020 11:01:45 +0000 (12:01 +0100)]
media: atomisp: Convert comments to C99 initializers

The struct initalizers have been changed as recommended on
https://kernelnewbies.org/KernelJanitors/Todo
Also remove all the false, 0, and NULL members.

Link: https://lore.kernel.org/linux-media/20201214110156.6152-2-Philipp.Gerlesberger@fau.de
Co-developed-by: Andrey Khlopkov <ij72uhux@stud.informatik.uni-erlangen.de>
Signed-off-by: Andrey Khlopkov <ij72uhux@stud.informatik.uni-erlangen.de>
Signed-off-by: Philipp Gerlesberger <Philipp.Gerlesberger@fau.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: remove redundant NULL check of "params"
Ding Xiang [Tue, 17 Nov 2020 08:10:58 +0000 (09:10 +0100)]
media: atomisp: remove redundant NULL check of "params"

The check result of (!A || (A && B)) is equivalent to (!A || B),
so remove redundant NULL check of "params"

Link: https://lore.kernel.org/linux-media/20201117081058.673291-1-dingxiang@cmss.chinamobile.com
Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: do not select COMMON_CLK to fix builds
Krzysztof Kozlowski [Tue, 16 Mar 2021 07:56:25 +0000 (08:56 +0100)]
media: atomisp: do not select COMMON_CLK to fix builds

COMMON_CLK is a user-selectable option with its own dependencies.  The
most important dependency is !HAVE_LEGACY_CLK.  User-selectable drivers
should not select COMMON_CLK because they will create a dependency cycle
and build failures.

Link: https://lore.kernel.org/linux-media/20210316075625.10382-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: make atomisp_css_continuous_set_num_raw_frames() void
Kaixu Xia [Sat, 14 Nov 2020 13:55:50 +0000 (14:55 +0100)]
media: atomisp: make atomisp_css_continuous_set_num_raw_frames() void

The return value of atomisp_css_continuous_set_num_raw_frames() function
is always 0, so there's no reason for a return value. In addition, the
__enable_continuous_mode() checked the return value for possible error
which is unnecessary. Convert atomisp_css_continuous_set_num_raw_frames()
to a void function.

Link: https://lore.kernel.org/linux-media/1605362150-11401-1-git-send-email-kaixuxia@tencent.com
Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: make atomisp_css_stop() void
Kaixu Xia [Sat, 14 Nov 2020 13:19:36 +0000 (14:19 +0100)]
media: atomisp: make atomisp_css_stop() void

The return value of atomisp_css_stop() function is always 0 and there
are no callers check the return value, so there's no reason for a return
value. Convert atomisp_css_stop() to a void function.

Link: https://lore.kernel.org/linux-media/1605359976-11254-1-git-send-email-kaixuxia@tencent.com
Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: atomisp: Remove unnecessary if statement
Alex Dewar [Sat, 17 Oct 2020 14:28:02 +0000 (16:28 +0200)]
media: staging: media: atomisp: Remove unnecessary if statement

The bodies of the if and else sections are the same, so just remove the
check.

Link: https://lore.kernel.org/linux-media/20201017142810.26967-2-alex.dewar90@gmail.com
Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: atomisp: Remove unused function
Alex Dewar [Sat, 17 Oct 2020 14:28:00 +0000 (16:28 +0200)]
media: staging: media: atomisp: Remove unused function

The function ia_css_mipi_frame_specify() is not called from anywhere and
the comment above its declaration states that it should be removed when
there are no more users. So remove it.

Link: https://lore.kernel.org/linux-media/20201017142810.26967-1-alex.dewar90@gmail.com
Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: m88rs6000t: avoid potential out-of-bounds reads on arrays
Colin Ian King [Wed, 7 Oct 2020 12:16:28 +0000 (14:16 +0200)]
media: m88rs6000t: avoid potential out-of-bounds reads on arrays

There a 3 array for-loops that don't check the upper bounds of the
index into arrays and this may lead to potential out-of-bounds
reads.  Fix this by adding array size upper bounds checks to be
full safe.

Addresses-Coverity: ("Out-of-bounds read")

Link: https://lore.kernel.org/linux-media/20201007121628.20676-1-colin.king@canonical.com
Fixes: 333829110f1d ("[media] m88rs6000t: add new dvb-s/s2 tuner for integrated chip M88RS6000")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: atomisp: Corrected error handling in function
Leonid Kushnir [Tue, 6 Oct 2020 20:29:03 +0000 (22:29 +0200)]
media: staging: atomisp: Corrected error handling in function

This patch fixes check of a result of 'power_up()' function call in
function 'gc0310_s_power()' to do "error handling" instead of "success
handling" as Dan Carpenter noted in his comment on the previous patch.
Lines 'return gc0310_init(sd)' and 'return ret' are swapped, and direct
value of 'ret' is checked in IF statement now.

Link: https://lore.kernel.org/linux-media/20201006202903.GA8346@linux
Signed-off-by: Leonid Kushnir <leonf008@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: atomisp: Removed else branch in function
Leonid Kushnir [Tue, 6 Oct 2020 08:17:21 +0000 (10:17 +0200)]
media: staging: atomisp: Removed else branch in function

This patch fixes the checkpatch.pl warning :

WARNING: else is not generally useful after a break or return

Expressions under 'else' branch in function 'gc0310_s_power' are
executed whenever the exppression in 'if' is False. Otherwise, return
from function occurs. Therefore, there is no need in 'else', and it has
been removed.

Link: https://lore.kernel.org/linux-media/20201006081721.GA35979@linux
Signed-off-by: Leonid Kushnir <leonf008@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: atomisp: Fixed allignment to match open parenthesis
Leonid Kushnir [Mon, 5 Oct 2020 09:41:07 +0000 (11:41 +0200)]
media: staging: atomisp: Fixed allignment to match open parenthesis

Moved the parameters of the function '__gc0310_write_reg_is_consecutive'
to the right under open parenthesis to fix warning message from
checkpatch.pl: 'CHECK: Alignment should match open parenthesis'.

Link: https://lore.kernel.org/linux-media/20201005094107.GA44033@linux
Signed-off-by: Leonid Kushnir <leonf008@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Fixed error handling path
Souptick Joarder [Sun, 27 Sep 2020 15:08:04 +0000 (17:08 +0200)]
media: atomisp: Fixed error handling path

Inside alloc_user_pages() based on flag value either pin_user_pages()
or get_user_pages_fast() will be called. However, these API might fail.

But free_user_pages() called in error handling path doesn't bother
about return value and will try to unpin bo->pgnr pages, which is
incorrect.

Fix this by passing the page_nr to free_user_pages(). If page_nr > 0
pages will be unpinned based on bo->mem_type. This will also take care
of non error handling path.

allocation")

Link: https://lore.kernel.org/linux-media/1601219284-13275-1-git-send-email-jrdr.linux@gmail.com
Fixes: 14a638ab96c5 ("media: atomisp: use pin_user_pages() for memory
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: atomisp: clean up block comment style issues
Gary Yao [Sat, 26 Sep 2020 20:50:58 +0000 (22:50 +0200)]
media: staging: media: atomisp: clean up block comment style issues

Clean up block comment style issues to follow kernel coding style
and clear checkpatch warnings.

WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line

Link: https://lore.kernel.org/linux-media/20200926205103.189041-1-gary@apache.org
Signed-off-by: Gary Yao <gary@apache.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: mantis: remove orphan mantis_core.c
Necip Fazil Yildiran [Tue, 22 Sep 2020 13:22:22 +0000 (15:22 +0200)]
media: mantis: remove orphan mantis_core.c

There is no Makefile rule to have drivers/media/pci/mantis/mantis_core.o
in build since the code overhaul with commit b3b961448f70
("V4L/DVB (13795): [Mantis/Hopper] Code overhaul, add Hopper devices into the PCI ID list").

It looks like drivers/media/pci/mantis/mantis_core.c is a leftover.

Remove the orphan code.

Link: https://lore.kernel.org/linux-media/20200922132221.2051769-1-fazilyildiran@gmail.com
Fixes: b3b961448f70 ("V4L/DVB (13795): [Mantis/Hopper] Code overhaul, add Hopper devices into the PCI ID list").
Signed-off-by: Necip Fazil Yildiran <fazilyildiran@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: atomisp: Remove unhelpful info message
Alex Dewar [Mon, 21 Sep 2020 21:53:53 +0000 (23:53 +0200)]
media: staging: media: atomisp: Remove unhelpful info message

We don't really need to know that the LED pin reset successfully.

Link: https://lore.kernel.org/linux-media/20200921215359.45003-3-alex.dewar90@gmail.com
Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoatomisp: remove a now unused var
Mauro Carvalho Chehab [Mon, 22 Mar 2021 16:21:07 +0000 (17:21 +0100)]
atomisp: remove a now unused var

A previous cleanup patch removed the usage of the ret var.

So, drop it.

Link: https://lore.kernel.org/linux-media/a03a4a3e9aad2b8154018c323cf7766266990724.1616430113.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: mantis: switch from 'pci_' to 'dma_' API
Christophe JAILLET [Sun, 13 Sep 2020 14:57:16 +0000 (16:57 +0200)]
media: mantis: switch from 'pci_' to 'dma_' API

The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated in 'mantis_alloc_buffers()' (mantis_dma.c)
GFP_KERNEL can be used because it is called from 'mantis_dma_init()' which
is only called from probe functions and no lock is taken in the between.

@@
@@
-    PCI_DMA_BIDIRECTIONAL
+    DMA_BIDIRECTIONAL

@@
@@
-    PCI_DMA_TODEVICE
+    DMA_TO_DEVICE

@@
@@
-    PCI_DMA_FROMDEVICE
+    DMA_FROM_DEVICE

@@
@@
-    PCI_DMA_NONE
+    DMA_NONE

@@
expression e1, e2, e3;
@@
-    pci_alloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-    pci_zalloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-    pci_free_consistent(e1, e2, e3, e4)
+    dma_free_coherent(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_single(e1, e2, e3, e4)
+    dma_map_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_single(e1, e2, e3, e4)
+    dma_unmap_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-    pci_map_page(e1, e2, e3, e4, e5)
+    dma_map_page(&e1->dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_page(e1, e2, e3, e4)
+    dma_unmap_page(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_sg(e1, e2, e3, e4)
+    dma_map_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_sg(e1, e2, e3, e4)
+    dma_unmap_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_device(e1, e2, e3, e4)
+    dma_sync_single_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2;
@@
-    pci_dma_mapping_error(e1, e2)
+    dma_mapping_error(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_dma_mask(e1, e2)
+    dma_set_mask(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_consistent_dma_mask(e1, e2)
+    dma_set_coherent_mask(&e1->dev, e2)

Link: https://lore.kernel.org/linux-media/20200913145716.361507-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camera-sensor.rst: fix a doc build warning
Mauro Carvalho Chehab [Wed, 9 Sep 2020 13:07:11 +0000 (15:07 +0200)]
media: camera-sensor.rst: fix a doc build warning

Documentation/driver-api/media/camera-sensor.rst:123: WARNING: Inline literal start-string without end-string.

There's a missing blank line over there.

Link: https://lore.kernel.org/linux-media/c326774ad841b905c3b2925e5f8f509d29fb4c6f.1599656828.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: atomisp: Don't abort on error in module exit path
Alex Dewar [Thu, 3 Sep 2020 18:31:34 +0000 (20:31 +0200)]
media: staging: media: atomisp: Don't abort on error in module exit path

The function lm3554_remove() checks for the return code for
lm3554_gpio_uninit() even though this is on the exit path and exits the
function, leaving the variable flash unfreed. Print a warning instead
and free flash unconditionally.

Link: https://lore.kernel.org/linux-media/20200903183145.720727-1-alex.dewar90@gmail.com
Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dvb-frontends: lgdt3306a.c: remove dead code
Daniel W. S. Almeida [Thu, 3 Sep 2020 13:13:09 +0000 (15:13 +0200)]
media: dvb-frontends: lgdt3306a.c: remove dead code

Fix the following coccinelle report:

drivers/media/dvb-frontends/lgdt3306a.c:718:5-8:
Unneeded variable: "ret". Return "0" on line 744

Code was enclosed with #if 0 and thus this variable was not needed.
Remove that function altogether.

The  lgdt3306a_spectral_inversion function was dropped completely
since the function doesn't do anything. A comment was left at its
calling site to let others know that spectral_inversion defaults
already set for VSB and QAM

Found using - Coccinelle (http://coccinelle.lip6.fr)

Link: https://lore.kernel.org/linux-media/20200903131311.442255-1-dwlsalmeida@gmail.com
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: [next] staging: media: atomisp: fix memory leak of object flash
Colin Ian King [Wed, 2 Sep 2020 16:58:52 +0000 (18:58 +0200)]
media: [next] staging: media: atomisp: fix memory leak of object flash

In the case where the call to lm3554_platform_data_func returns an
error there is a memory leak on the error return path of object
flash.  Fix this by adding an error return path that will free
flash and rename labels fail2 to fail3 and fail1 to fail2.

Link: https://lore.kernel.org/linux-media/20200902165852.201155-1-colin.king@canonical.com
Fixes: 9289cdf39992 ("staging: media: atomisp: Convert to GPIO descriptors")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dvb_frontend: warn if frontend driver has API issues
Mauro Carvalho Chehab [Mon, 22 Mar 2021 15:33:57 +0000 (16:33 +0100)]
media: dvb_frontend: warn if frontend driver has API issues

the kAPI for a frontend can use 3 different tuning methods:

1. The hardware tracks internally frequency shifts via its
   own internal zigzag logic;
2. The hardware has a custom zigzag method, implemented via
   fe search() ops;
3. The hardware doesn't have any internal zigzag logic. So,
   the Kernel needs to implement it.

Drivers that use the in-kernel software zigzag are required to
provide some parameters for the zigzag code to work. Failing
to do that will just make the Kernel to tune several times
to the very same frequency, delaying the tuning time for
no good reason. This is actually a kAPI violation
(and an uAPI one, as the frequency shift is exported to the
uAPI).

Emit a warning on such case, as the driver needs to be fixed.

Link: https://lore.kernel.org/linux-media/6d5941e3ba77439bbc401207cd87d9b8748d5cb8.1616427172.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dvb_frontend: don't call dvb_frontend_get_stepsize() twice
Mauro Carvalho Chehab [Mon, 22 Mar 2021 14:53:46 +0000 (15:53 +0100)]
media: dvb_frontend: don't call dvb_frontend_get_stepsize() twice

Avoid calling the function twice, as it was just called at the
previous line.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dvb_frontend: move algo-specific settings to a function
Mauro Carvalho Chehab [Wed, 17 Jun 2020 18:52:13 +0000 (20:52 +0200)]
media: dvb_frontend: move algo-specific settings to a function

As we're planning to call this code from somewhere else,
let's first move it to its own function.

Link: https://lore.kernel.org/linux-media/daa69edd80e7fcf979062273f3067cb7b5573d52.1592419750.git.mchehab+huawei@kernel.org
Reviewed-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: cx25821: switch from 'pci_' to 'dma_' API
Christophe JAILLET [Sun, 21 Mar 2021 07:58:11 +0000 (08:58 +0100)]
media: cx25821: switch from 'pci_' to 'dma_' API

The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated in 'cx25821_riscmem_alloc()' GFP_KERNEL can be
used because either this flag is already used in the call chain, or it is
called from a 'buf_prepare' function.

The call chains are:
  vb2_ops.buf_prepare              (in cx25821-video.c)
    cx25821_buffer_prepare         (in cx25821-video.c)
      cx25821_risc_buffer
        cx25821_riscmem_alloc

  snd_cx25821_hw_params            (in cx25821-alsa.c) <-- use GFP_KERNEL
    cx25821_risc_databuffer_audio
      cx25821_riscmem_alloc

@@
@@
-    PCI_DMA_BIDIRECTIONAL
+    DMA_BIDIRECTIONAL

@@
@@
-    PCI_DMA_TODEVICE
+    DMA_TO_DEVICE

@@
@@
-    PCI_DMA_FROMDEVICE
+    DMA_FROM_DEVICE

@@
@@
-    PCI_DMA_NONE
+    DMA_NONE

@@
expression e1, e2, e3;
@@
-    pci_alloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-    pci_zalloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-    pci_free_consistent(e1, e2, e3, e4)
+    dma_free_coherent(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_single(e1, e2, e3, e4)
+    dma_map_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_single(e1, e2, e3, e4)
+    dma_unmap_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-    pci_map_page(e1, e2, e3, e4, e5)
+    dma_map_page(&e1->dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_page(e1, e2, e3, e4)
+    dma_unmap_page(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_sg(e1, e2, e3, e4)
+    dma_map_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_sg(e1, e2, e3, e4)
+    dma_unmap_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_device(e1, e2, e3, e4)
+    dma_sync_single_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2;
@@
-    pci_dma_mapping_error(e1, e2)
+    dma_mapping_error(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_dma_mask(e1, e2)
+    dma_set_mask(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_consistent_dma_mask(e1, e2)
+    dma_set_coherent_mask(&e1->dev, e2)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-mc: fix a warning message
Antti Keränen [Mon, 15 Mar 2021 13:58:54 +0000 (14:58 +0100)]
media: v4l2-mc: fix a warning message

The message erroneously told that the pad wasn't found from a tuner
when in reality it wasn't found from a decoder.

Signed-off-by: Antti Keränen <detegr@rbx.email>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rkvdec: Remove of_match_ptr()
Fabio Estevam [Sat, 20 Mar 2021 12:21:52 +0000 (13:21 +0100)]
media: rkvdec: Remove of_match_ptr()

When building with CONFIG_OF not set, the following clang
build warning is seen:

>> drivers/staging/media/rkvdec/rkvdec.c:967:34: warning: unused variable 'of_rkvdec_match' [-Wunused-const-variable]

Fix the warning by removing the unnecessary of_match_ptr().

Reported-by: kernel test robot <lkp@intel.com>
Fixes: cd33c830448b ("media: rkvdec: Add the rkvdec driver")
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: adv7604: writing a one-block EDID failed
Hans Verkuil [Fri, 19 Mar 2021 16:57:59 +0000 (17:57 +0100)]
media: adv7604: writing a one-block EDID failed

The adv7604 refused to accept an one-block EDID, it required two blocks.

Fix this.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: buffer.rst: fix incorrect :c:type
Hans Verkuil [Thu, 18 Mar 2021 14:27:46 +0000 (15:27 +0100)]
media: buffer.rst: fix incorrect :c:type

:c:type:`struct v4l2_requestbuffers` should be
struct :c:type:`v4l2_requestbuffers`.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: vidioc-g-ext-ctrls.rst: reformat tables and clarify which vs ctrl_class
Hans Verkuil [Thu, 18 Mar 2021 09:03:06 +0000 (10:03 +0100)]
media: vidioc-g-ext-ctrls.rst: reformat tables and clarify which vs ctrl_class

The VIDIOC_G/S/TRY_EXT_CTRLS documentation has large explanatory texts for
some of the fields in a table. This makes it hard to read. Move those text
to a new cell spanning the whole width of the table, similar to what was
done for struct v4l2_pix_format. This makes it much more readable.

Also move the 'ctrl_class' description to below the 'which' description and
just mention that it is deprecated and that 'which' should be used instead.

Finally remove 'note::' for the V4L2_CTRL_WHICH_DEF_VAL description. It
doesn't have to be marked as a note, it's just a simple paragraph.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/pci/pt1: Assign value when defining variables
zuoqilin [Wed, 17 Mar 2021 03:08:04 +0000 (04:08 +0100)]
media: media/pci/pt1: Assign value when defining variables

When defining variables and assigning values can be done at the same time.

Signed-off-by: zuoqilin <zuoqilin@yulong.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: coda: Remove unneeded of_match_ptr()
Fabio Estevam [Tue, 16 Mar 2021 16:50:39 +0000 (17:50 +0100)]
media: coda: Remove unneeded of_match_ptr()

The coda driver only runs on i.MX, which is a DT-only platform, so
remove the unneeded of_match_ptr().

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: videobuf2: Exit promptly if size = 0
Ricardo Ribalda [Tue, 9 Mar 2021 20:51:08 +0000 (21:51 +0100)]
media: videobuf2: Exit promptly if size = 0

Exit as soon as possible if a driver wants to allocate a buffer of
size 0, and print a warning to help fixing the issue.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-ctrls: Fix h264 hierarchical coding type menu ctrl
Stanimir Varbanov [Tue, 2 Mar 2021 22:42:06 +0000 (23:42 +0100)]
media: v4l2-ctrls: Fix h264 hierarchical coding type menu ctrl

Add a name of the menu and fill control type.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: i2c: adv7842: remove open coded version of SMBus block write
Wolfram Sang [Tue, 19 Jan 2021 09:39:08 +0000 (10:39 +0100)]
media: i2c: adv7842: remove open coded version of SMBus block write

The version here is identical to the one in the I2C core, so use the
latter version directly.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: mtk-vpu/mtk_vpu.h: fix kernel-doc warnings
Hans Verkuil [Thu, 11 Mar 2021 10:20:22 +0000 (11:20 +0100)]
media: mtk-vpu/mtk_vpu.h: fix kernel-doc warnings

A top-level documentation block was missing 'DOC:'.

Fix typos in vpu_wdt_reg_handler() and vpu_mapping_dm_addr().

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Irui Wang <irui.wang@mediatek.com>
Cc: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: mtk-vcodec: fix kernel-doc warnings
Hans Verkuil [Thu, 11 Mar 2021 10:20:21 +0000 (11:20 +0100)]
media: mtk-vcodec: fix kernel-doc warnings

mtk_vcodec_drv.h:
It's '@var:', not '@var - '.
In two places 'struct' was used instead of 'enum'.

vdec_drv_if.h:
It's '@var:', not '@var :'.
In one place 'struct' was used instead of 'enum'.

venc_ipi_msg.h:
It's '@data:', not '@data[8]:', i.e. arrays do not include the
size in kernel-doc.
It's '@var:', not 'var:'.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Alexandre Courbot <acourbot@chromium.org>
Cc: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: mtk-mdp: fix kernel-doc warnings
Hans Verkuil [Thu, 11 Mar 2021 10:20:20 +0000 (11:20 +0100)]
media: mtk-mdp: fix kernel-doc warnings

mtk_mdp_comp.h: MTK_MDP_COMP_TYPE_MAX was undocumented, but it
is also unused, so just remove it.

mtk_mdp_core.h: add missing '*' inside comment blocks, add a
missing : after '@ctrls' and add a missing struct keyword.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Eizan Miyamoto <eizan@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: mtk-jpeg/mtk_jpeg_core.h: fix kernel-doc warnings
Hans Verkuil [Thu, 11 Mar 2021 10:20:19 +0000 (11:20 +0100)]
media: mtk-jpeg/mtk_jpeg_core.h: fix kernel-doc warnings

Add missing 'struct' keywords and fix typos in two struct member
names.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: meson: vdec: fix kernel-doc warning
Hans Verkuil [Thu, 11 Mar 2021 10:20:18 +0000 (11:20 +0100)]
media: staging: media: meson: vdec: fix kernel-doc warning

One comment used /** instead of /*, so it caused kernel-doc
warnings. Just turn it into a regular comment.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: ipu3: add missing kernel-doc 'struct' keywords
Hans Verkuil [Thu, 11 Mar 2021 10:20:17 +0000 (11:20 +0100)]
media: staging: media: ipu3: add missing kernel-doc 'struct' keywords

Two structs where missing the kernel-doc 'struct' keyword
in their kernel-doc documentation.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: hantro: fix kernel-doc formatting
Hans Verkuil [Thu, 11 Mar 2021 10:20:16 +0000 (11:20 +0100)]
media: staging: media: hantro: fix kernel-doc formatting

- @h264_dec was not documented, add that trivial change
- it is not possible to document a global variable in kernel-doc,
  change to use 'DOC:' instead
- fix mismatched struct name (hantro_vp8d_hw_ctx -> hantro_vp8_dec_hw_ctx)

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: vsp1/vsp1_drm.h: add missing 'struct' kernel-doc keyword
Hans Verkuil [Thu, 11 Mar 2021 10:20:15 +0000 (11:20 +0100)]
media: vsp1/vsp1_drm.h: add missing 'struct' kernel-doc keyword

The kernel-doc documentation for two structs was missing the
'struct' keyword.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/platform/sti: fix kernel-doc formatting
Hans Verkuil [Thu, 11 Mar 2021 10:20:14 +0000 (11:20 +0100)]
media: media/platform/sti: fix kernel-doc formatting

bdisp/bdisp-filter.h: coef: -> @coef:  (missing @)
c8sectpfe/c8sectpfe-debugfs.h: /** -> /* (wasn't a kernel-doc comment)
sti/hva/hva.h: @v4l2: -> @vbuf:  (wrong name)

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rcar-vin/rcar-vin.h: fix kernel-doc formatting
Hans Verkuil [Thu, 11 Mar 2021 10:20:13 +0000 (11:20 +0100)]
media: rcar-vin/rcar-vin.h: fix kernel-doc formatting

Fix formatting of two enums and one struct.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ti-vpe/cal.h: fix kernel-doc formatting
Hans Verkuil [Thu, 11 Mar 2021 10:20:12 +0000 (11:20 +0100)]
media: ti-vpe/cal.h: fix kernel-doc formatting

Fix inline struct member documentation, was missing the
'@memb:' prefix.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: s5p-jpeg: fix kernel-doc warnings
Hans Verkuil [Thu, 11 Mar 2021 10:20:11 +0000 (11:20 +0100)]
media: s5p-jpeg: fix kernel-doc warnings

- added missing 'struct' kernel-doc keywords
- add missing '*' in kernel-doc comment blocks

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: exynos-gsc/exynos4-is: add missing 'struct' to kerneldoc
Hans Verkuil [Thu, 11 Mar 2021 10:20:10 +0000 (11:20 +0100)]
media: exynos-gsc/exynos4-is: add missing 'struct' to kerneldoc

Fix kernel-doc warnings due to missing 'struct' keyword.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: tegra-video/csi.h: fix kernel-doc mistake
Hans Verkuil [Tue, 9 Mar 2021 14:35:46 +0000 (15:35 +0100)]
media: tegra-video/csi.h: fix kernel-doc mistake

Fixes this kernel-doc warning:

drivers/staging/media/tegra-video/csi.h:152: warning: Function parameter or member 'csi_chans' not described in 'tegra_csi'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/usb: fix kernel-doc header issues
Hans Verkuil [Tue, 9 Mar 2021 13:03:36 +0000 (14:03 +0100)]
media: media/usb: fix kernel-doc header issues

Fix the following kernel-doc warnings:

drivers/media/usb/dvb-usb-v2/dvb_usb.h:109: warning: cannot understand function prototype: 'struct dvb_usb_driver_info '
drivers/media/usb/dvb-usb-v2/dvb_usb.h:126: warning: cannot understand function prototype: 'struct dvb_usb_rc '
drivers/media/usb/dvb-usb-v2/dvb_usb.h:143: warning: cannot understand function prototype: 'struct usb_data_stream_properties '
drivers/media/usb/dvb-usb-v2/dvb_usb.h:170: warning: expecting prototype for properties of dvb usb device adapter(). Prototype was for
MAX_NO_OF_FE_PER_ADAP() instead
drivers/media/usb/dvb-usb-v2/dvb_usb.h:221: error: Cannot parse struct or union!
drivers/media/usb/dvb-usb-v2/dvb_usb.h:277: warning: expecting prototype for generic object of an usb stream(). Prototype was for
MAX_NO_URBS_FOR_DATA_STREAM() instead
drivers/media/usb/dvb-usb-v2/dvb_usb.h:319: warning: cannot understand function prototype: 'struct dvb_usb_adapter '
drivers/media/usb/dvb-usb-v2/dvb_usb.h:363: warning: cannot understand function prototype: 'struct dvb_usb_device '
drivers/media/usb/dvb-usb/dvb-usb.h:104: warning: cannot understand function prototype: 'struct usb_data_stream_properties '
drivers/media/usb/dvb-usb/dvb-usb.h:163: warning: expecting prototype for struct dvb_usb_adapter_properties. Prototype was for struct
dvb_usb_adapter_fe_properties instead
drivers/media/usb/dvb-usb/dvb-usb.h:205: warning: cannot understand function prototype: 'struct dvb_rc '
drivers/media/usb/dvb-usb/dvb-usb.h:227: warning: Enum value 'DVB_RC_LEGACY' not described in enum 'dvb_usb_mode'
drivers/media/usb/dvb-usb/dvb-usb.h:227: warning: Enum value 'DVB_RC_CORE' not described in enum 'dvb_usb_mode'
drivers/media/usb/dvb-usb/dvb-usb.h:271: error: Cannot parse struct or union!
drivers/media/usb/dvb-usb/dvb-usb.h:325: error: Cannot parse struct or union!
drivers/media/usb/dvb-usb/dvb-usb.h:385: warning: expecting prototype for struct dvb_usb_adapter. Prototype was for struct
dvb_usb_fe_adapter instead
drivers/media/usb/dvb-usb/dvb-usb.h:476: warning: Function parameter or member 'num_adapters_initialized' not described in 'dvb_usb_device'
drivers/media/usb/dvb-usb/dvb-usb.h:476: warning: Function parameter or member 'adapter' not described in 'dvb_usb_device'
drivers/media/usb/dvb-usb/dvb-usb.h:476: warning: Function parameter or member 'rc_phys' not described in 'dvb_usb_device'
drivers/media/usb/em28xx/em28xx.h:377: warning: cannot understand function prototype: 'enum em28xx_amux '

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: Remove qcom,camss documentation
Robert Foss [Tue, 16 Mar 2021 17:19:28 +0000 (18:19 +0100)]
media: dt-bindings: media: Remove qcom,camss documentation

This documentation has been incorporated in dtschema dt-bindings
for the devices supported by CAMSS and is no longer helpful.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: MAINTAINERS: Change CAMSS documentation to use dtschema bindings
Robert Foss [Tue, 16 Mar 2021 17:19:27 +0000 (18:19 +0100)]
media: MAINTAINERS: Change CAMSS documentation to use dtschema bindings

Due to the complexity of describing multiple hardware generations
in one document, switch to using separate dt-bindings.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: camss: Add qcom,sdm845-camss binding
Robert Foss [Tue, 16 Mar 2021 17:19:26 +0000 (18:19 +0100)]
media: dt-bindings: media: camss: Add qcom,sdm845-camss binding

Add bindings for qcom,sdm845-camss in order to support the camera
subsystem for SDM845.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: camss: Add qcom,sdm660-camss binding
Robert Foss [Tue, 16 Mar 2021 17:19:25 +0000 (18:19 +0100)]
media: dt-bindings: media: camss: Add qcom,sdm660-camss binding

Add bindings for qcom,sdm660-camss in order to support the camera
subsystem on SDM630/660 and SDA variants.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: camss: Add qcom,msm8996-camss binding
Robert Foss [Tue, 16 Mar 2021 17:19:24 +0000 (18:19 +0100)]
media: dt-bindings: media: camss: Add qcom,msm8996-camss binding

Add bindings for qcom,msm8996-camss in order to support the camera
subsystem on MSM8996.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: camss: Add qcom,msm8916-camss binding
Robert Foss [Tue, 16 Mar 2021 17:19:23 +0000 (18:19 +0100)]
media: dt-bindings: media: camss: Add qcom,msm8916-camss binding

Add bindings for qcom,msm8916-camss in order to support the camera
subsystem on MSM8916.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Enable SDM845
Robert Foss [Tue, 16 Mar 2021 17:19:22 +0000 (18:19 +0100)]
media: camss: Enable SDM845

Enable support for SDM845 based Titan 170 ISPs.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Refactor VFE power domain toggling
Robert Foss [Tue, 16 Mar 2021 17:19:21 +0000 (18:19 +0100)]
media: camss: Refactor VFE power domain toggling

For Titan ISPs clocks fail to re-enable during vfe_get()
after any vfe has been halted and its corresponding power
domain power has been detached.

Since all of the clocks depend on all of the PDs, per
VFE PD detaching is no option for Gen2 HW.

In order to not have regressions on for Gen1 HW, refactor
the power domain management into hardware version specific
code paths.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Add support for CSIPHY hardware version Titan 170
Robert Foss [Tue, 16 Mar 2021 17:19:20 +0000 (18:19 +0100)]
media: camss: Add support for CSIPHY hardware version Titan 170

Add register definitions for version 170 of the Titan architecture
and implement support for the CSIPHY subdevice.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Add support for CSID hardware version Titan 170
Robert Foss [Tue, 16 Mar 2021 17:19:19 +0000 (18:19 +0100)]
media: camss: Add support for CSID hardware version Titan 170

Add register definitions for version 170 of the Titan architecture
and implement support for the CSID subdevice.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Refactor CSID HW version support
Robert Foss [Tue, 16 Mar 2021 17:19:18 +0000 (18:19 +0100)]
media: camss: Refactor CSID HW version support

In order to support Qualcomm ISP hardware architectures that diverge
from older architectures, the CSID subdevice drivers needs to be refactored
to better abstract the different ISP hardware architectures.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Add missing format identifiers
Robert Foss [Tue, 16 Mar 2021 17:19:17 +0000 (18:19 +0100)]
media: camss: Add missing format identifiers

The CSI-2 spec defines format identifier for Data Type (DT),
and how the Decode Format (DF) & Encode Format (EF) are implemented.
The spec does however not define the DF, EF or Plain Format (PF)
identifiers, as those are vendor specific.

Plain formats describe the size of the pixels written by the RDI
units to memory. PLAIN8 for example has the size 8 bits, and
PLAIN32 32 bits. The appropriate Plain Format is determined by
the Decode Format used. The smallest Plain Format that is able
to contain a pixel of the used Decode Format is the appropriate
one to use.

As the vendor specific identifiers differ between hardware
generations, split them out into separate headers.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Add support for VFE hardware version Titan 170
Robert Foss [Tue, 16 Mar 2021 17:19:16 +0000 (18:19 +0100)]
media: camss: Add support for VFE hardware version Titan 170

Add register definitions for version 170 of the Titan architecture
and implement support for the RDI output mode.

The RDI mode as opposed to the PIX output mode for the VFE unit does
not support any ISP functionality. This means essentially only
supporting dumping the output of the whatever the CSI decoder receives
from the sensor.

For example will a sensor outputting YUV pixel format frames, only
allow the VFE to dump those frames as they are received by the ISP
to memory through the RDI interface.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Refactor VFE HW version support
Robert Foss [Tue, 16 Mar 2021 17:19:15 +0000 (18:19 +0100)]
media: camss: Refactor VFE HW version support

In order to support Qualcomm ISP hardware architectures that diverge
from older architectures, the VFE subdevice driver needs to be refactored
to better abstract the different ISP architectures.

Gen1 represents the CAMSS ISP architecture. The ISP architecture developed
after CAMSS, Titan, will be referred to as Gen2.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Make ISPIF subdevice optional
Robert Foss [Tue, 16 Mar 2021 17:19:14 +0000 (18:19 +0100)]
media: camss: Make ISPIF subdevice optional

This driver supports multiple architecture versions of the Qualcomm ISP.
The CAMSS architecure which this driver is name after, and with the
introduction of this series, the Titan architecture.

The ISPIF is an IP-block that is only present in the CAMSS generation of
the architecture. In order to support the Titan generation, make the
ISPIF an optional subdevice.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Add CAMSS_845 camss version
Robert Foss [Tue, 16 Mar 2021 17:19:13 +0000 (18:19 +0100)]
media: camss: Add CAMSS_845 camss version

Add enum representing the SDM845 SOC, which incorporates version
170 of the Titan architecture ISP.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Replace trace_printk() with dev_dbg()
Robert Foss [Tue, 16 Mar 2021 17:19:12 +0000 (18:19 +0100)]
media: camss: Replace trace_printk() with dev_dbg()

trace_printk() should not be used in production code,
since extra memory is used for special buffers whenever
trace_puts() is used.

Replace it with dev_dbg() which provides all of the desired
debugging functionality.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Suggested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Fix vfe_isr comment typo
Robert Foss [Tue, 16 Mar 2021 17:19:11 +0000 (18:19 +0100)]
media: camss: Fix vfe_isr comment typo

Comment refers to ISPIF, but this is incorrect. Only
the VFE interrupts are handled by this function.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Fix vfe_isr_comp_done() documentation
Robert Foss [Tue, 16 Mar 2021 17:19:10 +0000 (18:19 +0100)]
media: camss: Fix vfe_isr_comp_done() documentation

Function name in comment is wrong, and was changed to be
the same as the actual function name.

The comment was changed to kerneldoc format.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: radio-si476x: rectify spelling and grammar
Xiaofeng Cao [Thu, 11 Mar 2021 07:20:44 +0000 (08:20 +0100)]
media: radio-si476x: rectify spelling and grammar

Change 'inaccesable' to 'inaccessible'
Change 'detrmine' to 'determine'
Delete 'in' grammatically

Signed-off-by: Xiaofeng Cao <caoxiaofeng@yulong.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camera-mx3: Remove unused header file
Fabio Estevam [Mon, 15 Mar 2021 19:44:46 +0000 (20:44 +0100)]
media: camera-mx3: Remove unused header file

The imx3 camera driver has been removed a long time ago, so get
rid of this unused header file.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camera-mx2: Remove unused header file
Fabio Estevam [Mon, 15 Mar 2021 19:44:45 +0000 (20:44 +0100)]
media: camera-mx2: Remove unused header file

The imx27/imx25 camera driver has been removed a long time ago,
so get rid of this unused header file.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: pci: saa7164: Rudimentary spelling fixes in the file saa7164-types.h
Bhaskar Chowdhury [Mon, 15 Mar 2021 01:39:58 +0000 (02:39 +0100)]
media: pci: saa7164: Rudimentary spelling fixes in the file saa7164-types.h

s/structues/structures/
s/decies/decides/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ext-ctrls-codec.rst: fix typos
Hans Verkuil [Sat, 13 Mar 2021 12:51:19 +0000 (13:51 +0100)]
media: ext-ctrls-codec.rst: fix typos

The _FRAME_SKIP_ enums were missing the _VIDEO prefix.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-ctrls.c: initialize flags field of p_fwht_params
Hans Verkuil [Fri, 12 Mar 2021 08:49:55 +0000 (09:49 +0100)]
media: v4l2-ctrls.c: initialize flags field of p_fwht_params

The V4L2_CID_STATELESS_FWHT_PARAMS compound control was missing a
proper initialization of the flags field, so after loading the vicodec
module for the first time, running v4l2-compliance for the stateless
decoder would fail on this control because the initial control value
was considered invalid by the vicodec driver.

Initializing the flags field to sane values fixes this.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: gspca/sq905.c: fix uninitialized variable
Hans Verkuil [Thu, 11 Mar 2021 14:46:40 +0000 (15:46 +0100)]
media: gspca/sq905.c: fix uninitialized variable

act_len can be uninitialized if usb_bulk_msg() returns an error.
Set it to 0 to avoid a KMSAN error.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: syzbot+a4e309017a5f3a24c7b3@syzkaller.appspotmail.com
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-ioctl.c: fix timestamp format
Hans Verkuil [Thu, 11 Mar 2021 13:07:10 +0000 (14:07 +0100)]
media: v4l2-ioctl.c: fix timestamp format

The timestamp uses microseconds, not nanoseconds, so use %06ld instead
of %09ld.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-dev.c: show which events are requested by poll()
Hans Verkuil [Thu, 11 Mar 2021 13:05:38 +0000 (14:05 +0100)]
media: v4l2-dev.c: show which events are requested by poll()

This helps debugging poll problems.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/usb/gspca/w996Xcf.c: /** -> /*
Hans Verkuil [Thu, 11 Mar 2021 11:20:18 +0000 (12:20 +0100)]
media: media/usb/gspca/w996Xcf.c: /** -> /*

The copyright text is just a comment, not kernel-doc documentation.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: docs: Fix data organization of MEDIA_BUS_FMT_RGB101010_1X30
Liu Ying [Thu, 11 Mar 2021 05:53:47 +0000 (06:53 +0100)]
media: docs: Fix data organization of MEDIA_BUS_FMT_RGB101010_1X30

The media bus bit width of MEDIA_BUS_FMT_RGB101010_1X30 is 30.
So, 'Bit31' and 'Bit30' cells for the 'MEDIA_BUS_FMT_RGB101010_1X30'
row should be spaces instead of '0's.

Fixes: 54f38fcae536 ("media: docs: move uAPI book to userspace-api/media")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/saa7164: fix saa7164_encoder_register() memory leak bugs
Daniel Niv [Thu, 11 Mar 2021 02:53:00 +0000 (03:53 +0100)]
media: media/saa7164: fix saa7164_encoder_register() memory leak bugs

Add a fix for the memory leak bugs that can occur when the
saa7164_encoder_register() function fails.
The function allocates memory without explicitly freeing
it when errors occur.
Add a better error handling that deallocate the unused buffers before the
function exits during a fail.

Signed-off-by: Daniel Niv <danielniv3@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Correct 'so'
Xiaofeng Cao [Wed, 10 Mar 2021 14:58:16 +0000 (15:58 +0100)]
media: Correct 'so'

In Kconfig it should be 'to'
In c8sectpfe-core.c it should be 'do'

Signed-off-by: Xiaofeng Cao <cxfcosmos@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: videobuf2: Explicitly state max size of planes
Ricardo Ribalda [Wed, 10 Mar 2021 10:46:39 +0000 (11:46 +0100)]
media: videobuf2: Explicitly state max size of planes

The plane size needs to be PAGE_ALIGNED, so it is not possible to have
sizes bigger than MAX_INT - PAGE_SIZE.

We already check for overflows when that happen:
 if (size < vb->planes[plane].length)
goto free;

But it is good to explicitly state our max allowed value, in order to
align with the driver expectations.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Add maintainer for IMX jpeg v4l2 driver
Mirela Rabulea [Thu, 11 Mar 2021 00:28:54 +0000 (01:28 +0100)]
media: Add maintainer for IMX jpeg v4l2 driver

The driver is located in drivers/media/platform/imx-jpeg,
and it applies to the JPEG decoder from i.MX QXP and QM.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder
Mirela Rabulea [Thu, 11 Mar 2021 08:53:17 +0000 (09:53 +0100)]
media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder

V4L2 driver for the JPEG encoder/decoder from i.MX8QXP/i.MX8QM application
processors.
The multi-planar buffers API is used.

Baseline and extended sequential jpeg decoding is supported.
Progressive jpeg decoding is not supported by the IP.
Supports encode and decode of various formats:
     YUV444, YUV422, YUV420, RGB, ARGB, Gray
YUV420 is the only multi-planar format supported.
Minimum resolution is 64 x 64, maximum 8192 x 8192.
The alignment requirements for the resolution depend on the format,
multiple of 16 resolutions should work for all formats.

v4l2-compliance tests are passing, including the
streaming tests, "v4l2-compliance -s"

[hverkuil: fix kernel-doc typos]

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Avoid parsing quantization and huffman tables
Mirela Rabulea [Thu, 11 Mar 2021 00:28:51 +0000 (01:28 +0100)]
media: Avoid parsing quantization and huffman tables

These are optional in struct v4l2_jpeg_header, so skip DHT/DQT segment
parsing if huffman_tables/quantization_tables were not requested by user,
to save time.
However, do count them (num_dht/num_dqt).

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Quit parsing stream if doesn't start with SOI
Mirela Rabulea [Thu, 11 Mar 2021 00:28:50 +0000 (01:28 +0100)]
media: Quit parsing stream if doesn't start with SOI

In the case we get an invalid stream, such as from v4l2-compliance
streaming test, jpeg_next_marker will end up parsing the entire
stream. The standard describes the high level syntax of a jpeg
as starting with SOI, ending with EOI, so return error if the very
first 2 bytes are not SOI.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Add parsing for APP14 data segment in jpeg helpers
Mirela Rabulea [Thu, 11 Mar 2021 00:28:49 +0000 (01:28 +0100)]
media: Add parsing for APP14 data segment in jpeg helpers

According to Rec. ITU-T T.872 (06/2012) 6.5.3
APP14 segment is for color encoding, it contains a transform flag, which
may have values of 0, 1 and 2 and are interpreted as follows:
0 - CMYK for images that are encoded with four components
  - RGB for images that are encoded with three components
1 - An image encoded with three components using YCbCr colour encoding.
2 - An image encoded with four components using YCCK colour encoding.

This is used in imx-jpeg decoder, to distinguish between
YUV444 and RGB24.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: Add bindings for i.MX8QXP/QM JPEG driver
Mirela Rabulea [Thu, 11 Mar 2021 00:28:48 +0000 (01:28 +0100)]
media: dt-bindings: Add bindings for i.MX8QXP/QM JPEG driver

Add bindings documentation for i.MX8QXP/QM JPEG decoder & encoder driver.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l: Add packed YUV444 24bpp pixel format
Mirela Rabulea [Thu, 11 Mar 2021 00:28:47 +0000 (01:28 +0100)]
media: v4l: Add packed YUV444 24bpp pixel format

The added format is V4L2_PIX_FMT_YUV24, this is a packed
YUV 4:4:4 format, with 8 bits for each component, 24 bits
per sample.

This format is used by the i.MX 8QuadMax and i.MX 8DualXPlus/8QuadXPlus
JPEG encoder/decoder.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: cec/core/cec-notifier: use IS_REACHABLE(CONFIG_I2C)
Hans Verkuil [Wed, 10 Mar 2021 08:21:32 +0000 (09:21 +0100)]
media: cec/core/cec-notifier: use IS_REACHABLE(CONFIG_I2C)

If CONFIG_I2C=m and CONFIG_CEC_CORE=y then of_find_i2c_device_by_node()
is not reachable. So use IS_REACHABLE instead of IS_ENABLED.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: a62943c145c1 ("media: cec-notifier: also search for HDMI devices on I2C")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media tuner headers: fix kernel-doc warnings
Hans Verkuil [Tue, 9 Mar 2021 12:28:11 +0000 (13:28 +0100)]
media: media tuner headers: fix kernel-doc warnings

Fix the following kernel-doc warnings:

drivers/media/tuners/it913x.h:28: warning: Function parameter or member 'fe' not described in 'it913x_platform_data'
drivers/media/tuners/tda827x.h:34: warning: wrong kernel-doc identifier on line:
 * Attach a tda827x tuner to the supplied frontend structure.
drivers/media/tuners/qt1010.h:20: warning: wrong kernel-doc identifier on line:
 * Attach a qt1010 tuner to the supplied frontend structure.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: vpbe_osd.h/uvcvideo.h includes: fix trivial kernel-doc warnings
Hans Verkuil [Tue, 9 Mar 2021 12:22:37 +0000 (13:22 +0100)]
media: vpbe_osd.h/uvcvideo.h includes: fix trivial kernel-doc warnings

Fix these kernel-doc warnings:

include/media/davinci/vpbe_osd.h:77: warning: Enum value 'PIXFMT_YCBCRI' not described in enum 'osd_pix_format'
include/media/davinci/vpbe_osd.h:77: warning: Enum value 'PIXFMT_YCRCBI' not described in enum 'osd_pix_format'
include/media/davinci/vpbe_osd.h:77: warning: Excess enum value 'PIXFMT_YCrCbI' description in 'osd_pix_format'
include/media/davinci/vpbe_osd.h:77: warning: Excess enum value 'PIXFMT_YCbCrI' description in 'osd_pix_format'
include/media/davinci/vpbe_osd.h:232: warning: expecting prototype for enum davinci_cursor_v_width. Prototype was for enum
osd_cursor_v_width instead
include/uapi/linux/uvcvideo.h:98: warning: Function parameter or member 'ns' not described in 'uvc_meta_buf'
include/uapi/linux/uvcvideo.h:98: warning: Function parameter or member 'sof' not described in 'uvc_meta_buf'
include/uapi/linux/uvcvideo.h:98: warning: Function parameter or member 'length' not described in 'uvc_meta_buf'
include/uapi/linux/uvcvideo.h:98: warning: Function parameter or member 'flags' not described in 'uvc_meta_buf'
include/uapi/linux/uvcvideo.h:98: warning: Function parameter or member 'buf' not described in 'uvc_meta_buf'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/i2c: fix kerneldoc issues for media i2c headers
Hans Verkuil [Tue, 9 Mar 2021 12:17:10 +0000 (13:17 +0100)]
media: media/i2c: fix kerneldoc issues for media i2c headers

This fixes these kernel-doc warnings:

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI1A' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI1B' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI1C' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI2A' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI2B' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI2C' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI3A' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI3B' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI3C' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI4A' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI2A_VI1A' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI2B_VI1B' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI2C_VI1C' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI2A_VI3A' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI2B_VI3B' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI2C_VI3C' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI4A_VI1A' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI4A_VI1B' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI4A_VI1C' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI4A_VI3A' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI4A_VI3B' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI4A_VI3C' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_INVALID' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:82: warning: Enum value 'OUTPUT_10BIT_422_EMBEDDED_SYNC' not described in enum 'tvp514x_output'
include/media/i2c/tvp514x.h:82: warning: Enum value 'OUTPUT_20BIT_422_SEPERATE_SYNC' not described in enum 'tvp514x_output'
include/media/i2c/tvp514x.h:82: warning: Enum value 'OUTPUT_10BIT_422_SEPERATE_SYNC' not described in enum 'tvp514x_output'
include/media/i2c/tvp514x.h:82: warning: Enum value 'OUTPUT_INVALID' not described in enum 'tvp514x_output'
include/media/i2c/adv7343.h:38: warning: cannot understand function prototype: 'struct adv7343_power_mode '
include/media/i2c/s5k4ecgx.h:31: warning: expecting prototype for struct ss5k4ecgx_platform_data. Prototype was for struct
s5k4ecgx_platform_data instead
include/media/i2c/mt9t112.h:21: warning: cannot understand function prototype: 'struct mt9t112_platform_data '
include/media/i2c/noon010pc30.h:13: warning: Cannot understand  * @clk_rate: the clock frequency in Hz
include/media/i2c/s5k6aa.h:45: warning: Function parameter or member 'bus_type' not described in 's5k6aa_platform_data'
include/media/i2c/tw9910.h:19: warning: cannot understand function prototype: 'enum tw9910_mpout_pin '
include/media/i2c/tw9910.h:36: warning: cannot understand function prototype: 'struct tw9910_video_info '
include/media/i2c/ov772x.h:53: warning: cannot understand function prototype: 'struct ov772x_camera_info '
include/media/i2c/s5c73m3.h:53: warning: Function parameter or member 'bus_type' not described in 's5c73m3_platform_data'
drivers/media/i2c/ccs/ccs-quirk.h:50: warning: Function parameter or member 'post_streamoff' not described in 'ccs_quirk'
drivers/media/i2c/ccs/ccs-quirk.h:50: warning: Function parameter or member 'flags' not described in 'ccs_quirk'
drivers/media/i2c/ccs/ccs-data.h:144: warning: expecting prototype for struct ccs_pdaf_pix_loc_block_desc. Prototype was for struct
ccs_pdaf_pix_loc_pixel_desc instead
drivers/media/i2c/tvp514x_regs.h:272: warning: Function parameter or member 'token' not described in 'tvp514x_reg'
drivers/media/i2c/tvp514x_regs.h:272: warning: Function parameter or member 'reg' not described in 'tvp514x_reg'
drivers/media/i2c/tvp514x_regs.h:272: warning: Function parameter or member 'val' not described in 'tvp514x_reg'
drivers/media/i2c/m5mols/m5mols.h:69: warning: Function parameter or member 'brightness' not described in 'm5mols_exif'
drivers/media/i2c/m5mols/m5mols.h:147: error: Cannot parse struct or union!
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN0' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN1' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN2' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN3' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN4' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN5' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN6' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN7' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_HDMI' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_TTL' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_TXA' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_TXB' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_MAX' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:199: warning: Function parameter or member 'i2c_clients' not described in 'adv748x_state'
drivers/media/i2c/adv748x/adv748x.h:199: warning: Function parameter or member 'regmap' not described in 'adv748x_state'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/pci: fix kerneldoc issues in two headers
Hans Verkuil [Tue, 9 Mar 2021 12:15:36 +0000 (13:15 +0100)]
media: media/pci: fix kerneldoc issues in two headers

This fixes these kerneldoc warnings:

drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'v4l2_dev' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'snd_card' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'name' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'type' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'dma_mode' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'pci_dev' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'mmio' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'dma_ops' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'video_channels' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'audio_channels' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'audio_rate' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'period_size' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'audio_enabled' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'dma_delay_timer' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'pending_dma_en' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'pending_dma_cmd' not described in 'tw686x_dev'
drivers/media/pci/sta2x11/sta2x11_vip.h:25: warning: Function parameter or member 'i2c_id' not described in 'vip_config'
drivers/media/pci/sta2x11/sta2x11_vip.h:25: warning: Function parameter or member 'i2c_addr' not described in 'vip_config'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: core headers: fix kernel-doc warnings
Hans Verkuil [Tue, 9 Mar 2021 11:48:20 +0000 (12:48 +0100)]
media: core headers: fix kernel-doc warnings

This patch fixes the following kernel-doc warnings:

include/uapi/linux/videodev2.h:996: warning: Function parameter or member 'm' not described in 'v4l2_plane'
include/uapi/linux/videodev2.h:996: warning: Function parameter or member 'reserved' not described in 'v4l2_plane'
include/uapi/linux/videodev2.h:1057: warning: Function parameter or member 'm' not described in 'v4l2_buffer'
include/uapi/linux/videodev2.h:1057: warning: Function parameter or member 'reserved2' not described in 'v4l2_buffer'
include/uapi/linux/videodev2.h:1057: warning: Function parameter or member 'reserved' not described in 'v4l2_buffer'
include/uapi/linux/videodev2.h:1068: warning: Function parameter or member 'tv' not described in 'v4l2_timeval_to_ns'
include/uapi/linux/videodev2.h:1068: warning: Excess function parameter 'ts' description in 'v4l2_timeval_to_ns'
include/uapi/linux/videodev2.h:1138: warning: Function parameter or member 'reserved' not described in 'v4l2_exportbuffer'
include/uapi/linux/videodev2.h:2237: warning: Function parameter or member 'reserved' not described in 'v4l2_plane_pix_format'
include/uapi/linux/videodev2.h:2270: warning: Function parameter or member 'hsv_enc' not described in 'v4l2_pix_format_mplane'
include/uapi/linux/videodev2.h:2270: warning: Function parameter or member 'reserved' not described in 'v4l2_pix_format_mplane'
include/uapi/linux/videodev2.h:2281: warning: Function parameter or member 'reserved' not described in 'v4l2_sdr_format'
include/uapi/linux/videodev2.h:2315: warning: Function parameter or member 'fmt' not described in 'v4l2_format'

include/uapi/linux/v4l2-subdev.h:53: warning: Function parameter or member 'reserved' not described in 'v4l2_subdev_format'
include/uapi/linux/v4l2-subdev.h:66: warning: Function parameter or member 'reserved' not described in 'v4l2_subdev_crop'
include/uapi/linux/v4l2-subdev.h:89: warning: Function parameter or member 'reserved' not described in 'v4l2_subdev_mbus_code_enum'
include/uapi/linux/v4l2-subdev.h:108: warning: Function parameter or member 'min_width' not described in 'v4l2_subdev_frame_size_enum'
include/uapi/linux/v4l2-subdev.h:108: warning: Function parameter or member 'max_width' not described in 'v4l2_subdev_frame_size_enum'
include/uapi/linux/v4l2-subdev.h:108: warning: Function parameter or member 'min_height' not described in 'v4l2_subdev_frame_size_enum'
include/uapi/linux/v4l2-subdev.h:108: warning: Function parameter or member 'max_height' not described in 'v4l2_subdev_frame_size_enum'
include/uapi/linux/v4l2-subdev.h:108: warning: Function parameter or member 'reserved' not described in 'v4l2_subdev_frame_size_enum'
include/uapi/linux/v4l2-subdev.h:119: warning: Function parameter or member 'reserved' not described in 'v4l2_subdev_frame_interval'
include/uapi/linux/v4l2-subdev.h:140: warning: Function parameter or member 'reserved' not described in 'v4l2_subdev_frame_interval_enum'

include/uapi/linux/cec.h:406: warning: Function parameter or member 'raw' not described in 'cec_connector_info'
include/uapi/linux/cec.h:470: warning: Function parameter or member 'flags' not described in 'cec_event'

include/media/v4l2-h264.h:82: warning: Function parameter or member 'reflist' not described in 'v4l2_h264_build_p_ref_list'
include/media/v4l2-h264.h:82: warning: expecting prototype for v4l2_h264_build_b_ref_lists(). Prototype was for v4l2_h264_build_p_ref_list()
instead

include/media/cec.h:50: warning: Function parameter or member 'lock' not described in 'cec_devnode'

include/media/v4l2-jpeg.h:122: warning: Function parameter or member 'num_dht' not described in 'v4l2_jpeg_header'
include/media/v4l2-jpeg.h:122: warning: Function parameter or member 'num_dqt' not described in 'v4l2_jpeg_header'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ext-ctrls-codec.rst: clarify V4L2_CID_MPEG_VIDEO_BITRATE
Hans Verkuil [Tue, 9 Mar 2021 07:43:33 +0000 (08:43 +0100)]
media: ext-ctrls-codec.rst: clarify V4L2_CID_MPEG_VIDEO_BITRATE

The documentation for V4L2_CID_MPEG_VIDEO_BITRATE was missing the word
'Average': this is the average video bitrate.

The V4L2_CID_MPEG_VIDEO_BITRATE_PEAK documentation *does* refer to
V4L2_CID_MPEG_VIDEO_BITRATE as the average video bitrate.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: m88ds3103: fix return value check in m88ds3103_probe()
Wei Yongjun [Mon, 8 Mar 2021 12:28:02 +0000 (13:28 +0100)]
media: m88ds3103: fix return value check in m88ds3103_probe()

In case of error, the function i2c_new_dummy_device() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Fixes: e6089feca460 ("media: m88ds3103: Add support for ds3103b demod")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: tuners: fix error return code of hybrid_tuner_request_state()
Jia-Ju Bai [Sat, 6 Mar 2021 14:30:28 +0000 (15:30 +0100)]
media: tuners: fix error return code of hybrid_tuner_request_state()

When kzalloc() fails and state is NULL, no error return code is
assigned.
To fix this bug, __ret is assigned with -ENOMEM in this case.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>