zephyr/drivers/video/video_device.c
Phi Bang Nguyen 2b46cc0b78 drivers: video: Introduce video device structure
Introduce a new video device structure representing a device in a
video pipeline. Each video device embeds a pointer to its "source"
device and other "video" characteristics.

This structure give the video framework an access to all video features
of the device and a hierachical view of the video pipeline that the
device belongs to.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2025-04-21 20:03:31 +02:00

23 lines
308 B
C

/*
* Copyright 2025 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "video_device.h"
struct video_device *video_find_vdev(const struct device *dev)
{
if (!dev) {
return NULL;
}
STRUCT_SECTION_FOREACH(video_device, vdev) {
if (vdev->dev == dev) {
return vdev;
}
}
return NULL;
}