platform/kernel/linux-rpi.git
3 years agomedia: s5p-mfc/s5p_mfc_common.h: fix kernel-doc warnings
Hans Verkuil [Tue, 23 Mar 2021 14:31:26 +0000 (15:31 +0100)]
media: s5p-mfc/s5p_mfc_common.h: fix kernel-doc warnings

Trivial fixes for many kernel-doc warnings. Most of the comments before
enums or struct can just be that: regular comments.

So just change /** to /*.

In one remaining case it was just a wrong construct: @mem_dev[] -> @mem_dev

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx-jpeg: Pass the v4l2_jpeg_header header argument by reference
Colin Ian King [Tue, 23 Mar 2021 14:24:21 +0000 (15:24 +0100)]
media: imx-jpeg: Pass the v4l2_jpeg_header header argument by reference

Currently the header argument is being passed by value, so a copy of 256
byte structure on the stack is potentially occurring. Fix this by passing
by reference to avoid any large stack copies.

Addresses-Coverity: ("Big parameter passed by value")

Fixes: 2db16c6ed72c ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: hantro: fix kernel-doc warnings and style
Ezequiel Garcia [Tue, 23 Mar 2021 12:07:46 +0000 (13:07 +0100)]
media: hantro: fix kernel-doc warnings and style

Add a description for enum values in hantro_enc_fmt,
in order to fix these warnings:

drivers/staging/media/hantro/hantro_hw.h:149: warning: Enum value 'RK3288_VPU_ENC_FMT_YUV420P' not described in enum 'hantro_enc_fmt'
drivers/staging/media/hantro/hantro_hw.h:149: warning: Enum value 'RK3288_VPU_ENC_FMT_YUV420SP' not described in enum 'hantro_enc_fmt'
drivers/staging/media/hantro/hantro_hw.h:149: warning: Enum value 'RK3288_VPU_ENC_FMT_YUYV422' not described in enum 'hantro_enc_fmt'
drivers/staging/media/hantro/hantro_hw.h:149: warning: Enum value 'RK3288_VPU_ENC_FMT_UYVY422' not described in enum 'hantro_enc_fmt'

While here, improve the kernel-doc style, adding an empty
line before the fields of the structs.

Signed-off-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: imx-jpeg: Fix return value check in mxc_jpeg_attach_pm_domains()
Wei Yongjun [Tue, 23 Mar 2021 11:29:03 +0000 (12:29 +0100)]
media: imx-jpeg: Fix return value check in mxc_jpeg_attach_pm_domains()

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

Fixes: 2db16c6ed72c ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder")
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: imx-jpeg: Fix error return code in mxc_jpeg_probe()
Wei Yongjun [Tue, 23 Mar 2021 11:28:55 +0000 (12:28 +0100)]
media: imx-jpeg: Fix error return code in mxc_jpeg_probe()

Fix to return negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 2db16c6ed72c ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder")
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: rkisp1: uapi: document which flags/structs relate to statistics config
Dafna Hirschfeld [Tue, 23 Mar 2021 09:22:11 +0000 (10:22 +0100)]
media: rkisp1: uapi: document which flags/structs relate to statistics config

Modify the documentation to point out which flags and structs are
used to configure the statistics.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx-jpeg: Fix spelling mistake "Canot" -> "Cannot"
Colin Ian King [Tue, 23 Mar 2021 09:21:41 +0000 (10:21 +0100)]
media: imx-jpeg: Fix spelling mistake "Canot" -> "Cannot"

There is a spelling mistake in a dev_err message. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: exynos4-is: fix kernel-doc warnings
Hans Verkuil [Tue, 23 Mar 2021 09:15:08 +0000 (10:15 +0100)]
media: exynos4-is: fix kernel-doc warnings

Fixes these kernel-doc warnings:

drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 've' not described in 'fimc_is_video'
drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'buf_count' not described in 'fimc_is_video'
drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'buf_mask' not described in 'fimc_is_video'
drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'streaming' not described in 'fimc_is_video'
drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'buffers' not described in 'fimc_is_video'
drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'pixfmt' not described in 'fimc_is_video'
drivers/media/platform/exynos4-is/fimc-isp.h:176: warning: Function parameter or member 'src_fmt' not described in 'fimc_isp'
drivers/media/platform/exynos4-is/fimc-isp.h:176: warning: Function parameter or member 'sink_fmt' not described in 'fimc_isp'
drivers/media/platform/exynos4-is/fimc-isp.h:176: warning: Function parameter or member 'subdev_lock' not described in 'fimc_isp'
drivers/media/platform/exynos4-is/fimc-lite.h:178: warning: Function parameter or member 'events' not described in 'fimc_lite'
drivers/media/platform/exynos4-is/fimc-lite.h:178: warning: Function parameter or member 'streaming' not described in 'fimc_lite'
drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'wbclk' not described in 'fimc_md'
drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'fimc_lite' not described in 'fimc_md'
drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'clk_provider' not described in 'fimc_md'
drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'subdev_notifier' not described in 'fimc_md'
drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'pipelines' not described in 'fimc_md'
drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'link_setup_graph' not described in 'fimc_md'
drivers/media/platform/exynos4-is/fimc-core.h:261: warning: Function parameter or member 'alpha' not described in 'fimc_frame'
drivers/media/platform/exynos4-is/fimc-core.h:321: warning: Function parameter or member 'streaming' not described in 'fimc_vid_cap'
drivers/media/platform/exynos4-is/fimc-core.h:429: warning: Function parameter or member 'drv_data' not described in 'fimc_dev'
drivers/media/platform/exynos4-is/fimc-core.h:495: warning: Function parameter or member 'in_order_1p' not described in 'fimc_ctx'
drivers/media/platform/exynos4-is/fimc-core.h:673: warning: Function parameter or member 'vid_cap' not described in 'fimc_active_queue_add'
drivers/media/platform/exynos4-is/fimc-core.h:685: warning: Function parameter or member 'vid_cap' not described in 'fimc_active_queue_pop'
drivers/media/platform/exynos4-is/fimc-core.h:700: warning: Function parameter or member 'vid_cap' not described in 'fimc_pending_queue_add'
drivers/media/platform/exynos4-is/fimc-core.h:711: warning: Function parameter or member 'vid_cap' not described in 'fimc_pending_queue_pop'
drivers/media/platform/exynos4-is/fimc-reg.h:333: warning: Function parameter or member 'dev' not described in 'fimc_hw_set_dma_seq'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: exynos-gsc/gsc-core.h: fix kernel-doc warnings
Hans Verkuil [Tue, 23 Mar 2021 08:52:31 +0000 (09:52 +0100)]
media: exynos-gsc/gsc-core.h: fix kernel-doc warnings

Fixes these kernel-doc warnings:

drivers/media/platform/exynos-gsc/gsc-core.h:76: warning: Enum value 'GSC_MIXER' not described in enum 'gsc_datapath'
drivers/media/platform/exynos-gsc/gsc-core.h:76: warning: Enum value 'GSC_FIMD' not described in enum 'gsc_datapath'
drivers/media/platform/exynos-gsc/gsc-core.h:76: warning: Excess enum value 'GSC_LOCAL' description in 'gsc_datapath'
drivers/media/platform/exynos-gsc/gsc-core.h:124: warning: Function parameter or member 'color' not described in 'gsc_fmt'
drivers/media/platform/exynos-gsc/gsc-core.h:124: warning: Function parameter or member 'num_comp' not described in 'gsc_fmt'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'pix_max' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'pix_min' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'pix_align' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'in_buf_cnt' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'out_buf_cnt' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'sc_up_max' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'sc_down_max' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'poly_sc_down_max' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'pre_sc_down_max' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'local_sc_down' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:310: warning: Function parameter or member 'clk_names' not described in 'gsc_driverdata'
drivers/media/platform/exynos-gsc/gsc-core.h:310: warning: Function parameter or member 'num_clocks' not described in 'gsc_driverdata'
drivers/media/platform/exynos-gsc/gsc-core.h:340: warning: Function parameter or member 'num_clocks' not described in 'gsc_dev'
drivers/media/platform/exynos-gsc/gsc-core.h:340: warning: Function parameter or member 'v4l2_dev' not described in 'gsc_dev'
drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'rotation' not described in 'gsc_ctx'
drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'hflip' not described in 'gsc_ctx'
drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'vflip' not described in 'gsc_ctx'
drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'gsc_ctrls' not described in 'gsc_ctx'
drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'out_colorspace' not described in 'gsc_ctx'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: s5p-jpeg/jpeg-core.h: fix kernel-doc warnings
Hans Verkuil [Tue, 23 Mar 2021 08:39:16 +0000 (09:39 +0100)]
media: s5p-jpeg/jpeg-core.h: fix kernel-doc warnings

Fixes these warnings:

drivers/media/platform/s5p-jpeg/jpeg-core.h:136: warning: Function parameter or member 'irq_ret' not described in 's5p_jpeg'
drivers/media/platform/s5p-jpeg/jpeg-core.h:136: warning: Function parameter or member 'irq_status' not described in 's5p_jpeg'
drivers/media/platform/s5p-jpeg/jpeg-core.h:168: warning: Function parameter or member 'memplanes' not described in 's5p_jpeg_fmt'
drivers/media/platform/s5p-jpeg/jpeg-core.h:168: warning: Function parameter or member 'subsampling' not described in 's5p_jpeg_fmt'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: s3c-camif/camif-core.h: fix kernel-doc warnings
Hans Verkuil [Tue, 23 Mar 2021 08:26:10 +0000 (09:26 +0100)]
media: s3c-camif/camif-core.h: fix kernel-doc warnings

Fixes these warnings:

drivers/media/platform/s3c-camif/camif-core.h:156: warning: Function parameter or member 'pix_limits' not described in 's3c_camif_variant'
drivers/media/platform/s3c-camif/camif-core.h:156: warning: Function parameter or member 'has_img_effect' not described in 's3c_camif_variant'
drivers/media/platform/s3c-camif/camif-core.h:156: warning: Function parameter or member 'vp_offset' not described in 's3c_camif_variant'
drivers/media/platform/s3c-camif/camif-core.h:232: warning: Function parameter or member 'vdev' not described in 'camif_vp'
drivers/media/platform/s3c-camif/camif-core.h:232: warning: Function parameter or member 'vb_queue' not described in 'camif_vp'
drivers/media/platform/s3c-camif/camif-core.h:232: warning: Function parameter or member 'offset' not described in 'camif_vp'
drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'ctrl_test_pattern' not described in 'camif_dev'
drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'ctrl_colorfx' not described in 'camif_dev'
drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'ctrl_colorfx_cbcr' not described in 'camif_dev'
drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'colorfx' not described in 'camif_dev'
drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'colorfx_cb' not described in 'camif_dev'
drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'colorfx_cr' not described in 'camif_dev'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: allegro-dvt/nal-h264.h: fix kernel-doc: hdr -> hrd
Hans Verkuil [Tue, 23 Mar 2021 07:49:13 +0000 (08:49 +0100)]
media: allegro-dvt/nal-h264.h: fix kernel-doc: hdr -> hrd

Give typo in kernel-doc documentation: hdr -> hrd

Fixes this warning:

drivers/media/platform/allegro-dvt/nal-h264.h:33: warning: expecting prototype for struct nal_h264_hdr_parameters. Prototype was for struct
nal_h264_hrd_parameters instead

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: fix a typo
Bhaskar Chowdhury [Mon, 22 Mar 2021 02:24:31 +0000 (03:24 +0100)]
media: atomisp: fix a typo

s/Sysytem/System/

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: atomisp: remove duplicate include in sh_css
Zhang Yunkai [Sat, 6 Mar 2021 12:11:04 +0000 (13:11 +0100)]
media: atomisp: remove duplicate include in sh_css

'ia_css_isys.h' included in 'sh_css.c' is duplicated.
It is also included in the 30th line.

Link: https://lore.kernel.org/linux-media/20210306121104.218696-1-zhang.yunkai@zte.com.cn
Signed-off-by: Zhang Yunkai <zhang.yunkai@zte.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: atomisp: reduce kernel stack usage
Arnd Bergmann [Fri, 26 Feb 2021 14:05:02 +0000 (15:05 +0100)]
media: staging: atomisp: reduce kernel stack usage

The atomisp_set_fmt() function has multiple copies of the large
v4l2_format structure on its stack, resulting in a warning about
excessive stack usage in some rare randconfig builds.

drivers/staging/media/atomisp/pci/atomisp_cmd.c:5600:5: error: stack frame size of 1084 bytes in function 'atomisp_set_fmt' [-Werror,-Wframe-larger-than=]

Of this structure, only three members in the 'fmt.pix' member are
used, so simplify it by using the smaller v4l2_pix_format structure
directly. This reduces the stack usage to 612 bytes, and it could
be reduced further by only storing the three members that are used.

Link: https://lore.kernel.org/linux-media/20210226140524.3478346-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: omap4iss: code style - avoid macro argument precedence issues
Nikolay Kyx [Sun, 21 Feb 2021 19:53:08 +0000 (20:53 +0100)]
media: staging: media: omap4iss: code style - avoid macro argument precedence issues

This patch fixes the following checkpatch.pl check:

CHECK: Macro argument 'i' may be better as '(i)' to avoid precedence issues

in file iss_regs.h

Link: https://lore.kernel.org/linux-media/20210221195308.1451-1-knv418@gmail.com
Signed-off-by: Nikolay Kyx <knv418@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: ipu3: code style fix - missing a blank line after declarations
Nikolay Kyx [Sun, 21 Feb 2021 08:12:36 +0000 (09:12 +0100)]
media: staging: media: ipu3: code style fix - missing a blank line after declarations

This patch fixes the following checkpatch.pl warning:

WARNING: Missing a blank line after declarations

in file ipu3-css-fw.h

Link: https://lore.kernel.org/linux-media/20210221081236.9758-2-knv418@gmail.com
Signed-off-by: Nikolay Kyx <knv418@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media/atomisp: don't compile unused code
karthik alapati [Sat, 20 Feb 2021 14:16:27 +0000 (15:16 +0100)]
media: staging: media/atomisp: don't compile unused code

currently the functions defined in ibuf_ctrl_rmgr.c file are only
used by isys_init.c when CONFIG_VIDEO_ATOMISP_ISP2401 is selected
so dont't compile it when not needed, also fixes some sparse warnings

Link: https://lore.kernel.org/linux-media/YDEZu3oniT/vUMMY@karthik-strix-linux.karthek.com
Signed-off-by: karthik alapati <mail@karthek.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: do not free kmalloc memory by vfree
Jiri Slaby [Fri, 19 Feb 2021 10:12:16 +0000 (11:12 +0100)]
media: atomisp: do not free kmalloc memory by vfree

fw_minibuffer[i].buffer is allocated by kmalloc in sh_css_load_blob_info
and by vmalloc in setup_binary. So use kvfree to decide which of those
allocators to use for freeing.

Also remove the useless cast.

Link: https://lore.kernel.org/linux-media/20210219101216.28406-1-jslaby@suse.cz
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: auto-select VIDEO_V4L2_SUBDEV_API
Tong Zhang [Wed, 10 Feb 2021 03:38:30 +0000 (04:38 +0100)]
media: atomisp: auto-select VIDEO_V4L2_SUBDEV_API

VIDEO_ATOMISP depends on VIDEO_V4L2_SUBDEV_API, if VIDEO_V4L2_SUBDEV_API
 is not selected, it will cause compilation error

drivers/staging/media/atomisp/pci/atomisp_cmd.c:6079:42: error:
 ‘struct v4l2_subdev_fh’ has no member named ‘pad’ atomisp_subdev_set_ffmt
(&asd->subdev, fh.pad, V4L2_SUBDEV_FORMAT_ACTIVE,

add auto select VIDEO_V4L2_SUBDEV_API if VIDEO_ATOMISP is selected

Link: https://lore.kernel.org/linux-media/20210210033830.961086-1-ztong0001@gmail.com
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: remove redundant NULL check
Yang Li [Thu, 21 Jan 2021 09:11:52 +0000 (10:11 +0100)]
media: atomisp: remove redundant NULL check

Fix below warnings reported by coccicheck:
./drivers/staging/media/atomisp/pci/atomisp_cmd.c:4269:2-8: WARNING:
NULL check before some freeing functions is not needed.
./drivers/staging/media/atomisp/pci/atomisp_cmd.c:4626:2-8: WARNING:
NULL check before some freeing functions is not needed.

Link: https://lore.kernel.org/linux-media/1611220312-89384-3-git-send-email-abaci-bugfix@linux.alibaba.com
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: remove redundant NULL check
Yang Li [Thu, 21 Jan 2021 08:28:51 +0000 (09:28 +0100)]
media: atomisp: remove redundant NULL check

Fix below warnings reported by coccicheck:
./drivers/staging/media/atomisp/pci/sh_css_params.c:1575:2-8: WARNING:
NULL check before some freeing functions is not needed.
./drivers/staging/media/atomisp/pci/sh_css_params.c:3006:2-8: WARNING:
NULL check before some freeing functions is not needed.

Link: https://lore.kernel.org/linux-media/1611217731-56866-1-git-send-email-abaci-bugfix@linux.alibaba.com
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: fix Wvisiblity warning
Arnd Bergmann [Fri, 8 Jan 2021 08:23:28 +0000 (09:23 +0100)]
media: atomisp: fix Wvisiblity warning

Some randconfig builds include ia_css_firmware.h without first
including linux/device.h:

In file included from atomisp/pci/mmu/sh_mmu_mrfld.c:23:
In file included from atomisp/pci/atomisp_compat.h:22:
In file included from atomisp/pci/atomisp_compat_css20.h:24:
In file included from atomisp/pci/ia_css.h:28:
In file included from atomisp/pci/ia_css_control.h:25:
drivers/staging/media/atomisp//pci/ia_css_firmware.h:52:29: error: declaration of 'struct device' will not be visible outside of this function [-Werror,-Wvisibility]

Add a forward declaration to avoid the warning.

Link: https://lore.kernel.org/linux-media/20210108082337.2305938-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: ov2722: remove unnecessary debug print
Filip Kolev [Wed, 6 Jan 2021 18:11:05 +0000 (19:11 +0100)]
media: atomisp: ov2722: remove unnecessary debug print

checkpatch.pl emits the following warning:

WARNING: Prefer using '"%s...", __func__' to using 'ov2722_remove', this function's name, in a string
+ dev_dbg(&client->dev, "ov2722_remove...\n");

This is just a "trace" call and therefore should be removed entirely;
ftrace should be used instead.

Link: https://lore.kernel.org/linux-media/20210106181158.2270-1-fil.kolev@gmail.com
Signed-off-by: Filip Kolev <fil.kolev@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/siano: Fix transmission parameters reporting for ISDB-T
Nicolas Stuardo Diaz [Tue, 22 Dec 2020 03:05:23 +0000 (04:05 +0100)]
media: media/siano: Fix transmission parameters reporting for ISDB-T

The currently used functions for converting the transmission mode and guard
interval from the internal values to the DVBv5 API values do not return
correct values for ISDB broadcasts:

- The raw (debugfs) transmission mode is an integer whose values can be
1, 2 or 3, that corresponds to 2K, 4K and 8K FFT modes respectively.
However sms_to_mode() expects values 2, 4 or 8.
- Guard interval, as defined by smscoreapi.h returns "1 divided by value"
instead of 0, 1, 2, and 3 as defined in sms_to_guard_interval_table().

This commit implements ISDB-T specific methods for converting the internal
values for the aforementioned parameters to the DVBv5 API values. It also
adds support for reporting FEC and time interleaving values for each one
of the layers.

[mchehab: fix two coding style whitespace warnings]
Link: https://lore.kernel.org/linux-media/20201222030522.28774-1-nicolasstuardodiaz@gmail.com
Signed-off-by: Nicolas Stuardo Diaz <nicolasstuardodiaz@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camera-sensor.rst: fix c:function build warning
Mauro Carvalho Chehab [Tue, 23 Mar 2021 07:08:56 +0000 (08:08 +0100)]
media: camera-sensor.rst: fix c:function build warning

The :c:function: tag evaluation depends on Sphinx version 2 or 3.
Use a syntax that should work with both versions.

Link: https://lore.kernel.org/linux-media/e4214991b7d59c0d7aa4e6e48833dc1809c47d47.1616484262.git.mchehab+huawei@kernel.org
Fixes: c0e3bcb25390 ("media: camera-sensor.rst: fix a doc build warning")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dvbdev: Fix memory leak in dvb_media_device_free()
Peilin Ye [Fri, 11 Dec 2020 08:30:39 +0000 (09:30 +0100)]
media: dvbdev: Fix memory leak in dvb_media_device_free()

dvb_media_device_free() is leaking memory. Free `dvbdev->adapter->conn`
before setting it to NULL, as documented in include/media/media-device.h:
"The media_entity instance itself must be freed explicitly by the driver
if required."

Link: https://syzkaller.appspot.com/bug?id=9bbe4b842c98f0ed05c5eed77a226e9de33bf298
Link: https://lore.kernel.org/linux-media/20201211083039.521617-1-yepeilin.cs@gmail.com
Cc: stable@vger.kernel.org
Fixes: 0230d60e4661 ("[media] dvbdev: Add RF connector if needed")
Reported-by: syzbot+7f09440acc069a0d38ac@syzkaller.appspotmail.com
Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Remove redundant NULL check
Xu Wang [Fri, 25 Dec 2020 08:45:24 +0000 (09:45 +0100)]
media: atomisp: Remove redundant NULL check

./drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c:390:2-8: WARNING: NULL check before some freeing functions is not needed.

Link: https://lore.kernel.org/linux-media/20201225084524.64839-1-vulab@iscas.ac.cn
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Remove redundant NULL check
Xu Wang [Fri, 25 Dec 2020 08:38:18 +0000 (09:38 +0100)]
media: atomisp: Remove redundant NULL check

Fix warnings reported by coccicheck:
./drivers/staging/media/atomisp/pci/runtime/isp_param/src/isp_param.c:159:4-10: WARNING: NULL check before some freeing functions is not needed.

Link: https://lore.kernel.org/linux-media/20201225083818.64588-1-vulab@iscas.ac.cn
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: replace boolean comparison of values with bool variables
Aditya Srivastava [Mon, 14 Dec 2020 13:27:16 +0000 (14:27 +0100)]
media: atomisp: replace boolean comparison of values with bool variables

There are certain expressions in a condition in atomisp, where a boolean
variable is compared with true/false in forms such as (foo == true)
or (false != bar), which does not comply with the coding style rule by
checkpatch.pl (CHK: BOOL_COMPARISON), according to which the boolean
variables should be themselves used in the condition, rather than
comparing with true or false.

E.g. In drivers/staging/media/atomisp/pci/atomisp_compat_css20.c:

if (asd->stream_prepared == false) {

Can be replaced with:
if (!asd->stream_prepared) {

Replace such expressions with boolean variables appropriately.

Link: https://lore.kernel.org/linux-media/20201214132716.28157-1-yashsri421@gmail.com
Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Fix use after free in atomisp_alloc_css_stat_bufs()
Dan Carpenter [Mon, 14 Dec 2020 11:53:31 +0000 (12:53 +0100)]
media: atomisp: Fix use after free in atomisp_alloc_css_stat_bufs()

The "s3a_buf" is freed along with all the other items on the
"asd->s3a_stats" list.  It leads to a double free and a use after free.

Link: https://lore.kernel.org/linux-media/X9dSO3RGf7r0pq2k@mwanda
Fixes: ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Write function decleration in one line
Philipp Gerlesberger [Mon, 14 Dec 2020 11:03:57 +0000 (12:03 +0100)]
media: atomisp: Write function decleration in one line

CHECK:OPEN_ENDED_LINE: Lines should not end with a '('
WARNING:LEADING_SPACE: please, no spaces at the start of a line
Avoid these errors by writing the function decleration in one line.

Link: https://lore.kernel.org/linux-media/20201214110358.7102-12-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: Fix BLOCK_COMMENT_STYLE
Philipp Gerlesberger [Mon, 14 Dec 2020 11:01:54 +0000 (12:01 +0100)]
media: atomisp: Fix BLOCK_COMMENT_STYLE

Block comments should align the * on each line

Link: https://lore.kernel.org/linux-media/20201214110156.6152-11-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: Fix PARENTHESIS_ALIGNMENT
Philipp Gerlesberger [Mon, 14 Dec 2020 11:01:53 +0000 (12:01 +0100)]
media: atomisp: Fix PARENTHESIS_ALIGNMENT

You can sum up the two lines, because the maximum line length of
100 columns is not exceeded.

Link: https://lore.kernel.org/linux-media/20201214110156.6152-10-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: Delete braces
Philipp Gerlesberger [Mon, 14 Dec 2020 11:01:52 +0000 (12:01 +0100)]
media: atomisp: Delete braces

WARNING:BRACES: braces {} are not necessary for single statement blocks

Link: https://lore.kernel.org/linux-media/20201214110156.6152-9-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: Fix funciton decleration
Philipp Gerlesberger [Mon, 14 Dec 2020 11:01:51 +0000 (12:01 +0100)]
media: atomisp: Fix funciton decleration

Write return_type, function_name and parameters in one line
because lines should not end with a '(' [OPEN_ENDED_LINE]
Write open brace ’{’ on the next line to fix OPEN_BRACE Error

Link: https://lore.kernel.org/linux-media/20201214110156.6152-8-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: Fix overlong line
Philipp Gerlesberger [Mon, 14 Dec 2020 11:01:49 +0000 (12:01 +0100)]
media: atomisp: Fix overlong line

Line length of 105 exceeds 100 columns.

Link: https://lore.kernel.org/linux-media/20201214110156.6152-6-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: Fix OPEN_ENDED_LINE
Philipp Gerlesberger [Mon, 14 Dec 2020 11:01:48 +0000 (12:01 +0100)]
media: atomisp: Fix OPEN_ENDED_LINE

Lines should not end with a '('

Link: https://lore.kernel.org/linux-media/20201214110156.6152-5-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: Fix EMBEDDED_FUNCTION_NAME warning
Philipp Gerlesberger [Mon, 14 Dec 2020 11:01:47 +0000 (12:01 +0100)]
media: atomisp: Fix EMBEDDED_FUNCTION_NAME warning

Use the automatically defined __func__ macro instead of the function name,
so it stays correct when the function is renamed.

Link: https://lore.kernel.org/linux-media/20201214110156.6152-4-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: 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>