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