Lines Matching +full:int +full:- +full:enum

10  * SPDX-License-Identifier: Apache-2.0
28 #include <drivers/video-controls.h>
114 * @brief video_endpoint_id enum
117 enum video_endpoint_id {
125 * @brief video_event enum
128 enum video_signal_result {
139 typedef int (*video_api_set_format_t)(const struct device *dev,
140 enum video_endpoint_id ep,
148 typedef int (*video_api_get_format_t)(const struct device *dev,
149 enum video_endpoint_id ep,
157 typedef int (*video_api_enqueue_t)(const struct device *dev,
158 enum video_endpoint_id ep,
166 typedef int (*video_api_dequeue_t)(const struct device *dev,
167 enum video_endpoint_id ep,
177 typedef int (*video_api_flush_t)(const struct device *dev,
178 enum video_endpoint_id ep,
186 typedef int (*video_api_stream_start_t)(const struct device *dev);
193 typedef int (*video_api_stream_stop_t)(const struct device *dev);
200 typedef int (*video_api_set_ctrl_t)(const struct device *dev,
201 unsigned int cid,
209 typedef int (*video_api_get_ctrl_t)(const struct device *dev,
210 unsigned int cid,
218 typedef int (*video_api_get_caps_t)(const struct device *dev,
219 enum video_endpoint_id ep,
227 typedef int (*video_api_set_signal_t)(const struct device *dev,
228 enum video_endpoint_id ep,
257 * @retval -EINVAL If parameters are invalid.
258 * @retval -ENOTSUP If format is not supported.
259 * @retval -EIO General input / output error.
261 static inline int video_set_format(const struct device *dev, in video_set_format()
262 enum video_endpoint_id ep, in video_set_format()
266 (const struct video_driver_api *)dev->api; in video_set_format()
268 if (api->set_format == NULL) { in video_set_format()
269 return -ENOSYS; in video_set_format()
272 return api->set_format(dev, ep, fmt); in video_set_format()
286 static inline int video_get_format(const struct device *dev, in video_get_format()
287 enum video_endpoint_id ep, in video_get_format()
291 (const struct video_driver_api *)dev->api; in video_get_format()
293 if (api->get_format == NULL) { in video_get_format()
294 return -ENOSYS; in video_get_format()
297 return api->get_format(dev, ep, fmt); in video_get_format()
311 * @retval -EINVAL If parameters are invalid.
312 * @retval -EIO General input / output error.
314 static inline int video_enqueue(const struct device *dev, in video_enqueue()
315 enum video_endpoint_id ep, in video_enqueue()
319 (const struct video_driver_api *)dev->api; in video_enqueue()
321 if (api->enqueue == NULL) { in video_enqueue()
322 return -ENOSYS; in video_enqueue()
325 return api->enqueue(dev, ep, buf); in video_enqueue()
340 * @retval -EINVAL If parameters are invalid.
341 * @retval -EIO General input / output error.
343 static inline int video_dequeue(const struct device *dev, in video_dequeue()
344 enum video_endpoint_id ep, in video_dequeue()
349 (const struct video_driver_api *)dev->api; in video_dequeue()
351 if (api->dequeue == NULL) { in video_dequeue()
352 return -ENOSYS; in video_dequeue()
355 return api->dequeue(dev, ep, buf, timeout); in video_dequeue()
371 * @retval 0 Is successful, -ERRNO code otherwise.
373 static inline int video_flush(const struct device *dev, in video_flush()
374 enum video_endpoint_id ep, in video_flush()
378 (const struct video_driver_api *)dev->api; in video_flush()
380 if (api->flush == NULL) { in video_flush()
381 return -ENOSYS; in video_flush()
384 return api->flush(dev, ep, cancel); in video_flush()
397 * @retval -EIO General input / output error.
399 static inline int video_stream_start(const struct device *dev) in video_stream_start()
402 (const struct video_driver_api *)dev->api; in video_stream_start()
404 if (api->stream_start == NULL) { in video_stream_start()
405 return -ENOSYS; in video_stream_start()
408 return api->stream_start(dev); in video_stream_start()
418 * @retval -EIO General input / output error.
420 static inline int video_stream_stop(const struct device *dev) in video_stream_stop()
423 (const struct video_driver_api *)dev->api; in video_stream_stop()
424 int ret; in video_stream_stop()
426 if (api->stream_stop) { in video_stream_stop()
427 return -ENOSYS; in video_stream_stop()
430 ret = api->stream_stop(dev); in video_stream_stop()
443 * @retval 0 Is successful, -ERRNO code otherwise.
445 static inline int video_get_caps(const struct device *dev, in video_get_caps()
446 enum video_endpoint_id ep, in video_get_caps()
450 (const struct video_driver_api *)dev->api; in video_get_caps()
452 if (api->get_caps == NULL) { in video_get_caps()
453 return -ENOSYS; in video_get_caps()
456 return api->get_caps(dev, ep, caps); in video_get_caps()
470 * @retval -EINVAL If parameters are invalid.
471 * @retval -ENOTSUP If format is not supported.
472 * @retval -EIO General input / output error.
474 static inline int video_set_ctrl(const struct device *dev, unsigned int cid, in video_set_ctrl()
478 (const struct video_driver_api *)dev->api; in video_set_ctrl()
480 if (api->set_ctrl == NULL) { in video_set_ctrl()
481 return -ENOSYS; in video_set_ctrl()
484 return api->set_ctrl(dev, cid, value); in video_set_ctrl()
498 * @retval -EINVAL If parameters are invalid.
499 * @retval -ENOTSUP If format is not supported.
500 * @retval -EIO General input / output error.
502 static inline int video_get_ctrl(const struct device *dev, unsigned int cid, in video_get_ctrl()
506 (const struct video_driver_api *)dev->api; in video_get_ctrl()
508 if (api->get_ctrl == NULL) { in video_get_ctrl()
509 return -ENOSYS; in video_get_ctrl()
512 return api->get_ctrl(dev, cid, value); in video_get_ctrl()
526 * @retval 0 Is successful, -ERRNO code otherwise.
528 static inline int video_set_signal(const struct device *dev, in video_set_signal()
529 enum video_endpoint_id ep, in video_set_signal()
533 (const struct video_driver_api *)dev->api; in video_set_signal()
535 if (api->set_signal == NULL) { in video_set_signal()
536 return -ENOSYS; in video_set_signal()
539 return api->set_signal(dev, ep, signal); in video_set_signal()
559 /* fourcc - four-character-code */
570 #define VIDEO_PIX_FMT_RGB565 video_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */