summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-10-28media: videobuf2-core: update vb2_thread if wait_finish/prepare are NULLHans Verkuil1-6/+20
The vb2_thread is used for DVB support. This will queue and dequeue buffers automatically. It calls wait_finish/prepare around vb2_core_dqbuf() and vb2_core_qbuf(), but that assumes all drivers have these ops set. But that will change due to commit 88785982a19d ("media: vb2: use lock if wait_prepare/finish are NULL"). So instead just check if the callback is available, and if not, use q->lock, just as __vb2_wait_for_done_vb() does. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-23media: uvcvideo: Stop stream during unregisterRicardo Ribalda1-1/+31
uvc_unregister_video() can be called asynchronously from uvc_disconnect(). If the device is still streaming when that happens, a plethora of race conditions can occur. Make sure that the device has stopped streaming before exiting this function. If the user still holds handles to the driver's file descriptors, any ioctl will return -ENODEV from the v4l2 core. This change makes uvc more consistent with the rest of the v4l2 drivers using the vb2_fop_* and vb2_ioctl_* helpers. This driver (and many other usb drivers) always had this problem, but it wasn't possible to easily fix this until the vb2_video_unregister_device() helper was added. So the Fixes tag points to the creation of that helper. Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl> Suggested-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Fixes: f729ef5796d8 ("media: videobuf2-v4l2.c: add vb2_video_unregister_device helper function") Cc: stable@vger.kernel.org # 5.10.x [hverkuil: add note regarding Fixes version] Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: renesas: rzg2l-cru: Add 'yuv' flag to IP format structureLad Prabhakar3-5/+8
Add a 'yuv' flag to the `rzg2l_cru_ip_format` structure to indicate whether a given format is YUV-based and update the `rzg2l_cru_ip_formats` array with this flag appropriately. This change enables a more efficient way to check if the input and output formats use the same colorspace. With this change, we can eliminate the use of `v4l2_format_info()` in `rzg2l_cru_initialize_image_conv()` as the necessary details for the source and destination formats are already available through the `yuv` flag. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-24-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Move register definitions to a separate fileLad Prabhakar4-70/+82
Move the RZ/G2L CRU register definitions from `rzg2l-video.c` to a dedicated header file, `rzg2l-cru-regs.h`. Separating these definitions into their own file improves the readability of the code. Suggested-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-23-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Add support to capture 8bit raw sRGBLad Prabhakar2-0/+32
Add support to capture 8bit Bayer formats. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-22-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Refactor ICnDMR register configurationLad Prabhakar3-8/+9
Refactor the ICnDMR register configuration in `rzg2l_cru_initialize_image_conv()` by adding a new member `icndmr` in the `rzg2l_cru_ip_format` structure. Suggested-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-21-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: csi2: Use rzg2l_csi2_formats array in enum_frame_sizeLad Prabhakar1-0/+3
Make use of `rzg2l_csi2_formats` array in rzg2l_csi2_enum_frame_size() to validate if the `fse->code` is supported. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-20-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: video: Implement .link_validate() callbackLad Prabhakar1-44/+38
Implement the `.link_validate()` callback for the video node and move the format checking into this function. This change allows the removal of `rzg2l_cru_mc_validate_format()`. Note, the fmt.format.code and fmt.format.field checks have be dropped as the subdev .set_fmt() handler ensures that those fields always hold valid values. Suggested-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-19-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: csi2: Remove unused field from rzg2l_csi2_formatLad Prabhakar1-2/+1
Remove the unused `datatype` field from the `rzg2l_csi2_format` struct and update the `rzg2l_csi2_formats[]` array to reflect the updated structure. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-18-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Use `rzg2l_cru_ip_formats` array in enum_frame_sizeLad Prabhakar1-1/+1
Use the `rzg2l_cru_ip_formats` array in `rzg2l_cru_ip_enum_frame_size()` to validate the format code. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-17-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Make use of v4l2_format_info() helpersLad Prabhakar1-15/+7
Make use of v4l2_format_info() helpers to determine the input and output formats. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-16-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Inline calculating bytesperlineLad Prabhakar1-10/+6
Remove the `rzg2l_cru_format_bytesperline()` function and inline the calculation of `bytesperline` directly in `rzg2l_cru_format_align()`. This simplifies the code by removing an unnecessary function call and directly multiplying the image width by the `bpp` (bytes per pixel) from the format structure. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-15-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Simplify handling of supported formatsLad Prabhakar3-24/+37
Refactor the handling of supported formats in the RZ/G2L CRU driver by adding `pixelformat` and `bpp` members to the `rzg2l_cru_ip_format` structure. New helper functions, `rzg2l_cru_ip_format_to_fmt()` and `rzg2l_cru_ip_index_to_fmt()`, are added to retrieve format information based on 4CC format and index, respectively. These helpers allow the removal of the now redundant `rzg2l_cru_format_from_pixel()` function. The new helpers are used in `rzg2l_cru_format_bytesperline()`, `rzg2l_cru_format_align()`, and `rzg2l_cru_enum_fmt_vid_cap()`, streamlining the handling of supported formats and improving code maintainability. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-14-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Inline calculating image sizeLad Prabhakar1-6/+1
Inline the `rzg2l_cru_format_sizeimage()` function into its single caller as the function is trivial and is not expected to be called anywhere else. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-13-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Simplify configuring input format for image processingLad Prabhakar3-12/+26
Move the `rzg2l_cru_ip_format` struct to `rzg2l-cru.h` for better accessibility and add a `datatype` member to it, allowing the configuration of the ICnMC register based on the MIPI CSI2 data type. Also, move the `rzg2l_cru_ip_code_to_fmt()` function to `rzg2l-cru.h` to streamline format lookup and make it more accessible across the driver. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-12-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Remove unnecessary WARN_ON check in format funcLad Prabhakar1-3/+0
`WARN_ON(!fmt)` check in `rzg2l_cru_format_bytesperline()` is unnecessary because the `rzg2l_cru_format_align()` function ensures that a valid `pixelformat` is set before calling `rzg2l_cru_format_bytesperline()`. As a result, `rzg2l_cru_format_from_pixel()` is guaranteed to return a non-NULL value, making the check redundant. Additionally, the return type of `rzg2l_cru_format_bytesperline()` is `u32`, but the code returned `-EINVAL`, a negative value. This mismatch is now resolved by removing the invalid error return path. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-11-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Remove unused fields from rzg2l_cru_ip_format structLad Prabhakar1-3/+1
Simplified the `rzg2l_cru_ip_format` struct by removing the unused `datatype` and `bpp` fields from the structure in `rzg2l-ip.c`. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-10-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Use MIPI CSI-2 data types for ICnMC_INF definitionsLad Prabhakar1-4/+4
The INF field in the ICnMC register accepts data type codes as specified in the MIPI CSI-2 v2.1 specification. This patch introduces the `ICnMC_INF()` macro to use the MIPI CSI-2 data types, which are available in the `media/mipi-csi2.h` header. Suggested-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-9-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Remove `channel` member from `struct rzg2l_cru_csi`Lad Prabhakar3-8/+8
Remove the CSI virtual channel number from `struct rzg2l_cru_csi`. Instead, pass the CSI virtual channel number as an argument to `rzg2l_cru_csi2_setup()`. Suggested-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-8-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Retrieve virtual channel informationLad Prabhakar3-5/+39
The RZ/G2L CRU needs to configure the ICnMC.VCSEL bits to specify which virtual channel should be processed from the four available VCs. To retrieve this information from the connected subdevice, the .get_frame_desc() function is called. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-7-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: csi2: Implement .get_frame_desc()Lad Prabhakar1-0/+20
The RZ/G2L CRU requires information about which VCx to process data from, among the four available VCs. To obtain this information, the .get_frame_desc() routine is implemented. This routine, in turn, calls .get_frame_desc() on the remote sensor connected to the CSI2 bridge. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-6-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: csi2: Use ARRAY_SIZE() in media_entity_pads_init()Lad Prabhakar1-1/+2
The media_entity_pads_init() function was previously hardcoded to use a magic number for the number of pads. Replace the magic number with the ARRAY_SIZE() macro to determine the number of pads dynamically. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-5-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: csi2: Mark sink and source pad with MUST_CONNECT flagLad Prabhakar1-2/+4
Mark the sink and source pad with the MEDIA_PAD_FL_MUST_CONNECT flag to ensure pipeline validation fails if it is not connected. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Mark sink and source pad with MUST_CONNECT flagLad Prabhakar2-3/+5
Mark the sink and source pad with the MEDIA_PAD_FL_MUST_CONNECT flag to ensure pipeline validation fails if it is not connected. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: rzg2l-cru: Use RZG2L_CRU_IP_SINK/SOURCE enum entriesLad Prabhakar1-2/+2
Use enum values (`RZG2L_CRU_IP_SINK` and `RZG2L_CRU_IP_SOURCE`) instead of hardcoded array indices. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20241018133446.223516-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-22media: platform: rzg2l-cru: rzg2l-video: Set AXI burst max lengthBiju Das1-0/+11
As per the hardware manual section 35.2.3.26 'AXI Master Transfer Setting Register for CRU Image Data', it is mentioned that to improve the transfer performance of CRU, it is recommended to use AXILEN value '0xf' for AXI burst max length setting for image data. Signed-off-by: Hien Huynh <hien.huynh.px@renesas.com> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20240905111828.159670-1-biju.das.jz@bp.renesas.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-10-16media: atomisp: Replace ternary operator with ifRicardo Ribalda1-2/+4
Replace the ternary operator with an if. In this case the code is more clear and also fixes the following cocci warnings: drivers/staging/media/atomisp/pci/sh_css_frac.h:40:17-18: WARNING opportunity for max() drivers/staging/media/atomisp/pci/sh_css_frac.h:50:17-18: WARNING opportunity for max() Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-16media: platform: video-mux: Fix mutex lockingPaul Elder1-3/+3
The current order of locking between the driver mutex and the v4l2 subdev state lock causes a circular locking dependency when trying to set up a link. Fix this. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [Sakari Ailus: Fix spelling in commit message.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-16media: ipu6: remove redundant dependency in KconfigBingbu Cao1-1/+1
IPU6 driver simply depends on X86, X86 and 64BIT cover the X86_64, redundant X86_64 dependency in Kconfig could be removed. Fixes: c70281cc83d6 ("media: intel/ipu6: add Kconfig and Makefile") Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-16media: ipu6: fix the wrong type casting and 64-bit divisionBingbu Cao7-17/+18
This patch fixes the build errors with `i386-allmodconfig`, the errors are caused by wrong type casting and 64-bit division. Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-16v4l2-subdev: Return -EOPNOTSUPP for unsupported pad type in ↵Lad Prabhakar1-0/+5
call_get_frame_desc() The `get_frame_desc()` operation should always be called on a source pad, which is indicated by the `MEDIA_PAD_FL_SOURCE` flag. This patch adds a check in `call_get_frame_desc()` to ensure that the `MEDIA_PAD_FL_SOURCE` flag is set for the pad before invoking `get_frame_desc()`. If the pad is not a source pad, the function will return an `-EOPNOTSUPP` error, signaling that the operation is not supported on non-source pads. Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-16media: i2c: ds90ub960: Fix missing return check on ub960_rxport_read callColin Ian King1-1/+1
The function ub960_rxport_read is being called and afterwards ret is being checked for any failures, however ret is not being assigned to the return of the function call. Fix this by assigning ret to the return of the call which appears to be missing. Fixes: afe267f2d368 ("media: i2c: add DS90UB960 driver") Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-16media: Documentation: Improve v4l2_subdev_{en,dis}able_streams documentationSakari Ailus1-0/+4
Document that callers of v4l2_subdev_{en,dis}able_streams() need to set the mask to BIT_ULL(0). Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-16media: Documentation: Update {enable,disable}_streams documentationSakari Ailus1-0/+8
Document the expected {enable,disable}_streams callback behaviour for drivers that are stream-unaware i.e. don't specify the V4L2_SUBDEV_CAP_STREAMS sub-device capability flag. In this specific case, the mask argument can be ignored. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-16media: Documentation: Deprecate s_stream video op, update docsSakari Ailus3-11/+15
The scope of the s_stream video operation is now fully supported by {enable,disable}_streams. Explicitly document the s_stream() op as deprecated and update the related documentation. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-16media: platform: rzg2l-cru: rzg2l-video: Move request_irq() to probe()Biju Das3-21/+13
Move request_irq() to probe(), in order to avoid requesting IRQ during device start which happens frequently. As this function is in probe(), it is better to replace it with its devm variant for managing the resource efficiently. While at it, drop the IRQF_SHARED flag as currently there is a single user for this IRQ. Suggested-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-16media: i2c: vgxy61: Fix an error handling path in vgxy61_detect()Christophe JAILLET1-1/+1
If cci_read() fails, 'st' is set to 0 in cci_read(), so we return success, instead of the expected error code. Fix it and return the expected error. Fixes: 9a6d7f2ba2b9 ("media: i2c: st-vgxy61: Convert to CCI register access helpers") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-16media: admin-guide: Document the Raspberry Pi CFE (rp1-cfe)Tomi Valkeinen3-0/+106
Add documentation for rp1-cfe driver. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-16media: raspberrypi: Add support for RP1-CFETomi Valkeinen17-0/+4989
Add support for Raspberry Pi CFE. The CFE is a hardware block that contains: - MIPI D-PHY - MIPI CSI-2 receiver - Front End ISP (FE) The driver has been upported from the Raspberry Pi kernel commit 88a681df9623 ("ARM: dts: bcm2712-rpi: Add i2c<n>_pins labels"). Co-developed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>