1 1.1 mlelstv /* $NetBSD: igmavar.h,v 1.1 2014/01/21 14:52:07 mlelstv Exp $ */ 2 1.1 mlelstv 3 1.1 mlelstv /* 4 1.1 mlelstv * Copyright (c) 2014 Michael van Elst 5 1.1 mlelstv * 6 1.1 mlelstv * Permission to use, copy, modify, and distribute this software for any 7 1.1 mlelstv * purpose with or without fee is hereby granted, provided that the above 8 1.1 mlelstv * copyright notice and this permission notice appear in all copies. 9 1.1 mlelstv * 10 1.1 mlelstv * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 1.1 mlelstv * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 1.1 mlelstv * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 1.1 mlelstv * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 1.1 mlelstv * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 1.1 mlelstv * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 1.1 mlelstv * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 1.1 mlelstv */ 18 1.1 mlelstv 19 1.1 mlelstv #ifndef IGMAVAR_H 20 1.1 mlelstv #define IGMAVAR_H 21 1.1 mlelstv 22 1.1 mlelstv #include <dev/pci/pcivar.h> 23 1.1 mlelstv #include <dev/pci/pcireg.h> 24 1.1 mlelstv 25 1.1 mlelstv struct igma_chip; 26 1.1 mlelstv struct igma_chip_ops { 27 1.1 mlelstv void (*barrier)(const struct igma_chip *, int); 28 1.1 mlelstv u_int32_t (*read_reg)(const struct igma_chip *, int); 29 1.1 mlelstv void (*write_reg)(const struct igma_chip *, int, u_int32_t); 30 1.1 mlelstv u_int8_t (*read_vga)(const struct igma_chip *, int); 31 1.1 mlelstv void (*write_vga)(const struct igma_chip *, int, u_int8_t); 32 1.1 mlelstv #if 0 33 1.1 mlelstv u_int8_t (*read_crtc)(const struct igma_chip *, int); 34 1.1 mlelstv void (*write_crtc)(const struct igma_chip *, int, u_int8_t); 35 1.1 mlelstv #endif 36 1.1 mlelstv }; 37 1.1 mlelstv 38 1.1 mlelstv struct igma_chip { 39 1.1 mlelstv const struct igma_chip_ops *ops; 40 1.1 mlelstv 41 1.1 mlelstv bus_space_tag_t gttt; 42 1.1 mlelstv bus_space_handle_t gtth; 43 1.1 mlelstv 44 1.1 mlelstv bus_space_tag_t mmiot; 45 1.1 mlelstv bus_space_handle_t mmioh; 46 1.1 mlelstv 47 1.1 mlelstv bus_space_tag_t vgat; 48 1.1 mlelstv bus_space_handle_t vgah; 49 1.1 mlelstv 50 1.1 mlelstv bus_space_tag_t gmt; 51 1.1 mlelstv bus_space_handle_t gmh; 52 1.1 mlelstv bus_addr_t gmb; 53 1.1 mlelstv 54 1.1 mlelstv int num_gmbus; 55 1.1 mlelstv int gpio_offset; 56 1.1 mlelstv int vga_cntrl; 57 1.1 mlelstv int num_pipes; 58 1.1 mlelstv int use_pipe; 59 1.1 mlelstv u_int32_t pri_cntrl; 60 1.1 mlelstv int backlight_cntrl; 61 1.1 mlelstv int backlight_cntrl2; 62 1.1 mlelstv int backlight_factor; 63 1.1 mlelstv 64 1.1 mlelstv unsigned quirks; 65 1.1 mlelstv }; 66 1.1 mlelstv #define IGMA_PLANESTART_QUIRK (1L << 0) 67 1.1 mlelstv #define IGMA_PFITDISABLE_QUIRK (1L << 1) 68 1.1 mlelstv 69 1.1 mlelstv struct igma_attach_args { 70 1.1 mlelstv const struct igma_chip_ops *iaa_chip_ops; 71 1.1 mlelstv struct igma_chip iaa_chip; 72 1.1 mlelstv bool iaa_console; 73 1.1 mlelstv char iaa_name[32]; 74 1.1 mlelstv }; 75 1.1 mlelstv 76 1.1 mlelstv #endif 77