aboutsummaryrefslogtreecommitdiff
path: root/drivers/media
AgeCommit message (Collapse)AuthorFilesLines
2024-04-09media: cobalt: Use pad variant of dv timing subdev callsPaweł Anikiel1-6/+6
Use the pad variant for all (s|g|query)_dv_timings subdev calls, which includes a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-09media: spi: gs1662: Switch dv timing callbacks to pad opsPaweł Anikiel1-9/+18
Change all (s|g|query)_dv_timings subdev callbacks to include a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: align to open parenthesis]
2024-04-09media: i2c: tvp7002: Switch dv timing callbacks to pad opsPaweł Anikiel1-11/+21
Change all (s|g|query)_dv_timings subdev callbacks to include a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: align to open parenthesis]
2024-04-09media: i2c: ths8200: Switch dv timing callbacks to pad opsPaweł Anikiel1-4/+10
Change all (s|g|query)_dv_timings subdev callbacks to include a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-09media: i2c: ths7303: Switch dv timing callbacks to pad opsPaweł Anikiel1-3/+7
Change all (s|g|query)_dv_timings subdev callbacks to include a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: align to open parenthesis]
2024-04-09media: i2c: tda1997x: Switch dv timing callbacks to pad opsPaweł Anikiel1-7/+7
Change all (s|g|query)_dv_timings subdev callbacks to include a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: align to open parenthesis]
2024-04-09media: i2c: tc358743: Switch dv timing callbacks to pad opsPaweł Anikiel1-8/+17
Change all (s|g|query)_dv_timings subdev callbacks to include a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: align to open parenthesis]
2024-04-09media: i2c: adv7842: Switch dv timing callbacks to pad opsPaweł Anikiel1-8/+17
Change all (s|g|query)_dv_timings subdev callbacks to include a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-09media: i2c: adv7604: Switch dv timing callbacks to pad opsPaweł Anikiel1-10/+10
Change all (s|g|query)_dv_timings subdev callbacks to include a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: align to open parenthesis]
2024-04-09media: i2c: adv7511: Switch dv timing callbacks to pad opsPaweł Anikiel1-5/+11
Change all (s|g|query)_dv_timings subdev callbacks to include a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: align to open parenthesis]
2024-04-09media: i2c: adv748x: Switch dv timing callbacks to pad opsPaweł Anikiel1-8/+8
Change all (s|g|query)_dv_timings subdev callbacks to include a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Tested-by: Niklas Söderlund <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-09media: v4l2-subdev: Add pad versions of dv timing subdev callsPaweł Anikiel1-0/+33
Currently, subdev dv timing calls (i.e. g/s/query_dv_timings) are video ops without a pad argument. This is a problem if the subdevice can have different dv timings for each pad (e.g. a DisplayPort receiver with multiple virtual channels). To solve this, change these calls to include a pad argument, and put them into pad ops. Keep the old ones temporarily to make the switch easier. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: qcom: camss: vfe-17x: Rename camss-vfe-170 to camss-vfe-17xBryan O'Donoghue2-1/+1
vfe-170 and vfe-175 can be supported in the same file with some minimal indirection to differentiate between the silicon versions. sdm845 uses vfe-170, sc8280xp uses vfe-175-200. Lets rename the file to capture its wider scope than vfe-170 only. Acked-by: Konrad Dybcio <[email protected]> Signed-off-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: qcom: camss: Add sc8280xp supportBryan O'Donoghue4-8/+42
Add in functional logic throughout the code to support the sc8280xp. Acked-by: Konrad Dybcio <[email protected]> Signed-off-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: qcom: camss: Add sc8280xp resourcesBryan O'Donoghue1-0/+307
This commit describes the hardware layout for the sc8280xp for the following hardware blocks: - 4 x VFE, 4 RDI per VFE - 4 x VFE Lite, 4 RDI per VFE - 4 x CSID - 4 x CSID Lite - 4 x CSI PHY Signed-off-by: Bryan O'Donoghue <[email protected]> Acked-by: Konrad Dybcio <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: qcom: camss: Add CAMSS_SC8280XP enumBryan O'Donoghue1-0/+1
Adds a CAMSS SoC identifier for the SC8280XP. Signed-off-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: qcom: camss: csiphy-3ph: Add Gen2 v1.1 two-phase MIPI CSI-2 DPHY initBryan O'Donoghue1-0/+85
Add a PHY configuration sequence for the sc8280xp which uses a Qualcomm Gen 2 version 1.1 CSI-2 PHY. The PHY can be configured as two phase or three phase in C-PHY or D-PHY mode. This configuration supports two-phase D-PHY mode. Reviewed-by: Konrad Dybcio <[email protected]> Signed-off-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: platform: cros-ec: provide ID table for avoiding fallback matchTzung-Bi Shih1-1/+8
Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Tzung-Bi Shih <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: mmc: siano: simplify module initializationKrzysztof Kozlowski1-24/+1
This driver's initialization functions do not perform any custom code, except printing messages. Printing messages on modules loading/unloading is discouraged because it pollutes the dmesg regardless whether user actually has this device. Core kernel code already gives tools to investigate whether module was loaded or not. Drop the printing messages which allows to replace open-coded module_sdio_driver(). Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: dvbdev: Initialize sbufRicardo Ribalda1-1/+1
Because the size passed to copy_from_user() cannot be known beforehand, it needs to be checked during runtime with check_object_size. That makes gcc believe that the content of sbuf can be used before init. Fix: ./include/linux/thread_info.h:215:17: warning: ‘sbuf’ may be used uninitialized [-Wmaybe-uninitialized] Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: radio-shark2: Avoid led_names truncationsRicardo Ribalda1-1/+1
Increase the size of led_names so it can fit any valid v4l2 device name. Fixes: drivers/media/radio/radio-shark2.c:197:17: warning: ‘%s’ directive output may be truncated writing up to 35 bytes into a region of size 32 [-Wformat-truncation=] Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: rcar-vin: work around -Wenum-compare-conditional warningArnd Bergmann1-1/+1
clang-19 warns about mixing two enum types here: drivers/media/platform/renesas/rcar-vin/rcar-vin.h:296:12: error: conditional expression between different enumeration types ('enum rvin_csi_id' and 'enum rvin_isp_id') [-Werror,-Wenum-compare-conditional] drivers/media/platform/renesas/rcar-vin/rcar-core.c:216:18: error: conditional expression between different enumeration types ('enum rvin_csi_id' and 'enum rvin_isp_id') [-Werror,-Wenum-compare-conditional] drivers/media/platform/renesas/rcar-vin/rcar-vin.h:296:12: error: conditional expression between different enumeration types ('enum rvin_csi_id' and 'enum rvin_isp_id') [-Werror,-Wenum-compare-conditional] drivers/media/platform/renesas/rcar-vin/rcar-vin.h:296:12: error: conditional expression between different enumeration types ('enum rvin_csi_id' and 'enum rvin_isp_id') [-Werror,-Wenum-compare-conditional] This one is intentional, and there is already a cast to work around another warning, so address this by adding another cast. Fixes: 406bb586dec0 ("media: rcar-vin: Add r8a779a0 support") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: v4l2-common: Add Y210 and Y216 format infoJacopo Mondi1-0/+2
According to the formats description in videodev2.h Y210, Y212 and Y216 are YCbCr packed formats. For each Y2xx format, xx bits of valid data occupy the MSBs of the 16 bit components, and 16-xx bits of zero padding occupy the LSBs. The Y210 and Y216 formats are missing an entry in the v4l2_format_info[] table. Add it. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: cxd2880: Add terminating new line to KconfigPrasad Pandit1-1/+1
Add terminating new line to the Kconfig file. Signed-off-by: Prasad Pandit <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: dropped 'Fixes' tag, not relevant for this]
2024-04-08media: v4l2-ctrls: add support for area type loggingHans Verkuil1-0/+3
A 'case V4L2_CTRL_TYPE_AREA' was missing in v4l2_ctrl_type_op_log, which led to an 'unknown type' message in the kernel log. Add support for controls of this type. Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: ngene: Add dvb_ca_en50221_init return value checkAleksandr Burakov1-1/+3
The return value of dvb_ca_en50221_init() is not checked here that may cause undefined behavior in case of nonzero value return. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 25aee3debe04 ("[media] Rename media/dvb as media/pci") Signed-off-by: Aleksandr Burakov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-08media: anysee: accept read buffers of length 1 in anysee_master_xferIstván Váradi1-2/+2
anysee_master_xfer currently accepts read messages of length 2 only. However, several frontends, e.g. tda10023 send buffers of length 1, containing an 8-bit register number (see tda10023_readreg). These buffers are rejected currently, making many Anysee variants to not work. In these cases the "Unsupported Anysee version" message is logged. This patch alters the function to accept buffers of a length of 1 too. Signed-off-by: István Váradi <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: add spaces around '<', fix typo in 'sevaral']
2024-03-26media: mediatek: vcodec: support 36 bits physical addressYunfei Dong2-3/+3
The physical address on the MT8188 platform is larger than 32 bits, change the type from unsigned int to dma_addr_t to be able to access the high bits of the address. Signed-off-by: Yunfei Dong <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-26media: mediatek: vcodec: adding lock to protect encoder context listYunfei Dong4-2/+11
Add a lock for the ctx_list, to avoid accessing a NULL pointer within the 'vpu_enc_ipi_handler' function when the ctx_list has been deleted due to an unexpected behavior on the SCP IP block. Fixes: 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder") Signed-off-by: Yunfei Dong <[email protected]> Reviewed-by: Nicolas Dufresne <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-26media: mediatek: vcodec: adding lock to protect decoder context listYunfei Dong4-2/+11
Add a lock for the ctx_list, to avoid accessing a NULL pointer within the 'vpu_dec_ipi_handler' function when the ctx_list has been deleted due to an unexpected behavior on the SCP IP block. Hardware name: Google juniper sku16 board (DT) pstate: 20400005 (nzCv daif +PAN -UAO -TCO BTYPE=--) pc : vpu_dec_ipi_handler+0x58/0x1f8 [mtk_vcodec_dec] lr : scp_ipi_handler+0xd0/0x194 [mtk_scp] sp : ffffffc0131dbbd0 x29: ffffffc0131dbbd0 x28: 0000000000000000 x27: ffffff9bb277f348 x26: ffffff9bb242ad00 x25: ffffffd2d440d3b8 x24: ffffffd2a13ff1d4 x23: ffffff9bb7fe85a0 x22: ffffffc0133fbdb0 x21: 0000000000000010 x20: ffffff9b050ea328 x19: ffffffc0131dbc08 x18: 0000000000001000 x17: 0000000000000000 x16: ffffffd2d461c6e0 x15: 0000000000000242 x14: 000000000000018f x13: 000000000000004d x12: 0000000000000000 x11: 0000000000000001 x10: fffffffffffffff0 x9 : ffffff9bb6e793a8 x8 : 0000000000000000 x7 : 0000000000000000 x6 : 000000000000003f x5 : 0000000000000040 x4 : fffffffffffffff0 x3 : 0000000000000020 x2 : ffffff9bb6e79080 x1 : 0000000000000010 x0 : ffffffc0131dbc08 Call trace: vpu_dec_ipi_handler+0x58/0x1f8 [mtk_vcodec_dec (HASH:6c3f 2)] scp_ipi_handler+0xd0/0x194 [mtk_scp (HASH:7046 3)] mt8183_scp_irq_handler+0x44/0x88 [mtk_scp (HASH:7046 3)] scp_irq_handler+0x48/0x90 [mtk_scp (HASH:7046 3)] irq_thread_fn+0x38/0x94 irq_thread+0x100/0x1c0 kthread+0x140/0x1fc ret_from_fork+0x10/0x30 Code: 54000088 f94ca50a eb14015f 54000060 (f9400108) ---[ end trace ace43ce36cbd5c93 ]--- Kernel panic - not syncing: Oops: Fatal exception SMP: stopping secondary CPUs Kernel Offset: 0x12c4000000 from 0xffffffc010000000 PHYS_OFFSET: 0xffffffe580000000 CPU features: 0x08240002,2188200c Memory Limit: none Fixes: 655b86e52eac ("media: mediatek: vcodec: Fix possible invalid memory access for decoder") Signed-off-by: Yunfei Dong <[email protected]> Reviewed-by: Nicolas Dufresne <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-26media: mediatek: vcodec: Fix oops when HEVC init failsNicolas Dufresne1-1/+1
The stateless HEVC decoder saves the instance pointer in the context regardless if the initialization worked or not. This caused a use after free, when the pointer is freed in case of a failure in the deinit function. Only store the instance pointer when the initialization was successful, to solve this issue. Hardware name: Acer Tomato (rev3 - 4) board (DT) pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : vcodec_vpu_send_msg+0x4c/0x190 [mtk_vcodec_dec] lr : vcodec_send_ap_ipi+0x78/0x170 [mtk_vcodec_dec] sp : ffff80008750bc20 x29: ffff80008750bc20 x28: ffff1299f6d70000 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 x23: ffff80008750bc98 x22: 000000000000a003 x21: ffffd45c4cfae000 x20: 0000000000000010 x19: ffff1299fd668310 x18: 000000000000001a x17: 000000040044ffff x16: ffffd45cb15dc648 x15: 0000000000000000 x14: ffff1299c08da1c0 x13: ffffd45cb1f87a10 x12: ffffd45cb2f5fe80 x11: 0000000000000001 x10: 0000000000001b30 x9 : ffffd45c4d12b488 x8 : 1fffe25339380d81 x7 : 0000000000000001 x6 : ffff1299c9c06c00 x5 : 0000000000000132 x4 : 0000000000000000 x3 : 0000000000000000 x2 : 0000000000000010 x1 : ffff80008750bc98 x0 : 0000000000000000 Call trace: vcodec_vpu_send_msg+0x4c/0x190 [mtk_vcodec_dec] vcodec_send_ap_ipi+0x78/0x170 [mtk_vcodec_dec] vpu_dec_deinit+0x1c/0x30 [mtk_vcodec_dec] vdec_hevc_slice_deinit+0x30/0x98 [mtk_vcodec_dec] vdec_if_deinit+0x38/0x68 [mtk_vcodec_dec] mtk_vcodec_dec_release+0x20/0x40 [mtk_vcodec_dec] fops_vcodec_release+0x64/0x118 [mtk_vcodec_dec] v4l2_release+0x7c/0x100 __fput+0x80/0x2d8 __fput_sync+0x58/0x70 __arm64_sys_close+0x40/0x90 invoke_syscall+0x50/0x128 el0_svc_common.constprop.0+0x48/0xf0 do_el0_svc+0x24/0x38 el0_svc+0x38/0xd8 el0t_64_sync_handler+0xc0/0xc8 el0t_64_sync+0x1a8/0x1b0 Code: d503201f f9401660 b900127f b900227f (f9400400) Signed-off-by: Nicolas Dufresne <[email protected]> Fixes: 2674486aac7d ("media: mediatek: vcodec: support stateless hevc decoder") Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-26media: mediatek: vcodec: Handle VP9 superframe bitstream with 8 sub-framesIrui Wang1-5/+6
The VP9 bitstream uses superframes, which each contain 8 sub-frames, enable accessing the last superframe by increasing the range of the index vaidation as the maximum number of superframes is 8 and not 7, so that the last sub-frame can be decoded normally with the stateful VP9 decoder. Signed-off-by: Irui Wang <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: verisilicon: Support removing buffers on capture queueBenjamin Gaignard1-0/+1
Allow to remove buffers on capture queue because it the one which own the decoded buffers. After a dynamic resolution change lot of them could remain allocated but won't be used anymore so deleting them save memory. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: v4l2: Add mem2mem helpers for REMOVE_BUFS ioctlBenjamin Gaignard5-0/+19
Create v4l2-mem2mem helpers for VIDIOC_REMOVE_BUFS ioctl and make test drivers use it. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: v4l2: Add REMOVE_BUFS ioctlBenjamin Gaignard4-1/+90
VIDIOC_REMOVE_BUFS ioctl allows to remove buffers from a queue. The number of buffers to remove in given by count field of struct v4l2_remove_buffers and the range start at the index specified in the same structure. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: vidioc-remove-bufs.rst: mention no bufs are freed on error]
2024-03-25media: core: Free range of buffersBenjamin Gaignard1-30/+26
Improve __vb2_queue_free() and __vb2_free_mem() to free range of buffers and not only the last few buffers. Introduce starting index to be flexible on range and change the loops according to this parameter. Signed-off-by: Benjamin Gaignard <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: core: Add bitmap manage bufs array entriesBenjamin Gaignard1-18/+53
Add a bitmap field to know which of bufs array entries are used or not. Remove no more used num_buffers field from queue structure. Use bitmap_find_next_zero_area() to find the first possible range when creating new buffers to fill the gaps. If no suitable range is found try to allocate less buffers than requested. Signed-off-by: Benjamin Gaignard <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: core: Rework how create_buf index returned value is computedBenjamin Gaignard2-10/+22
When REMOVE_BUFS will be introduced holes could created in bufs array. To be able to reuse these unused indices reworking how create->index is set is mandatory. Let __vb2_queue_alloc() decide which first index is correct and forward this to the caller. Signed-off-by: Benjamin Gaignard <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: test-drivers: Set REQBUFS minimum number of buffersBenjamin Gaignard4-13/+5
Instead of using 'min_queued_buffers' field to specify the minimum number of buffers to be allocated when calling REQBUF use 'min_reqbufs_allocation' field which is dedicated to this purpose. Change the minimum requested buffers to 2 for vivid-meta-out and vivid-touch-cap drivers when creating the queues. That allows to remove code which prohibe to allocate only one buffer in their respective queue setup functions. While at it rename vivid_create_queue() parameter. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: videobuf2: Add min_reqbufs_allocation field to vb2_queue structureBenjamin Gaignard1-15/+23
Add 'min_reqbufs_allocation' field in the vb2_queue structure so drivers can specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. When initializing the queue, v4l2 core makes sure that the following constraints are respected: - the minimum number of buffers to allocate must be at least 2 because one buffer is used by the hardware while the other is being processed by userspace. -if the driver needs 'min_queued_buffers' in the queue before calling start_streaming(), then the minimum requirement is 'min_queued_buffers + 1' to keep at least one buffer available for userspace. Simplify __vb2_init_fileio() by using 'min_reqbufs_allocation' directly to avoid duplicating the minimum number of buffers to allocate computation. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: videobuf2: Update vb2_is_busy() logicBenjamin Gaignard1-0/+4
Do not rely on the number of allocated buffers to know if the queue is busy but on a flag set when at least one buffer has been allocated by REQBUFS or CREATE_BUFS ioctl. The flag is reset when REQBUFS is called with count = 0 or the file handle is closed. This is needed because remove buffers feature will be able to remove all the buffers from a queue while streaming so relying on the number of allocated buffers in the queue won't be possible. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: imon: Convert sprintf/snprintf to sysfs_emitLi Zhijian1-6/+6
Per filesystems/sysfs.rst, show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. coccinelle complains that there are still a couple of functions that use snprintf(). Convert them to sysfs_emit(). sprintf() will be converted as weel if they have. Generally, this patch is generated by make coccicheck M=<path/to/file> MODE=patch \ COCCI=scripts/coccinelle/api/device_attr_show.cocci No functional change intended Signed-off-by: Li Zhijian <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: lirc_dev: Make lirc_class constantRicardo B. Marliere1-9/+9
Since commit 43a7206b0963 ("driver core: class: make class_register() take a const *"), the driver core allows for struct class to be in read-only memory, so move the lirc_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: Greg Kroah-Hartman <[email protected]> Suggested-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Ricardo B. Marliere <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: ir-spi: Unify indentation and comment styleAndy Shevchenko1-7/+5
Unify the indentation and multi-line comment style. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: ir-spi: Remove trailing comma in the terminator entryAndy Shevchenko1-2/+2
Remove trailing comma in the terminator entry in ID table(s). Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: ir-spi: Utilise temporary variable for struct deviceAndy Shevchenko1-3/+3
We have a temporary variable to keep pointer to struct device. Utilise it inside the ->probe() implementation. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: ir-spi: Make use of device propertiesAndy Shevchenko1-4/+4
Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: ir-spi: Don't use "proxy" headersAndy Shevchenko1-4/+9
Update header inclusions to follow IWYU (Include What You Use) principle. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: c8sectpfe: Remove unused of_gpio.hAndy Shevchenko1-1/+0
of_gpio.h is deprecated and subject to remove. The driver doesn't use it, simply remove the unused header. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-03-25media: rc: gpio-ir-recv: Remove unused of_gpio.hAndy Shevchenko1-1/+0
of_gpio.h is deprecated and subject to remove. The driver doesn't use it, simply remove the unused header. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>