1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
/*
* Copyright (C) ST-Ericsson AB 2010
*
* HDMI driver
*
* Author: Per Persson <per.xb.persson@stericsson.com>
* for ST-Ericsson.
*
* License terms: GNU General Public License (GPL), version 2.
*/
#ifndef __HDMI__H__
#define __HDMI__H__
#define HDMI_RESULT_OK 0
#define HDMI_RESULT_NOT_OK 1
#define HDMI_AES_NOT_FUSED 2
#define HDMI_RESULT_CRC_MISMATCH 3
#define HDMI_CEC_READ_MAXSIZE 16
#define HDMI_CEC_WRITE_MAXSIZE 15
#define HDMI_INFOFRAME_MAX_SIZE 27
#define HDMI_HDCP_FUSEAES_KEYSIZE 16
#define HDMI_HDCP_AES_BLOCK_START 128
#define HDMI_HDCP_KSV_BLOCK 40
#define HDMI_HDCP_AES_NR_OF_BLOCKS 18
#define HDMI_HDCP_AES_KEYSIZE 16
#define HDMI_HDCP_AES_KSVSIZE 5
#define HDMI_HDCP_AES_KSVZEROESSIZE 3
#define HDMI_EDID_DATA_SIZE 128
#define HDMI_CEC_SIZE 15
#define HDMI_INFOFR_SIZE 27
#define HDMI_FUSE_KEYSIZE 16
#define HDMI_AES_KSVSIZE 5
#define HDMI_AES_KEYSIZE 288
#define HDMI_CRC32_SIZE 4
#define HDMI_REVOC_LIST_SIZE 30
#define HDMI_STOREASTEXT_TEXT_SIZE 2
#define HDMI_STOREASTEXT_BIN_SIZE 1
#define HDMI_PLUGDETEN_TEXT_SIZE 6
#define HDMI_PLUGDETEN_BIN_SIZE 3
#define HDMI_EDIDREAD_TEXT_SIZE 4
#define HDMI_EDIDREAD_BIN_SIZE 2
#define HDMI_CECEVEN_TEXT_SIZE 2
#define HDMI_CECEVEN_BIN_SIZE 1
#define HDMI_CECSEND_TEXT_SIZE_MAX 37
#define HDMI_CECSEND_TEXT_SIZE_MIN 6
#define HDMI_CECSEND_BIN_SIZE_MAX 18
#define HDMI_CECSEND_BIN_SIZE_MIN 3
#define HDMI_INFOFRSEND_TEXT_SIZE_MIN 8
#define HDMI_INFOFRSEND_TEXT_SIZE_MAX 63
#define HDMI_INFOFRSEND_BIN_SIZE_MIN 4
#define HDMI_INFOFRSEND_BIN_SIZE_MAX 31
#define HDMI_HDCPEVEN_TEXT_SIZE 2
#define HDMI_HDCPEVEN_BIN_SIZE 1
#define HDMI_HDCP_FUSEAES_TEXT_SIZE 34
#define HDMI_HDCP_FUSEAES_BIN_SIZE 17
#define HDMI_HDCP_LOADAES_TEXT_SIZE 594
#define HDMI_HDCP_LOADAES_BIN_SIZE 297
#define HDMI_HDCPAUTHENCR_TEXT_SIZE 4
#define HDMI_HDCPAUTHENCR_BIN_SIZE 2
#define HDMI_EVCLR_TEXT_SIZE 2
#define HDMI_EVCLR_BIN_SIZE 1
#define HDMI_AUDIOCFG_TEXT_SIZE 14
#define HDMI_AUDIOCFG_BIN_SIZE 7
#define HDMI_POWERONOFF_TEXT_SIZE 2
#define HDMI_POWERONOFF_BIN_SIZE 1
#define HDMI_IOC_MAGIC 0xcc
/** IOCTL Operations */
#define IOC_PLUG_DETECT_ENABLE _IOWR(HDMI_IOC_MAGIC, 1, int)
#define IOC_EDID_READ _IOWR(HDMI_IOC_MAGIC, 2, int)
#define IOC_CEC_EVENT_ENABLE _IOWR(HDMI_IOC_MAGIC, 3, int)
#define IOC_CEC_READ _IOWR(HDMI_IOC_MAGIC, 4, int)
#define IOC_CEC_SEND _IOWR(HDMI_IOC_MAGIC, 5, int)
#define IOC_INFOFRAME_SEND _IOWR(HDMI_IOC_MAGIC, 6, int)
#define IOC_HDCP_EVENT_ENABLE _IOWR(HDMI_IOC_MAGIC, 7, int)
#define IOC_HDCP_CHKAESOTP _IOWR(HDMI_IOC_MAGIC, 8, int)
#define IOC_HDCP_FUSEAES _IOWR(HDMI_IOC_MAGIC, 9, int)
#define IOC_HDCP_LOADAES _IOWR(HDMI_IOC_MAGIC, 10, int)
#define IOC_HDCP_AUTHENCR_REQ _IOWR(HDMI_IOC_MAGIC, 11, int)
#define IOC_HDCP_STATE_GET _IOWR(HDMI_IOC_MAGIC, 12, int)
#define IOC_EVENTS_READ _IOWR(HDMI_IOC_MAGIC, 13, int)
#define IOC_EVENTS_CLEAR _IOWR(HDMI_IOC_MAGIC, 14, int)
#define IOC_AUDIO_CFG _IOWR(HDMI_IOC_MAGIC, 15, int)
#define IOC_PLUG_STATUS _IOWR(HDMI_IOC_MAGIC, 16, int)
#define IOC_POWERONOFF _IOWR(HDMI_IOC_MAGIC, 17, int)
#define IOC_EVENT_WAKEUP _IOWR(HDMI_IOC_MAGIC, 18, int)
#define IOC_POWERSTATE _IOWR(HDMI_IOC_MAGIC, 19, int)
/* HDMI driver */
void hdmi_event(enum av8100_hdmi_event);
int hdmi_init(void);
void hdmi_exit(void);
enum hdmi_event {
HDMI_EVENT_NONE = 0x0,
HDMI_EVENT_HDMI_PLUGIN = 0x1,
HDMI_EVENT_HDMI_PLUGOUT = 0x2,
HDMI_EVENT_CEC = 0x4,
HDMI_EVENT_HDCP = 0x8,
HDMI_EVENT_CECTXERR = 0x10,
HDMI_EVENT_WAKEUP = 0x20,
};
enum hdmi_hdcp_auth_type {
HDMI_HDCP_AUTH_OFF = 0,
HDMI_HDCP_AUTH_START = 1,
HDMI_HDCP_AUTH_REV_LIST_REQ = 2,
HDMI_HDCP_AUTH_CONT = 3,
};
enum hdmi_hdcp_encr_type {
HDMI_HDCP_ENCR_OESS = 0,
HDMI_HDCP_ENCR_EESS = 1,
};
struct plug_detect {
u8 hdmi_detect_enable;
u8 on_time;
u8 hdmi_off_time;
};
struct edid_read {
u8 address;
u8 block_nr;
u8 data_length;
u8 data[HDMI_EDID_DATA_SIZE];
};
struct cec_rw {
u8 src;
u8 dest;
u8 length;
u8 data[HDMI_CEC_SIZE];
};
struct info_fr {
u8 type;
u8 ver;
u8 crc;
u8 length;
u8 data[HDMI_INFOFR_SIZE];
};
struct hdcp_fuseaes {
u8 key[HDMI_FUSE_KEYSIZE];
u8 crc;
u8 result;
};
struct hdcp_loadaesall {
u8 key[HDMI_AES_KEYSIZE];
u8 ksv[HDMI_AES_KSVSIZE];
u8 crc32[HDMI_CRC32_SIZE];
u8 result;
};
struct hdcp_authencr {
u8 auth_type;
u8 encr_type;
u8 result;
u8 revoc_list[HDMI_REVOC_LIST_SIZE];
};
struct audio_cfg {
u8 if_format;
u8 i2s_entries;
u8 freq;
u8 word_length;
u8 format;
u8 if_mode;
u8 mute;
};
#endif /* __HDMI__H__ */
|