drivers: video: sw_generator: convert to use the devicetree

Make the video software generator a devicetree node, which allows enabling
several instances, and select it as chosen { zephyr,camera = &... }; node.
It can be enabled via a `video-sw-generator` snippet.

Signed-off-by: Josuah Demangeon <me@josuah.net>
This commit is contained in:
Josuah Demangeon 2025-04-18 00:02:43 +00:00 committed by Benjamin Cabé
commit a3465f8f4d
16 changed files with 97 additions and 57 deletions

View file

@ -0,0 +1,20 @@
.. _snippet-video-sw-generator:
Video Software Generator Snippet (video-sw-generator)
#####################################################
.. code-block:: console
west build -S video-sw-generator [...]
Overview
********
This snippet instantiate a fake video source generating a test pattern continuously
for test purpose. It is selected as the ``zephyr,camera`` :ref:`devicetree` chosen node.
Requirements
************
No hardware support is required besides sufficient memory for the video resolution
declared by :kconfig:option:`CONFIG_VIDEO_BUFFER_POOL_SZ_MAX`.

View file

@ -0,0 +1,3 @@
name: video-sw-generator
append:
EXTRA_DTC_OVERLAY_FILE: video-sw-generator.overlay

View file

@ -0,0 +1,14 @@
/*
* Copyright The Zephyr Project Contributors
* SPDX-License-Identifier: Apache-2.0
*/
/ {
chosen {
zephyr,camera = &video_sw_generator;
};
video_sw_generator: video-sw-generator {
compatible = "zephyr,video-sw-generator";
};
};