summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/mgb4 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* media: pci: drop vb2_ops_wait_prepare/finishHans Verkuil2024-10-282-4/+0
| | | | | | | | | | | | | | | Since commit 88785982a19d ("media: vb2: use lock if wait_prepare/finish are NULL") it is no longer needed to set the wait_prepare/finish vb2_ops callbacks as long as the lock field in vb2_queue is set. Since the vb2_ops_wait_prepare/finish callbacks already rely on that field, we can safely drop these callbacks. This simplifies the code and this is a step towards the goal of deleting these callbacks. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
* media: mgb4: Fix debugfs error handlingMartin Tůma2024-10-126-40/+22
| | | | | | | | Fix broken handling of debugfs_create_dir() errors including errors creating the parent mgb4(PCIe) device's debugfs directory. Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: mgb4: Fixed signal frame rate limit handlingMartin Tůma2024-08-143-11/+12
| | | | | | | | | | | | | Change the default DV timings for the outputs to produce a better signal less "crippled" by the frame rate limiting. While the individual values are now different, the resulting signal still matches the same default display as before. Additionally fix the corner case when the frame rate limit is set to zero causing a "divide by zero" kernel panic. Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: mgb4: Add support for V4L2_CAP_TIMEPERFRAMEMartin Tůma2024-08-148-37/+277
| | | | | | | | | | | | | | | Recent mgb4 firmwares have support for setting a variable framerate independent of the signal framerate. Add/fix (the mgb4 driver already did promote V4L2_CAP_TIMEPERFRAME, but it didn't work) support for V4L2_CAP_TIMEPERFRAME to the driver to enable this feature. Additionally add support for the DV timings API (VIDIOC_G_DV_TIMINGS, VIDIOC_ENUM_DV_TIMINGS, ...) for the outputs that was missing. The timings info is required/used for implementing the V4L2_CAP_TIMEPERFRAME functionality. Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: mgb4: Add support for YUV image formatsMartin Tůma2024-08-143-40/+183
| | | | | | | | Recent mgb4 firmwares support YUV in addition to the RGB image format. Enable YUV in the driver when the FW supports it. Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: mgb4: Fix double debugfs removeMartin Tůma2024-05-271-3/+4
| | | | | | | | | | | Fixes an error where debugfs_remove_recursive() is called first on a parent directory and then again on a child which causes a kernel panic. Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Fixes: 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver") Cc: <stable@vger.kernel.org> [hverkuil: added Fixes/Cc tags]
* media: pci: mgb4: Refactor struct resourcesRicardo Ribalda2024-05-032-3/+3
| | | | | | | | | | | | | | | | | The struct resource end field signifies the end address not the relative offset from the start field i.e size == (end - start) + 1. Amend the .end field to specify the end address not the relative size from the offset as is currently given. Fixes cocci check: drivers/media/pci/mgb4/mgb4_regs.c:13:22-25: WARNING: Suspicious code. resource_size is maybe missing with res Link: https://lore.kernel.org/linux-media/20240429-fix-cocci-v3-1-3c4865f5a4b0@chromium.org Reviewed-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
* media: mgb4: Follow renaming of SPI "master" to "controller"Uwe Kleine-König2024-02-081-7/+7
| | | | | | | | | | | | | | | In commit 8caab75fd2c2 ("spi: Generalize SPI "master" to "controller"") some functions and struct members were renamed. To not break all drivers compatibility macros were provided. To be able to remove these compatibility macros push the renaming into this driver. Reviewed-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/ccad7ad4176265bf90af92add18a0242652f5a84.1707324794.git.u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* media: videobuf2: core: Rename min_buffers_needed field in vb2_queueBenjamin Gaignard2023-12-132-2/+2
| | | | | | | | | | | | Rename min_buffers_needed into min_queued_buffers and update the documentation about it. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: Drop the change where min_queued_buffers + 1 buffers would be] [hverkuil: allocated. Now this patch only renames this field instead of making] [hverkuil: a functional change as well.] [hverkuil: Renamed 3 remaining min_buffers_needed occurrences.]
* media: pci: mgb4: add COMMON_CLK dependencyArnd Bergmann2023-11-161-0/+1
| | | | | | | | | | | | | | | This driver fails to build when HAVE_CLK and COMMON_CLK are disabled: x86_64-linux-ld: vmlinux.o: in function `mgb4_remove': mgb4_core.c:(.text+0x1915e8c): undefined reference to `clkdev_drop' x86_64-linux-ld: mgb4_core.c:(.text+0x1915e98): undefined reference to `clk_hw_unregister' Add a Kconfig dependency to enforce a clean build. Fixes: 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: mgb4: Added support for T200 card variantMartin Tůma2023-11-161-5/+15
| | | | | | | | T200 card variants use the XC7A200T FPGA instead of XC7A100T. The SPI FLASH memory layout is different as the FPGA requires bigger FW images. Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: pci: mgb4: fix potential spectre vulnerabilityHans Verkuil2023-10-131-1/+4
| | | | | | | | | | | Fix smatch warnings: drivers/media/pci/mgb4/mgb4_sysfs_out.c:118 video_source_store() warn: potential spectre issue 'mgbdev->vin' [r] (local cap) drivers/media/pci/mgb4/mgb4_sysfs_out.c:122 video_source_store() warn: possible spectre second half. 'loopin_new' Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: pci: mgb4: Added Digiteq Automotive MGB4 driverMartin Tůma2023-10-0723-0/+4947
Digiteq Automotive MGB4 is a modular frame grabber PCIe card for automotive video interfaces. As for now, two modules - FPD-Link and GMSL - are available and supported by the driver. The card has two inputs and two outputs (FPD-Link only). In addition to the video interfaces it also provides a trigger signal interface and a MTD interface for FPGA firmware upload. Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>