1c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan/*
2c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
3c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
4c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan
5c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * This program is free software; you can redistribute it and/or
6c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * modify it under the terms of the GNU General Public
7c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * License as published by the Free Software Foundation;
8c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * either version 2, or (at your option) any later version.
9c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan
10c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * This program is distributed in the hope that it will be useful,
11c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
12c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * the implied warranty of MERCHANTABILITY or FITNESS FOR
13c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * A PARTICULAR PURPOSE.See the GNU General Public License
14c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * for more details.
15c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan
16c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * You should have received a copy of the GNU General Public License
17c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * along with this program; if not, write to the Free Software
18c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * Foundation, Inc.,
19c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan */
21c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan
22c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#ifndef __DVI_H__
23c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define __DVI_H__
24c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan
25c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan/*Definition TMDS Device ID register*/
26c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     VT1632_DEVICE_ID_REG        0x02
27c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     VT1632_DEVICE_ID            0x92
28c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan
29c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     GET_DVI_SIZE_BY_SYSTEM_BIOS     0x01
30c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     GET_DVI_SIZE_BY_VGA_BIOS        0x02
31c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     GET_DVI_SZIE_BY_HW_STRAPPING    0x03
32c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan
33c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan/* Definition DVI Panel ID*/
34c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan/* Resolution: 640x480,   Channel: single, Dithering: Enable */
35c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     DVI_PANEL_ID0_640X480       0x00
36c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan/* Resolution: 800x600,   Channel: single, Dithering: Enable */
37c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     DVI_PANEL_ID1_800x600       0x01
38c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan/* Resolution: 1024x768,  Channel: single, Dithering: Enable */
39c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     DVI_PANEL_ID1_1024x768      0x02
40c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan/* Resolution: 1280x768,  Channel: single, Dithering: Enable */
41c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     DVI_PANEL_ID1_1280x768      0x03
42c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan/* Resolution: 1280x1024, Channel: dual,   Dithering: Enable */
43c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     DVI_PANEL_ID1_1280x1024     0x04
44c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan/* Resolution: 1400x1050, Channel: dual,   Dithering: Enable */
45c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     DVI_PANEL_ID1_1400x1050     0x05
46c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan/* Resolution: 1600x1200, Channel: dual,   Dithering: Enable */
47c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     DVI_PANEL_ID1_1600x1200     0x06
48c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan
49c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan/* Define the version of EDID*/
50c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     EDID_VERSION_1      1
51c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     EDID_VERSION_2      2
52c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan
53c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     DEV_CONNECT_DVI     0x01
54c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#define     DEV_CONNECT_HDMI    0x02
55c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan
56c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chanint viafb_dvi_sense(void);
57c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chanvoid viafb_dvi_disable(void);
58c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chanvoid viafb_dvi_enable(void);
5948c68c4f1b542444f175a9e136febcecf3e704d8Greg Kroah-Hartmanbool viafb_tmds_trasmitter_identify(void);
6048c68c4f1b542444f175a9e136febcecf3e704d8Greg Kroah-Hartmanvoid viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
61c5f06f5cddd6681b978ffdb53755e28eefccb1bbFlorian Tobias Schandinat	struct tmds_setting_information *tmds_setting);
62532f9169db21fbffd07cc44075c7ea1859c07806Florian Tobias Schandinatvoid viafb_dvi_set_mode(const struct fb_var_screeninfo *var,
63532f9169db21fbffd07cc44075c7ea1859c07806Florian Tobias Schandinat	u16 cxres, u16 cyres, int iga);
64c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan
65c09c782f3e7d38e1f3842822209bb6faff4a2b1bJoseph Chan#endif /* __DVI_H__ */
66