summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-02-16media: videobuf2: Add missing doc comment for waiting_in_dqbufAndrzej Pietrasiewicz1-5/+8
While at it rearrange other comments to match the order of struct members. Fixes: d65842f7126a ("media: vb2: add waiting_in_dqbuf flag") Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Acked-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: pvrusb2: remove redundant NULL checkDaniil Dulov1-5/+0
Pointer dip->stream cannot be NULL due to a shift, thus remove redundant NULL check. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: c74e0062684b ("V4L/DVB (5059): Pvrusb2: Be smarter about mode restoration") Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: go7007: add check of return value of go7007_read_addr()Daniil Dulov1-1/+3
If go7007_read_addr() returns error channel is not assigned a value. In this case go to allocfail. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 866b8695d67e ("Staging: add the go7007 video driver") Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: bt8xx: make bttv_sub_bus_type constRicardo B. Marliere2-2/+2
Now that the driver core can properly handle constant struct bus_type, move the bttv_sub_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16docs: media: fix typo in docsVincenzo Mezzela1-1/+1
This patch resolves a spelling error in the documentation. It is submitted as part of my application to the "Linux Kernel Bug Fixing Spring Unpaid 2024" mentorship program of the Linux Kernel Foundation. Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: core: v4l2-ioctl.c: use is_valid_ioctl()Hans Verkuil1-1/+1
In most cases the is_valid_ioctl() macro is used to check if an ioctl is valid, except in one place. Use it there as well as it makes the code easier to read. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: ti: Use devm_platform_ioremap_resource() in ti_csi2rx_probe()Markus Elfring1-4/+1
A wrapper function is available since the commit 7945f929f1a7 ("drivers: provide devm_platform_ioremap_resource()"). * Thus reuse existing functionality instead of keeping duplicate source code. * Delete a local variable which became unnecessary with this refactoring. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Jai Luthra <j-luthra@ti.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: platform: cros-ec: Add Dita to the match tableKells Ping1-0/+2
The Google Dita device uses the same approach as the Google Brask which enables the HDMI CEC via the cros-ec-cec driver. Signed-off-by: Kells Ping <kells.ping@quanta.corp-partner.google.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: i2c: st-vgxy61: remove redundant initialization of pointer modeColin Ian King1-1/+1
The pointer mode is being initialized with a value that is never read, it is being re-assigned later on. The initialization is redundant and can be removed. Cleans up clang scan build warning: drivers/media/i2c/st-vgxy61.c:632:33: warning: Value stored to 'mode' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: tda18271: remove redundant assignment to variable bcalColin Ian King1-1/+0
The variable bcal is being initialized with a value that is never read, it is being re-assigned in both paths of an if statement near the end of the function. The initialization is redundant and can be removed. Cleans up clang scan build warning: drivers/media/tuners/tda18271-fe.c:473:2: warning: Value stored to 'bcal' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: v4l2-ctrls-core.c: check min/max for menu, controlsHans Verkuil2-3/+4
Menu controls that use the menu_skip_mask require that the min-max range is inside 0-63. Negative values obviously make no sense for menu controls, and the maximum value is currently limited by the number of bits of the menu_skip_mask value. However, if menu_skip_mask == 0, then larger menus are fine. If we ever need to add support for larger menus that support the skip mask, then more work is needed. In the places where the menu_skip_mask is checked, use BIT_ULL to get the bit to check and check if the bit number is < BITS_PER_LONG_LONG to avoid shifting out of range. With the new check in check_range this should never happen, but it is better to be safe and avoid static analyzer warnings. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: amphion: Abort vpu parsing directly in seekMing Qian1-1/+3
Driver abort vpu decoding when both output and capture queues are off, but if seek in parsing the sequence header, driver may miss aborting the parsing. so just abort the vpu parsing directly in seek. Meanwhile if capture is off unexpectedly, we still need to abort the decoding and return capture buffers. Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: imx-jpeg: Support for negotiating bytesperline with clientMing Qian2-0/+17
This mxc-jpeg driver doesn't allow the client to set the bytesperline, but for some android cts case, it need to negotiate the bytesperline between decoder and display, and fail the case if driver doesn't support negotiating bytesperline The jpegdec and jpegenc does support to set bytesperline which is multiple of 2, and greater than the value calulated by driver. Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: imx: csc/scaler: fix v4l2_ctrl_handler memory leakLucas Stach1-0/+1
Free the memory allocated in v4l2_ctrl_handler_init on release. Fixes: a8ef0488cc59 ("media: imx: add csc/scaler mem2mem device") Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16staging: media: starfive: Set 16 bpp for capture_raw deviceChanghuang Liang1-4/+4
For StarFive JH7110 Camera Subsystem, capture_raw video device output raw10 pixelformat requires 16bit of alignment. Fixes: e080f339c80a ("media: staging: media: starfive: camss: Add capture driver") Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: rcar-csi2: Move driver to renesas directoryNiklas Söderlund6-17/+18
The rcar-csi2 driver was added before the platform/renesas directory existed and since it was used together in a pipeline with the rcar-vin driver it was located together with it. The rcar-isp driver can also be used together with the rcar-csi2 driver in a pipeline that is terminated by the rcar-vin driver. However by the time rcar-isp was added the platform/renesas directory existed so it was added there. To remove the confusion that the rcar-csi2 driver have code dependencies on the rcar-vin driver move it to the same directory level as the rcar-isp driver. This makes it clear they are three distinct drivers that can be used together in a pipeline, but do not depend on each other. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: staging: imx: controls are from another device, mark thisHans Verkuil1-1/+1
The last argument of v4l2_ctrl_add_handler() indicates whether the controls you add are from a control handler owned by another driver (true) or from the same driver (false). In this case the last argument was incorrectly set to false. The control handlers are from different devices. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: dvb-frontends: Clean up errors in tda8083.hXueBing Chen1-4/+4
Fix the following errors reported by checkpatch: ERROR: "foo* bar" should be "foo *bar" Signed-off-by: XueBing Chen <chenxb_99091@126.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: Clean up errors in bcm3510_priv.hXueBing Chen1-3/+3
Fix the following errors reported by checkpatch: ERROR: space prohibited before that ',' (ctx:WxW) Signed-off-by: XueBing Chen <chenxb_99091@126.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: stv6110x: Clean up errors in stv6110x.hXueBing Chen1-4/+4
Fix the following errors reported by checkpatch: ERROR: space prohibited before that ',' (ctx:WxW) Signed-off-by: XueBing Chen <chenxb_99091@126.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: dvb-frontends: Clean up errors in cx24110.hXueBing Chen1-4/+4
Fix the following errors reported by checkpatch: ERROR: "foo* bar" should be "foo *bar" Signed-off-by: XueBing Chen <chenxb_99091@126.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: zl10036: Fix my email addressMatthias Schwarzott2-2/+2
It has been wrong from the beginning. Signed-off-by: Matthias Schwarzott <zzam@gentoo.org> Reported-by: Ulrich Mueller <ulm@gentoo.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: pvrusb2: Use wait_event_freezable() for freezable kthreadKevin Hao1-5/+1
A freezable kernel thread can enter frozen state during freezing by either calling try_to_freeze() or using wait_event_freezable() and its variants. So for the following snippet of code in a kernel thread loop: try_to_freeze(); wait_event_interruptible(); We can change it to a simple wait_event_freezable() and then eliminate a function call. Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: msp3400: Use wait_event_freezable_timeout() in msp_sleep()Kevin Hao2-16/+8
The msp_sleep() is nearly open-coded wait_event_interruptible_timeout(), and a freezable kernel thread can enter frozen state during freezing by either calling try_to_freeze() or using wait_event_freezable() and its variants. So we can reimplement msp_sleep() to simply invoke a wait_event_freezable_timeout() and then eliminate a call to try_to_freeze(). Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: dvb_frontend: Use wait_event_freezable_timeout() for freezable kthreadKevin Hao1-9/+4
A freezable kernel thread can enter frozen state during freezing by either calling try_to_freeze() or using wait_event_freezable() and its variants. So for the following snippet of code in a kernel thread loop: wait_event_interruptible_timeout(); try_to_freeze(); We can change it to a simple wait_event_freezable_timeout() and then eliminate a function call. Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: sun8i-di: Fix chroma difference thresholdJernej Skrabec1-1/+1
While there is no good explanation what this value does, vendor driver uses value 31 for it. Align driver with it. Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver") Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: sun8i-di: Fix power on/off sequencesJernej Skrabec1-12/+13
According to user manual, reset line should be deasserted before clocks are enabled. Also fix power down sequence to be reverse of that. Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver") Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: sun8i-di: Fix coefficient writesJernej Skrabec1-21/+21
Currently coefficients are applied only once, since they don't change. However, this is done before enable bit is set and thus it doesn't get applied properly. Fix that by applying coefficients after enable bit is set. While this means that it will be done evey time, it doesn't bring much time penalty. Fixes: a4260ea49547 ("media: sun4i: Add H3 deinterlace driver") Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: cedrus: h265: Fix configuring bitstream sizeJernej Skrabec1-6/+4
bit_size field holds size of slice, not slice + header. Because of HW quirks, driver can't program in just slice, but also preceding header. But that means that currently used bit_size is wrong (too small). Instead, just use size of whole buffer. There is no harm in doing this. Fixes: 86caab29da78 ("media: cedrus: Add HEVC/H.265 decoding support") Suggested-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16media: mediatek: vcodec: Remove unneeded semicolonYang Li1-7/+7
./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:569:2-3: Unneeded semicolon ./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:583:2-3: Unneeded semicolon ./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:599:2-3: Unneeded semicolon ./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:613:2-3: Unneeded semicolon ./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:633:2-3: Unneeded semicolon ./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:647:2-3: Unneeded semicolon ./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:683:2-3: Unneeded semicolon Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7632 Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-15media: platform: rzg2l-cru: rzg2l-video: Fix start reception procedureBiju Das1-31/+28
As per section 35.3.1 Starting Reception for the MIPI CSI-2 Input on the latest hardware manual (R01UH0914EJ0145 Rev.1.45) we need to supply all the clocks and then release the CRU resets. Currently we are releasing the resets and then supplying the clocks. So, fix the start reception procedure. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20240213181233.242316-6-biju.das.jz@bp.renesas.com Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-15media: platform: rzg2l-cru: rzg2l-csi2: Restructure vclk handlingBiju Das4-37/+19
As per section 35.3.1 Starting Reception for the MIPI CSI-2 Input on the latest hardware manual (R01UH0914EJ0145 Rev.1.45) we need to disable the vclk before enabling the LINK reception and enable the vclk after enabling the link Reception. So restructure vclk handling as per the HW manual. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20240213181233.242316-5-biju.das.jz@bp.renesas.com Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-15media: platform: rzg2l-cru: rzg2l-video: Fix image processing initializationBiju Das1-7/+7
As per section 35.3.1 Starting Reception for the MIPI CSI-2 Input on the latest hardware manual (R01UH0914EJ0140 Rev.1.40) it is mentioned that initialize the AXI master first and then initialize the image processing. Fix the start procedure as per the hardware manual. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20240213181233.242316-4-biju.das.jz@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-15media: platform: rzg2l-cru: rzg2l-ip: Add delay after D-PHY resetBiju Das1-0/+3
As per section 35.3.1 Starting Reception for the MIPI CSI-2 Input on the latest hardware manual (R01UH0914EJ0140 Rev.1.40) it is mentioned that after DPHY reset, we need to wait for 1 msec or more before start receiving data from the sensor. So add a delay after pre_streamon(). Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20240213181233.242316-3-biju.das.jz@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-15media: platform: rzg2l-cru: rzg2l-csi2: Switch to RUNTIME_PM_OPS()Biju Das1-4/+5
Replace the old SET_RUNTIME_PM_OPS() helpers with its modern alternative RUNTIME_PM_OPS(). The usage of pm_ptr and RUNTIME_PM_OPS() allows the compiler to see where it's used but still drop the dead code. After this we can get rid of the unnecessary '__maybe_unused' annotations on PM functions. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20240213181233.242316-2-biju.das.jz@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-07media: edia: dvbdev: fix a use-after-freeZhipeng Lu1-0/+5
In dvb_register_device, *pdvbdev is set equal to dvbdev, which is freed in several error-handling paths. However, *pdvbdev is not set to NULL after dvbdev's deallocation, causing use-after-frees in many places, for example, in the following call chain: budget_register |-> dvb_dmxdev_init |-> dvb_register_device |-> dvb_dmxdev_release |-> dvb_unregister_device |-> dvb_remove_device |-> dvb_device_put |-> kref_put When calling dvb_unregister_device, dmxdev->dvbdev (i.e. *pdvbdev in dvb_register_device) could point to memory that had been freed in dvb_register_device. Thereafter, this pointer is transferred to kref_put and triggering a use-after-free. Link: https://lore.kernel.org/linux-media/20240203134046.3120099-1-alexious@zju.edu.cn Fixes: b61901024776 ("V4L/DVB (5244): Dvbdev: fix illegal re-usage of fileoperations struct") Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-02-07media: docs: uAPI: dvb/decoder: completing the documentationStefan Herdler2-0/+62
The existing documentation of the legacy DVB Decoder API was incomplete. Revising the documentation, adding missing parts and arranging the documentation files new. This patch contains the new index file and links to it. Link: https://lore.kernel.org/linux-media/20240128233249.32794-2-herdler@nurfuerspam.de Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-02-07media: docs: uAPI: dvb/video: completing the documentation (function calls)Stefan Herdler1-0/+1632
The existing documentation of the legacy DVB Decoder API was incomplete. Revising the documentation, adding missing parts and arranging the documentation files new. This patch contains the documentation of the function calls defined in video.h. Link: https://lore.kernel.org/linux-media/20240128233249.32794-7-herdler@nurfuerspam.de Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-02-07media: docs: uAPI: dvb/video: completing the documentation (data types)Stefan Herdler1-0/+798
The existing documentation of the legacy DVB Decoder API was incomplete. Revising the documentation, adding missing parts and arranging the documentation files new. This patch contains the documentation of the data types defined in video.h. Link: https://lore.kernel.org/linux-media/20240128233249.32794-6-herdler@nurfuerspam.de Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-02-07media: docs: uAPI: dvb/audio: completing the documentation (function calls)Stefan Herdler1-0/+1195
The existing documentation of the legacy DVB Decoder API was incomplete. Revising the documentation, adding missing parts and arranging the documentation files new. This patch contains the documentation of the function calls defined in audio.h. Link: https://lore.kernel.org/linux-media/20240128233249.32794-5-herdler@nurfuerspam.de Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-02-07media: docs: uAPI: dvb/audio: completing the documentation (data types)Stefan Herdler1-0/+447
The existing documentation of the legacy DVB Decoder API was incomplete. Revising the documentation, adding missing parts and arranging the documentation files new. This patch contains the documentation of the data types defined in audio.h. Link: https://lore.kernel.org/linux-media/20240128233249.32794-4-herdler@nurfuerspam.de Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-02-07media: docs: uAPI: dvb/osd: completing the documentationStefan Herdler1-0/+883
The existing documentation of the legacy DVB Decoder API was incomplete. Revising the documentation, adding missing parts and arranging the documentation files new. This patch contains the documentation of osd.h. Link: https://lore.kernel.org/linux-media/20240128233249.32794-3-herdler@nurfuerspam.de Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-02-07media: dvb: remove redundant assignment to variable retColin Ian King1-2/+1
The variable ret is being assigned a value but it isn't being read afterwards. The assignment is redundant and so ret can be removed. Also add spaces after , to clean up checkpatch warnings. Cleans up clang scan build warning: warning: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret' [deadcode.DeadStores] Link: https://lore.kernel.org/linux-media/20240116115002.2265367-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-02-07media: dvb-frontends/dvb-pll: Remove usage of the deprecated ida_simple_xx() APIChristophe JAILLET1-3/+3
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_max() is inclusive. So a -1 has been added when needed. Link: https://lore.kernel.org/linux-media/920639b9e05775eea56ecb9cd5ed38ad292a96a8.1705008803.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-02-07media: cx24110: clean up some coding style issuesXueBing Chen1-2/+2
Fix the following errors reported by checkpatch: ERROR: "foo* bar" should be "foo *bar" ERROR: spaces required around that '=' (ctx:VxV) ERROR: space required after that ',' (ctx:VxV) Link: https://lore.kernel.org/linux-media/20240111105856.14655-1-chenxb_99091@126.com Signed-off-by: XueBing Chen <chenxb_99091@126.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-02-07media: drivers/media/dvb-core: copy user arrays safelyPhilipp Stanner1-4/+8
At several positions in dvb_frontend.c, memdup_user() is utilized to copy userspace arrays. This is done without overflow checks. Use the new wrapper memdup_array_user() to copy the arrays more safely. Link: https://lore.kernel.org/linux-media/20231102191633.52592-2-pstanner@redhat.com Suggested-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Philipp Stanner <pstanner@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-02-06media: ov08x40: Reduce start streaming timeJason Chen1-1152/+57
Because video duration involves calculating the streaming time, and i2c communication incurs too many XTALK register settings every 4 bytes with i2c START and STOP. So we have opted switch to the i2c burst method. This method involves writing the XTALK registers in the order of the register block. The start streaming time can be reduced from around 400ms to 150ms [Sakari Ailus: Drop unneeded dev_dbg().] Signed-off-by: Jason Chen <jason.z.chen@intel.com> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-06Revert "media: ov08x40: Reduce start streaming time"Sakari Ailus3-59/+1154
This reverts commit feb8831be9d468ee961289c6a275536a1ee0011c. Commit feb8831be9d468ee961289c6a275536a1ee0011c contained unintentional changes to Documentation/devicetree/bindings/media/video-interfaces.yaml and arch/arm/boot/dts/ti/omap/omap3-n9.dts. Revert the entire patch. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-05media: nxp: imx8-isi: Factor out a variableRicardo Ribalda1-5/+3
gcc-11 seems to believe that the coeffs variable can be used uninitialized. Refactor the code and remove the cscen variable to convince gcc that we are doing a good job. drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c:218:20: warning: 'coeffs' may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20240128-gcc-11-warnings-v1-1-52bbdf492049@chromium.org Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-05media: nxp: imx8-isi: Mark all crossbar sink pads as MUST_CONNECTLaurent Pinchart1-8/+2
All the sink pads of the crossbar switch require an active link if they're part of the pipeline. Mark them with the MEDIA_PAD_FL_MUST_CONNECT flag to fail pipeline validation if they're not connected. This allows removing a manual check when translating streams. Cc: stable@vger.kernel.org # 6.1 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>