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>
23 lines
308 B
C
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;
|
|
}
|