18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * sisusb - usb kernel driver for Net2280/SiS315 based USB2VGA dongles
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2005 by Thomas Winischhofer, Vienna, Austria
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * If distributed as part of the Linux kernel, this code is licensed under the
88c2ecf20Sopenharmony_ci * terms of the GPL v2.
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * Otherwise, the following license terms apply:
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci * Redistribution and use in source and binary forms, with or without
138c2ecf20Sopenharmony_ci * modification, are permitted provided that the following conditions
148c2ecf20Sopenharmony_ci * are met:
158c2ecf20Sopenharmony_ci * 1) Redistributions of source code must retain the above copyright
168c2ecf20Sopenharmony_ci *    notice, this list of conditions and the following disclaimer.
178c2ecf20Sopenharmony_ci * 2) Redistributions in binary form must reproduce the above copyright
188c2ecf20Sopenharmony_ci *    notice, this list of conditions and the following disclaimer in the
198c2ecf20Sopenharmony_ci *    documentation and/or other materials provided with the distribution.
208c2ecf20Sopenharmony_ci * 3) The name of the author may not be used to endorse or promote products
218c2ecf20Sopenharmony_ci *    derived from this software without specific prior written permission.
228c2ecf20Sopenharmony_ci *
238c2ecf20Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
248c2ecf20Sopenharmony_ci * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
258c2ecf20Sopenharmony_ci * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
268c2ecf20Sopenharmony_ci * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
278c2ecf20Sopenharmony_ci * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
288c2ecf20Sopenharmony_ci * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
298c2ecf20Sopenharmony_ci * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
308c2ecf20Sopenharmony_ci * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
318c2ecf20Sopenharmony_ci * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
328c2ecf20Sopenharmony_ci * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
338c2ecf20Sopenharmony_ci *
348c2ecf20Sopenharmony_ci * Author:	Thomas Winischhofer <thomas@winischhofer.net>
358c2ecf20Sopenharmony_ci *
368c2ecf20Sopenharmony_ci */
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#ifndef _SISUSB_H_
398c2ecf20Sopenharmony_ci#define _SISUSB_H_
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#include <linux/mutex.h>
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci/* Version Information */
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define SISUSB_VERSION		0
468c2ecf20Sopenharmony_ci#define SISUSB_REVISION		0
478c2ecf20Sopenharmony_ci#define SISUSB_PATCHLEVEL	8
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci/* Include console and mode switching code? */
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#include <linux/console.h>
528c2ecf20Sopenharmony_ci#include <linux/vt_kern.h>
538c2ecf20Sopenharmony_ci#include "sisusb_struct.h"
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/* USB related */
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci#define SISUSB_MINOR		133	/* official */
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci/* Size of the sisusb input/output buffers */
608c2ecf20Sopenharmony_ci#define SISUSB_IBUF_SIZE  0x01000
618c2ecf20Sopenharmony_ci#define SISUSB_OBUF_SIZE  0x10000	/* fixed */
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci#define NUMOBUFS 8		/* max number of output buffers/output URBs */
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci/* About endianness:
668c2ecf20Sopenharmony_ci *
678c2ecf20Sopenharmony_ci * 1) I/O ports, PCI config registers. The read/write()
688c2ecf20Sopenharmony_ci *    calls emulate inX/outX. Hence, the data is
698c2ecf20Sopenharmony_ci *    expected/delivered in machine endiannes by this
708c2ecf20Sopenharmony_ci *    driver.
718c2ecf20Sopenharmony_ci * 2) Video memory. The data is copied 1:1. There is
728c2ecf20Sopenharmony_ci *    no swapping. Ever. This means for userland that
738c2ecf20Sopenharmony_ci *    the data has to be prepared properly. (Hint:
748c2ecf20Sopenharmony_ci *    think graphics data format, command queue,
758c2ecf20Sopenharmony_ci *    hardware cursor.)
768c2ecf20Sopenharmony_ci * 3) MMIO. Data is copied 1:1. MMIO must be swapped
778c2ecf20Sopenharmony_ci *    properly by userland.
788c2ecf20Sopenharmony_ci *
798c2ecf20Sopenharmony_ci */
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN
828c2ecf20Sopenharmony_ci#define SISUSB_CORRECT_ENDIANNESS_PACKET(p)		\
838c2ecf20Sopenharmony_ci	do {						\
848c2ecf20Sopenharmony_ci		p->header  = cpu_to_le16(p->header);	\
858c2ecf20Sopenharmony_ci		p->address = cpu_to_le32(p->address);	\
868c2ecf20Sopenharmony_ci		p->data    = cpu_to_le32(p->data);	\
878c2ecf20Sopenharmony_ci	} while(0)
888c2ecf20Sopenharmony_ci#else
898c2ecf20Sopenharmony_ci#define SISUSB_CORRECT_ENDIANNESS_PACKET(p)
908c2ecf20Sopenharmony_ci#endif
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_cistruct sisusb_usb_data;
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_cistruct sisusb_urb_context {	/* urb->context for outbound bulk URBs */
958c2ecf20Sopenharmony_ci	struct sisusb_usb_data *sisusb;
968c2ecf20Sopenharmony_ci	int urbindex;
978c2ecf20Sopenharmony_ci	int *actual_length;
988c2ecf20Sopenharmony_ci};
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_cistruct sisusb_usb_data {
1018c2ecf20Sopenharmony_ci	struct usb_device *sisusb_dev;
1028c2ecf20Sopenharmony_ci	struct usb_interface *interface;
1038c2ecf20Sopenharmony_ci	struct kref kref;
1048c2ecf20Sopenharmony_ci	wait_queue_head_t wait_q;	/* for syncind and timeouts */
1058c2ecf20Sopenharmony_ci	struct mutex lock;	/* general race avoidance */
1068c2ecf20Sopenharmony_ci	unsigned int ifnum;	/* interface number of the USB device */
1078c2ecf20Sopenharmony_ci	int minor;		/* minor (for logging clarity) */
1088c2ecf20Sopenharmony_ci	int isopen;		/* !=0 if open */
1098c2ecf20Sopenharmony_ci	int present;		/* !=0 if device is present on the bus */
1108c2ecf20Sopenharmony_ci	int ready;		/* !=0 if device is ready for userland */
1118c2ecf20Sopenharmony_ci	int numobufs;		/* number of obufs = number of out urbs */
1128c2ecf20Sopenharmony_ci	char *obuf[NUMOBUFS], *ibuf;	/* transfer buffers */
1138c2ecf20Sopenharmony_ci	int obufsize, ibufsize;
1148c2ecf20Sopenharmony_ci	struct urb *sisurbout[NUMOBUFS];
1158c2ecf20Sopenharmony_ci	struct urb *sisurbin;
1168c2ecf20Sopenharmony_ci	unsigned char urbstatus[NUMOBUFS];
1178c2ecf20Sopenharmony_ci	unsigned char completein;
1188c2ecf20Sopenharmony_ci	struct sisusb_urb_context urbout_context[NUMOBUFS];
1198c2ecf20Sopenharmony_ci	unsigned long flagb0;
1208c2ecf20Sopenharmony_ci	unsigned long vrambase;	/* framebuffer base */
1218c2ecf20Sopenharmony_ci	unsigned int vramsize;	/* framebuffer size (bytes) */
1228c2ecf20Sopenharmony_ci	unsigned long mmiobase;
1238c2ecf20Sopenharmony_ci	unsigned int mmiosize;
1248c2ecf20Sopenharmony_ci	unsigned long ioportbase;
1258c2ecf20Sopenharmony_ci	unsigned char devinit;	/* device initialized? */
1268c2ecf20Sopenharmony_ci	unsigned char gfxinit;	/* graphics core initialized? */
1278c2ecf20Sopenharmony_ci	unsigned short chipid, chipvendor;
1288c2ecf20Sopenharmony_ci	unsigned short chiprevision;
1298c2ecf20Sopenharmony_ci#ifdef CONFIG_USB_SISUSBVGA_CON
1308c2ecf20Sopenharmony_ci	struct SiS_Private *SiS_Pr;
1318c2ecf20Sopenharmony_ci	unsigned long scrbuf;
1328c2ecf20Sopenharmony_ci	unsigned int scrbuf_size;
1338c2ecf20Sopenharmony_ci	int haveconsole, con_first, con_last;
1348c2ecf20Sopenharmony_ci	int havethisconsole[MAX_NR_CONSOLES];
1358c2ecf20Sopenharmony_ci	int textmodedestroyed;
1368c2ecf20Sopenharmony_ci	unsigned int sisusb_num_columns;	/* real number, not vt's idea */
1378c2ecf20Sopenharmony_ci	int cur_start_addr, con_rolled_over;
1388c2ecf20Sopenharmony_ci	int sisusb_cursor_loc, bad_cursor_pos;
1398c2ecf20Sopenharmony_ci	int sisusb_cursor_size_from;
1408c2ecf20Sopenharmony_ci	int sisusb_cursor_size_to;
1418c2ecf20Sopenharmony_ci	int current_font_height, current_font_512;
1428c2ecf20Sopenharmony_ci	int font_backup_size, font_backup_height, font_backup_512;
1438c2ecf20Sopenharmony_ci	char *font_backup;
1448c2ecf20Sopenharmony_ci	int font_slot;
1458c2ecf20Sopenharmony_ci	struct vc_data *sisusb_display_fg;
1468c2ecf20Sopenharmony_ci	int is_gfx;
1478c2ecf20Sopenharmony_ci	int con_blanked;
1488c2ecf20Sopenharmony_ci#endif
1498c2ecf20Sopenharmony_ci};
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci#define to_sisusb_dev(d) container_of(d, struct sisusb_usb_data, kref)
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci/* USB transport related */
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci/* urbstatus */
1568c2ecf20Sopenharmony_ci#define SU_URB_BUSY   1
1578c2ecf20Sopenharmony_ci#define SU_URB_ALLOC  2
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci/* Endpoints */
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci#define SISUSB_EP_GFX_IN	0x0e	/* gfx std packet out(0e)/in(8e) */
1628c2ecf20Sopenharmony_ci#define SISUSB_EP_GFX_OUT	0x0e
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci#define SISUSB_EP_GFX_BULK_OUT	0x01	/* gfx mem bulk out/in */
1658c2ecf20Sopenharmony_ci#define SISUSB_EP_GFX_BULK_IN	0x02	/* ? 2 is "OUT" ? */
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci#define SISUSB_EP_GFX_LBULK_OUT	0x03	/* gfx large mem bulk out */
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci#define SISUSB_EP_UNKNOWN_04	0x04	/* ? 4 is "OUT" ? - unused */
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci#define SISUSB_EP_BRIDGE_IN	0x0d	/* Net2280 out(0d)/in(8d) */
1728c2ecf20Sopenharmony_ci#define SISUSB_EP_BRIDGE_OUT	0x0d
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci#define SISUSB_TYPE_MEM		0
1758c2ecf20Sopenharmony_ci#define SISUSB_TYPE_IO		1
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_cistruct sisusb_packet {
1788c2ecf20Sopenharmony_ci	unsigned short header;
1798c2ecf20Sopenharmony_ci	u32 address;
1808c2ecf20Sopenharmony_ci	u32 data;
1818c2ecf20Sopenharmony_ci} __attribute__ ((__packed__));
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci#define CLEARPACKET(packet) memset(packet, 0, 10)
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci/* PCI bridge related */
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci#define SISUSB_PCI_MEMBASE	0xd0000000
1888c2ecf20Sopenharmony_ci#define SISUSB_PCI_MMIOBASE	0xe4000000
1898c2ecf20Sopenharmony_ci#define SISUSB_PCI_IOPORTBASE	0x0000d000
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci#define SISUSB_PCI_PSEUDO_MEMBASE	0x10000000
1928c2ecf20Sopenharmony_ci#define SISUSB_PCI_PSEUDO_MMIOBASE	0x20000000
1938c2ecf20Sopenharmony_ci#define SISUSB_PCI_PSEUDO_IOPORTBASE	0x0000d000
1948c2ecf20Sopenharmony_ci#define SISUSB_PCI_PSEUDO_PCIBASE	0x00010000
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci#define SISUSB_PCI_MMIOSIZE	(128*1024)
1978c2ecf20Sopenharmony_ci#define SISUSB_PCI_PCONFSIZE	0x5c
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci/* graphics core related */
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_ci#define AROFFSET	0x40
2028c2ecf20Sopenharmony_ci#define ARROFFSET	0x41
2038c2ecf20Sopenharmony_ci#define GROFFSET	0x4e
2048c2ecf20Sopenharmony_ci#define SROFFSET	0x44
2058c2ecf20Sopenharmony_ci#define CROFFSET	0x54
2068c2ecf20Sopenharmony_ci#define MISCROFFSET	0x4c
2078c2ecf20Sopenharmony_ci#define MISCWOFFSET	0x42
2088c2ecf20Sopenharmony_ci#define INPUTSTATOFFSET 0x5A
2098c2ecf20Sopenharmony_ci#define PART1OFFSET	0x04
2108c2ecf20Sopenharmony_ci#define PART2OFFSET	0x10
2118c2ecf20Sopenharmony_ci#define PART3OFFSET	0x12
2128c2ecf20Sopenharmony_ci#define PART4OFFSET	0x14
2138c2ecf20Sopenharmony_ci#define PART5OFFSET	0x16
2148c2ecf20Sopenharmony_ci#define CAPTUREOFFSET	0x00
2158c2ecf20Sopenharmony_ci#define VIDEOOFFSET	0x02
2168c2ecf20Sopenharmony_ci#define COLREGOFFSET	0x48
2178c2ecf20Sopenharmony_ci#define PELMASKOFFSET	0x46
2188c2ecf20Sopenharmony_ci#define VGAENABLE	0x43
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_ci#define SISAR		SISUSB_PCI_IOPORTBASE + AROFFSET
2218c2ecf20Sopenharmony_ci#define SISARR		SISUSB_PCI_IOPORTBASE + ARROFFSET
2228c2ecf20Sopenharmony_ci#define SISGR		SISUSB_PCI_IOPORTBASE + GROFFSET
2238c2ecf20Sopenharmony_ci#define SISSR		SISUSB_PCI_IOPORTBASE + SROFFSET
2248c2ecf20Sopenharmony_ci#define SISCR		SISUSB_PCI_IOPORTBASE + CROFFSET
2258c2ecf20Sopenharmony_ci#define SISMISCR	SISUSB_PCI_IOPORTBASE + MISCROFFSET
2268c2ecf20Sopenharmony_ci#define SISMISCW	SISUSB_PCI_IOPORTBASE + MISCWOFFSET
2278c2ecf20Sopenharmony_ci#define SISINPSTAT	SISUSB_PCI_IOPORTBASE + INPUTSTATOFFSET
2288c2ecf20Sopenharmony_ci#define SISPART1	SISUSB_PCI_IOPORTBASE + PART1OFFSET
2298c2ecf20Sopenharmony_ci#define SISPART2	SISUSB_PCI_IOPORTBASE + PART2OFFSET
2308c2ecf20Sopenharmony_ci#define SISPART3	SISUSB_PCI_IOPORTBASE + PART3OFFSET
2318c2ecf20Sopenharmony_ci#define SISPART4	SISUSB_PCI_IOPORTBASE + PART4OFFSET
2328c2ecf20Sopenharmony_ci#define SISPART5	SISUSB_PCI_IOPORTBASE + PART5OFFSET
2338c2ecf20Sopenharmony_ci#define SISCAP		SISUSB_PCI_IOPORTBASE + CAPTUREOFFSET
2348c2ecf20Sopenharmony_ci#define SISVID		SISUSB_PCI_IOPORTBASE + VIDEOOFFSET
2358c2ecf20Sopenharmony_ci#define SISCOLIDXR	SISUSB_PCI_IOPORTBASE + COLREGOFFSET - 1
2368c2ecf20Sopenharmony_ci#define SISCOLIDX	SISUSB_PCI_IOPORTBASE + COLREGOFFSET
2378c2ecf20Sopenharmony_ci#define SISCOLDATA	SISUSB_PCI_IOPORTBASE + COLREGOFFSET + 1
2388c2ecf20Sopenharmony_ci#define SISCOL2IDX	SISPART5
2398c2ecf20Sopenharmony_ci#define SISCOL2DATA	SISPART5 + 1
2408c2ecf20Sopenharmony_ci#define SISPEL		SISUSB_PCI_IOPORTBASE + PELMASKOFFSET
2418c2ecf20Sopenharmony_ci#define SISVGAEN	SISUSB_PCI_IOPORTBASE + VGAENABLE
2428c2ecf20Sopenharmony_ci#define SISDACA		SISCOLIDX
2438c2ecf20Sopenharmony_ci#define SISDACD		SISCOLDATA
2448c2ecf20Sopenharmony_ci
2458c2ecf20Sopenharmony_ci/* ioctl related */
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci/* Structure argument for SISUSB_GET_INFO ioctl  */
2488c2ecf20Sopenharmony_cistruct sisusb_info {
2498c2ecf20Sopenharmony_ci	__u32 sisusb_id;	/* for identifying sisusb */
2508c2ecf20Sopenharmony_ci#define SISUSB_ID  0x53495355	/* Identify myself with 'SISU' */
2518c2ecf20Sopenharmony_ci	__u8 sisusb_version;
2528c2ecf20Sopenharmony_ci	__u8 sisusb_revision;
2538c2ecf20Sopenharmony_ci	__u8 sisusb_patchlevel;
2548c2ecf20Sopenharmony_ci	__u8 sisusb_gfxinit;	/* graphics core initialized? */
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ci	__u32 sisusb_vrambase;
2578c2ecf20Sopenharmony_ci	__u32 sisusb_mmiobase;
2588c2ecf20Sopenharmony_ci	__u32 sisusb_iobase;
2598c2ecf20Sopenharmony_ci	__u32 sisusb_pcibase;
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_ci	__u32 sisusb_vramsize;	/* framebuffer size in bytes */
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_ci	__u32 sisusb_minor;
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_ci	__u32 sisusb_fbdevactive;	/* != 0 if framebuffer device active */
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ci	__u32 sisusb_conactive;	/* != 0 if console driver active */
2688c2ecf20Sopenharmony_ci
2698c2ecf20Sopenharmony_ci	__u8 sisusb_reserved[28];	/* for future use */
2708c2ecf20Sopenharmony_ci};
2718c2ecf20Sopenharmony_ci
2728c2ecf20Sopenharmony_cistruct sisusb_command {
2738c2ecf20Sopenharmony_ci	__u8 operation;		/* see below */
2748c2ecf20Sopenharmony_ci	__u8 data0;		/* operation dependent */
2758c2ecf20Sopenharmony_ci	__u8 data1;		/* operation dependent */
2768c2ecf20Sopenharmony_ci	__u8 data2;		/* operation dependent */
2778c2ecf20Sopenharmony_ci	__u32 data3;		/* operation dependent */
2788c2ecf20Sopenharmony_ci	__u32 data4;		/* for future use */
2798c2ecf20Sopenharmony_ci};
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci#define SUCMD_GET	0x01	/* for all: data0 = index, data3 = port */
2828c2ecf20Sopenharmony_ci#define SUCMD_SET	0x02	/* data1 = value */
2838c2ecf20Sopenharmony_ci#define SUCMD_SETOR	0x03	/* data1 = or */
2848c2ecf20Sopenharmony_ci#define SUCMD_SETAND	0x04	/* data1 = and */
2858c2ecf20Sopenharmony_ci#define SUCMD_SETANDOR	0x05	/* data1 = and, data2 = or */
2868c2ecf20Sopenharmony_ci#define SUCMD_SETMASK	0x06	/* data1 = data, data2 = mask */
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_ci#define SUCMD_CLRSCR	0x07	/* data0:1:2 = length, data3 = address */
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_ci#define SUCMD_HANDLETEXTMODE 0x08	/* Reset/destroy text mode */
2918c2ecf20Sopenharmony_ci
2928c2ecf20Sopenharmony_ci#define SUCMD_SETMODE	0x09	/* Set a display mode (data3 = SiS mode) */
2938c2ecf20Sopenharmony_ci#define SUCMD_SETVESAMODE 0x0a	/* Set a display mode (data3 = VESA mode) */
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_ci#define SISUSB_COMMAND		_IOWR(0xF3,0x3D,struct sisusb_command)
2968c2ecf20Sopenharmony_ci#define SISUSB_GET_CONFIG_SIZE	_IOR(0xF3,0x3E,__u32)
2978c2ecf20Sopenharmony_ci#define SISUSB_GET_CONFIG	_IOR(0xF3,0x3F,struct sisusb_info)
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_ci#endif /* SISUSB_H */
300