packaging: update the changelog
[profile/ivi/intel-emgd-kmod.git] / emgd / pal / ch7036 / ch7036_fw.h
1 /*-----------------------------------------------------------------------------
2 * Copyright (c) Chrontel Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 *
22 *-----------------------------------------------------------------------------
23 * @file  ch7036_fw.h
24 * @version 1.2.2
25 *-----------------------------------------------------------------------------
26 */
27
28
29 #ifndef H_FW_OPER_H
30 #define H_FW_OPER_H
31
32 #include "ch7036_typedef.h"
33
34
35 //#include <linux/kernel.h>
36
37 #define CFG_CAP_EDID    0x01
38 #define CFG_CAP_HDCP    0x02
39
40 typedef unsigned char ch7036_attr_table_index_t;
41
42
43 typedef struct _FW7036_CFG {
44     unsigned char size;
45         unsigned char ver_major;
46         unsigned char ver_minor;
47         unsigned char did;
48         unsigned char rid;
49         unsigned char capbility;
50         unsigned char reserved;
51 } FW7036_CFG;
52
53
54 #define LHFM_GET_VERSION                0x1F
55 #define LHFM_GET_HPD                    0x06
56 #define LHFM_GET_EDID                   0x01
57 #define LHFM_GET_MODEINFO               0x03
58 #define LHFM_GET_VGA_MODEINFO   0x33
59 #define LHFM_HDMI_ONOFF         0x04
60 #define LHFM_REQUEST            0x40
61 #define LHFM_RET_ERROR          0x80
62
63 int LHFM_get_version(DEV_CONTEXT* p_ch7xxx_context,struct _FW7036_CFG* cfg);
64
65 void LHFM_enable_crt_hpd(DEV_CONTEXT* p_ch7xxx_context);
66 ch7036_status_t LHFM_get_crt_hpd(DEV_CONTEXT* p_ch7xxx_context);
67 int LHFM_hdmi_onoff(int turnon);
68 ch7036_status_t LHFM_get_hdmi_modeinfo(DEV_CONTEXT* p_ch7xxx_context,unsigned char *minfo);
69 ch7036_status_t LHFM_get_edid(DEV_CONTEXT* p_ch7xxx_context,unsigned char*edid, unsigned char* ebn, unsigned char flag);
70 int LHFM_load_firmware(DEV_CONTEXT* pDevContext);
71 void ch7036_dump( char *s, int size, unsigned char *regdata);
72
73 #define GET_VER                                 0x01
74 #define GET_HPD                                 0x02
75 #define GET_EDID                                0x04
76 #define GET_HDMI_DISPLAY_MODES  0x08
77
78 #define GET_CRT_HPD                             0x10
79 #define GET_CRT_EDID                    0x20
80
81 #define CH7036_HDMI_DDC                 0
82 #define CH7036_VGA_DDC                  0x80
83
84 #define MAX_EDID_BLOCKS                 2
85
86 #define MAX_I2C_BLOCK_SIZE              32
87
88
89
90
91 #define NUM_OF_BLOCKS                         0x0F
92 #define DTD_SIZE                              0x12
93 #define EDID_SIZE                             0x0100
94 #define EDID_STRUCTURE_VERSION                0x12
95 #define EDID_STRUCTURE_REVISION               0x13
96 #define EDID_FEATURE_SUPPORT                  0x18
97 #define EDID_ESTABLISHED_TIMINGS_1            0x23
98 #define EDID_ESTABLISHED_TIMINGS_2            0x24
99 #define EDID_MANUFACTURERS_RESERVED_TIMINGS   0x25
100 #define EDID_STANDARD_TIMINGS                 0x26
101 #define EDID_STANDARD_TIMINGS_BIT_DESCRIPTION 0x27
102 #define EDID_DETAILED_TIMING_DESCRIPTION_1    0x36
103 #define EDID_DETAILED_TIMING_DESCRIPTION_2    0x48
104 #define EDID_DETAILED_TIMING_DESCRIPTION_3    0x5A
105
106 #define EDID_EXTENSION_FLAG                   0x7E
107
108 #define EDID_CEA_TAG                          0x80
109 #define EDID_CEA_REVISION                     0x81
110 #define EDID_CEA_DETAILED_TIMING_DATA_OFFSET  0x82
111 #define EDID_CEA_VIDEO_DATA_BLOCK             0x84
112 #define EDID_CEA_DATA_BLOCK                                       0x84
113
114 #define EDID_CEA_VIDEO_DATA_BLOCK_2           0x96
115 #define EDID_CEA_VIDEO_DATA_BLOCK_3           0xA8
116 #define EDID_CEA_VIDEO_DATA_BLOCK_4           0xBA
117 #define EDID_CEA_VIDEO_DATA_BLOCK_5           0xCC
118 #define EDID_CEA_VIDEO_DATA_BLOCK_6           0xDE
119
120 #define EDID_SPACE_INDEX_START                0x18
121
122
123
124
125
126 typedef struct {
127     unsigned char  is_supported;
128     char mode_name[13];
129         unsigned long index[3];
130
131 }established_timings_t, *p_established_timings;
132
133 typedef struct {
134         unsigned int ha;
135         unsigned int va;
136         unsigned char refresh_rate;
137 }standard_timings_t, *p_standard_timings;
138
139
140
141 typedef struct {
142         unsigned char pclk_lobyte;
143         unsigned char pclk_hibyte;
144         unsigned char hactive_lobyte;
145         unsigned char hblank_lobyte;
146         unsigned char hactive_blank;
147         unsigned char vactive_lobyte;
148         unsigned char vblank_lobyte;
149         unsigned char vactive_blank;
150         unsigned char hsync_off_lobyte;
151         unsigned char hsync_pulse_width;
152         unsigned char vsync_off_pulse_width;
153
154         unsigned char hsopw_vsopw;
155
156
157
158         unsigned char himage_size_lobyte;
159         unsigned char vimage_size_lobyte;
160         unsigned char hvimage_size;
161
162         unsigned char hborder;
163         unsigned char vborder;
164         unsigned char flags;
165 }dtd_t, *p_dtd;
166
167
168 typedef struct monitor_range {
169
170         unsigned char  hrate_min;
171         unsigned char  hrate_max;
172         unsigned char  vrate_min;
173         unsigned char  vrate_max;
174
175         unsigned long  pclk_max;
176
177 }monitor_range_t;
178
179
180 typedef struct detailed_timing_block {
181         unsigned long data_tag;
182         OUT_FMT         dtiming;
183 } dtblks_t;
184
185
186 typedef struct edid_blk {
187
188
189         unsigned char                                           is_edid;
190         unsigned char                                           is_preferred_timing;
191
192         unsigned char                                           ebn;
193         unsigned char                                           edidblk[EDID_SIZE];
194
195         established_timings_t                           *etiming_I;
196         established_timings_t                           *etiming_II;
197         established_timings_t                           *etiming_man;
198
199         standard_timings_t                                      stiming[8];
200
201         standard_timings_t                                      stiming_x[6];
202         monitor_range_t                                         rtiming;
203
204         dtblks_t                                                        dtblk[4];
205
206
207         unsigned char                                           supported_modes[15];
208         ch7036_attr_table_index_t                       modes[MAX_ATTR_LIST_SIZE];
209
210 } ch7036_edid_blk_t;
211
212
213 #endif