video_if.h 2.5 KB

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