1
2
3
4
5
6
7
8
9 #ifndef _ASM_POWERPC_PS3AV_H_
10 #define _ASM_POWERPC_PS3AV_H_
11
12
13 #define PS3AV_VERSION 0x205
14
15 #define PS3AV_CID_AV_INIT 0x00000001
16 #define PS3AV_CID_AV_FIN 0x00000002
17 #define PS3AV_CID_AV_GET_HW_CONF 0x00000003
18 #define PS3AV_CID_AV_GET_MONITOR_INFO 0x00000004
19 #define PS3AV_CID_AV_ENABLE_EVENT 0x00000006
20 #define PS3AV_CID_AV_DISABLE_EVENT 0x00000007
21 #define PS3AV_CID_AV_TV_MUTE 0x0000000a
22
23 #define PS3AV_CID_AV_VIDEO_CS 0x00010001
24 #define PS3AV_CID_AV_VIDEO_MUTE 0x00010002
25 #define PS3AV_CID_AV_VIDEO_DISABLE_SIG 0x00010003
26 #define PS3AV_CID_AV_AUDIO_PARAM 0x00020001
27 #define PS3AV_CID_AV_AUDIO_MUTE 0x00020002
28 #define PS3AV_CID_AV_HDMI_MODE 0x00040001
29
30 #define PS3AV_CID_VIDEO_INIT 0x01000001
31 #define PS3AV_CID_VIDEO_MODE 0x01000002
32 #define PS3AV_CID_VIDEO_FORMAT 0x01000004
33 #define PS3AV_CID_VIDEO_PITCH 0x01000005
34
35 #define PS3AV_CID_AUDIO_INIT 0x02000001
36 #define PS3AV_CID_AUDIO_MODE 0x02000002
37 #define PS3AV_CID_AUDIO_MUTE 0x02000003
38 #define PS3AV_CID_AUDIO_ACTIVE 0x02000004
39 #define PS3AV_CID_AUDIO_INACTIVE 0x02000005
40 #define PS3AV_CID_AUDIO_SPDIF_BIT 0x02000006
41 #define PS3AV_CID_AUDIO_CTRL 0x02000007
42
43 #define PS3AV_CID_EVENT_UNPLUGGED 0x10000001
44 #define PS3AV_CID_EVENT_PLUGGED 0x10000002
45 #define PS3AV_CID_EVENT_HDCP_DONE 0x10000003
46 #define PS3AV_CID_EVENT_HDCP_FAIL 0x10000004
47 #define PS3AV_CID_EVENT_HDCP_AUTH 0x10000005
48 #define PS3AV_CID_EVENT_HDCP_ERROR 0x10000006
49
50 #define PS3AV_CID_AVB_PARAM 0x04000001
51
52
53 #define PS3AV_HDMI_MAX 2
54 #define PS3AV_AVMULTI_MAX 1
55 #define PS3AV_AV_PORT_MAX (PS3AV_HDMI_MAX + PS3AV_AVMULTI_MAX)
56 #define PS3AV_OPT_PORT_MAX 1
57 #define PS3AV_HEAD_MAX 2
58
59
60 #define PS3AV_AVB_NUM_VIDEO PS3AV_HEAD_MAX
61 #define PS3AV_AVB_NUM_AUDIO 0
62 #define PS3AV_AVB_NUM_AV_VIDEO PS3AV_AV_PORT_MAX
63 #define PS3AV_AVB_NUM_AV_AUDIO PS3AV_HDMI_MAX
64
65 #define PS3AV_MUTE_PORT_MAX 1
66
67
68 #define PS3AV_CMD_EVENT_BIT_UNPLUGGED (1 << 0)
69 #define PS3AV_CMD_EVENT_BIT_PLUGGED (1 << 1)
70 #define PS3AV_CMD_EVENT_BIT_HDCP_DONE (1 << 2)
71 #define PS3AV_CMD_EVENT_BIT_HDCP_FAIL (1 << 3)
72 #define PS3AV_CMD_EVENT_BIT_HDCP_REAUTH (1 << 4)
73 #define PS3AV_CMD_EVENT_BIT_HDCP_TOPOLOGY (1 << 5)
74
75
76
77 #define PS3AV_CMD_MUTE_OFF 0x0000
78 #define PS3AV_CMD_MUTE_ON 0x0001
79
80 #define PS3AV_CMD_AVPORT_HDMI_0 0x0000
81 #define PS3AV_CMD_AVPORT_HDMI_1 0x0001
82 #define PS3AV_CMD_AVPORT_AVMULTI_0 0x0010
83 #define PS3AV_CMD_AVPORT_SPDIF_0 0x0020
84 #define PS3AV_CMD_AVPORT_SPDIF_1 0x0021
85
86
87
88 #define PS3AV_CMD_AV_MCLK_128 0x0000
89 #define PS3AV_CMD_AV_MCLK_256 0x0001
90 #define PS3AV_CMD_AV_MCLK_512 0x0003
91
92 #define PS3AV_CMD_AV_INPUTLEN_16 0x02
93 #define PS3AV_CMD_AV_INPUTLEN_20 0x0a
94 #define PS3AV_CMD_AV_INPUTLEN_24 0x0b
95
96 #define PS3AV_CMD_AV_LAYOUT_32 (1 << 0)
97 #define PS3AV_CMD_AV_LAYOUT_44 (1 << 1)
98 #define PS3AV_CMD_AV_LAYOUT_48 (1 << 2)
99 #define PS3AV_CMD_AV_LAYOUT_88 (1 << 3)
100 #define PS3AV_CMD_AV_LAYOUT_96 (1 << 4)
101 #define PS3AV_CMD_AV_LAYOUT_176 (1 << 5)
102 #define PS3AV_CMD_AV_LAYOUT_192 (1 << 6)
103
104 #define PS3AV_CMD_AV_HDMI_MODE_NORMAL 0xff
105 #define PS3AV_CMD_AV_HDMI_HDCP_OFF 0x01
106 #define PS3AV_CMD_AV_HDMI_EDID_PASS 0x80
107 #define PS3AV_CMD_AV_HDMI_DVI 0x40
108
109
110
111 #define PS3AV_CMD_VIDEO_HEAD_A 0x0000
112 #define PS3AV_CMD_VIDEO_HEAD_B 0x0001
113
114 #define PS3AV_CMD_VIDEO_CS_NONE 0x0000
115 #define PS3AV_CMD_VIDEO_CS_RGB_8 0x0001
116 #define PS3AV_CMD_VIDEO_CS_YUV444_8 0x0002
117 #define PS3AV_CMD_VIDEO_CS_YUV422_8 0x0003
118 #define PS3AV_CMD_VIDEO_CS_XVYCC_8 0x0004
119 #define PS3AV_CMD_VIDEO_CS_RGB_10 0x0005
120 #define PS3AV_CMD_VIDEO_CS_YUV444_10 0x0006
121 #define PS3AV_CMD_VIDEO_CS_YUV422_10 0x0007
122 #define PS3AV_CMD_VIDEO_CS_XVYCC_10 0x0008
123 #define PS3AV_CMD_VIDEO_CS_RGB_12 0x0009
124 #define PS3AV_CMD_VIDEO_CS_YUV444_12 0x000a
125 #define PS3AV_CMD_VIDEO_CS_YUV422_12 0x000b
126 #define PS3AV_CMD_VIDEO_CS_XVYCC_12 0x000c
127
128 #define PS3AV_CMD_VIDEO_VID_NONE 0x0000
129 #define PS3AV_CMD_VIDEO_VID_480I 0x0001
130 #define PS3AV_CMD_VIDEO_VID_576I 0x0003
131 #define PS3AV_CMD_VIDEO_VID_480P 0x0005
132 #define PS3AV_CMD_VIDEO_VID_576P 0x0006
133 #define PS3AV_CMD_VIDEO_VID_1080I_60HZ 0x0007
134 #define PS3AV_CMD_VIDEO_VID_1080I_50HZ 0x0008
135 #define PS3AV_CMD_VIDEO_VID_720P_60HZ 0x0009
136 #define PS3AV_CMD_VIDEO_VID_720P_50HZ 0x000a
137 #define PS3AV_CMD_VIDEO_VID_1080P_60HZ 0x000b
138 #define PS3AV_CMD_VIDEO_VID_1080P_50HZ 0x000c
139 #define PS3AV_CMD_VIDEO_VID_WXGA 0x000d
140 #define PS3AV_CMD_VIDEO_VID_SXGA 0x000e
141 #define PS3AV_CMD_VIDEO_VID_WUXGA 0x000f
142 #define PS3AV_CMD_VIDEO_VID_480I_A 0x0010
143
144 #define PS3AV_CMD_VIDEO_FORMAT_BLACK 0x0000
145 #define PS3AV_CMD_VIDEO_FORMAT_ARGB_8BIT 0x0007
146
147 #define PS3AV_CMD_VIDEO_ORDER_RGB 0x0000
148 #define PS3AV_CMD_VIDEO_ORDER_BGR 0x0001
149
150 #define PS3AV_CMD_VIDEO_FMT_X8R8G8B8 0x0000
151
152 #define PS3AV_CMD_VIDEO_OUT_FORMAT_RGB_12BIT 0x0000
153
154 #define PS3AV_CMD_VIDEO_CL_CNV_ENABLE_LUT 0x0000
155 #define PS3AV_CMD_VIDEO_CL_CNV_DISABLE_LUT 0x0010
156
157 #define PS3AV_CMD_VIDEO_SYNC_VSYNC 0x0001
158 #define PS3AV_CMD_VIDEO_SYNC_CSYNC 0x0004
159 #define PS3AV_CMD_VIDEO_SYNC_HSYNC 0x0010
160
161
162
163 #define PS3AV_CMD_AUDIO_NUM_OF_CH_2 0x0000
164 #define PS3AV_CMD_AUDIO_NUM_OF_CH_3 0x0001
165 #define PS3AV_CMD_AUDIO_NUM_OF_CH_4 0x0002
166 #define PS3AV_CMD_AUDIO_NUM_OF_CH_5 0x0003
167 #define PS3AV_CMD_AUDIO_NUM_OF_CH_6 0x0004
168 #define PS3AV_CMD_AUDIO_NUM_OF_CH_7 0x0005
169 #define PS3AV_CMD_AUDIO_NUM_OF_CH_8 0x0006
170
171 #define PS3AV_CMD_AUDIO_FS_32K 0x0001
172 #define PS3AV_CMD_AUDIO_FS_44K 0x0002
173 #define PS3AV_CMD_AUDIO_FS_48K 0x0003
174 #define PS3AV_CMD_AUDIO_FS_88K 0x0004
175 #define PS3AV_CMD_AUDIO_FS_96K 0x0005
176 #define PS3AV_CMD_AUDIO_FS_176K 0x0006
177 #define PS3AV_CMD_AUDIO_FS_192K 0x0007
178
179 #define PS3AV_CMD_AUDIO_WORD_BITS_16 0x0001
180 #define PS3AV_CMD_AUDIO_WORD_BITS_20 0x0002
181 #define PS3AV_CMD_AUDIO_WORD_BITS_24 0x0003
182
183 #define PS3AV_CMD_AUDIO_FORMAT_PCM 0x0001
184 #define PS3AV_CMD_AUDIO_FORMAT_BITSTREAM 0x00ff
185
186 #define PS3AV_CMD_AUDIO_SOURCE_SERIAL 0x0000
187 #define PS3AV_CMD_AUDIO_SOURCE_SPDIF 0x0001
188
189 #define PS3AV_CMD_AUDIO_SWAP_0 0x0000
190 #define PS3AV_CMD_AUDIO_SWAP_1 0x0000
191
192 #define PS3AV_CMD_AUDIO_MAP_OUTPUT_0 0x0000
193 #define PS3AV_CMD_AUDIO_MAP_OUTPUT_1 0x0001
194 #define PS3AV_CMD_AUDIO_MAP_OUTPUT_2 0x0002
195 #define PS3AV_CMD_AUDIO_MAP_OUTPUT_3 0x0003
196
197 #define PS3AV_CMD_AUDIO_LAYOUT_2CH 0x0000
198 #define PS3AV_CMD_AUDIO_LAYOUT_6CH 0x000b
199 #define PS3AV_CMD_AUDIO_LAYOUT_8CH 0x001f
200
201 #define PS3AV_CMD_AUDIO_DOWNMIX_PERMITTED 0x0000
202 #define PS3AV_CMD_AUDIO_DOWNMIX_PROHIBITED 0x0001
203
204
205 #define PS3AV_CMD_AUDIO_PORT_HDMI_0 ( 1 << 0 )
206 #define PS3AV_CMD_AUDIO_PORT_HDMI_1 ( 1 << 1 )
207 #define PS3AV_CMD_AUDIO_PORT_AVMULTI_0 ( 1 << 10 )
208 #define PS3AV_CMD_AUDIO_PORT_SPDIF_0 ( 1 << 20 )
209 #define PS3AV_CMD_AUDIO_PORT_SPDIF_1 ( 1 << 21 )
210
211
212 #define PS3AV_CMD_AUDIO_CTRL_ID_DAC_RESET 0x0000
213 #define PS3AV_CMD_AUDIO_CTRL_ID_DAC_DE_EMPHASIS 0x0001
214 #define PS3AV_CMD_AUDIO_CTRL_ID_AVCLK 0x0002
215
216 #define PS3AV_CMD_AUDIO_CTRL_RESET_NEGATE 0x0000
217 #define PS3AV_CMD_AUDIO_CTRL_RESET_ASSERT 0x0001
218
219 #define PS3AV_CMD_AUDIO_CTRL_DE_EMPHASIS_OFF 0x0000
220 #define PS3AV_CMD_AUDIO_CTRL_DE_EMPHASIS_ON 0x0001
221
222 #define PS3AV_CMD_AUDIO_CTRL_AVCLK_22 0x0000
223 #define PS3AV_CMD_AUDIO_CTRL_AVCLK_18 0x0001
224
225
226
227 #define PS3AV_CMD_AV_VID_480I 0x0000
228 #define PS3AV_CMD_AV_VID_480P 0x0001
229 #define PS3AV_CMD_AV_VID_720P_60HZ 0x0002
230 #define PS3AV_CMD_AV_VID_1080I_60HZ 0x0003
231 #define PS3AV_CMD_AV_VID_1080P_60HZ 0x0004
232 #define PS3AV_CMD_AV_VID_576I 0x0005
233 #define PS3AV_CMD_AV_VID_576P 0x0006
234 #define PS3AV_CMD_AV_VID_720P_50HZ 0x0007
235 #define PS3AV_CMD_AV_VID_1080I_50HZ 0x0008
236 #define PS3AV_CMD_AV_VID_1080P_50HZ 0x0009
237 #define PS3AV_CMD_AV_VID_WXGA 0x000a
238 #define PS3AV_CMD_AV_VID_SXGA 0x000b
239 #define PS3AV_CMD_AV_VID_WUXGA 0x000c
240
241
242 #define PS3AV_CMD_AV_CS_RGB_8 0x0000
243 #define PS3AV_CMD_AV_CS_YUV444_8 0x0001
244 #define PS3AV_CMD_AV_CS_YUV422_8 0x0002
245 #define PS3AV_CMD_AV_CS_XVYCC_8 0x0003
246 #define PS3AV_CMD_AV_CS_RGB_10 0x0004
247 #define PS3AV_CMD_AV_CS_YUV444_10 0x0005
248 #define PS3AV_CMD_AV_CS_YUV422_10 0x0006
249 #define PS3AV_CMD_AV_CS_XVYCC_10 0x0007
250 #define PS3AV_CMD_AV_CS_RGB_12 0x0008
251 #define PS3AV_CMD_AV_CS_YUV444_12 0x0009
252 #define PS3AV_CMD_AV_CS_YUV422_12 0x000a
253 #define PS3AV_CMD_AV_CS_XVYCC_12 0x000b
254 #define PS3AV_CMD_AV_CS_8 0x0000
255 #define PS3AV_CMD_AV_CS_10 0x0001
256 #define PS3AV_CMD_AV_CS_12 0x0002
257
258 #define PS3AV_CMD_AV_DITHER_OFF 0x0000
259 #define PS3AV_CMD_AV_DITHER_ON 0x0001
260 #define PS3AV_CMD_AV_DITHER_8BIT 0x0000
261 #define PS3AV_CMD_AV_DITHER_10BIT 0x0002
262 #define PS3AV_CMD_AV_DITHER_12BIT 0x0004
263
264 #define PS3AV_CMD_AV_SUPER_WHITE_OFF 0x0000
265 #define PS3AV_CMD_AV_SUPER_WHITE_ON 0x0001
266
267 #define PS3AV_CMD_AV_ASPECT_16_9 0x0000
268 #define PS3AV_CMD_AV_ASPECT_4_3 0x0001
269
270 #define PS3AV_CMD_VIDEO_CS_RGB 0x0001
271 #define PS3AV_CMD_VIDEO_CS_YUV422 0x0002
272 #define PS3AV_CMD_VIDEO_CS_YUV444 0x0003
273
274
275 #define PS3AV_RESBIT_720x480P 0x0003
276 #define PS3AV_RESBIT_720x576P 0x0003
277 #define PS3AV_RESBIT_1280x720P 0x0004
278 #define PS3AV_RESBIT_1920x1080I 0x0008
279 #define PS3AV_RESBIT_1920x1080P 0x4000
280 #define PS3AV_RES_MASK_60 (PS3AV_RESBIT_720x480P \
281 | PS3AV_RESBIT_1280x720P \
282 | PS3AV_RESBIT_1920x1080I \
283 | PS3AV_RESBIT_1920x1080P)
284 #define PS3AV_RES_MASK_50 (PS3AV_RESBIT_720x576P \
285 | PS3AV_RESBIT_1280x720P \
286 | PS3AV_RESBIT_1920x1080I \
287 | PS3AV_RESBIT_1920x1080P)
288
289
290 #define PS3AV_RESBIT_VGA 0x0001
291 #define PS3AV_RESBIT_WXGA 0x0002
292 #define PS3AV_RESBIT_SXGA 0x0004
293 #define PS3AV_RESBIT_WUXGA 0x0008
294 #define PS3AV_RES_MASK_VESA (PS3AV_RESBIT_WXGA |\
295 PS3AV_RESBIT_SXGA |\
296 PS3AV_RESBIT_WUXGA)
297
298 #define PS3AV_MONITOR_TYPE_HDMI 1
299 #define PS3AV_MONITOR_TYPE_DVI 2
300
301
302
303 enum ps3av_mode_num {
304 PS3AV_MODE_AUTO = 0,
305 PS3AV_MODE_480I = 1,
306 PS3AV_MODE_480P = 2,
307 PS3AV_MODE_720P60 = 3,
308 PS3AV_MODE_1080I60 = 4,
309 PS3AV_MODE_1080P60 = 5,
310 PS3AV_MODE_576I = 6,
311 PS3AV_MODE_576P = 7,
312 PS3AV_MODE_720P50 = 8,
313 PS3AV_MODE_1080I50 = 9,
314 PS3AV_MODE_1080P50 = 10,
315 PS3AV_MODE_WXGA = 11,
316 PS3AV_MODE_SXGA = 12,
317 PS3AV_MODE_WUXGA = 13,
318 };
319
320 #define PS3AV_MODE_MASK 0x000F
321 #define PS3AV_MODE_HDCP_OFF 0x1000
322 #define PS3AV_MODE_DITHER 0x0800
323 #define PS3AV_MODE_COLOR 0x0400
324 #define PS3AV_MODE_WHITE 0x0200
325 #define PS3AV_MODE_FULL 0x0080
326 #define PS3AV_MODE_DVI 0x0040
327 #define PS3AV_MODE_RGB 0x0020
328
329
330 #define PS3AV_DEFAULT_HDMI_MODE_ID_REG_60 PS3AV_MODE_480P
331 #define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_60 PS3AV_MODE_480I
332 #define PS3AV_DEFAULT_HDMI_MODE_ID_REG_50 PS3AV_MODE_576P
333 #define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_50 PS3AV_MODE_576I
334
335 #define PS3AV_REGION_60 0x01
336 #define PS3AV_REGION_50 0x02
337 #define PS3AV_REGION_RGB 0x10
338
339 #define get_status(buf) (((__u32 *)buf)[2])
340 #define PS3AV_HDR_SIZE 4
341
342
343
344 struct ps3av_send_hdr {
345 u16 version;
346 u16 size;
347 u32 cid;
348 };
349
350 struct ps3av_reply_hdr {
351 u16 version;
352 u16 size;
353 u32 cid;
354 u32 status;
355 };
356
357
358 struct ps3av_pkt_av_init {
359 struct ps3av_send_hdr send_hdr;
360 u32 event_bit;
361 };
362
363
364 struct ps3av_pkt_av_fin {
365 struct ps3av_send_hdr send_hdr;
366
367 u32 reserved;
368 };
369
370
371 struct ps3av_pkt_av_get_hw_conf {
372 struct ps3av_send_hdr send_hdr;
373
374 u32 status;
375 u16 num_of_hdmi;
376 u16 num_of_avmulti;
377 u16 num_of_spdif;
378 u16 reserved;
379 };
380
381
382 struct ps3av_info_resolution {
383 u32 res_bits;
384 u32 native;
385 };
386
387 struct ps3av_info_cs {
388 u8 rgb;
389 u8 yuv444;
390 u8 yuv422;
391 u8 reserved;
392 };
393
394 struct ps3av_info_color {
395 u16 red_x;
396 u16 red_y;
397 u16 green_x;
398 u16 green_y;
399 u16 blue_x;
400 u16 blue_y;
401 u16 white_x;
402 u16 white_y;
403 u32 gamma;
404 };
405
406 struct ps3av_info_audio {
407 u8 type;
408 u8 max_num_of_ch;
409 u8 fs;
410 u8 sbit;
411 };
412
413 struct ps3av_info_monitor {
414 u8 avport;
415 u8 monitor_id[10];
416 u8 monitor_type;
417 u8 monitor_name[16];
418 struct ps3av_info_resolution res_60;
419 struct ps3av_info_resolution res_50;
420 struct ps3av_info_resolution res_other;
421 struct ps3av_info_resolution res_vesa;
422 struct ps3av_info_cs cs;
423 struct ps3av_info_color color;
424 u8 supported_ai;
425 u8 speaker_info;
426 u8 num_of_audio_block;
427 struct ps3av_info_audio audio[0];
428 u8 reserved[169];
429 } __attribute__ ((packed));
430
431 struct ps3av_pkt_av_get_monitor_info {
432 struct ps3av_send_hdr send_hdr;
433 u16 avport;
434 u16 reserved;
435
436 struct ps3av_info_monitor info;
437 };
438
439
440 struct ps3av_pkt_av_event {
441 struct ps3av_send_hdr send_hdr;
442 u32 event_bit;
443 };
444
445
446 struct ps3av_pkt_av_video_cs {
447 struct ps3av_send_hdr send_hdr;
448 u16 avport;
449 u16 av_vid;
450 u16 av_cs_out;
451 u16 av_cs_in;
452 u8 dither;
453 u8 bitlen_out;
454 u8 super_white;
455 u8 aspect;
456 };
457
458
459 struct ps3av_av_mute {
460 u16 avport;
461 u16 mute;
462 };
463
464 struct ps3av_pkt_av_video_mute {
465 struct ps3av_send_hdr send_hdr;
466 struct ps3av_av_mute mute[PS3AV_MUTE_PORT_MAX];
467 };
468
469
470 struct ps3av_pkt_av_video_disable_sig {
471 struct ps3av_send_hdr send_hdr;
472 u16 avport;
473 u16 reserved;
474 };
475
476
477 struct ps3av_audio_info_frame {
478 struct pb1_bit {
479 u8 ct:4;
480 u8 rsv:1;
481 u8 cc:3;
482 } pb1;
483 struct pb2_bit {
484 u8 rsv:3;
485 u8 sf:3;
486 u8 ss:2;
487 } pb2;
488 u8 pb3;
489 u8 pb4;
490 struct pb5_bit {
491 u8 dm:1;
492 u8 lsv:4;
493 u8 rsv:3;
494 } pb5;
495 };
496
497 struct ps3av_pkt_av_audio_param {
498 struct ps3av_send_hdr send_hdr;
499 u16 avport;
500 u16 reserved;
501 u8 mclk;
502 u8 ns[3];
503 u8 enable;
504 u8 swaplr;
505 u8 fifomap;
506 u8 inputctrl;
507 u8 inputlen;
508 u8 layout;
509 struct ps3av_audio_info_frame info;
510 u8 chstat[5];
511 };
512
513
514 struct ps3av_pkt_av_audio_mute {
515 struct ps3av_send_hdr send_hdr;
516 struct ps3av_av_mute mute[PS3AV_MUTE_PORT_MAX];
517 };
518
519
520 struct ps3av_pkt_av_hdmi_mode {
521 struct ps3av_send_hdr send_hdr;
522 u8 mode;
523 u8 reserved0;
524 u8 reserved1;
525 u8 reserved2;
526 };
527
528
529 struct ps3av_pkt_av_tv_mute {
530 struct ps3av_send_hdr send_hdr;
531 u16 avport;
532 u16 mute;
533 };
534
535
536 struct ps3av_pkt_video_init {
537 struct ps3av_send_hdr send_hdr;
538
539 u32 reserved;
540 };
541
542
543 struct ps3av_pkt_video_mode {
544 struct ps3av_send_hdr send_hdr;
545 u32 video_head;
546 u32 reserved;
547 u32 video_vid;
548 u16 reserved1;
549 u16 width;
550 u16 reserved2;
551 u16 height;
552 u32 pitch;
553 u32 video_out_format;
554 u32 video_format;
555 u8 reserved3;
556 u8 video_cl_cnv;
557 u16 video_order;
558 u32 reserved4;
559 };
560
561
562 struct ps3av_pkt_video_format {
563 struct ps3av_send_hdr send_hdr;
564 u32 video_head;
565 u32 video_format;
566 u8 reserved;
567 u8 video_cl_cnv;
568 u16 video_order;
569 };
570
571
572 struct ps3av_pkt_video_pitch {
573 u16 version;
574 u16 size;
575 u32 cid;
576 u32 video_head;
577 u32 pitch;
578 };
579
580
581 struct ps3av_pkt_audio_init {
582 struct ps3av_send_hdr send_hdr;
583
584 u32 reserved;
585 };
586
587
588 struct ps3av_pkt_audio_mode {
589 struct ps3av_send_hdr send_hdr;
590 u8 avport;
591 u8 reserved0[3];
592 u32 mask;
593 u32 audio_num_of_ch;
594 u32 audio_fs;
595 u32 audio_word_bits;
596 u32 audio_format;
597 u32 audio_source;
598 u8 audio_enable[4];
599 u8 audio_swap[4];
600 u8 audio_map[4];
601 u32 audio_layout;
602 u32 audio_downmix;
603 u32 audio_downmix_level;
604 u8 audio_cs_info[8];
605 };
606
607
608 struct ps3av_audio_mute {
609 u8 avport;
610 u8 reserved[3];
611 u32 mute;
612 };
613
614 struct ps3av_pkt_audio_mute {
615 struct ps3av_send_hdr send_hdr;
616 struct ps3av_audio_mute mute[PS3AV_OPT_PORT_MAX];
617 };
618
619
620 struct ps3av_pkt_audio_active {
621 struct ps3av_send_hdr send_hdr;
622 u32 audio_port;
623 };
624
625
626 struct ps3av_pkt_audio_spdif_bit {
627 u16 version;
628 u16 size;
629 u32 cid;
630 u8 avport;
631 u8 reserved[3];
632 u32 audio_port;
633 u32 spdif_bit_data[12];
634 };
635
636
637 struct ps3av_pkt_audio_ctrl {
638 u16 version;
639 u16 size;
640 u32 cid;
641 u32 audio_ctrl_id;
642 u32 audio_ctrl_data[4];
643 };
644
645
646 #define PS3AV_PKT_AVB_PARAM_MAX_BUF_SIZE \
647 (PS3AV_AVB_NUM_VIDEO*sizeof(struct ps3av_pkt_video_mode) + \
648 PS3AV_AVB_NUM_AUDIO*sizeof(struct ps3av_pkt_audio_mode) + \
649 PS3AV_AVB_NUM_AV_VIDEO*sizeof(struct ps3av_pkt_av_video_cs) + \
650 PS3AV_AVB_NUM_AV_AUDIO*sizeof(struct ps3av_pkt_av_audio_param))
651
652 struct ps3av_pkt_avb_param {
653 struct ps3av_send_hdr send_hdr;
654 u16 num_of_video_pkt;
655 u16 num_of_audio_pkt;
656 u16 num_of_av_video_pkt;
657 u16 num_of_av_audio_pkt;
658
659
660
661
662
663
664
665
666 u8 buf[PS3AV_PKT_AVB_PARAM_MAX_BUF_SIZE];
667 };
668
669
670 extern u8 ps3av_mode_cs_info[];
671
672
673 #define PS3AV_STATUS_SUCCESS 0x0000
674 #define PS3AV_STATUS_RECEIVE_VUART_ERROR 0x0001
675 #define PS3AV_STATUS_SYSCON_COMMUNICATE_FAIL 0x0002
676 #define PS3AV_STATUS_INVALID_COMMAND 0x0003
677 #define PS3AV_STATUS_INVALID_PORT 0x0004
678 #define PS3AV_STATUS_INVALID_VID 0x0005
679 #define PS3AV_STATUS_INVALID_COLOR_SPACE 0x0006
680 #define PS3AV_STATUS_INVALID_FS 0x0007
681 #define PS3AV_STATUS_INVALID_AUDIO_CH 0x0008
682 #define PS3AV_STATUS_UNSUPPORTED_VERSION 0x0009
683 #define PS3AV_STATUS_INVALID_SAMPLE_SIZE 0x000a
684 #define PS3AV_STATUS_FAILURE 0x000b
685 #define PS3AV_STATUS_UNSUPPORTED_COMMAND 0x000c
686 #define PS3AV_STATUS_BUFFER_OVERFLOW 0x000d
687 #define PS3AV_STATUS_INVALID_VIDEO_PARAM 0x000e
688 #define PS3AV_STATUS_NO_SEL 0x000f
689 #define PS3AV_STATUS_INVALID_AV_PARAM 0x0010
690 #define PS3AV_STATUS_INVALID_AUDIO_PARAM 0x0011
691 #define PS3AV_STATUS_UNSUPPORTED_HDMI_MODE 0x0012
692 #define PS3AV_STATUS_NO_SYNC_HEAD 0x0013
693
694 extern void ps3av_set_hdr(u32, u16, struct ps3av_send_hdr *);
695 extern int ps3av_do_pkt(u32, u16, size_t, struct ps3av_send_hdr *);
696
697 extern int ps3av_cmd_init(void);
698 extern int ps3av_cmd_fin(void);
699 extern int ps3av_cmd_av_video_mute(int, u32 *, u32);
700 extern int ps3av_cmd_av_video_disable_sig(u32);
701 extern int ps3av_cmd_av_tv_mute(u32, u32);
702 extern int ps3av_cmd_enable_event(void);
703 extern int ps3av_cmd_av_hdmi_mode(u8);
704 extern u32 ps3av_cmd_set_av_video_cs(void *, u32, int, int, int, u32);
705 extern u32 ps3av_cmd_set_video_mode(void *, u32, int, int, u32);
706 extern int ps3av_cmd_video_format_black(u32, u32, u32);
707 extern int ps3av_cmd_av_audio_mute(int, u32 *, u32);
708 extern u32 ps3av_cmd_set_av_audio_param(void *, u32,
709 const struct ps3av_pkt_audio_mode *,
710 u32);
711 extern void ps3av_cmd_set_audio_mode(struct ps3av_pkt_audio_mode *, u32, u32,
712 u32, u32, u32, u32);
713 extern int ps3av_cmd_audio_mode(struct ps3av_pkt_audio_mode *);
714 extern int ps3av_cmd_audio_mute(int, u32 *, u32);
715 extern int ps3av_cmd_audio_active(int, u32);
716 extern int ps3av_cmd_avb_param(struct ps3av_pkt_avb_param *, u32);
717 extern int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *);
718 extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *,
719 u32);
720
721 extern int ps3av_set_video_mode(int);
722 extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32);
723 extern int ps3av_get_auto_mode(void);
724 extern int ps3av_get_mode(void);
725 extern int ps3av_video_mode2res(u32, u32 *, u32 *);
726 extern int ps3av_video_mute(int);
727 extern int ps3av_audio_mute(int);
728 extern int ps3av_audio_mute_analog(int);
729 extern int ps3av_dev_open(void);
730 extern int ps3av_dev_close(void);
731 #endif