Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Driver for Digigram miXart soundcards |
| 3 | * |
| 4 | * low level interface with interrupt handling and mail box implementation |
| 5 | * |
| 6 | * Copyright (c) 2003 by Digigram <alsa@digigram.com> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 | */ |
| 22 | |
| 23 | #ifndef __SOUND_MIXART_CORE_H |
| 24 | #define __SOUND_MIXART_CORE_H |
| 25 | |
| 26 | |
| 27 | enum mixart_message_id { |
| 28 | MSG_CONNECTOR_GET_AUDIO_INFO = 0x050008, |
| 29 | MSG_CONNECTOR_GET_OUT_AUDIO_LEVEL = 0x050009, |
| 30 | MSG_CONNECTOR_SET_OUT_AUDIO_LEVEL = 0x05000A, |
| 31 | |
| 32 | MSG_CONSOLE_MANAGER = 0x070000, |
| 33 | MSG_CONSOLE_GET_CLOCK_UID = 0x070003, |
| 34 | |
| 35 | MSG_PHYSICALIO_SET_LEVEL = 0x0F0008, |
| 36 | |
| 37 | MSG_STREAM_ADD_INPUT_GROUP = 0x130000, |
| 38 | MSG_STREAM_ADD_OUTPUT_GROUP = 0x130001, |
| 39 | MSG_STREAM_DELETE_GROUP = 0x130004, |
| 40 | MSG_STREAM_START_STREAM_GRP_PACKET = 0x130006, |
| 41 | MSG_STREAM_START_INPUT_STAGE_PACKET = 0x130007, |
| 42 | MSG_STREAM_START_OUTPUT_STAGE_PACKET = 0x130008, |
| 43 | MSG_STREAM_STOP_STREAM_GRP_PACKET = 0x130009, |
| 44 | MSG_STREAM_STOP_INPUT_STAGE_PACKET = 0x13000A, |
| 45 | MSG_STREAM_STOP_OUTPUT_STAGE_PACKET = 0x13000B, |
| 46 | MSG_STREAM_SET_INPUT_STAGE_PARAM = 0x13000F, |
| 47 | MSG_STREAM_SET_OUTPUT_STAGE_PARAM = 0x130010, |
| 48 | MSG_STREAM_SET_IN_AUDIO_LEVEL = 0x130015, |
| 49 | MSG_STREAM_SET_OUT_STREAM_LEVEL = 0x130017, |
| 50 | |
| 51 | MSG_SYSTEM_FIRST_ID = 0x160000, |
| 52 | MSG_SYSTEM_ENUM_PHYSICAL_IO = 0x16000E, |
| 53 | MSG_SYSTEM_ENUM_PLAY_CONNECTOR = 0x160017, |
| 54 | MSG_SYSTEM_ENUM_RECORD_CONNECTOR = 0x160018, |
| 55 | MSG_SYSTEM_WAIT_SYNCHRO_CMD = 0x16002C, |
| 56 | MSG_SYSTEM_SEND_SYNCHRO_CMD = 0x16002D, |
| 57 | |
| 58 | MSG_SERVICES_TIMER_NOTIFY = 0x1D0404, |
| 59 | MSG_SERVICES_REPORT_TRACES = 0x1D0700, |
| 60 | |
| 61 | MSG_CLOCK_CHECK_PROPERTIES = 0x200001, |
| 62 | MSG_CLOCK_SET_PROPERTIES = 0x200002, |
| 63 | }; |
| 64 | |
| 65 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | struct mixart_msg |
| 67 | { |
| 68 | u32 message_id; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 69 | struct mixart_uid uid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | void* data; |
| 71 | size_t size; |
| 72 | }; |
| 73 | |
| 74 | /* structs used to communicate with miXart */ |
| 75 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | struct mixart_enum_connector_resp |
| 77 | { |
| 78 | u32 error_code; |
| 79 | u32 first_uid_offset; |
| 80 | u32 uid_count; |
| 81 | u32 current_uid_index; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 82 | struct mixart_uid uid[MIXART_MAX_PHYS_CONNECTORS]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | } __attribute__((packed)); |
| 84 | |
| 85 | |
| 86 | /* used for following struct */ |
| 87 | #define MIXART_FLOAT_P_22_0_TO_HEX 0x41b00000 /* 22.0f */ |
| 88 | #define MIXART_FLOAT_M_20_0_TO_HEX 0xc1a00000 /* -20.0f */ |
| 89 | #define MIXART_FLOAT____0_0_TO_HEX 0x00000000 /* 0.0f */ |
| 90 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | struct mixart_audio_info_req |
| 92 | { |
| 93 | u32 line_max_level; /* float */ |
| 94 | u32 micro_max_level; /* float */ |
| 95 | u32 cd_max_level; /* float */ |
| 96 | } __attribute__((packed)); |
| 97 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | struct mixart_analog_hw_info |
| 99 | { |
| 100 | u32 is_present; |
| 101 | u32 hw_connection_type; |
| 102 | u32 max_level; /* float */ |
| 103 | u32 min_var_level; /* float */ |
| 104 | u32 max_var_level; /* float */ |
| 105 | u32 step_var_level; /* float */ |
| 106 | u32 fix_gain; /* float */ |
| 107 | u32 zero_var; /* float */ |
| 108 | } __attribute__((packed)); |
| 109 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | struct mixart_digital_hw_info |
| 111 | { |
| 112 | u32 hw_connection_type; |
| 113 | u32 presence; |
| 114 | u32 clock; |
| 115 | u32 reserved; |
| 116 | } __attribute__((packed)); |
| 117 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | struct mixart_analog_info |
| 119 | { |
| 120 | u32 type_mask; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 121 | struct mixart_analog_hw_info micro_info; |
| 122 | struct mixart_analog_hw_info line_info; |
| 123 | struct mixart_analog_hw_info cd_info; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | u32 analog_level_present; |
| 125 | } __attribute__((packed)); |
| 126 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | struct mixart_digital_info |
| 128 | { |
| 129 | u32 type_mask; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 130 | struct mixart_digital_hw_info aes_info; |
| 131 | struct mixart_digital_hw_info adat_info; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | } __attribute__((packed)); |
| 133 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | struct mixart_audio_info |
| 135 | { |
| 136 | u32 clock_type_mask; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 137 | struct mixart_analog_info analog_info; |
| 138 | struct mixart_digital_info digital_info; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | } __attribute__((packed)); |
| 140 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | struct mixart_audio_info_resp |
| 142 | { |
| 143 | u32 txx_status; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 144 | struct mixart_audio_info info; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | } __attribute__((packed)); |
| 146 | |
| 147 | |
| 148 | /* used for nb_bytes_max_per_sample */ |
| 149 | #define MIXART_FLOAT_P__4_0_TO_HEX 0x40800000 /* +4.0f */ |
| 150 | #define MIXART_FLOAT_P__8_0_TO_HEX 0x41000000 /* +8.0f */ |
| 151 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | struct mixart_stream_info |
| 153 | { |
| 154 | u32 size_max_byte_frame; |
| 155 | u32 size_max_sample_frame; |
| 156 | u32 nb_bytes_max_per_sample; /* float */ |
| 157 | } __attribute__((packed)); |
| 158 | |
| 159 | /* MSG_STREAM_ADD_INPUT_GROUP */ |
| 160 | /* MSG_STREAM_ADD_OUTPUT_GROUP */ |
| 161 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | struct mixart_streaming_group_req |
| 163 | { |
| 164 | u32 stream_count; |
| 165 | u32 channel_count; |
| 166 | u32 user_grp_number; |
| 167 | u32 first_phys_audio; |
| 168 | u32 latency; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 169 | struct mixart_stream_info stream_info[32]; |
| 170 | struct mixart_uid connector; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | u32 flow_entry[32]; |
| 172 | } __attribute__((packed)); |
| 173 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 174 | struct mixart_stream_desc |
| 175 | { |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 176 | struct mixart_uid stream_uid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | u32 stream_desc; |
| 178 | } __attribute__((packed)); |
| 179 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | struct mixart_streaming_group |
| 181 | { |
| 182 | u32 status; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 183 | struct mixart_uid group; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | u32 pipe_desc; |
| 185 | u32 stream_count; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 186 | struct mixart_stream_desc stream[32]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 | } __attribute__((packed)); |
| 188 | |
| 189 | /* MSG_STREAM_DELETE_GROUP */ |
| 190 | |
| 191 | /* request : mixart_uid_t group */ |
| 192 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | struct mixart_delete_group_resp |
| 194 | { |
| 195 | u32 status; |
| 196 | u32 unused[2]; |
| 197 | } __attribute__((packed)); |
| 198 | |
| 199 | |
| 200 | /* MSG_STREAM_START_INPUT_STAGE_PACKET = 0x130000 + 7, |
| 201 | MSG_STREAM_START_OUTPUT_STAGE_PACKET = 0x130000 + 8, |
| 202 | MSG_STREAM_STOP_INPUT_STAGE_PACKET = 0x130000 + 10, |
| 203 | MSG_STREAM_STOP_OUTPUT_STAGE_PACKET = 0x130000 + 11, |
| 204 | */ |
| 205 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 206 | struct mixart_fx_couple_uid |
| 207 | { |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 208 | struct mixart_uid uid_fx_code; |
| 209 | struct mixart_uid uid_fx_data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | } __attribute__((packed)); |
| 211 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | struct mixart_txx_stream_desc |
| 213 | { |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 214 | struct mixart_uid uid_pipe; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 215 | u32 stream_idx; |
| 216 | u32 fx_number; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 217 | struct mixart_fx_couple_uid uid_fx[4]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 218 | } __attribute__((packed)); |
| 219 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | struct mixart_flow_info |
| 221 | { |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 222 | struct mixart_txx_stream_desc stream_desc; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 223 | u32 flow_entry; |
| 224 | u32 flow_phy_addr; |
| 225 | } __attribute__((packed)); |
| 226 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 227 | struct mixart_stream_state_req |
| 228 | { |
| 229 | u32 delayed; |
| 230 | u64 scheduler; |
| 231 | u32 reserved4np[3]; |
| 232 | u32 stream_count; /* set to 1 for instance */ |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 233 | struct mixart_flow_info stream_info; /* could be an array[stream_count] */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | } __attribute__((packed)); |
| 235 | |
| 236 | /* MSG_STREAM_START_STREAM_GRP_PACKET = 0x130000 + 6 |
| 237 | MSG_STREAM_STOP_STREAM_GRP_PACKET = 0x130000 + 9 |
| 238 | */ |
| 239 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | struct mixart_group_state_req |
| 241 | { |
| 242 | u32 delayed; |
| 243 | u64 scheduler; |
| 244 | u32 reserved4np[2]; |
| 245 | u32 pipe_count; /* set to 1 for instance */ |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 246 | struct mixart_uid pipe_uid[1]; /* could be an array[pipe_count] */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | } __attribute__((packed)); |
| 248 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | struct mixart_group_state_resp |
| 250 | { |
| 251 | u32 txx_status; |
| 252 | u64 scheduler; |
| 253 | } __attribute__((packed)); |
| 254 | |
| 255 | |
| 256 | |
| 257 | /* Structures used by the MSG_SERVICES_TIMER_NOTIFY command */ |
| 258 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | struct mixart_sample_pos |
| 260 | { |
| 261 | u32 buffer_id; |
| 262 | u32 validity; |
| 263 | u32 sample_pos_high_part; |
| 264 | u32 sample_pos_low_part; |
| 265 | } __attribute__((packed)); |
| 266 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 267 | struct mixart_timer_notify |
| 268 | { |
| 269 | u32 stream_count; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 270 | struct mixart_sample_pos streams[MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 271 | } __attribute__((packed)); |
| 272 | |
| 273 | |
| 274 | /* MSG_CONSOLE_GET_CLOCK_UID = 0x070003, |
| 275 | */ |
| 276 | |
| 277 | /* request is a uid with desc = MSG_CONSOLE_MANAGER | cardindex */ |
| 278 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 279 | struct mixart_return_uid |
| 280 | { |
| 281 | u32 error_code; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 282 | struct mixart_uid uid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 283 | } __attribute__((packed)); |
| 284 | |
| 285 | /* MSG_CLOCK_CHECK_PROPERTIES = 0x200001, |
| 286 | MSG_CLOCK_SET_PROPERTIES = 0x200002, |
| 287 | */ |
| 288 | |
| 289 | enum mixart_clock_generic_type { |
| 290 | CGT_NO_CLOCK, |
| 291 | CGT_INTERNAL_CLOCK, |
| 292 | CGT_PROGRAMMABLE_CLOCK, |
| 293 | CGT_INTERNAL_ENSLAVED_CLOCK, |
| 294 | CGT_EXTERNAL_CLOCK, |
| 295 | CGT_CURRENT_CLOCK |
| 296 | }; |
| 297 | |
| 298 | enum mixart_clock_mode { |
| 299 | CM_UNDEFINED, |
| 300 | CM_MASTER, |
| 301 | CM_SLAVE, |
| 302 | CM_STANDALONE, |
| 303 | CM_NOT_CONCERNED |
| 304 | }; |
| 305 | |
| 306 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 307 | struct mixart_clock_properties |
| 308 | { |
| 309 | u32 error_code; |
| 310 | u32 validation_mask; |
| 311 | u32 frequency; |
| 312 | u32 reference_frequency; |
| 313 | u32 clock_generic_type; |
| 314 | u32 clock_mode; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 315 | struct mixart_uid uid_clock_source; |
| 316 | struct mixart_uid uid_event_source; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 317 | u32 event_mode; |
| 318 | u32 synchro_signal_presence; |
| 319 | u32 format; |
| 320 | u32 board_mask; |
| 321 | u32 nb_callers; /* set to 1 (see below) */ |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 322 | struct mixart_uid uid_caller[1]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 323 | } __attribute__((packed)); |
| 324 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 325 | struct mixart_clock_properties_resp |
| 326 | { |
| 327 | u32 status; |
| 328 | u32 clock_mode; |
| 329 | } __attribute__((packed)); |
| 330 | |
| 331 | |
| 332 | /* MSG_STREAM_SET_INPUT_STAGE_PARAM = 0x13000F */ |
| 333 | /* MSG_STREAM_SET_OUTPUT_STAGE_PARAM = 0x130010 */ |
| 334 | |
| 335 | enum mixart_coding_type { |
| 336 | CT_NOT_DEFINED, |
| 337 | CT_LINEAR, |
| 338 | CT_MPEG_L1, |
| 339 | CT_MPEG_L2, |
| 340 | CT_MPEG_L3, |
| 341 | CT_MPEG_L3_LSF, |
| 342 | CT_GSM |
| 343 | }; |
| 344 | enum mixart_sample_type { |
| 345 | ST_NOT_DEFINED, |
| 346 | ST_FLOATING_POINT_32BE, |
| 347 | ST_FLOATING_POINT_32LE, |
| 348 | ST_FLOATING_POINT_64BE, |
| 349 | ST_FLOATING_POINT_64LE, |
| 350 | ST_FIXED_POINT_8, |
| 351 | ST_FIXED_POINT_16BE, |
| 352 | ST_FIXED_POINT_16LE, |
| 353 | ST_FIXED_POINT_24BE, |
| 354 | ST_FIXED_POINT_24LE, |
| 355 | ST_FIXED_POINT_32BE, |
| 356 | ST_FIXED_POINT_32LE, |
| 357 | ST_INTEGER_8, |
| 358 | ST_INTEGER_16BE, |
| 359 | ST_INTEGER_16LE, |
| 360 | ST_INTEGER_24BE, |
| 361 | ST_INTEGER_24LE, |
| 362 | ST_INTEGER_32BE, |
| 363 | ST_INTEGER_32LE |
| 364 | }; |
| 365 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 366 | struct mixart_stream_param_desc |
| 367 | { |
| 368 | u32 coding_type; /* use enum mixart_coding_type */ |
| 369 | u32 sample_type; /* use enum mixart_sample_type */ |
| 370 | |
| 371 | union { |
| 372 | struct { |
| 373 | u32 linear_endian_ness; |
| 374 | u32 linear_bits; |
| 375 | u32 is_signed; |
| 376 | u32 is_float; |
| 377 | } linear_format_info; |
| 378 | |
| 379 | struct { |
| 380 | u32 mpeg_layer; |
| 381 | u32 mpeg_mode; |
| 382 | u32 mpeg_mode_extension; |
| 383 | u32 mpeg_pre_emphasis; |
| 384 | u32 mpeg_has_padding_bit; |
| 385 | u32 mpeg_has_crc; |
| 386 | u32 mpeg_has_extension; |
| 387 | u32 mpeg_is_original; |
| 388 | u32 mpeg_has_copyright; |
| 389 | } mpeg_format_info; |
| 390 | } format_info; |
| 391 | |
| 392 | u32 delayed; |
| 393 | u64 scheduler; |
| 394 | u32 sample_size; |
| 395 | u32 has_header; |
| 396 | u32 has_suffix; |
| 397 | u32 has_bitrate; |
| 398 | u32 samples_per_frame; |
| 399 | u32 bytes_per_frame; |
| 400 | u32 bytes_per_sample; |
| 401 | u32 sampling_freq; |
| 402 | u32 number_of_channel; |
| 403 | u32 stream_number; |
| 404 | u32 buffer_size; |
| 405 | u32 differed_time; |
| 406 | u32 reserved4np[3]; |
| 407 | u32 pipe_count; /* set to 1 (array size !) */ |
| 408 | u32 stream_count; /* set to 1 (array size !) */ |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 409 | struct mixart_txx_stream_desc stream_desc[1]; /* only one stream per command, but this could be an array */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 410 | |
| 411 | } __attribute__((packed)); |
| 412 | |
| 413 | |
| 414 | /* MSG_CONNECTOR_GET_OUT_AUDIO_LEVEL = 0x050009, |
| 415 | */ |
| 416 | |
| 417 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 418 | struct mixart_get_out_audio_level |
| 419 | { |
| 420 | u32 txx_status; |
| 421 | u32 digital_level; /* float */ |
| 422 | u32 analog_level; /* float */ |
| 423 | u32 monitor_level; /* float */ |
| 424 | u32 mute; |
| 425 | u32 monitor_mute1; |
| 426 | u32 monitor_mute2; |
| 427 | } __attribute__((packed)); |
| 428 | |
| 429 | |
| 430 | /* MSG_CONNECTOR_SET_OUT_AUDIO_LEVEL = 0x05000A, |
| 431 | */ |
| 432 | |
| 433 | /* used for valid_mask below */ |
| 434 | #define MIXART_AUDIO_LEVEL_ANALOG_MASK 0x01 |
| 435 | #define MIXART_AUDIO_LEVEL_DIGITAL_MASK 0x02 |
| 436 | #define MIXART_AUDIO_LEVEL_MONITOR_MASK 0x04 |
| 437 | #define MIXART_AUDIO_LEVEL_MUTE_MASK 0x08 |
| 438 | #define MIXART_AUDIO_LEVEL_MUTE_M1_MASK 0x10 |
| 439 | #define MIXART_AUDIO_LEVEL_MUTE_M2_MASK 0x20 |
| 440 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 441 | struct mixart_set_out_audio_level |
| 442 | { |
| 443 | u32 delayed; |
| 444 | u64 scheduler; |
| 445 | u32 valid_mask1; |
| 446 | u32 valid_mask2; |
| 447 | u32 digital_level; /* float */ |
| 448 | u32 analog_level; /* float */ |
| 449 | u32 monitor_level; /* float */ |
| 450 | u32 mute; |
| 451 | u32 monitor_mute1; |
| 452 | u32 monitor_mute2; |
| 453 | u32 reserved4np; |
| 454 | } __attribute__((packed)); |
| 455 | |
| 456 | |
| 457 | /* MSG_SYSTEM_ENUM_PHYSICAL_IO = 0x16000E, |
| 458 | */ |
| 459 | |
| 460 | #define MIXART_MAX_PHYS_IO (MIXART_MAX_CARDS * 2 * 2) /* 4 * (analog+digital) * (playback+capture) */ |
| 461 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 462 | struct mixart_uid_enumeration |
| 463 | { |
| 464 | u32 error_code; |
| 465 | u32 first_uid_offset; |
| 466 | u32 nb_uid; |
| 467 | u32 current_uid_index; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 468 | struct mixart_uid uid[MIXART_MAX_PHYS_IO]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 469 | } __attribute__((packed)); |
| 470 | |
| 471 | |
| 472 | /* MSG_PHYSICALIO_SET_LEVEL = 0x0F0008, |
| 473 | MSG_PHYSICALIO_GET_LEVEL = 0x0F000C, |
| 474 | */ |
| 475 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 476 | struct mixart_io_channel_level |
| 477 | { |
| 478 | u32 analog_level; /* float */ |
| 479 | u32 unused[2]; |
| 480 | } __attribute__((packed)); |
| 481 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 482 | struct mixart_io_level |
| 483 | { |
| 484 | s32 channel; /* 0=left, 1=right, -1=both, -2=both same */ |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 485 | struct mixart_io_channel_level level[2]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 486 | } __attribute__((packed)); |
| 487 | |
| 488 | |
| 489 | /* MSG_STREAM_SET_IN_AUDIO_LEVEL = 0x130015, |
| 490 | */ |
| 491 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 492 | struct mixart_in_audio_level_info |
| 493 | { |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 494 | struct mixart_uid connector; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 495 | u32 valid_mask1; |
| 496 | u32 valid_mask2; |
| 497 | u32 digital_level; |
| 498 | u32 analog_level; |
| 499 | } __attribute__((packed)); |
| 500 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 501 | struct mixart_set_in_audio_level_req |
| 502 | { |
| 503 | u32 delayed; |
| 504 | u64 scheduler; |
| 505 | u32 audio_count; /* set to <= 2 */ |
| 506 | u32 reserved4np; |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 507 | struct mixart_in_audio_level_info level[2]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 508 | } __attribute__((packed)); |
| 509 | |
| 510 | /* response is a 32 bit status */ |
| 511 | |
| 512 | |
| 513 | /* MSG_STREAM_SET_OUT_STREAM_LEVEL = 0x130017, |
| 514 | */ |
| 515 | |
| 516 | /* defines used for valid_mask1 */ |
| 517 | #define MIXART_OUT_STREAM_SET_LEVEL_LEFT_AUDIO1 0x01 |
| 518 | #define MIXART_OUT_STREAM_SET_LEVEL_LEFT_AUDIO2 0x02 |
| 519 | #define MIXART_OUT_STREAM_SET_LEVEL_RIGHT_AUDIO1 0x04 |
| 520 | #define MIXART_OUT_STREAM_SET_LEVEL_RIGHT_AUDIO2 0x08 |
| 521 | #define MIXART_OUT_STREAM_SET_LEVEL_STREAM_1 0x10 |
| 522 | #define MIXART_OUT_STREAM_SET_LEVEL_STREAM_2 0x20 |
| 523 | #define MIXART_OUT_STREAM_SET_LEVEL_MUTE_1 0x40 |
| 524 | #define MIXART_OUT_STREAM_SET_LEVEL_MUTE_2 0x80 |
| 525 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 526 | struct mixart_out_stream_level_info |
| 527 | { |
| 528 | u32 valid_mask1; |
| 529 | u32 valid_mask2; |
| 530 | u32 left_to_out1_level; |
| 531 | u32 left_to_out2_level; |
| 532 | u32 right_to_out1_level; |
| 533 | u32 right_to_out2_level; |
| 534 | u32 digital_level1; |
| 535 | u32 digital_level2; |
| 536 | u32 mute1; |
| 537 | u32 mute2; |
| 538 | } __attribute__((packed)); |
| 539 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 540 | struct mixart_set_out_stream_level |
| 541 | { |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 542 | struct mixart_txx_stream_desc desc; |
| 543 | struct mixart_out_stream_level_info out_level; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 544 | } __attribute__((packed)); |
| 545 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 546 | struct mixart_set_out_stream_level_req |
| 547 | { |
| 548 | u32 delayed; |
| 549 | u64 scheduler; |
| 550 | u32 reserved4np[2]; |
| 551 | u32 nb_of_stream; /* set to 1 */ |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 552 | struct mixart_set_out_stream_level stream_level; /* could be an array */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 553 | } __attribute__((packed)); |
| 554 | |
| 555 | /* response to this request is a u32 status value */ |
| 556 | |
| 557 | |
| 558 | /* exported */ |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 559 | void snd_mixart_init_mailbox(struct mixart_mgr *mgr); |
| 560 | void snd_mixart_exit_mailbox(struct mixart_mgr *mgr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 561 | |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 562 | int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int max_resp_size, void *resp_data); |
| 563 | int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr, struct mixart_msg *request, u32 notif_event); |
| 564 | int snd_mixart_send_msg_nonblock(struct mixart_mgr *mgr, struct mixart_msg *request); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 565 | |
David Howells | 7d12e78 | 2006-10-05 14:55:46 +0100 | [diff] [blame] | 566 | irqreturn_t snd_mixart_interrupt(int irq, void *dev_id); |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 567 | void snd_mixart_msg_tasklet(unsigned long arg); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 568 | |
Takashi Iwai | 67b48b8 | 2005-11-17 15:01:08 +0100 | [diff] [blame] | 569 | void snd_mixart_reset_board(struct mixart_mgr *mgr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 570 | |
| 571 | #endif /* __SOUND_MIXART_CORE_H */ |