xref: /netbsd/sys/dev/ic/ct65550var.h (revision 10c49617)
1*10c49617Smacallan /*	$NetBSD: ct65550var.h,v 1.3 2017/02/02 19:55:05 macallan Exp $	*/
2999b21f5Smacallan 
3999b21f5Smacallan /*
4999b21f5Smacallan  * Copyright (c) 2006 Michael Lorenz
5999b21f5Smacallan  * All rights reserved.
6999b21f5Smacallan  *
7999b21f5Smacallan  * Redistribution and use in source and binary forms, with or without
8999b21f5Smacallan  * modification, are permitted provided that the following conditions
9999b21f5Smacallan  * are met:
10999b21f5Smacallan  * 1. Redistributions of source code must retain the above copyright
11999b21f5Smacallan  *    notice, this list of conditions and the following disclaimer.
12999b21f5Smacallan  * 2. Redistributions in binary form must reproduce the above copyright
13999b21f5Smacallan  *    notice, this list of conditions and the following disclaimer in the
14999b21f5Smacallan  *    documentation and/or other materials provided with the distribution.
15999b21f5Smacallan  *
16999b21f5Smacallan  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17999b21f5Smacallan  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18999b21f5Smacallan  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19999b21f5Smacallan  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20999b21f5Smacallan  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21999b21f5Smacallan  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22999b21f5Smacallan  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23999b21f5Smacallan  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24999b21f5Smacallan  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25999b21f5Smacallan  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26999b21f5Smacallan  */
27999b21f5Smacallan 
28999b21f5Smacallan #ifndef CT65550VAR_H
29999b21f5Smacallan #define CT65550VAR_H
30999b21f5Smacallan 
31999b21f5Smacallan #include <dev/wscons/wsdisplayvar.h>
32999b21f5Smacallan #include <dev/wscons/wsconsio.h>
33999b21f5Smacallan #include <dev/wsfont/wsfont.h>
34999b21f5Smacallan #include <dev/rasops/rasops.h>
35999b21f5Smacallan #include <dev/wscons/wsdisplay_vconsvar.h>
36*10c49617Smacallan #include <dev/wscons/wsdisplay_glyphcachevar.h>
37999b21f5Smacallan #include <dev/i2c/i2cvar.h>
38999b21f5Smacallan 
39999b21f5Smacallan struct chipsfb_softc {
40999b21f5Smacallan 	device_t sc_dev;
41999b21f5Smacallan 
42999b21f5Smacallan 	bus_space_tag_t sc_memt;
43999b21f5Smacallan 	bus_space_tag_t sc_iot;
44999b21f5Smacallan 
45999b21f5Smacallan 	bus_space_handle_t sc_fbh;
468367a7b6Smacallan 	bus_space_handle_t sc_mmregh;
47999b21f5Smacallan 	bus_space_handle_t sc_ioregh;
488367a7b6Smacallan 	bus_addr_t sc_fb;
49999b21f5Smacallan 	bus_size_t sc_fbsize, sc_ioregsize;
50999b21f5Smacallan 
51999b21f5Smacallan 	int (*sc_ioctl)(void *, void *, u_long, void *, int, struct lwp *);
528367a7b6Smacallan 	paddr_t	(*sc_mmap)(void *, void *, off_t, int);
53999b21f5Smacallan 
54999b21f5Smacallan 
55999b21f5Smacallan 	size_t memsize;
56999b21f5Smacallan 
57*10c49617Smacallan 	int sc_bits_per_pixel;
58*10c49617Smacallan 	int sc_width, sc_height, sc_linebytes;
59999b21f5Smacallan 
60999b21f5Smacallan 	int sc_mode;
61999b21f5Smacallan 	uint32_t sc_bg;
62999b21f5Smacallan 
63999b21f5Smacallan 	u_char sc_cmap_red[256];
64999b21f5Smacallan 	u_char sc_cmap_green[256];
65999b21f5Smacallan 	u_char sc_cmap_blue[256];
66999b21f5Smacallan 	int sc_dacw;
67999b21f5Smacallan 
68999b21f5Smacallan 	/*
69999b21f5Smacallan 	 * I2C stuff
70999b21f5Smacallan 	 * DDC2 clock is on GPIO1, data on GPIO0
71999b21f5Smacallan 	 */
72999b21f5Smacallan 	struct i2c_controller sc_i2c;
73999b21f5Smacallan 	uint8_t sc_edid[1024];
74999b21f5Smacallan 	int sc_edidbytes;	/* number of bytes read from the monitor */
75999b21f5Smacallan 
76999b21f5Smacallan 	struct vcons_data vd;
77*10c49617Smacallan 	glyphcache sc_gc;
78999b21f5Smacallan };
79999b21f5Smacallan 
80999b21f5Smacallan void chipsfb_do_attach(struct chipsfb_softc *sc);
81999b21f5Smacallan uint32_t chipsfb_probe_vram(struct chipsfb_softc *sc);
82999b21f5Smacallan 
83999b21f5Smacallan #endif /* CT65550VAR_H */
84