Linux Audio

Check our new training course

Linux kernel drivers training

Mar 31-Apr 9, 2025, special US time zones
Register
Loading...
v4.10.11
 
  1/*
  2 * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
  3 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
  4
  5 * This program is free software; you can redistribute it and/or
  6 * modify it under the terms of the GNU General Public
  7 * License as published by the Free Software Foundation;
  8 * either version 2, or (at your option) any later version.
  9
 10 * This program is distributed in the hope that it will be useful,
 11 * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
 12 * the implied warranty of MERCHANTABILITY or FITNESS FOR
 13 * A PARTICULAR PURPOSE.See the GNU General Public License
 14 * for more details.
 15
 16 * You should have received a copy of the GNU General Public License
 17 * along with this program; if not, write to the Free Software
 18 * Foundation, Inc.,
 19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 20 */
 21
 22#ifndef __IOCTL_H__
 23#define __IOCTL_H__
 24
 25#ifndef __user
 26#define __user
 27#endif
 28
 29/* VIAFB IOCTL definition */
 30#define VIAFB_GET_INFO_SIZE		0x56494101	/* 'VIA\01' */
 31#define VIAFB_GET_INFO			0x56494102	/* 'VIA\02' */
 32#define VIAFB_HOTPLUG			0x56494103	/* 'VIA\03' */
 33#define VIAFB_SET_HOTPLUG_FLAG		0x56494104	/* 'VIA\04' */
 34#define VIAFB_GET_RESOLUTION		0x56494105	/* 'VIA\05' */
 35#define VIAFB_GET_SAMM_INFO		0x56494107	/* 'VIA\07' */
 36#define VIAFB_TURN_ON_OUTPUT_DEVICE     0x56494108	/* 'VIA\08' */
 37#define VIAFB_TURN_OFF_OUTPUT_DEVICE    0x56494109	/* 'VIA\09' */
 38#define VIAFB_GET_DEVICE		0x5649410B
 39#define VIAFB_GET_DRIVER_VERSION	0x56494112	/* 'VIA\12' */
 40#define VIAFB_GET_CHIP_INFO		0x56494113	/* 'VIA\13' */
 41#define VIAFB_GET_DEVICE_INFO           0x56494115
 42
 43#define VIAFB_GET_DEVICE_SUPPORT	0x56494118
 44#define VIAFB_GET_DEVICE_CONNECT	0x56494119
 45#define VIAFB_GET_PANEL_SUPPORT_EXPAND	0x5649411A
 46#define VIAFB_GET_DRIVER_NAME		0x56494122
 47#define VIAFB_GET_DEVICE_SUPPORT_STATE	0x56494123
 48#define VIAFB_GET_GAMMA_LUT		0x56494124
 49#define VIAFB_SET_GAMMA_LUT		0x56494125
 50#define VIAFB_GET_GAMMA_SUPPORT_STATE	0x56494126
 51#define VIAFB_SYNC_SURFACE		0x56494130
 52#define VIAFB_GET_DRIVER_CAPS		0x56494131
 53#define VIAFB_GET_IGA_SCALING_INFO	0x56494132
 54#define VIAFB_GET_PANEL_MAX_SIZE	0x56494133
 55#define VIAFB_GET_PANEL_MAX_POSITION	0x56494134
 56#define VIAFB_SET_PANEL_SIZE		0x56494135
 57#define VIAFB_SET_PANEL_POSITION        0x56494136
 58#define VIAFB_GET_PANEL_POSITION        0x56494137
 59#define VIAFB_GET_PANEL_SIZE		0x56494138
 60
 61#define None_Device 0x00
 62#define CRT_Device  0x01
 63#define LCD_Device  0x02
 64#define DVI_Device  0x08
 65#define CRT2_Device 0x10
 66#define LCD2_Device 0x40
 67
 68#define OP_LCD_CENTERING   0x01
 69#define OP_LCD_PANEL_ID    0x02
 70#define OP_LCD_MODE        0x03
 71
 72/*SAMM operation flag*/
 73#define OP_SAMM            0x80
 74
 75#define LCD_PANEL_ID_MAXIMUM	23
 76
 77#define STATE_ON            0x1
 78#define STATE_OFF           0x0
 79#define STATE_DEFAULT       0xFFFF
 80
 81#define MAX_ACTIVE_DEV_NUM  2
 82
 83struct device_t {
 84	unsigned short crt:1;
 85	unsigned short dvi:1;
 86	unsigned short lcd:1;
 87	unsigned short samm:1;
 88	unsigned short lcd_dsp_cent:1;
 89	unsigned char lcd_mode:1;
 90	unsigned short epia_dvi:1;
 91	unsigned short lcd_dual_edge:1;
 92	unsigned short lcd2:1;
 93
 94	unsigned short primary_dev;
 95	unsigned char lcd_panel_id;
 96	unsigned short xres, yres;
 97	unsigned short xres1, yres1;
 98	unsigned short refresh;
 99	unsigned short bpp;
100	unsigned short refresh1;
101	unsigned short bpp1;
102	unsigned short sequence;
103	unsigned short bus_width;
104};
105
106struct viafb_ioctl_info {
107	u32 viafb_id;		/* for identifying viafb */
108#define VIAID       0x56494146	/* Identify myself with 'VIAF' */
109	u16 vendor_id;
110	u16 device_id;
111	u8 version;
112	u8 revision;
113	u8 reserved[246];	/* for future use */
114};
115
116struct viafb_ioctl_mode {
117	u32 xres;
118	u32 yres;
119	u32 refresh;
120	u32 bpp;
121	u32 xres_sec;
122	u32 yres_sec;
123	u32 virtual_xres_sec;
124	u32 virtual_yres_sec;
125	u32 refresh_sec;
126	u32 bpp_sec;
127};
128struct viafb_ioctl_samm {
129	u32 samm_status;
130	u32 size_prim;
131	u32 size_sec;
132	u32 mem_base;
133	u32 offset_sec;
134};
135
136struct viafb_driver_version {
137	int iMajorNum;
138	int iKernelNum;
139	int iOSNum;
140	int iMinorNum;
141};
142
143struct viafb_ioctl_lcd_attribute {
144	unsigned int panel_id;
145	unsigned int display_center;
146	unsigned int lcd_mode;
147};
148
149struct viafb_ioctl_setting {
150	/* Enable or disable active devices */
151	unsigned short device_flag;
152	/* Indicate which device should be turn on or turn off. */
153	unsigned short device_status;
154	unsigned int reserved;
155	/* Indicate which LCD's attribute can be changed. */
156	unsigned short lcd_operation_flag;
157	/* 1: SAMM ON  0: SAMM OFF */
158	unsigned short samm_status;
159	/* horizontal resolution of first device */
160	unsigned short first_dev_hor_res;
161	/* vertical resolution of first device */
162	unsigned short first_dev_ver_res;
163	/* horizontal resolution of second device */
164	unsigned short second_dev_hor_res;
165	/* vertical resolution of second device */
166	unsigned short second_dev_ver_res;
167	/* refresh rate of first device */
168	unsigned short first_dev_refresh;
169	/* bpp of first device */
170	unsigned short first_dev_bpp;
171	/* refresh rate of second device */
172	unsigned short second_dev_refresh;
173	/* bpp of second device */
174	unsigned short second_dev_bpp;
175	/* Indicate which device are primary display device. */
176	unsigned int primary_device;
177	unsigned int struct_reserved[35];
178	struct viafb_ioctl_lcd_attribute lcd_attributes;
179};
180
181struct _UTFunctionCaps {
182	unsigned int dw3DScalingState;
183	unsigned int reserved[31];
184};
185
186struct _POSITIONVALUE {
187	unsigned int dwX;
188	unsigned int dwY;
189};
190
191struct _panel_size_pos_info {
192	unsigned int device_type;
193	int x;
194	int y;
195};
196
197extern int viafb_LCD_ON;
198extern int viafb_DVI_ON;
199
200int viafb_ioctl_get_viafb_info(u_long arg);
201int viafb_ioctl_hotplug(int hres, int vres, int bpp);
202
203#endif /* __IOCTL_H__ */
v6.9.4
  1/* SPDX-License-Identifier: GPL-2.0-or-later */
  2/*
  3 * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
  4 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
  5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  6 */
  7
  8#ifndef __IOCTL_H__
  9#define __IOCTL_H__
 10
 11#ifndef __user
 12#define __user
 13#endif
 14
 15/* VIAFB IOCTL definition */
 16#define VIAFB_GET_INFO_SIZE		0x56494101	/* 'VIA\01' */
 17#define VIAFB_GET_INFO			0x56494102	/* 'VIA\02' */
 18#define VIAFB_HOTPLUG			0x56494103	/* 'VIA\03' */
 19#define VIAFB_SET_HOTPLUG_FLAG		0x56494104	/* 'VIA\04' */
 20#define VIAFB_GET_RESOLUTION		0x56494105	/* 'VIA\05' */
 21#define VIAFB_GET_SAMM_INFO		0x56494107	/* 'VIA\07' */
 22#define VIAFB_TURN_ON_OUTPUT_DEVICE     0x56494108	/* 'VIA\08' */
 23#define VIAFB_TURN_OFF_OUTPUT_DEVICE    0x56494109	/* 'VIA\09' */
 24#define VIAFB_GET_DEVICE		0x5649410B
 25#define VIAFB_GET_DRIVER_VERSION	0x56494112	/* 'VIA\12' */
 26#define VIAFB_GET_CHIP_INFO		0x56494113	/* 'VIA\13' */
 27#define VIAFB_GET_DEVICE_INFO           0x56494115
 28
 29#define VIAFB_GET_DEVICE_SUPPORT	0x56494118
 30#define VIAFB_GET_DEVICE_CONNECT	0x56494119
 31#define VIAFB_GET_PANEL_SUPPORT_EXPAND	0x5649411A
 32#define VIAFB_GET_DRIVER_NAME		0x56494122
 33#define VIAFB_GET_DEVICE_SUPPORT_STATE	0x56494123
 34#define VIAFB_GET_GAMMA_LUT		0x56494124
 35#define VIAFB_SET_GAMMA_LUT		0x56494125
 36#define VIAFB_GET_GAMMA_SUPPORT_STATE	0x56494126
 37#define VIAFB_SYNC_SURFACE		0x56494130
 38#define VIAFB_GET_DRIVER_CAPS		0x56494131
 39#define VIAFB_GET_IGA_SCALING_INFO	0x56494132
 40#define VIAFB_GET_PANEL_MAX_SIZE	0x56494133
 41#define VIAFB_GET_PANEL_MAX_POSITION	0x56494134
 42#define VIAFB_SET_PANEL_SIZE		0x56494135
 43#define VIAFB_SET_PANEL_POSITION        0x56494136
 44#define VIAFB_GET_PANEL_POSITION        0x56494137
 45#define VIAFB_GET_PANEL_SIZE		0x56494138
 46
 47#define None_Device 0x00
 48#define CRT_Device  0x01
 49#define LCD_Device  0x02
 50#define DVI_Device  0x08
 51#define CRT2_Device 0x10
 52#define LCD2_Device 0x40
 53
 54#define OP_LCD_CENTERING   0x01
 55#define OP_LCD_PANEL_ID    0x02
 56#define OP_LCD_MODE        0x03
 57
 58/*SAMM operation flag*/
 59#define OP_SAMM            0x80
 60
 61#define LCD_PANEL_ID_MAXIMUM	23
 62
 63#define STATE_ON            0x1
 64#define STATE_OFF           0x0
 65#define STATE_DEFAULT       0xFFFF
 66
 67#define MAX_ACTIVE_DEV_NUM  2
 68
 69struct device_t {
 70	unsigned short crt:1;
 71	unsigned short dvi:1;
 72	unsigned short lcd:1;
 73	unsigned short samm:1;
 74	unsigned short lcd_dsp_cent:1;
 75	unsigned char lcd_mode:1;
 76	unsigned short epia_dvi:1;
 77	unsigned short lcd_dual_edge:1;
 78	unsigned short lcd2:1;
 79
 80	unsigned short primary_dev;
 81	unsigned char lcd_panel_id;
 82	unsigned short xres, yres;
 83	unsigned short xres1, yres1;
 84	unsigned short refresh;
 85	unsigned short bpp;
 86	unsigned short refresh1;
 87	unsigned short bpp1;
 88	unsigned short sequence;
 89	unsigned short bus_width;
 90};
 91
 92struct viafb_ioctl_info {
 93	u32 viafb_id;		/* for identifying viafb */
 94#define VIAID       0x56494146	/* Identify myself with 'VIAF' */
 95	u16 vendor_id;
 96	u16 device_id;
 97	u8 version;
 98	u8 revision;
 99	u8 reserved[246];	/* for future use */
100};
101
102struct viafb_ioctl_mode {
103	u32 xres;
104	u32 yres;
105	u32 refresh;
106	u32 bpp;
107	u32 xres_sec;
108	u32 yres_sec;
109	u32 virtual_xres_sec;
110	u32 virtual_yres_sec;
111	u32 refresh_sec;
112	u32 bpp_sec;
113};
114struct viafb_ioctl_samm {
115	u32 samm_status;
116	u32 size_prim;
117	u32 size_sec;
118	u32 mem_base;
119	u32 offset_sec;
120};
121
122struct viafb_driver_version {
123	int iMajorNum;
124	int iKernelNum;
125	int iOSNum;
126	int iMinorNum;
127};
128
129struct viafb_ioctl_lcd_attribute {
130	unsigned int panel_id;
131	unsigned int display_center;
132	unsigned int lcd_mode;
133};
134
135struct viafb_ioctl_setting {
136	/* Enable or disable active devices */
137	unsigned short device_flag;
138	/* Indicate which device should be turn on or turn off. */
139	unsigned short device_status;
140	unsigned int reserved;
141	/* Indicate which LCD's attribute can be changed. */
142	unsigned short lcd_operation_flag;
143	/* 1: SAMM ON  0: SAMM OFF */
144	unsigned short samm_status;
145	/* horizontal resolution of first device */
146	unsigned short first_dev_hor_res;
147	/* vertical resolution of first device */
148	unsigned short first_dev_ver_res;
149	/* horizontal resolution of second device */
150	unsigned short second_dev_hor_res;
151	/* vertical resolution of second device */
152	unsigned short second_dev_ver_res;
153	/* refresh rate of first device */
154	unsigned short first_dev_refresh;
155	/* bpp of first device */
156	unsigned short first_dev_bpp;
157	/* refresh rate of second device */
158	unsigned short second_dev_refresh;
159	/* bpp of second device */
160	unsigned short second_dev_bpp;
161	/* Indicate which device are primary display device. */
162	unsigned int primary_device;
163	unsigned int struct_reserved[35];
164	struct viafb_ioctl_lcd_attribute lcd_attributes;
165};
166
167struct _UTFunctionCaps {
168	unsigned int dw3DScalingState;
169	unsigned int reserved[31];
170};
171
172struct _POSITIONVALUE {
173	unsigned int dwX;
174	unsigned int dwY;
175};
176
177struct _panel_size_pos_info {
178	unsigned int device_type;
179	int x;
180	int y;
181};
182
183extern int viafb_LCD_ON;
184extern int viafb_DVI_ON;
185
186int viafb_ioctl_get_viafb_info(u_long arg);
187int viafb_ioctl_hotplug(int hres, int vres, int bpp);
188
189#endif /* __IOCTL_H__ */