2 * Video spigot capture driver.
4 * Copyright (c) 1995, Jim Lowe. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 2.
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
18 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * Version 1.2, Aug 30, 1995.
27 * $FreeBSD: src/sys/i386/include/spigot.h,v 1.5 1999/12/29 04:33:08 peter Exp $
28 * $DragonFly: src/sys/platform/pc32/include/spigot.h,v 1.2 2003/06/17 04:28:36 dillon Exp $
31 #ifndef _MACHINE_SPIGOT_H_
32 #define _MACHINE_SPIGOT_H_
34 #include <sys/ioccom.h>
44 #define SPIGOT_GET_INFO _IOR('s', 4, struct spigot_info)
46 * Set up a user interrupt.
48 #define SPIGOT_SETINT _IOW('s', 5, int)
50 * Allow/disallow access to the I/O Page.
52 #define SPIGOT_IOPL_ON _IO ('s', 6)
53 #define SPIGOT_IOPL_OFF _IO ('s', 7)
57 * Defines for spigot library.
59 unsigned short * spigot_open(char *dev);
60 void spigot_close(void);
61 void spigot_set_capture_size(int width, int vtof);
62 unsigned char spigot_start_xfer(int num_frames);
63 void spigot_stop_xfer(void);
64 unsigned char spigot_status(void);
67 * Define the status bits.
69 #define SPIGOT_COLOR 0x01 /* Color present (No color) */
70 #define SPIGOT_60HZ 0x02 /* 60 hz input signal (50hz) */
71 #define SPIGOT_NO_HORIZONTAL_LOCK 0x04 /* Horizontal lock present */
72 #define SPIGOT_HPLL_LOCKED 0x08 /* HPLL locked (HPLL unlocked)*/
73 #define SPIGOT_VCR_MODE 0x10 /* VCR mode (TV mode) */
74 #define SPIGOT_VSYNC_PRESENT 0x20 /* Vsync present */
77 * spigot_open() returns a data address pointing to the spigot data.
78 * Each read from this address returns the next word. The ``dev'' passed
79 * is usually "/dev/spigot". Data is described in the phillips desktop
80 * video data handbook under the 7191 chip. Formats may be either
81 * YUV 4:2:2 or YUV 4:1:1. A sample device driver for ``nv'' is included
84 * spigot_close() cleans up and closes the device.
86 * spigot_set_capture_size() will set the capture window size. Width should be
87 * one of: 80, 160, 240, 320, or 640 for NTSC or
88 * 96, 192, 288, 384 for PAL.
89 * vtof is the Vertical top of frame offset and must be between 0 and 15 lines.
91 * spigot_start_xfer() will start a transfer from the 7191 to the data fifo.
92 * spigot_stop_xfer() will clear the data fifo and abort any transfers.
94 * spigot_status() will return the above status bits.
98 #endif /* !_MACHINE_SPIGOT_H_ */