summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2022-07-08media: cx18: Fix typo in commentsJiang Jian1-1/+1
Remove the repeated word 'and' from comments Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: c8sectpfe: Remove unneeded NULL check before clk_disable_unprepareWan Jiabing1-2/+1
clk_disable_unprepare() already checks NULL by using IS_ERR_OR_NULL. Remove unneeded NULL check for fei->c8sectpfeclk. Link: https://lore.kernel.org/linux-media/20220516131254.13816-1-wanjiabing@vivo.com Signed-off-by: Wan Jiabing <wanjiabing@vivo.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-08media: c8sectpfe: Clean up handling of *_buffer_alignedAndy Shevchenko1-19/+11
There are a few cases where code is harder than needed to read. Improve those by: - dropping unnecessary castings (see note below) - use PTR_ALING() to be more explicit on what's going on there - use proper definitions instead of hard coded values Note, dropping castings will allow to perform an additional check that type is not changed from void * to something else, e.g. u64, which may very well break the bitmap APIs. Link: https://lore.kernel.org/linux-media/20220209182521.55632-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Alain Volmat <alain.volmat@foss.st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-07media: venus: hfi_platform: Correct supported codecs for sc7280Vikash Garodia3-2/+28
VP8 codec is deprecated for sc7280 SOC. Fix in platform layer to update the supported codecs accordingly. Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Tested-by: Fritz Koenig<frkoenig@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-07media: venus: Add support for SSR trigger using fault injectionDikshita Agarwal3-1/+36
Here we introduce a new fault injection for SSR trigger. To trigger the SSR: echo 100 > /sys/kernel/debug/venus/fail_ssr/probability echo 1 > /sys/kernel/debug/venus/fail_ssr/times Co-developed-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-07-05media: isl7998x: select V4L2_FWNODE to fix build errorRandy Dunlap1-0/+1
Fix build error when VIDEO_ISL7998X=y and V4L2_FWNODE=m by selecting V4L2_FWNODE. microblaze-linux-ld: drivers/media/i2c/isl7998x.o: in function `isl7998x_probe': (.text+0x8f4): undefined reference to `v4l2_fwnode_endpoint_parse' Cc: stable@vger.kernel.org # 5.18 and above Fixes: 51ef2be546e2 ("media: i2c: isl7998x: Add driver for Intersil ISL7998x") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: kernel test robot <lkp@intel.com> Cc: Marek Vasut <marex@denx.de> Cc: Pengutronix Kernel Team <kernel@pengutronix.de> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: mediatek: vcodec: Report supported bitrate modesHirokazu Honda1-0/+11
The media driver supports constant bitrate mode only. The supported rate control mode is reported through querymenu() and s_ctrl() fails if non constant bitrate mode (e.g. VBR) is requested. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Irui Wang <irui.wang@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: av7110: Remove duplicate 'with' in two places.Jiang Jian1-1/+1
file: ./drivers/staging/media/av7110/av7110.c line: 2367 * reset with with MASK_31 to MC1 changed to * reset with MASK_31 to MC1 Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: saa7164: Remove duplicate 'on' in two places.Jiang Jian1-1/+1
file: drivers/media/pci/saa7164/saa7164-api.c line: 804 /* Assumption: Hauppauge eeprom is at 0xa0 on on bus 0 */ changed to /* Assumption: Hauppauge eeprom is at 0xa0 on bus 0 */ Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: mediatek: vcodec: Fix non subdev architecture open power failYunfei Dong1-0/+2
According to subdev_bitmap bit value to open hardware power, need to set subdev_bitmap value for non subdev architecture. Fixes: c05bada35f01 ("media: mtk-vcodec: Add to support multi hardware decode") Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Tested-by: Chen-Yu Tsai <wenst@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: usb: gspca: aligned '*' each lineJiang Jian1-1/+1
Consider "*" alignment in comments Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: tw686x: Fix memory leak in tw686x_video_initMiaoqian Lin1-1/+3
video_device_alloc() allocates memory for vdev, when video_register_device() fails, it doesn't release the memory and leads to memory leak, call video_device_release() to fix this. Fixes: 704a84ccdbf1 ("[media] media: Support Intersil/Techwell TW686x-based video capture cards") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: driver/nxp/imx-jpeg: fix a unexpected return value problemJian Zhang1-0/+2
In function mxc_jpeg_probe(), when devm_clk_get() fail, the return value will be unexpected, and it should be the devm_clk_get's error code. Fixes: 4c2e5156d9fa6 ("media: imx-jpeg: Add pm-runtime support for imx-jpeg") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Jian Zhang <zhangjian210@huawei.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: MAINTAINERS: add Yunfei Dong as mediatek vcodec driver maintainerYunfei Dong1-0/+1
I have been working on mediatek driver development for a very long time, and sent many patches to change the driver architecture. Add myself as co-maintainer for mediatek vcodec driver. Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: mediatek: vcodec: Skip SOURCE_CHANGE & EOS events for statelessChen-Yu Tsai1-0/+5
The stateless decoder API does not specify the usage of SOURCE_CHANGE and EOF events. These events are used by stateful decoders to signal changes in the bitstream. They do not make sense for stateless decoders. Do not handle subscription for these two types of events for stateless decoder instances. This fixes the last v4l2-compliance error: Control ioctls: fail: v4l2-test-controls.cpp(946): have_source_change || have_eos test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL Fixes: 8cdc3794b2e3 ("media: mtk-vcodec: vdec: support stateless API") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: tw686x: Fix an error handling path in tw686x_probe()Christophe JAILLET1-1/+4
The commit in Fixes: is incomplete. It has moved some code in the probe but not all error handling paths have been updated. Now, if request_irq() fails, we must release some resources. Fixes: c8946454ed96 ("media: tw686x: Register the irq at the end of probe") 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@kernel.org>
2022-06-27media: stm32: dcmi: Drop always NULL sd_state from dcmi_pipeline_s_fmt()Marek Vasut1-3/+2
The second argument is always NULL, stop passing it to the function. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alain Volmat <alain.volmat@foss.st.com> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com> Cc: Amelie DELAUNAY <amelie.delaunay@foss.st.com> Cc: Hugues FRUCHET <hugues.fruchet@foss.st.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Philippe CORNU <philippe.cornu@foss.st.com> Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: stm32: dcmi: Fill in remaining Bayer formatsMarek Vasut1-0/+48
Fill in 10, 12, 14 bit Bayer formats into the DCMI driver. Those are useful e.g. when MT9P006 sensor is connected. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alain Volmat <alain.volmat@foss.st.com> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com> Cc: Amelie DELAUNAY <amelie.delaunay@foss.st.com> Cc: Hugues FRUCHET <hugues.fruchet@foss.st.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Philippe CORNU <philippe.cornu@foss.st.com> Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: mediatek: vcodec: Initialize decoder parameters after getting ↵Yunfei Dong2-2/+2
dec_capability Need to get dec_capability from scp first, then initialize decoder supported format and other parameters according to dec_capability value. Fixes: fd00d90330d1 ("media: mtk-vcodec: vdec: move stateful ops into their own file") Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Tested-by: Chen-Yu Tsai <wenst@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkvdec:Remove redundant memsetZhang Zekun1-2/+0
As dma_alloc_coherent() will return a zeroed buffer, we don't need to memset the returned buffer. priv_tbl = dma_alloc_coherent() and count_tbl = dma_alloc_coherent() should be enough. -see commit 750afb08ca71 ("cross-tree: phase out dma_zalloc_coherent()") Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: atmel: atmel-isc-base: allow wb ctrls to be changed when isc is not ↵Eugen Hristev1-4/+0
configured When attempting to change the white balance (WB) ctrls before starting streaming, e.g.: # v4l2-ctl -L User Controls .. blue_component_gain 0x009819c1 (int) : min=0 max=8191 step=1 default=512 value=512 flags=slider .. # v4l2-ctl --set-ctrl=blue_component_gain=500 # v4l2-ctl -L .. blue_component_gain 0x009819c1 (int) : min=0 max=8191 step=1 default=512 value=500 flags=slider .. These will not be written to the internal data struct and will not be written to the WB hardware module. Thus, after starting streaming, they will be reset to default: # v4l2-ctl -L .. blue_component_gain 0x009819c1 (int) : min=0 max=8191 step=1 default=512 value=512 flags=slider .. It does not make much sense to not be able to configure the WB controls at all times. Even if the sensor would not be RAW Bayer (and in this case the WB module is unavailable), the user could configure the ISC itself, as the ISC should not care about the sensor format. Thus, when WB module is available (if the sensor changes format e.g.) it will be already configured as be user's desires. In consequence, remove the check in isc_s_awb_ctrl that will return if ISC does not know the sensor format. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: sta2x11: remove VIRT_TO_BUS dependencyArnd Bergmann1-1/+1
This driver does not use the virt_to_bus() function, though it depends on x86 specific fixups in the swiotlb code, which was last rewritten in commit e380a0394c36 ("x86/PCI: sta2x11: use default DMA address translation"). It is possible that the driver still fails to build on some architectures that are missing CONFIG_VIRT_TO_BUS, but it is always set on x86 machines with the STA2X11 platform enabled. More likely though is that it was never meant to depend on CONFIG_VIRT_TO_BUS, and the Kconfig dependency was kept from an out-of-tree version when the driver was originally merged. Fixes: efeb98b4e2b2 ("[media] STA2X11 VIP: new V4L2 driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: mediatek: vcodec: return EINVAL if plane is too smallJustin Green1-0/+1
Modify vb2ops_vdec_buf_prepare to return EINVAL if the size of the plane is less than the size of the image. Currently we just log an error and return 0 anyway, which may cause a buffer overrun bug. Signed-off-by: Justin Green <greenjustin@chromium.org> Suggested-by: Andres Calderon Jaramillo <andrescj@chromium.org> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: v4l2-mem2mem: prevent pollerr when last_buffer_dequeued is setMing Qian1-1/+1
If the last buffer was dequeued from the capture queue, signal userspace. DQBUF(CAPTURE) will return -EPIPE. But if output queue is empty and capture queue is empty, v4l2_m2m_poll_for_data will return EPOLLERR, This is very easy to happen in drain. When last_buffer_dequeued is set, we shouldn't return EPOLLERR, but return EPOLLIN | EPOLLRDNORM. Fixes: 1698a7f151126 ("media: v4l2-mem2mem: simplify poll logic") Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: mediatek: vcodec: remove unneeded semicolonYang Li1-1/+1
Eliminate the following coccicheck warning: ./drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c:71:2-3: Unneeded semicolon Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: hdpvr: fix error value returns in hdpvr_readNiels Dossche1-1/+1
Error return values are supposed to be negative in hdpvr_read. Most error returns are currently handled via an unsigned integer "ret". When setting a negative error value to "ret", the value actually becomes a large positive value, because "ret" is unsigned. Later on, the "ret" value is returned. But as ssize_t is a 64-bit signed number, the error return value stays a large positive integer instead of a negative integer. This can cause an error value to be interpreted as the read size, which can cause a buffer overread for applications relying on the returned size. Fixes: 9aba42efe85b ("V4L/DVB (11096): V4L2 Driver for the Hauppauge HD PVR usb capture device") Signed-off-by: Niels Dossche <dossche.niels@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: mediatek: vcodec: fix minmax.cocci warningGuo Zhengkui1-1/+1
Fix the following coccicheck warning: drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c: 694:15-16: WARNING opportunity for min(). Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: MAINTAINERS: add include/dt-bindings/media to MEDIA INPUT INFRASTRUCTURELukas Bulwahn1-0/+1
Maintainers of the directory Documentation/devicetree/bindings/media are also the maintainers of the corresponding directory include/dt-bindings/media. Add the file entry for include/dt-bindings/media to the appropriate section in MAINTAINERS. Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: ddbridge: Remove useless license text when SPDX-License-Identifier is ↵Christophe JAILLET16-147/+3
already used An SPDX-License-Identifier is already in place. There is no need to duplicate part of the corresponding license. While at it, a few comments at the end of some .h files have been updated to reflect the correct include guard name (missing '_' and co.) 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@kernel.org>
2022-06-27media: em28xx: Remove useless license text when SPDX-License-Identifier is ↵Christophe JAILLET11-103/+0
already used An SPDX-License-Identifier is already in place. There is no need to duplicate part of the corresponding license. 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@kernel.org>
2022-06-27media: rcar_drif: Remove useless license text when SPDX-License-Identifier ↵Christophe JAILLET1-5/+0
is already used An SPDX-License-Identifier is already in place. There is no need to duplicate part of the corresponding license. This is a left-over from commit adeb69705682 ("media: rcar_drif: convert to SPDX identifiers") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: platform: cros-ec: Add kinox to the match tableAjye Huang1-0/+2
The Google Kinox device uses the same approach as the Google Brask which enables the HDMI CEC via the cros-ec-cec driver. Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com> Reviewed-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: amphion: output firmware error messageMing Qian1-1/+6
Firmware may send the error event with some error message, and it help locate the firmware error, so output the error message if it exists Fixes: 61cbf1c1fa6d7 ("media: amphion: implement vpu core communication based on mailbox") Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: imx-jpeg: Disable slot interrupt when frame doneMing Qian3-8/+8
The interrupt STMBUF_HALF may be triggered after frame done. It may led to system hang if driver try to access the register after power off. Disable the slot interrupt when frame done. Fixes: 2db16c6ed72ce ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder") Signed-off-by: Ming Qian <ming.qian@nxp.com> Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com> Tested-by: Mirela Rabulea <mirela.rabulea@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: mediatek: vcodec: Change encoder v4l2 capability valueYunfei Dong2-3/+2
Change the value of v4l2 capability parameters: driver and card. Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: mediatek: vcodec: Fix encoder v4l2 bus_info not correctlyYunfei Dong1-1/+20
Fix v4l2 capability bus_info value with correct chip name according to compatible. Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: mediatek: vcodec: Change decoder v4l2 capability valueYunfei Dong1-2/+2
Change the value of v4l2 capability parameters: driver and card. Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: mediatek: vcodec: Fix decoder v4l2 bus_info not correctlyYunfei Dong1-1/+22
Fix v4l2 capability bus_info value with correct chip name according to compatible. Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkisp1: Drop parentheses and fix indentation in rkisp1_probe()Laurent Pinchart1-3/+3
Fix a small indentation issue to increase code readability, and drop unneeded parentheses. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkisp1: Align macro definitionsLaurent Pinchart1-15/+15
Make the code more readable by using the same alignment for all macros in rkisp1-common.h. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkisp1: capture: Bypass the main device for handling querycapPaul Elder1-5/+2
When handling querycap, the capture node would access the main rkisp1 device unnecessarily. Get the information from the most direct source. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkisp1: debug: Update max register name lengthLaurent Pinchart1-3/+9
Update the maximum register name length to match all the registers being printed. This helps getting a consistent alignment of register dumps when concatenating multiple debugfs files. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkisp1: debug: Consolidate reg dumps for shadow registersLaurent Pinchart1-50/+33
Extend the rkisp1_debug_register structure and the rkisp1_debug_dump_regs() function to support shadow registers, and replace the manual registers dump implementation in rkisp1_debug_dump_rsz_regs_show() with a call to rkisp1_debug_dump_regs(). Support for printing register values in decimal is dropped, as it was actually confusing to print resizer register expressed as fixed-point values in decimal. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkisp1: debug: Move resizer register dump to debugfsLaurent Pinchart2-37/+57
The debugfs support already includes support to dump core and ISP registers. Move the resizer register dump there too to make the userspace interface consistent. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkisp1: debug: Add debugfs files to dump core and ISP registersLaurent Pinchart1-0/+72
It's useful to dump the value of registers for debugging purpose. Add two debugfs files to dump key core and ISP registers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkisp1: debug: Collect input status by sampling ISP_FLAGS_SHDLaurent Pinchart2-0/+63
The ISP_FLAGS_SHD register exposes the ISP parallel input signals (data and synchronization) in real time. This can help debugging when the device doesn't output any image. Sample the register 10000 times with a 1µs delay and expose the result through debugfs. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkisp1: Compile debugfs support conditionallyLaurent Pinchart2-8/+19
When CONFIG_DEBUGFS is disabled, there's no need to compile the debugfs support in. Make it conditional. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkisp1: Move debugfs code to a separate fileLaurent Pinchart4-32/+57
To avoid cluttering the main rkisp1-dev.c driver file, move debugfs code to a separate source file. This prepares for extensions to the debugfs infrastructure. While at it, add a missing forward declaration for struct dentry in rkisp1-common.h to avoid depending on indirect includes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkisp1: resizer: Simplify register accessLaurent Pinchart3-155/+75
The registers for the mainpath and selfpath resizers are located at the same offset from the instance-specific base. Use this to simplify register access, removing the need to store per-register offsets in the rkisp1_rsz_config structure. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-06-27media: rkisp1: Swap value and address arguments to rkisp1_write()Laurent Pinchart6-488/+477
While writel() takes the value and address arguments in that order, most write functions (including in the regmap API) use the opposite convention. Having the value first is considered confusing, and often leads to more difficult to read code compared to the opposite convention where the write call and the register name often fit on a single line: rkisp1_write(rkisp1, RKISP1_CIF_THE_REG_NAME, complicate_calculation + for / the_register value + goes | here); Swap the arguments of the rkisp1_write() function, and use the following semantic patch to update the callers: @@ expression rkisp1, value, address; @@ - rkisp1_write(rkisp1, value, address) + rkisp1_write(rkisp1, address, value) This commit also includes a few additional line break cleanups in the rkisp1_write() calls, but no other manual change. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>