ct65550var.h revision 1.1.2.2 1 1.1.2.2 bouyer /* $NetBSD: ct65550var.h,v 1.1.2.2 2011/02/17 12:00:12 bouyer Exp $ */
2 1.1.2.2 bouyer
3 1.1.2.2 bouyer /*
4 1.1.2.2 bouyer * Copyright (c) 2006 Michael Lorenz
5 1.1.2.2 bouyer * All rights reserved.
6 1.1.2.2 bouyer *
7 1.1.2.2 bouyer * Redistribution and use in source and binary forms, with or without
8 1.1.2.2 bouyer * modification, are permitted provided that the following conditions
9 1.1.2.2 bouyer * are met:
10 1.1.2.2 bouyer * 1. Redistributions of source code must retain the above copyright
11 1.1.2.2 bouyer * notice, this list of conditions and the following disclaimer.
12 1.1.2.2 bouyer * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.2.2 bouyer * notice, this list of conditions and the following disclaimer in the
14 1.1.2.2 bouyer * documentation and/or other materials provided with the distribution.
15 1.1.2.2 bouyer *
16 1.1.2.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1.2.2 bouyer * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.1.2.2 bouyer * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1.2.2 bouyer * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.1.2.2 bouyer * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 1.1.2.2 bouyer * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 1.1.2.2 bouyer * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 1.1.2.2 bouyer * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 1.1.2.2 bouyer * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 1.1.2.2 bouyer * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 1.1.2.2 bouyer */
27 1.1.2.2 bouyer
28 1.1.2.2 bouyer #ifndef CT65550VAR_H
29 1.1.2.2 bouyer #define CT65550VAR_H
30 1.1.2.2 bouyer
31 1.1.2.2 bouyer #include <dev/wscons/wsdisplayvar.h>
32 1.1.2.2 bouyer #include <dev/wscons/wsconsio.h>
33 1.1.2.2 bouyer #include <dev/wsfont/wsfont.h>
34 1.1.2.2 bouyer #include <dev/rasops/rasops.h>
35 1.1.2.2 bouyer #include <dev/wscons/wsdisplay_vconsvar.h>
36 1.1.2.2 bouyer #include <dev/i2c/i2cvar.h>
37 1.1.2.2 bouyer
38 1.1.2.2 bouyer struct chipsfb_softc {
39 1.1.2.2 bouyer device_t sc_dev;
40 1.1.2.2 bouyer
41 1.1.2.2 bouyer bus_space_tag_t sc_memt;
42 1.1.2.2 bouyer bus_space_tag_t sc_iot;
43 1.1.2.2 bouyer bus_space_handle_t sc_memh;
44 1.1.2.2 bouyer
45 1.1.2.2 bouyer bus_space_tag_t sc_fbt;
46 1.1.2.2 bouyer bus_space_tag_t sc_ioregt;
47 1.1.2.2 bouyer bus_space_handle_t sc_fbh;
48 1.1.2.2 bouyer bus_space_handle_t sc_ioregh;
49 1.1.2.2 bouyer bus_addr_t sc_fb, sc_ioreg;
50 1.1.2.2 bouyer bus_size_t sc_fbsize, sc_ioregsize;
51 1.1.2.2 bouyer
52 1.1.2.2 bouyer int (*sc_ioctl)(void *, void *, u_long, void *, int, struct lwp *);
53 1.1.2.2 bouyer paddr_t (*chipsfb_mmap)(void *, void *, off_t, int);
54 1.1.2.2 bouyer
55 1.1.2.2 bouyer void *sc_ih;
56 1.1.2.2 bouyer
57 1.1.2.2 bouyer size_t memsize;
58 1.1.2.2 bouyer
59 1.1.2.2 bouyer int bits_per_pixel;
60 1.1.2.2 bouyer int width, height, linebytes;
61 1.1.2.2 bouyer
62 1.1.2.2 bouyer int sc_mode;
63 1.1.2.2 bouyer uint32_t sc_bg;
64 1.1.2.2 bouyer
65 1.1.2.2 bouyer u_char sc_cmap_red[256];
66 1.1.2.2 bouyer u_char sc_cmap_green[256];
67 1.1.2.2 bouyer u_char sc_cmap_blue[256];
68 1.1.2.2 bouyer int sc_dacw;
69 1.1.2.2 bouyer
70 1.1.2.2 bouyer /*
71 1.1.2.2 bouyer * I2C stuff
72 1.1.2.2 bouyer * DDC2 clock is on GPIO1, data on GPIO0
73 1.1.2.2 bouyer */
74 1.1.2.2 bouyer struct i2c_controller sc_i2c;
75 1.1.2.2 bouyer uint8_t sc_edid[1024];
76 1.1.2.2 bouyer int sc_edidbytes; /* number of bytes read from the monitor */
77 1.1.2.2 bouyer
78 1.1.2.2 bouyer struct vcons_data vd;
79 1.1.2.2 bouyer };
80 1.1.2.2 bouyer
81 1.1.2.2 bouyer void chipsfb_do_attach(struct chipsfb_softc *sc);
82 1.1.2.2 bouyer uint32_t chipsfb_probe_vram(struct chipsfb_softc *sc);
83 1.1.2.2 bouyer
84 1.1.2.2 bouyer #endif /* CT65550VAR_H */
85