1*d279d26dSmglocker /* $OpenBSD: video_if.h,v 1.3 2008/05/25 07:47:47 mglocker Exp $ */ 2cf110a4aSrobert /* 3cf110a4aSrobert * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> 4cf110a4aSrobert * 5cf110a4aSrobert * Permission to use, copy, modify, and distribute this software for any 6cf110a4aSrobert * purpose with or without fee is hereby granted, provided that the above 7cf110a4aSrobert * copyright notice and this permission notice appear in all copies. 8cf110a4aSrobert * 9cf110a4aSrobert * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10cf110a4aSrobert * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11cf110a4aSrobert * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12cf110a4aSrobert * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13cf110a4aSrobert * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14cf110a4aSrobert * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15cf110a4aSrobert * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16cf110a4aSrobert */ 17cf110a4aSrobert 18cf110a4aSrobert #ifndef _SYS_DEV_VIDEO_IF_H 19cf110a4aSrobert #define _SYS_DEV_VIDEO_IF_H 20cf110a4aSrobert 21cf110a4aSrobert /* 22cf110a4aSrobert * Generic interface to hardware driver 23cf110a4aSrobert */ 24cf110a4aSrobert 25cf110a4aSrobert #define VIDEOUNIT(x) (minor(x)) 26cf110a4aSrobert 27cf110a4aSrobert struct video_hw_if { 28cf110a4aSrobert /* open hardware */ 29dabf5a5aSmglocker int (*open)(void *, int, int *, uint8_t *, void (*)(void *), 30dabf5a5aSmglocker void *); 31cf110a4aSrobert 32cf110a4aSrobert /* close hardware */ 33cf110a4aSrobert int (*close)(void *); 34cf110a4aSrobert 35*d279d26dSmglocker /* ioctl's */ 36cf110a4aSrobert int (*querycap)(void *, struct v4l2_capability *); 37cf110a4aSrobert int (*s_fmt)(void *, struct v4l2_format *); 38cf110a4aSrobert int (*g_fmt)(void *, struct v4l2_format *); 39cf110a4aSrobert int (*reqbufs)(void *, struct v4l2_requestbuffers *); 40cf110a4aSrobert int (*qbuf)(void *, struct v4l2_buffer *); 41cf110a4aSrobert int (*dqbuf)(void *, struct v4l2_buffer *); 42cf110a4aSrobert }; 43cf110a4aSrobert 44cf110a4aSrobert struct video_attach_args { 45cf110a4aSrobert void *hwif; 46cf110a4aSrobert void *hdl; 47cf110a4aSrobert }; 48cf110a4aSrobert 49cf110a4aSrobert struct device *video_attach_mi(struct video_hw_if *, void *, struct device *); 50cf110a4aSrobert 51cf110a4aSrobert #endif /* _SYS_DEV_VIDEO_IF_H */ 52