1*d874cce4Sray /* $OpenBSD: ramdac.h,v 1.7 2008/06/26 05:42:16 ray Exp $ */ 24cd9f15eSericj /* $NetBSD: ramdac.h,v 1.1 2000/03/04 10:23:39 elric Exp $ */ 34cd9f15eSericj 44cd9f15eSericj /*- 54cd9f15eSericj * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. 64cd9f15eSericj * All rights reserved. 74cd9f15eSericj * 84cd9f15eSericj * This code is derived from software contributed to The NetBSD Foundation 94cd9f15eSericj * by Roland C. Dowdeswell. 104cd9f15eSericj * 114cd9f15eSericj * Redistribution and use in source and binary forms, with or without 124cd9f15eSericj * modification, are permitted provided that the following conditions 134cd9f15eSericj * are met: 144cd9f15eSericj * 1. Redistributions of source code must retain the above copyright 154cd9f15eSericj * notice, this list of conditions and the following disclaimer. 164cd9f15eSericj * 2. Redistributions in binary form must reproduce the above copyright 174cd9f15eSericj * notice, this list of conditions and the following disclaimer in the 184cd9f15eSericj * documentation and/or other materials provided with the distribution. 194cd9f15eSericj * 204cd9f15eSericj * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 214cd9f15eSericj * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 224cd9f15eSericj * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 234cd9f15eSericj * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 244cd9f15eSericj * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 254cd9f15eSericj * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 264cd9f15eSericj * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 274cd9f15eSericj * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 284cd9f15eSericj * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 294cd9f15eSericj * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 304cd9f15eSericj * POSSIBILITY OF SUCH DAMAGE. 314cd9f15eSericj */ 324cd9f15eSericj 334cd9f15eSericj #ifndef _DEV_IC_RAMDAC_H 344cd9f15eSericj #define _DEV_IC_RAMDAC_H 354cd9f15eSericj 364cd9f15eSericj #include <dev/wscons/wsconsio.h> 374cd9f15eSericj 384cd9f15eSericj struct ramdac_cookie; 394cd9f15eSericj 404cd9f15eSericj struct ramdac_funcs { 414cd9f15eSericj char *ramdac_name; 424f9e30d0Smillert struct ramdac_cookie *(*ramdac_register)(void *, 434cd9f15eSericj int (*)(void *, void (*)(void *)), 444cd9f15eSericj void (*)(void *, u_int, u_int8_t), 454f9e30d0Smillert u_int8_t (*)(void *, u_int)); 46c4071fd1Smillert void (*ramdac_init)(struct ramdac_cookie *); 474cd9f15eSericj 48c4071fd1Smillert int (*ramdac_set_cmap)(struct ramdac_cookie *, 49c4071fd1Smillert struct wsdisplay_cmap *); 50c4071fd1Smillert int (*ramdac_get_cmap)(struct ramdac_cookie *, 51c4071fd1Smillert struct wsdisplay_cmap *); 52c4071fd1Smillert int (*ramdac_set_cursor)(struct ramdac_cookie *, 53c4071fd1Smillert struct wsdisplay_cursor *); 54c4071fd1Smillert int (*ramdac_get_cursor)(struct ramdac_cookie *, 55c4071fd1Smillert struct wsdisplay_cursor *); 56c4071fd1Smillert int (*ramdac_set_curpos)(struct ramdac_cookie *, 57c4071fd1Smillert struct wsdisplay_curpos *); 58c4071fd1Smillert int (*ramdac_get_curpos)(struct ramdac_cookie *, 59c4071fd1Smillert struct wsdisplay_curpos *); 60c4071fd1Smillert int (*ramdac_get_curmax)(struct ramdac_cookie *, 61c4071fd1Smillert struct wsdisplay_curpos *); 624cd9f15eSericj 634cd9f15eSericj /* Only called from the TGA built-in cursor handling code. */ 64c4071fd1Smillert int (*ramdac_check_curcmap)(struct ramdac_cookie *, 65c4071fd1Smillert struct wsdisplay_cursor *); 66c4071fd1Smillert void (*ramdac_set_curcmap)(struct ramdac_cookie *, 67c4071fd1Smillert struct wsdisplay_cursor *); 68c4071fd1Smillert int (*ramdac_get_curcmap)(struct ramdac_cookie *, 69c4071fd1Smillert struct wsdisplay_cursor *); 70e00d3f43Smatthieu 71e00d3f43Smatthieu /* XXXrcd: new test code for setting the DOTCLOCK */ 72e00d3f43Smatthieu int (*ramdac_set_dotclock)(struct ramdac_cookie *, 73e00d3f43Smatthieu unsigned); 744cd9f15eSericj }; 754cd9f15eSericj 764cd9f15eSericj #endif 77