aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/platform/st/stm32
AgeCommit message (Collapse)AuthorFilesLines
2024-07-03media: stm32: dcmipp: correct error handling in dcmipp_create_subdevsAlain Volmat1-2/+2
Correct error handling within the dcmipp_create_subdevs by properly decrementing the i counter when releasing the subdevs. Fixes: 28e0f3772296 ("media: stm32-dcmipp: STM32 DCMIPP camera interface driver") Cc: [email protected] Signed-off-by: Alain Volmat <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Acked-by: Sakari Ailus <[email protected]> [hverkuil: correct the indices: it's [i], not [i - 1].]
2024-06-27Revert "media: stm32: dcmipp: correct error handling in dcmipp_create_subdevs"Hans Verkuil1-1/+1
This reverts commit 77d32b7e2a7b2e5389b67363d25371b4b8cad140. This patch is obviously wrong (causes array accesses at index -1), and I caught that just too late.
2024-06-27media: stm32: dcmipp: correct error handling in dcmipp_create_subdevsAlain Volmat1-1/+1
Correct error handling within the dcmipp_create_subdevs by properly decrementing the i counter when releasing the subdeves. Fixes: 28e0f3772296 ("media: stm32-dcmipp: STM32 DCMIPP camera interface driver") Cc: [email protected] Signed-off-by: Alain Volmat <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-05-03media: stm32-dcmipp: Remove redundant printkRicardo Ribalda1-5/+2
platform_get_irq() already prints an error message. Also platform_get_irq() can never return 0, so lets fix the condition now that we are at it. Found by cocci: drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c:444:3-10: line 444 is redundant because platform_get_irq() already prints an error Link: https://lore.kernel.org/linux-media/[email protected] Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-02-28media: stm32-dcmipp: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-02-23media: platform: replace of_graph_get_next_endpoint()Kuninori Morimoto1-2/+2
From DT point of view, in general, drivers should be asking for a specific port number because their function is fixed in the binding. of_graph_get_next_endpoint() doesn't match to this concept. Simply replace - of_graph_get_next_endpoint(xxx, NULL); + of_graph_get_endpoint_by_regs(xxx, 0, -1); Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-12-13media: videobuf2: core: Rename min_buffers_needed field in vb2_queueBenjamin Gaignard2-3/+3
Rename min_buffers_needed into min_queued_buffers and update the documentation about it. Signed-off-by: Benjamin Gaignard <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [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.]
2023-12-04media: stm32-dcmipp: STM32 DCMIPP camera interface driverHugues Fruchet9-0/+2914
This V4L2 subdev driver enables Digital Camera Memory Interface Pixel Processor(DCMIPP) of STMicroelectronics STM32 SoC series. Signed-off-by: Hugues Fruchet <[email protected]> Signed-off-by: Alain Volmat <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: remove empty line at end of source]
2023-11-23media: stm32-dcmi: Drop unnecessary of_match_device() callRob Herring1-8/+0
If probe is reached, we've already matched the device and in the case of DT matching, the struct device_node pointer will be set. Therefore, there is no need to call of_match_device() in probe. Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-08-10media: stm32: dcmi: only call s_stream on the source subdevAlain Volmat1-49/+14
Avoid calling s_stream on each subdev until reaching the sensor and instead call s_stream on the source subdev only (which will in turn do whatever needed to start the stream). Signed-off-by: Alain Volmat <[email protected]> Reviewed-by: Hugues FRUCHET <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-08-10media: v4l: async: Set v4l2_device and subdev in async notifier initSakari Ailus1-2/+2
Set the v4l2_device already in async notifier init, so struct device related to it will be available before the notifier is registered. This requires separating notifier initialisation into two functions, one that takes v4l2_device as its argument, v4l2_async_nf_init and v4l2_async_subdev_nf_init, for sub-device notifiers. Registering the notifier will use a single function, v4l2_async_nf_register. This is done in order to make struct device available earlier, during construction of the async connections, for sensible debug prints. Signed-off-by: Sakari Ailus <[email protected]> Tested-by: Philipp Zabel <[email protected]> # imx6qp Tested-by: Niklas Söderlund <[email protected]> # rcar + adv746x Tested-by: Aishwarya Kothari <[email protected]> # Apalis i.MX6Q with TC358743 Tested-by: Lad Prabhakar <[email protected]> # Renesas RZ/G2L SMARC Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-07-28media: v4l: async: Rename v4l2_async_subdev as v4l2_async_connectionSakari Ailus1-4/+4
Rename v4l2_async_subdev as v4l2_async_connection, in order to differentiate between the sub-devices and their connections: one sub-device can have many connections but the V4L2 async framework has so far allowed just a single one. Connections in this context will later translate into either MC ancillary or data links. This patch prepares changing that relation by changing existing users of v4l2_async_subdev to switch to v4l2_async_connection. Async sub-devices themselves will not be needed anymore Additionally, __v4l2_async_nf_add_subdev() has been renamed __v4l2_async_nf_add_connection(). Signed-off-by: Sakari Ailus <[email protected]> Tested-by: Philipp Zabel <[email protected]> # imx6qp Tested-by: Niklas Söderlund <[email protected]> # rcar + adv746x Tested-by: Aishwarya Kothari <[email protected]> # Apalis i.MX6Q with TC358743 Tested-by: Lad Prabhakar <[email protected]> # Renesas RZ/G2L SMARC Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-07-19media: stm32-dcmi: Use devm_platform_get_and_ioremap_resource()Yangtao Li1-13/+4
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-04-11media: stm32-dcmi: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-04-11media: dma2d: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-03-20media: stm32: dma2d: remove unused fb_bufHans Verkuil1-2/+0
Drop the unused struct v4l2_framebuffer fb_buf in struct dma2d_ctx. Signed-off-by: Hans Verkuil <[email protected]> CC: Hugues Fruchet <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-03-19media: stm32-dcmi: Enable incoherent buffer allocationMarek Vasut1-0/+1
Set allow_cache_hints to 1 for the vb2_queue capture queue in the STM32MP15xx DCMI V4L2 driver. This allows us to allocate buffers with the V4L2_MEMORY_FLAG_NON_COHERENT set. On STM32MP15xx SoCs, this enables caching for this memory, which improves performance when being read from CPU. This change should be safe from race conditions since videobuf2 already invalidates or flushes the appropriate cache lines in its prepare() and finish() methods. Tested on a STM32MP157F SoC. Resulted in 4x buffer access speedup. Signed-off-by: Marek Vasut <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-03-19media: platform: stm32: use devm_platform_get_and_ioremap_resource()Ye Xingchen1-4/+1
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Ye Xingchen <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-12-07media: Switch to use dev_err_probe() helperYang Yingliang1-18/+9
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER. Reviewed-by: Sean Young <[email protected]> Reviewed-by: Ricardo Ribalda <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Acked-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-10-24media: stm32: dcmi: Remove redundant dev_err callShang XiaoJing1-3/+1
devm_ioremap_resource() prints error message in itself. Remove the dev_err call to avoid redundant error message. Signed-off-by: Shang XiaoJing <[email protected]> Acked-by: Hugues Fruchet <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-09-24media: drivers: use video device pipeline start/stopTomi Valkeinen1-3/+3
Convert the media drivers to use video device based pipeline start/stop where possible. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-07-17media: mc-entity: Rename media_entity_remote_pad() to ↵Laurent Pinchart1-3/+3
media_pad_remote_pad_first() The media_entity_remote_pad() is misnamed, as it operates on a pad and not an entity. Rename it to media_pad_remote_pad_first() to clarify its behaviour. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Hans Verkuil <[email protected]> Acked-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-07-15media: stm32: dcmi: Fix subdev op call with uninitialized stateTomi Valkeinen1-12/+2
stm32-dcmi calls its source subdev with v4l2_subdev_call() using a v4l2_subdev_state constructed on stack. This means that init_cfg is never called for that state, and a source subdev that depends on the init_cfg call may break. A new macro has been added for this particular purpose, which properly initializes the state, so let's use v4l2_subdev_call_state_try() here. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Hans Verkuil <[email protected]> Tested-by: Marek Vasut <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-07-08media: stm32-dcmi: add support of 1X16 serial pixel formats variantHugues Fruchet1-6/+12
Add support of 1X16 serial pixel formats in order to support CSI-2 camera sensor exposing 1x16 pixel formats only. Signed-off-by: Hugues Fruchet <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]> Cc: Alain Volmat <[email protected]> Cc: Alexandre Torgue <[email protected]> Cc: Amelie DELAUNAY <[email protected]> Cc: Hugues FRUCHET <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Philippe CORNU <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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 <[email protected]> Cc: Alain Volmat <[email protected]> Cc: Alexandre Torgue <[email protected]> Cc: Amelie DELAUNAY <[email protected]> Cc: Hugues FRUCHET <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Philippe CORNU <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-04-24media: mc: Set bus_info in media_device_init()Sakari Ailus1-2/+0
Set bus_info field based on struct device in media_device_init() and remove corresponding code from drivers. Also update media_device_init() documentation: the dev field must be now initialised before calling it. Signed-off-by: Sakari Ailus <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-03-18media: Kconfig: cleanup VIDEO_DEV dependenciesMauro Carvalho Chehab1-2/+2
media Kconfig has two entries associated to V4L API: VIDEO_DEV and VIDEO_V4L2. On Kernel 2.6.x, there were two V4L APIs, each one with its own flag. VIDEO_DEV were meant to: 1) enable Video4Linux and make its Kconfig options to appear; 2) it makes the Kernel build the V4L core. while VIDEO_V4L2 where used to distinguish between drivers that implement the newer API and drivers that implemented the former one. With time, such meaning changed, specially after the removal of all V4L version 1 drivers. At the current implementation, VIDEO_DEV only does (1): it enables the media options related to V4L, that now has: menu "Video4Linux options" visible if VIDEO_DEV source "drivers/media/v4l2-core/Kconfig" endmenu but it doesn't affect anymore the V4L core drivers. The rationale is that the V4L2 core has a "soft" dependency at the I2C bus, and now requires to select a number of other Kconfig options: config VIDEO_V4L2 tristate depends on (I2C || I2C=n) && VIDEO_DEV select RATIONAL select VIDEOBUF2_V4L2 if VIDEOBUF2_CORE default (I2C || I2C=n) && VIDEO_DEV In the past, merging them would be tricky, but it seems that it is now possible to merge those symbols, in order to simplify V4L dependencies. Let's keep VIDEO_DEV, as this one is used on some make *defconfig configurations. Suggested-by: Laurent Pinchart <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> # for meson-vdec & meson-ge2d Acked-by: Andrzej Pietrasiewicz <[email protected]> Acked-by: Łukasz Stelmach <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-03-18media: platform: place stm32/ and sti/ under st/ dirMauro Carvalho Chehab7-0/+3340
As the end goal is to have platform drivers split by vendor, move both stm32/ and sti/ for them to be inside st/ directory. Acked-by: Hugues Fruchet <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>