Skip to content

Commit aec72b8

Browse files
committed
drivers: video: allow to specify individual ep with ID >= 0
This define the enum values so that they never clash with custom endpoint IDs passed numerically, for devices that supports more than one IN or OUT enpoint. This also documents semantics for VIDEO_EP_IN/OUT/ALL/NONE, while renaming VIDEO_EP_ANY to VIDEO_EP_ALL to remove the ambiguity when there are several IN and/or OUT endpoints. Signed-off-by: Josuah Demangeon <[email protected]>
1 parent b5fdbc2 commit aec72b8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

include/zephyr/drivers/video.h

+9-5
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,14 @@ struct video_buffer {
124124
* Identify the video device endpoint.
125125
*/
126126
enum video_endpoint_id {
127-
VIDEO_EP_NONE,
128-
VIDEO_EP_ANY,
129-
VIDEO_EP_IN,
130-
VIDEO_EP_OUT,
127+
/** Targets some part of the video device not bound to an endpoint */
128+
VIDEO_EP_NONE = -1,
129+
/** Targets all input or output endpoints of the device */
130+
VIDEO_EP_ALL = -2,
131+
/** Targets all input endpoints of the device: those consuming data */
132+
VIDEO_EP_IN = -3,
133+
/** Targets all output endpoints of the device: those producing data */
134+
VIDEO_EP_OUT = -4,
131135
};
132136

133137
/**
@@ -449,7 +453,7 @@ static inline int video_stream_stop(const struct device *dev)
449453
}
450454

451455
ret = api->stream_stop(dev);
452-
video_flush(dev, VIDEO_EP_ANY, true);
456+
video_flush(dev, VIDEO_EP_ALL, true);
453457

454458
return ret;
455459
}

0 commit comments

Comments
 (0)