| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * sisusb - usb kernel driver for Net2280/SiS315 based USB2VGA dongles | 
|  | 3 | * | 
|  | 4 | * Copyright (C) 2005 by Thomas Winischhofer, Vienna, Austria | 
|  | 5 | * | 
|  | 6 | * If distributed as part of the Linux kernel, this code is licensed under the | 
|  | 7 | * terms of the GPL v2. | 
|  | 8 | * | 
|  | 9 | * Otherwise, the following license terms apply: | 
|  | 10 | * | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 11 | * Redistribution and use in source and binary forms, with or without | 
|  | 12 | * modification, are permitted provided that the following conditions | 
|  | 13 | * are met: | 
|  | 14 | * 1) Redistributions of source code must retain the above copyright | 
|  | 15 | *    notice, this list of conditions and the following disclaimer. | 
|  | 16 | * 2) Redistributions in binary form must reproduce the above copyright | 
|  | 17 | *    notice, this list of conditions and the following disclaimer in the | 
|  | 18 | *    documentation and/or other materials provided with the distribution. | 
|  | 19 | * 3) The name of the author may not be used to endorse or promote products | 
|  | 20 | *    derived from this software without specific prior written permission. | 
|  | 21 | * | 
|  | 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR | 
|  | 23 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 
|  | 24 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 
|  | 25 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 
|  | 26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 
|  | 27 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 
|  | 28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 
|  | 29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 
|  | 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 
|  | 31 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | * | 
| Felipe Balbi | ed86d97 | 2007-08-10 09:34:24 -0400 | [diff] [blame] | 33 | * Author:	Thomas Winischhofer <thomas@winischhofer.net> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | * | 
|  | 35 | */ | 
|  | 36 |  | 
|  | 37 | #ifndef _SISUSB_H_ | 
|  | 38 | #define _SISUSB_H_ | 
|  | 39 |  | 
|  | 40 | #ifdef CONFIG_COMPAT | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | #define SISUSB_NEW_CONFIG_COMPAT | 
|  | 42 | #endif | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 |  | 
| Arjan van de Ven | 2682d27 | 2006-03-28 01:00:21 -0800 | [diff] [blame] | 44 | #include <linux/mutex.h> | 
|  | 45 |  | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 46 | /* For older kernels, support for text consoles is by default | 
| Felipe Balbi | 2acbd64 | 2007-08-10 09:34:27 -0400 | [diff] [blame] | 47 | * off. To enable text console support, change the following: | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 48 | */ | 
| Felipe Balbi | 9dedd36 | 2007-08-10 09:34:26 -0400 | [diff] [blame] | 49 | /* #define CONFIG_USB_SISUSBVGA_CON */ | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 50 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | /* Version Information */ | 
|  | 52 |  | 
|  | 53 | #define SISUSB_VERSION		0 | 
| Felipe Balbi | ed86d97 | 2007-08-10 09:34:24 -0400 | [diff] [blame] | 54 | #define SISUSB_REVISION		0 | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 55 | #define SISUSB_PATCHLEVEL	8 | 
|  | 56 |  | 
|  | 57 | /* Include console and mode switching code? */ | 
|  | 58 |  | 
|  | 59 | #ifdef CONFIG_USB_SISUSBVGA_CON | 
|  | 60 | #define INCL_SISUSB_CON		1 | 
|  | 61 | #endif | 
|  | 62 |  | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 63 | #include <linux/console.h> | 
|  | 64 | #include <linux/vt_kern.h> | 
|  | 65 | #include "sisusb_struct.h" | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 |  | 
|  | 67 | /* USB related */ | 
|  | 68 |  | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 69 | #define SISUSB_MINOR		133	/* official */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 |  | 
|  | 71 | /* Size of the sisusb input/output buffers */ | 
|  | 72 | #define SISUSB_IBUF_SIZE  0x01000 | 
|  | 73 | #define SISUSB_OBUF_SIZE  0x10000	/* fixed */ | 
|  | 74 |  | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 75 | #define NUMOBUFS 8		/* max number of output buffers/output URBs */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 |  | 
|  | 77 | /* About endianness: | 
|  | 78 | * | 
|  | 79 | * 1) I/O ports, PCI config registers. The read/write() | 
|  | 80 | *    calls emulate inX/outX. Hence, the data is | 
|  | 81 | *    expected/delivered in machine endiannes by this | 
|  | 82 | *    driver. | 
|  | 83 | * 2) Video memory. The data is copied 1:1. There is | 
|  | 84 | *    no swapping. Ever. This means for userland that | 
|  | 85 | *    the data has to be prepared properly. (Hint: | 
|  | 86 | *    think graphics data format, command queue, | 
|  | 87 | *    hardware cursor.) | 
|  | 88 | * 3) MMIO. Data is copied 1:1. MMIO must be swapped | 
|  | 89 | *    properly by userland. | 
|  | 90 | * | 
|  | 91 | */ | 
|  | 92 |  | 
|  | 93 | #ifdef __BIG_ENDIAN | 
| Felipe Balbi | ed86d97 | 2007-08-10 09:34:24 -0400 | [diff] [blame] | 94 | #define SISUSB_CORRECT_ENDIANNESS_PACKET(p)		\ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | do {						\ | 
|  | 96 | p->header  = cpu_to_le16(p->header);	\ | 
|  | 97 | p->address = cpu_to_le32(p->address);	\ | 
|  | 98 | p->data    = cpu_to_le32(p->data);	\ | 
|  | 99 | } while(0) | 
|  | 100 | #else | 
|  | 101 | #define SISUSB_CORRECT_ENDIANNESS_PACKET(p) | 
|  | 102 | #endif | 
|  | 103 |  | 
|  | 104 | struct sisusb_usb_data; | 
|  | 105 |  | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 106 | struct sisusb_urb_context {	/* urb->context for outbound bulk URBs */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | struct sisusb_usb_data *sisusb; | 
|  | 108 | int urbindex; | 
|  | 109 | int *actual_length; | 
|  | 110 | }; | 
|  | 111 |  | 
|  | 112 | struct sisusb_usb_data { | 
|  | 113 | struct usb_device *sisusb_dev; | 
|  | 114 | struct usb_interface *interface; | 
|  | 115 | struct kref kref; | 
|  | 116 | wait_queue_head_t wait_q;	/* for syncind and timeouts */ | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 117 | struct mutex lock;	/* general race avoidance */ | 
|  | 118 | unsigned int ifnum;	/* interface number of the USB device */ | 
|  | 119 | int minor;		/* minor (for logging clarity) */ | 
|  | 120 | int isopen;		/* !=0 if open */ | 
|  | 121 | int present;		/* !=0 if device is present on the bus */ | 
|  | 122 | int ready;		/* !=0 if device is ready for userland */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | #ifdef SISUSB_OLD_CONFIG_COMPAT | 
|  | 124 | int ioctl32registered; | 
|  | 125 | #endif | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 126 | int numobufs;		/* number of obufs = number of out urbs */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | char *obuf[NUMOBUFS], *ibuf;	/* transfer buffers */ | 
|  | 128 | int obufsize, ibufsize; | 
|  | 129 | dma_addr_t transfer_dma_out[NUMOBUFS]; | 
|  | 130 | dma_addr_t transfer_dma_in; | 
|  | 131 | struct urb *sisurbout[NUMOBUFS]; | 
|  | 132 | struct urb *sisurbin; | 
|  | 133 | unsigned char urbstatus[NUMOBUFS]; | 
|  | 134 | unsigned char completein; | 
|  | 135 | struct sisusb_urb_context urbout_context[NUMOBUFS]; | 
|  | 136 | unsigned long flagb0; | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 137 | unsigned long vrambase;	/* framebuffer base */ | 
|  | 138 | unsigned int vramsize;	/* framebuffer size (bytes) */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | unsigned long mmiobase; | 
|  | 140 | unsigned int mmiosize; | 
|  | 141 | unsigned long ioportbase; | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 142 | unsigned char devinit;	/* device initialized? */ | 
|  | 143 | unsigned char gfxinit;	/* graphics core initialized? */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 144 | unsigned short chipid, chipvendor; | 
|  | 145 | unsigned short chiprevision; | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 146 | #ifdef INCL_SISUSB_CON | 
|  | 147 | struct SiS_Private *SiS_Pr; | 
|  | 148 | unsigned long scrbuf; | 
|  | 149 | unsigned int scrbuf_size; | 
|  | 150 | int haveconsole, con_first, con_last; | 
|  | 151 | int havethisconsole[MAX_NR_CONSOLES]; | 
|  | 152 | int textmodedestroyed; | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 153 | unsigned int sisusb_num_columns;	/* real number, not vt's idea */ | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 154 | int cur_start_addr, con_rolled_over; | 
|  | 155 | int sisusb_cursor_loc, bad_cursor_pos; | 
|  | 156 | int sisusb_cursor_size_from; | 
|  | 157 | int sisusb_cursor_size_to; | 
|  | 158 | int current_font_height, current_font_512; | 
|  | 159 | int font_backup_size, font_backup_height, font_backup_512; | 
|  | 160 | char *font_backup; | 
|  | 161 | int font_slot; | 
|  | 162 | struct vc_data *sisusb_display_fg; | 
|  | 163 | int is_gfx; | 
|  | 164 | int con_blanked; | 
|  | 165 | #endif | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | }; | 
|  | 167 |  | 
|  | 168 | #define to_sisusb_dev(d) container_of(d, struct sisusb_usb_data, kref) | 
|  | 169 |  | 
|  | 170 | /* USB transport related */ | 
|  | 171 |  | 
|  | 172 | /* urbstatus */ | 
|  | 173 | #define SU_URB_BUSY   1 | 
|  | 174 | #define SU_URB_ALLOC  2 | 
|  | 175 |  | 
|  | 176 | /* Endpoints */ | 
|  | 177 |  | 
|  | 178 | #define SISUSB_EP_GFX_IN	0x0e	/* gfx std packet out(0e)/in(8e) */ | 
|  | 179 | #define SISUSB_EP_GFX_OUT	0x0e | 
|  | 180 |  | 
|  | 181 | #define SISUSB_EP_GFX_BULK_OUT	0x01	/* gfx mem bulk out/in */ | 
|  | 182 | #define SISUSB_EP_GFX_BULK_IN	0x02	/* ? 2 is "OUT" ? */ | 
|  | 183 |  | 
|  | 184 | #define SISUSB_EP_GFX_LBULK_OUT	0x03	/* gfx large mem bulk out */ | 
|  | 185 |  | 
|  | 186 | #define SISUSB_EP_UNKNOWN_04	0x04	/* ? 4 is "OUT" ? - unused */ | 
|  | 187 |  | 
|  | 188 | #define SISUSB_EP_BRIDGE_IN	0x0d	/* Net2280 out(0d)/in(8d) */ | 
|  | 189 | #define SISUSB_EP_BRIDGE_OUT	0x0d | 
|  | 190 |  | 
|  | 191 | #define SISUSB_TYPE_MEM		0 | 
|  | 192 | #define SISUSB_TYPE_IO		1 | 
|  | 193 |  | 
|  | 194 | struct sisusb_packet { | 
|  | 195 | unsigned short header; | 
|  | 196 | u32 address; | 
|  | 197 | u32 data; | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 198 | } __attribute__ ((__packed__)); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 199 |  | 
|  | 200 | #define CLEARPACKET(packet) memset(packet, 0, 10) | 
|  | 201 |  | 
|  | 202 | /* PCI bridge related */ | 
|  | 203 |  | 
|  | 204 | #define SISUSB_PCI_MEMBASE	0xd0000000 | 
|  | 205 | #define SISUSB_PCI_MMIOBASE	0xe4000000 | 
|  | 206 | #define SISUSB_PCI_IOPORTBASE	0x0000d000 | 
|  | 207 |  | 
|  | 208 | #define SISUSB_PCI_PSEUDO_MEMBASE	0x10000000 | 
|  | 209 | #define SISUSB_PCI_PSEUDO_MMIOBASE	0x20000000 | 
|  | 210 | #define SISUSB_PCI_PSEUDO_IOPORTBASE	0x0000d000 | 
|  | 211 | #define SISUSB_PCI_PSEUDO_PCIBASE	0x00010000 | 
|  | 212 |  | 
|  | 213 | #define SISUSB_PCI_MMIOSIZE	(128*1024) | 
|  | 214 | #define SISUSB_PCI_PCONFSIZE	0x5c | 
|  | 215 |  | 
|  | 216 | /* graphics core related */ | 
|  | 217 |  | 
|  | 218 | #define AROFFSET	0x40 | 
|  | 219 | #define ARROFFSET	0x41 | 
|  | 220 | #define GROFFSET	0x4e | 
|  | 221 | #define SROFFSET	0x44 | 
|  | 222 | #define CROFFSET	0x54 | 
|  | 223 | #define MISCROFFSET	0x4c | 
|  | 224 | #define MISCWOFFSET	0x42 | 
|  | 225 | #define INPUTSTATOFFSET 0x5A | 
|  | 226 | #define PART1OFFSET	0x04 | 
|  | 227 | #define PART2OFFSET	0x10 | 
|  | 228 | #define PART3OFFSET	0x12 | 
|  | 229 | #define PART4OFFSET	0x14 | 
|  | 230 | #define PART5OFFSET	0x16 | 
|  | 231 | #define CAPTUREOFFSET	0x00 | 
|  | 232 | #define VIDEOOFFSET	0x02 | 
|  | 233 | #define COLREGOFFSET	0x48 | 
|  | 234 | #define PELMASKOFFSET	0x46 | 
|  | 235 | #define VGAENABLE	0x43 | 
|  | 236 |  | 
|  | 237 | #define SISAR		SISUSB_PCI_IOPORTBASE + AROFFSET | 
|  | 238 | #define SISARR		SISUSB_PCI_IOPORTBASE + ARROFFSET | 
|  | 239 | #define SISGR		SISUSB_PCI_IOPORTBASE + GROFFSET | 
|  | 240 | #define SISSR		SISUSB_PCI_IOPORTBASE + SROFFSET | 
|  | 241 | #define SISCR		SISUSB_PCI_IOPORTBASE + CROFFSET | 
|  | 242 | #define SISMISCR	SISUSB_PCI_IOPORTBASE + MISCROFFSET | 
|  | 243 | #define SISMISCW	SISUSB_PCI_IOPORTBASE + MISCWOFFSET | 
|  | 244 | #define SISINPSTAT	SISUSB_PCI_IOPORTBASE + INPUTSTATOFFSET | 
|  | 245 | #define SISPART1	SISUSB_PCI_IOPORTBASE + PART1OFFSET | 
|  | 246 | #define SISPART2	SISUSB_PCI_IOPORTBASE + PART2OFFSET | 
|  | 247 | #define SISPART3	SISUSB_PCI_IOPORTBASE + PART3OFFSET | 
|  | 248 | #define SISPART4	SISUSB_PCI_IOPORTBASE + PART4OFFSET | 
|  | 249 | #define SISPART5	SISUSB_PCI_IOPORTBASE + PART5OFFSET | 
|  | 250 | #define SISCAP		SISUSB_PCI_IOPORTBASE + CAPTUREOFFSET | 
|  | 251 | #define SISVID		SISUSB_PCI_IOPORTBASE + VIDEOOFFSET | 
|  | 252 | #define SISCOLIDXR	SISUSB_PCI_IOPORTBASE + COLREGOFFSET - 1 | 
|  | 253 | #define SISCOLIDX	SISUSB_PCI_IOPORTBASE + COLREGOFFSET | 
|  | 254 | #define SISCOLDATA	SISUSB_PCI_IOPORTBASE + COLREGOFFSET + 1 | 
|  | 255 | #define SISCOL2IDX	SISPART5 | 
|  | 256 | #define SISCOL2DATA	SISPART5 + 1 | 
|  | 257 | #define SISPEL		SISUSB_PCI_IOPORTBASE + PELMASKOFFSET | 
|  | 258 | #define SISVGAEN	SISUSB_PCI_IOPORTBASE + VGAENABLE | 
|  | 259 | #define SISDACA		SISCOLIDX | 
|  | 260 | #define SISDACD		SISCOLDATA | 
|  | 261 |  | 
|  | 262 | /* ioctl related */ | 
|  | 263 |  | 
|  | 264 | /* Structure argument for SISUSB_GET_INFO ioctl  */ | 
|  | 265 | struct sisusb_info { | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 266 | __u32 sisusb_id;	/* for identifying sisusb */ | 
|  | 267 | #define SISUSB_ID  0x53495355	/* Identify myself with 'SISU' */ | 
|  | 268 | __u8 sisusb_version; | 
|  | 269 | __u8 sisusb_revision; | 
|  | 270 | __u8 sisusb_patchlevel; | 
|  | 271 | __u8 sisusb_gfxinit;	/* graphics core initialized? */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 |  | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 273 | __u32 sisusb_vrambase; | 
|  | 274 | __u32 sisusb_mmiobase; | 
|  | 275 | __u32 sisusb_iobase; | 
|  | 276 | __u32 sisusb_pcibase; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 |  | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 278 | __u32 sisusb_vramsize;	/* framebuffer size in bytes */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 279 |  | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 280 | __u32 sisusb_minor; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 281 |  | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 282 | __u32 sisusb_fbdevactive;	/* != 0 if framebuffer device active */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 283 |  | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 284 | __u32 sisusb_conactive;	/* != 0 if console driver active */ | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 285 |  | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 286 | __u8 sisusb_reserved[28];	/* for future use */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 287 | }; | 
|  | 288 |  | 
|  | 289 | struct sisusb_command { | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 290 | __u8 operation;		/* see below */ | 
|  | 291 | __u8 data0;		/* operation dependent */ | 
|  | 292 | __u8 data1;		/* operation dependent */ | 
|  | 293 | __u8 data2;		/* operation dependent */ | 
|  | 294 | __u32 data3;		/* operation dependent */ | 
|  | 295 | __u32 data4;		/* for future use */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 296 | }; | 
|  | 297 |  | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 298 | #define SUCMD_GET	0x01	/* for all: data0 = index, data3 = port */ | 
|  | 299 | #define SUCMD_SET	0x02	/* data1 = value */ | 
|  | 300 | #define SUCMD_SETOR	0x03	/* data1 = or */ | 
|  | 301 | #define SUCMD_SETAND	0x04	/* data1 = and */ | 
|  | 302 | #define SUCMD_SETANDOR	0x05	/* data1 = and, data2 = or */ | 
|  | 303 | #define SUCMD_SETMASK	0x06	/* data1 = data, data2 = mask */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 304 |  | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 305 | #define SUCMD_CLRSCR	0x07	/* data0:1:2 = length, data3 = address */ | 
|  | 306 |  | 
| Felipe Balbi | 1c1772a | 2007-08-10 09:34:29 -0400 | [diff] [blame] | 307 | #define SUCMD_HANDLETEXTMODE 0x08	/* Reset/destroy text mode */ | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 308 |  | 
|  | 309 | #define SUCMD_SETMODE	0x09	/* Set a display mode (data3 = SiS mode) */ | 
|  | 310 | #define SUCMD_SETVESAMODE 0x0a	/* Set a display mode (data3 = VESA mode) */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 311 |  | 
|  | 312 | #define SISUSB_COMMAND		_IOWR(0xF3,0x3D,struct sisusb_command) | 
| Thomas Winischhofer | 1bbb4f2 | 2005-08-29 17:01:16 +0200 | [diff] [blame] | 313 | #define SISUSB_GET_CONFIG_SIZE	_IOR(0xF3,0x3E,__u32) | 
|  | 314 | #define SISUSB_GET_CONFIG	_IOR(0xF3,0x3F,struct sisusb_info) | 
|  | 315 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 316 | #endif /* SISUSB_H */ |