Skip to content

Commit c8d7560

Browse files
committed
drivers: video: Introduce video interface device
The main device that interface with application on memory. Signed-off-by: Phi Bang Nguyen <[email protected]>
1 parent ee827fd commit c8d7560

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

cmake/linker_script/common/common-ram.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ endif()
127127

128128
if(CONFIG_VIDEO)
129129
zephyr_iterable_section(NAME video_device GROUP DATA_REGION ${XIP_ALIGN_WITH_INPUT})
130+
zephyr_iterable_section(NAME video_interface GROUP DATA_REGION ${XIP_ALIGN_WITH_INPUT})
130131
endif()
131132

132133
if(CONFIG_LOG)

drivers/video/video.ld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#include <zephyr/linker/iterable_sections.h>
22

33
ITERABLE_SECTION_RAM(video_device, Z_LINK_ITERABLE_SUBALIGN)
4+
ITERABLE_SECTION_RAM(video_interface, Z_LINK_ITERABLE_SUBALIGN)

drivers/video/video_device.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,22 @@ struct video_device {
1616
sys_dlist_t ctrls;
1717
};
1818

19+
struct video_interface {
20+
const struct device *dev;
21+
};
22+
1923
#define VIDEO_DEVICE_DEFINE(name, device, source) \
2024
static STRUCT_SECTION_ITERABLE(video_device, name) = { \
2125
.dev = device, \
2226
.src_dev = source, \
2327
.ctrls = SYS_DLIST_STATIC_INIT(&name.ctrls), \
2428
}
2529

30+
#define VIDEO_INTERFACE_DEFINE(name, device) \
31+
static STRUCT_SECTION_ITERABLE(video_interface, name) = { \
32+
.dev = device, \
33+
}
34+
2635
struct video_device *video_find_vdev(const struct device *dev);
2736

2837
#endif /* ZEPHYR_INCLUDE_DRIVERS_VIDEO_VIDEO_DEVICE_H_ */

0 commit comments

Comments
 (0)