xref: /netbsd-src/sys/dev/ic/ramdac.h (revision ce099b40997c43048fb78bd578195f81d2456523)
1*ce099b40Smartin /* $NetBSD: ramdac.h,v 1.8 2008/04/28 20:23:51 martin Exp $ */
2fec44d6fSelric 
3fec44d6fSelric /*-
4fec44d6fSelric  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
5fec44d6fSelric  * All rights reserved.
6fec44d6fSelric  *
7fec44d6fSelric  * This code is derived from software contributed to The NetBSD Foundation
8fec44d6fSelric  * by Roland C. Dowdeswell.
9fec44d6fSelric  *
10fec44d6fSelric  * Redistribution and use in source and binary forms, with or without
11fec44d6fSelric  * modification, are permitted provided that the following conditions
12fec44d6fSelric  * are met:
13fec44d6fSelric  * 1. Redistributions of source code must retain the above copyright
14fec44d6fSelric  *    notice, this list of conditions and the following disclaimer.
15fec44d6fSelric  * 2. Redistributions in binary form must reproduce the above copyright
16fec44d6fSelric  *    notice, this list of conditions and the following disclaimer in the
17fec44d6fSelric  *    documentation and/or other materials provided with the distribution.
18fec44d6fSelric  *
19fec44d6fSelric  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20fec44d6fSelric  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21fec44d6fSelric  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22fec44d6fSelric  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23fec44d6fSelric  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24fec44d6fSelric  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25fec44d6fSelric  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26fec44d6fSelric  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27fec44d6fSelric  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28fec44d6fSelric  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29fec44d6fSelric  * POSSIBILITY OF SUCH DAMAGE.
30fec44d6fSelric  */
31fec44d6fSelric 
32fec44d6fSelric #ifndef _DEV_IC_RAMDAC_H
33fec44d6fSelric #define _DEV_IC_RAMDAC_H
34fec44d6fSelric 
35fec44d6fSelric #include <dev/rcons/raster.h>
36fec44d6fSelric #include <dev/wscons/wsconsio.h>
37fec44d6fSelric #include <dev/wscons/wscons_raster.h>
38fec44d6fSelric 
39fec44d6fSelric struct ramdac_cookie;
40fec44d6fSelric 
41fec44d6fSelric struct ramdac_funcs {
4210e0e927Sdrochner 	const char	*ramdac_name;
4318db93c7Sperry 	struct ramdac_cookie *(*ramdac_register)(void *,
442b4ac6a7Snathanw 		    int (*)(void *, void (*)(void *)),
452b4ac6a7Snathanw 		    void (*)(void *, u_int, u_int8_t),
4618db93c7Sperry 		    u_int8_t (*)(void *, u_int));
4718db93c7Sperry 	void	(*ramdac_init)(struct ramdac_cookie *);
48fec44d6fSelric 
4918db93c7Sperry 	int	(*ramdac_set_cmap)(struct ramdac_cookie *,
5018db93c7Sperry 		    struct wsdisplay_cmap *);
5118db93c7Sperry 	int	(*ramdac_get_cmap)(struct ramdac_cookie *,
5218db93c7Sperry 		    struct wsdisplay_cmap *);
5318db93c7Sperry 	int	(*ramdac_set_cursor)(struct ramdac_cookie *,
5418db93c7Sperry 		    struct wsdisplay_cursor *);
5518db93c7Sperry 	int	(*ramdac_get_cursor)(struct ramdac_cookie *,
5618db93c7Sperry 		    struct wsdisplay_cursor *);
5718db93c7Sperry 	int	(*ramdac_set_curpos)(struct ramdac_cookie *,
5818db93c7Sperry 		    struct wsdisplay_curpos *);
5918db93c7Sperry 	int	(*ramdac_get_curpos)(struct ramdac_cookie *,
6018db93c7Sperry 		    struct wsdisplay_curpos *);
6118db93c7Sperry 	int	(*ramdac_get_curmax)(struct ramdac_cookie *,
6218db93c7Sperry 		    struct wsdisplay_curpos *);
63fec44d6fSelric 
64fec44d6fSelric 	/* Only called from the TGA built-in cursor handling code. */
6518db93c7Sperry 	int	(*ramdac_check_curcmap)(struct ramdac_cookie *,
6618db93c7Sperry 		    struct wsdisplay_cursor *);
6718db93c7Sperry 	void	(*ramdac_set_curcmap)(struct ramdac_cookie *,
6818db93c7Sperry 		    struct wsdisplay_cursor *);
6918db93c7Sperry 	int	(*ramdac_get_curcmap)(struct ramdac_cookie *,
7018db93c7Sperry 		    struct wsdisplay_cursor *);
7194448f7eSelric 
7294448f7eSelric 	/* XXXrcd:  new test code for setting the DOTCLOCK */
7318db93c7Sperry 	int	(*ramdac_set_dotclock)(struct ramdac_cookie *,
7418db93c7Sperry 		    unsigned);
75fec44d6fSelric };
76fec44d6fSelric 
77fec44d6fSelric #endif
78