Commit graph

379 commits

Author SHA1 Message Date
Brenden Adamczak
32701782c8 drivers: video: dcmipp: added Grey/Raw8 format capture
Added the ability to capture a RAW8 capture by using the GREY FourCC format
through the dump pipe.

Without this patch you could get Grey RAW8 via the pipes 1 and 2 but
not through pipe 0 "dump" pipe. To use Pipe 0 you would have to pretend
the format is a bayer pattern with RAW_BAYER_UNPACKED(8).
Which would cause mismatches when you tried to actually use the buffer.

Signed-off-by: Brenden Adamczak <cerebralasylum1@gmail.com>
2026-05-18 18:39:22 +02:00
Kate Wang
12782f1c9d drivers: video: sw_generator: Add JPEG and PNG format support
Add support for JPEG and PNG compressed formats to the video software
generator driver. This enables testing of compressed video formats
without requiring actual camera hardware.

The compressed frame buffers are included at compile time via
generated header files, with configurable file names to support
custom test patterns.

Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
2026-05-13 14:42:44 +02:00
Alain Volmat
4f8137d035 video: imx335: test_pattern handling support
This commit adds the handling of test patterns generated
by the sensor.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-05-07 18:14:22 -05:00
Phi Bang Nguyen
591047374c drivers: video: sw_generator: Add support for BGR24 and BGRX32 formats
Add support for VIDEO_PIX_FMT_BGR24 and VIDEO_PIX_FMT_BGRX32 formats

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2026-04-24 15:37:46 -04:00
Kate Wang
a403230c5e drivers: video: Add format size estimation for PNG and NV12/NV21
- PNG is treated similarly to JPEG with a rough worst-case estimate.
- Treat NV12/NV21 formats specially rather than fall into the default
condition. These 2-planar YUV formats have a pitch equal to width and
a total size of pitch * height * 2 (Y plane + interleaved UV plane).

Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
2026-04-14 22:23:18 -04:00
Pisit Sawangvonganan
4328b32b5c drivers: fix typo in (serial, spi, tee, timer, usb, usb_c, video)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/serial`
- `drivers/spi`
- `drivers/tee`
- `drivers/timer`
- `drivers/usb`
- `drivers/usb_c`
- `drivers/video`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-27 20:21:24 -04:00
Krystian Balicki
92514c2c18 drivers: video: add arducam camera driver
The Arducam mega is a low power, rolling shutter camera, supports
connecting one or more cameras to any microcontroller. It provides
high-quality image capture and processing capabilities, making it
highly suitable for various application fields, including machine
vision, image recognition, and robotics, among others. In current
implementation connecting multiple instances of the same camera
system is problematic.

Co-authored-by: Lee Jackson <lee.jackson@arducam.com>
Signed-off-by: Krystian Balicki <kristos_b@wp.pl>
2026-03-24 15:36:22 -05:00
Alain Volmat
5a27dc2b25 drivers: video: check parameters of video_closest_frmival_*
Add parameter checking of in functions video_closest_frmival
and video_closest_frmival_stepwise and return an error in
case of invalid parameter.
Previously ASSERT were used, but thoses are not always enabled,
leading to possibility to have invalid parameter being used.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-03-20 09:57:20 -05:00
Alain Volmat
055a9c29bf drivers: video: return an error instead of ASSERT
ASSERT are not always enabled, leading to not catching
invalid arguments in situation where it is not enabled.
Replace all ASSERT statement with argument check, properly
returning error instead of accessing invalid addresses.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-03-20 09:57:20 -05:00
Alain Volmat
7559b5102b drivers: video: avoid ASSERT in video_(auto_)cluster_ctrl
ASSERT aren't always enabled hence add return value in
video_auto_cluster_ctrl and video_cluster_ctrl functions
in order to avoid accessing invalid parameter and return
an error.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-03-20 09:57:20 -05:00
Phi Bang Nguyen
cb4e0478a0 drivers: video: Add support for external buffers
Add video_import_buffer() API and necessary changes to support buffers
allocated from outside, not from the video heap.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2026-03-20 18:18:08 +09:00
Phi Bang Nguyen
11049950ea drivers: video: Enqueue and track internal buffers via index
Currently, the video_enqueue() API enqueues the whole external video
buffer container structure from the application and the driver stores
this container in its FIFO queue.

While it works in simple applications where the enqueued video_buffer
container persists for the whole program lifecycle, it does not work in
situations where we cannot keep this container, e.g. enqueuing a buffer
inside a function, the local variable will be destroyed when the function
returns and hence the buffer is no longer valid.

Video buffers can be tracked via their indices in the buffer pool.
Set the index field when buffers are allocated and enqueue the internal
buffer rather than the external one to fix the issue.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2026-03-20 18:18:08 +09:00
Josuah Demangeon
1547179e0a drivers: video: fix ARGB32/XRGB32 formats and variants.
Fix the representation of pixel formats with an X (unused) or A (alpha)
channel to make the four character match the order in the channels in
memory byte per byte.

These formats are imported from Linux but contain a naming inconsistency.

The four character codes still match the Linux formats from V4L2
include/uapi/linux/videodev2.h based on the byte content rather than the
name: this means that communicating with Linux systems will work, but
sharing source code with Linux will need to modify the variable names.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-03-18 15:24:12 -05:00
Alain Volmat
c2a70c6cd6 drivers: video: dcmipp: use VIDEO_FMT_IS_ macro to known colorspace
Make usage of the macro VIDEO_FMT_IS_YUV/RGB/BAYER in order to
check the colorspace of a format.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-03-18 11:00:36 +09:00
Josuah Demangeon
d9dde2f551 drivers: video: categorize pixel formats categories
Add categories of pixel formats along with macros to detect
whether a pixel format is part of that category.
This can be used to detect multiple properties in a
maintainable way.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-03-18 11:00:36 +09:00
Josuah Demangeon
4e2a4c2696 drivers: video: shell: support more than 10 completions
The video shell uses a workaround to have different sub-commands use
different completions. Raise the limit of maximum completions from 10 up
to 20 to support more devices.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-03-16 18:59:44 -05:00
Josuah Demangeon
3b92cb59db drivers: video: shell: add a "video tree" command
Add a "video tree <device>" command to show the topology of video devices.
This follows the chain of source devices as defined by
VIDEO_DEVICE_DEFINE() in the macros.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-03-16 18:59:44 -05:00
Josuah Demangeon
79aa7e3845 drivers: video: shell: fix shell tab completion when device fails
The tab completion was not showing the valid devices after the failed
devices. Fix it by continuing to search for devices after a failed device.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-03-16 18:59:44 -05:00
Josuah Demangeon
7ecb1d032f drivers: video: shell: add tab completion for "video selection ..."
Add support for completion for the "video selection" shell command.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-03-16 18:59:44 -05:00
Felipe Neves
89de9b7ca9 video: ov5640: fix out of bounds
control initialization by setting the control array first.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
2026-03-16 10:08:54 -04:00
Josuah Demangeon
f527724abf drivers: video: add formats: 8-bit padded to 16-bit
Add padded formats as seen on Himax image sensors used with 8-bit
DVP receivers, where half of the pins are used, leading to empty
bits in memory. This replaces the Y4 format which is 8-bit despite
only giving 4-bit filled with data per byte.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-03-16 10:06:44 -04:00
Phi Bang Nguyen
c916a4a141 include: drivers: video: Use uint16 for buffer index
The buffer index is to track the buffers in the whole video buffer pool
which may be used for several video pipeline, each can use up to an
uint8 buffer. Extend the type to uint16 to account for this fact.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2026-03-16 12:22:32 +01:00
Phi Bang Nguyen
5e51280b07 drivers: video: video_common: Drop mem_block structure
The mem_block structure and the video_block array are not needed.
Drop them.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2026-03-16 12:22:32 +01:00
Phi Bang Nguyen
1a74f9b50e drivers: video: ov5640: Expose the high framerates first
Expose the high framerates first so that it can be listed first and
chosen as the default frame rate in some applications.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2026-03-16 12:22:32 +01:00
Phi Bang Nguyen
263abcfe1d video: controls: Add VIDEO_CID_ROTATE
Add VIDEO_CID_ROTATE which is needed for some m2m devices.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2026-03-16 12:22:32 +01:00
Sylvio Alves
c64a74e711 espressif: adapt to hal_espressif IDF master sync
Adapt all Espressif SoC and driver code to the updated
hal_espressif module synced with IDF master branch.

Main changes:
- clock control: delegate peripheral clock gating to HAL
  layer using new clock/reset APIs
- SPI/GDMA: adapt to restructured DMA HAL with new channel
  allocation and configuration interfaces
- ethernet: add RMII clock configuration and PHY management
- GPIO: simplify using direct HAL function calls
- flash: adapt to updated SPI flash HAL interfaces
- linker scripts: update IRAM/DRAM mappings for new HAL
  object files
- DTS: fix ESP32-S2 PSRAM dcache1 address to match actual
  MMU mapping region (0x3f800000 DRAM1 instead of 0x3f500000
  DPORT which lacks 8-bit access capability)
- west.yml: update hal_espressif revision

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-03-13 11:38:18 +01:00
Alain Volmat
e8b48d89a9 video: stm32-dcmipp: dcmipp requires 16bytes aligned buffers
Add the buf_align entry in caps to indicate buffer alignment
constraints.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-03-12 12:08:51 -04:00
Josuah Demangeon
4282f14306 drivers: video: introduce Sony IMX219 sensor driver
Add support for the Sony IMX219 CSI sensor.
This sensor supports resolution of 3280x2464 in RGGB bayer format
either 8 or 10 bits and using 2 or 4 CSI lanes.
Only 10 bits on 2 CSI lanes is currently supported, and only in
1920x1080 pixel resolution using cropping using the video_set_format(),
and will need to be converted to video_set_selection() instead.

Signed-off-by: Josuah Demangeon <me@josuah.net>
Co-authored-by: Alan Shaju <alanshaju@rideltech.com>
Co-authored-by: Alain Volmat <alain.volmat@foss.st.com>
2026-03-10 15:04:02 +01:00
Josuah Demangeon
591d6e3d17 drivers: video: sort CMakeLists.txt/Kconfig imports
Switch to zephyr-keep-sorted-start/stop to keep checking the new
driver imports are always sorted, which reduces chances of git
conflict while adding new drivers from separate branches.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-03-10 15:04:02 +01:00
Josuah Demangeon
70e1f96cb6 driver: video: ctrls: add VIDEO_CID_DIGITAL_GAIN
Only VIDEO_CID_ANALOGUE_GAIN and VIDEO_CID_GAIN were defined. Also add
the complementary VIDEO_CID_DIGITAL_GAIN.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-03-10 15:04:02 +01:00
Kurt Eckhardt
26ae95ecb9 drivers: video: hm01b0 - add missing pieces
Adding some of the missing pieces to the HM01b0 video class.

changed the VIDEO define to match all of the other video drivers
that I have tried:
That is CONFIG_VIDEO_HIMAX_HM01B0 to CONFIG_VIDEO_HM01B0

Added a few more format sizes: 324x324 to 324x244 164x122
match the spec.

Added BAYER format for the color camera (VIDEO_PIX_FMT_SBGGR8)
Only for Full, and QVGA, as cameras with BAYER filter do
not support the binning mode.

Added 4 data bit support, using new format: VIDEO_PIX_FMT_Y4

Support for hflip/vflip controls.

Added the frmival set/get/enum functions, to allow us better
control of how many frames are generated per second.

Used the reset register enumeration similar to other implementions,
such as Arduino library, Teensy Library, and OpenME

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
2026-03-08 16:35:20 +01:00
Chin-Yao Hung
29640a77c6 drivers: video: shell: fix incorrect endptr usage in strtoll
The current implementation of video_shell_set_ctrl() incorrectly
passes &arg_value as the endptr to strtoll(), while attempting
to validate the result using an uninitialized end_value pointer.
This causes the check (*end_value != '\0') to always trigger
shell_error.

Update the code to pass the address of end_value to strtoll()
correctly, ensuring it points to the first invalid character
within the input string for proper validation.

Signed-off-by: Chin-Yao Hung <cy.hung@guc-asic.com>
2026-02-27 15:30:02 +01:00
Mathieu Choplain
a11688fab5 drivers: *: stm32: don't check if clock device is ready
If the clock device (i.e., RCC) failed to initialize, we have bigger
problems than trying to call clock_control_{off,on,configure} on it.
Don't bother checking to save some footprint.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-02-13 18:59:16 +00:00
Anton Puppe
a88d23a7d8 soc: st: stm32n6: add DCMIPP CSI IRQ
Add DCMIPP CSI IRQ support for STM32N6.

Signed-off-by: Anton Puppe <anton-noel-flynn.puppe@zeiss.com>
2026-02-13 09:45:30 -06:00
Sylvio Alves
fbafad0520 drivers: video: esp32: fix camera sensor init race condition
Move camera XCLK setup from DVP driver (POST_KERNEL) to esp_lcd_cam.c
(PRE_KERNEL_2) to ensure the image sensor receives clock before its
I2C initialization. This fixes a race condition where sensors like
ov2640 would fail to respond during probe because XCLK wasn't yet
configured.

Also adds timestamp to captured video buffers and removes a noisy
error log for set_selection when the source returns -ENOSYS.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-01-28 08:33:10 +01:00
Roman Pustobaiev
598e7c13f3 drivers: video: stm32_dcmipp: fixing driver initialization issue
when pipe 1 or 2 is selected and parallel bus is chosen
HAL_DCMIPP_PARALLEL_SetConfig is failing, since it gets called twice
and driver is already in HAL_DCMIPP_STATE_READY state

Signed-off-by: Roman Pustobaiev <romanpustobayev@gmail.com>
2026-01-28 08:32:49 +01:00
Alain Volmat
914f2b0b5b video: correct video_print_ctrl behavior for integer_menu
Correct the behavior when printing interger menu values.
Current loop is not correct since it is waiting for a 0 value
to stop while for integer menu any value is possible.
Modify in order to loop until reaching the maximum number of
entries listed at the ctrl init time.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-01-27 10:56:27 +00:00
Alain Volmat
e71597cf56 video: video_ctrls: fix integer menu truncated type print
"integer menu" ctrl type is longer than the 8 bytes long
typebuf hence rename the type into "int menu" and increase
the typebuf buffer in addition to increase alignment during
print of the ctrl values.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-01-27 10:56:27 +00:00
Hugues Fruchet
70f57d119a drivers: video: stm32_dcmipp: give back buffers at stream disable
Give back buffers at stream disable.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
cc8475dd52 drivers: video: stm32_dcmipp: set multilines to 128 to limit interrupts
Set multiline on pixel pipes to 128 lines to limit slave IP hardware
handshakes and so reduce the number of interrupts received by slave IP.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
8c8a021a5f drivers: video: stm32_venc: log interrupts
Log number of interrupts, including fuse interrupts at each
key frame and at the end of encoding.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
f396ac9efc drivers: video: stm32_venc: fix completion on interrupt
Fix wait of hardware encoding completion by using
interrupt signaling instead of polling on irq status.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
e84f195780 drivers: video: stm32_venc: fix delta frames generation
Only key frames were generated because of resync flag
always true, fix this.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
a616f7b107 drivers: video: stm32_venc: fix release sequence
Fix missing H264 library release and total memory count reset.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Alain Volmat
39a60f8a0b video: st: remove soc specific dcmipp compatibles
Only st,stm32-dcmipp is described and only st,stm32n6-dcmipp
was used within the driver to decide if CSI / PIXEL_PIPES
are available. Instead of this, look at HAL provided macros
to know if the selected soc has the functionalities or not.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-01-20 15:29:27 +00:00
Alain Volmat
1da7503904 drivers: video: stm32-dcmi: correct set_frmival handling
Correct set_frmival in order to avoid having un-optimized
frmival selection due to rounded values.
Computation has been done in usec, leading to incorrect
frmival selection due to value being rounded internally.
As an example, code was selecting 1/60 from sensor then 4 time
frame drop by DCMI instead of selecting directly 1/15 from
sensor.
Use msec instead to hide those rounding issue and avoid
as well 64bit variables.
This also put the first video_frmival_nsec outside of the
loop to avoid having to do the processing everytime.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-01-14 13:02:01 +00:00
Gaetan Perrot
65f43b919e drivers: videos: ov767x: fix typos in comments
Fix typos in comments in ov767x_init_regtbl.

No functional change.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-13 10:30:03 +01:00
Gaetan Perrot
a0c17db18e drivers: video: remove redundant rad_val initialization
Remove the unused initialization without changing behavior.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-13 10:27:39 +01:00
Gaetan Perrot
4655fa18d4 drivers: video: ov7725: fix uninitialized struct
Fix uninitialized struct fmt to fix Coverity issue.
CID: 524756

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-13 10:26:59 +01:00
Anton Puppe
264a01f832 drivers: video: imx335: Add configurable refresh rate
Adds support for video_set_frmival for the IMX335 sensor driver.
The available framerates depend on whether the binning mode is enabled.
Currently, 25Hz and 30Hz are always available and 50Hz/60Hz only with
binning.

Signed-off-by: Anton Puppe <anton-noel-flynn.puppe@zeiss.com>
2026-01-11 13:05:34 +01:00