2022-03-21 12:22:39 -07:00
|
|
|
/* $OpenBSD: video_if.h,v 1.19 2022/03/21 19:22:40 miod Exp $ */
|
2008-04-09 12:49:55 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
|
2008-06-12 22:00:32 -07:00
|
|
|
* Copyright (c) 2008 Marcus Glocker <mglocker@openbsd.org>
|
2008-04-09 12:49:55 -07:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SYS_DEV_VIDEO_IF_H
|
|
|
|
#define _SYS_DEV_VIDEO_IF_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Generic interface to hardware driver
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define VIDEOUNIT(x) (minor(x))
|
|
|
|
|
|
|
|
struct video_hw_if {
|
|
|
|
/* open hardware */
|
2008-05-24 12:37:34 -07:00
|
|
|
int (*open)(void *, int, int *, uint8_t *, void (*)(void *),
|
|
|
|
void *);
|
2008-04-09 12:49:55 -07:00
|
|
|
|
|
|
|
/* close hardware */
|
|
|
|
int (*close)(void *);
|
|
|
|
|
2008-05-25 00:47:47 -07:00
|
|
|
/* ioctl's */
|
2008-04-09 12:49:55 -07:00
|
|
|
int (*querycap)(void *, struct v4l2_capability *);
|
2008-05-26 10:51:18 -07:00
|
|
|
int (*enum_fmt)(void *, struct v4l2_fmtdesc *);
|
2008-08-13 13:29:34 -07:00
|
|
|
int (*enum_fsizes)(void *, struct v4l2_frmsizeenum *);
|
|
|
|
int (*enum_fivals)(void *, struct v4l2_frmivalenum *);
|
2008-04-09 12:49:55 -07:00
|
|
|
int (*s_fmt)(void *, struct v4l2_format *);
|
|
|
|
int (*g_fmt)(void *, struct v4l2_format *);
|
2011-03-26 01:13:05 -07:00
|
|
|
int (*s_parm)(void *, struct v4l2_streamparm *);
|
|
|
|
int (*g_parm)(void *, struct v4l2_streamparm *);
|
2008-05-26 10:51:18 -07:00
|
|
|
int (*enum_input)(void *, struct v4l2_input *);
|
|
|
|
int (*s_input)(void *, int);
|
2014-10-18 01:01:34 -07:00
|
|
|
int (*g_input)(void *, int *);
|
2008-06-05 13:50:28 -07:00
|
|
|
int (*reqbufs)(void *, struct v4l2_requestbuffers *);
|
|
|
|
int (*querybuf)(void *, struct v4l2_buffer *);
|
2008-06-07 15:14:57 -07:00
|
|
|
int (*qbuf)(void *, struct v4l2_buffer *);
|
2008-04-09 12:49:55 -07:00
|
|
|
int (*dqbuf)(void *, struct v4l2_buffer *);
|
2008-06-07 15:14:57 -07:00
|
|
|
int (*streamon)(void *, int);
|
2008-06-10 18:27:30 -07:00
|
|
|
int (*streamoff)(void *, int);
|
2008-05-26 10:51:18 -07:00
|
|
|
int (*try_fmt)(void *, struct v4l2_format *);
|
2008-06-10 16:39:01 -07:00
|
|
|
int (*queryctrl)(void *, struct v4l2_queryctrl *);
|
2008-08-24 04:05:02 -07:00
|
|
|
int (*g_ctrl)(void *, struct v4l2_control *);
|
|
|
|
int (*s_ctrl)(void *, struct v4l2_control *);
|
2008-06-05 13:50:28 -07:00
|
|
|
caddr_t (*mappage)(void *, off_t, int);
|
2008-06-08 22:49:10 -07:00
|
|
|
|
|
|
|
/* other functions */
|
|
|
|
int (*get_bufsize)(void *);
|
2008-07-31 08:26:25 -07:00
|
|
|
int (*start_read)(void *);
|
2008-04-09 12:49:55 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct video_attach_args {
|
2022-03-21 12:22:39 -07:00
|
|
|
const void *hwif;
|
2008-04-09 12:49:55 -07:00
|
|
|
void *hdl;
|
|
|
|
};
|
|
|
|
|
2022-03-21 12:22:39 -07:00
|
|
|
struct device *video_attach_mi(const struct video_hw_if *, void *,
|
|
|
|
struct device *);
|
2008-04-09 12:49:55 -07:00
|
|
|
|
|
|
|
#endif /* _SYS_DEV_VIDEO_IF_H */
|