📄 mixart_core.h
字号:
/* * Driver for Digigram miXart soundcards * * low level interface with interrupt handling and mail box implementation * * Copyright (c) 2003 by Digigram <alsa@digigram.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */#ifndef __SOUND_MIXART_CORE_H#define __SOUND_MIXART_CORE_Henum mixart_message_id { MSG_CONNECTOR_GET_AUDIO_INFO = 0x050008, MSG_CONNECTOR_GET_OUT_AUDIO_LEVEL = 0x050009, MSG_CONNECTOR_SET_OUT_AUDIO_LEVEL = 0x05000A, MSG_CONSOLE_MANAGER = 0x070000, MSG_CONSOLE_GET_CLOCK_UID = 0x070003, MSG_PHYSICALIO_SET_LEVEL = 0x0F0008, MSG_STREAM_ADD_INPUT_GROUP = 0x130000, MSG_STREAM_ADD_OUTPUT_GROUP = 0x130001, MSG_STREAM_DELETE_GROUP = 0x130004, MSG_STREAM_START_STREAM_GRP_PACKET = 0x130006, MSG_STREAM_START_INPUT_STAGE_PACKET = 0x130007, MSG_STREAM_START_OUTPUT_STAGE_PACKET = 0x130008, MSG_STREAM_STOP_STREAM_GRP_PACKET = 0x130009, MSG_STREAM_STOP_INPUT_STAGE_PACKET = 0x13000A, MSG_STREAM_STOP_OUTPUT_STAGE_PACKET = 0x13000B, MSG_STREAM_SET_INPUT_STAGE_PARAM = 0x13000F, MSG_STREAM_SET_OUTPUT_STAGE_PARAM = 0x130010, MSG_STREAM_SET_IN_AUDIO_LEVEL = 0x130015, MSG_STREAM_SET_OUT_STREAM_LEVEL = 0x130017, MSG_SYSTEM_FIRST_ID = 0x160000, MSG_SYSTEM_ENUM_PHYSICAL_IO = 0x16000E, MSG_SYSTEM_ENUM_PLAY_CONNECTOR = 0x160017, MSG_SYSTEM_ENUM_RECORD_CONNECTOR = 0x160018, MSG_SYSTEM_WAIT_SYNCHRO_CMD = 0x16002C, MSG_SYSTEM_SEND_SYNCHRO_CMD = 0x16002D, MSG_SERVICES_TIMER_NOTIFY = 0x1D0404, MSG_SERVICES_REPORT_TRACES = 0x1D0700, MSG_CLOCK_CHECK_PROPERTIES = 0x200001, MSG_CLOCK_SET_PROPERTIES = 0x200002,};typedef struct mixart_msg mixart_msg_t;struct mixart_msg{ u32 message_id; mixart_uid_t uid; void* data; size_t size;};/* structs used to communicate with miXart */typedef struct mixart_enum_connector_resp mixart_enum_connector_resp_t;struct mixart_enum_connector_resp{ u32 error_code; u32 first_uid_offset; u32 uid_count; u32 current_uid_index; mixart_uid_t uid[MIXART_MAX_PHYS_CONNECTORS];} __attribute__((packed));/* used for following struct */#define MIXART_FLOAT_P_22_0_TO_HEX 0x41b00000 /* 22.0f */#define MIXART_FLOAT_M_20_0_TO_HEX 0xc1a00000 /* -20.0f */#define MIXART_FLOAT____0_0_TO_HEX 0x00000000 /* 0.0f */typedef struct mixart_audio_info_req mixart_audio_info_req_t;struct mixart_audio_info_req{ u32 line_max_level; /* float */ u32 micro_max_level; /* float */ u32 cd_max_level; /* float */} __attribute__((packed));typedef struct mixart_analog_hw_info mixart_analog_hw_info_t;struct mixart_analog_hw_info{ u32 is_present; u32 hw_connection_type; u32 max_level; /* float */ u32 min_var_level; /* float */ u32 max_var_level; /* float */ u32 step_var_level; /* float */ u32 fix_gain; /* float */ u32 zero_var; /* float */} __attribute__((packed));typedef struct mixart_digital_hw_info mixart_digital_hw_info_t;struct mixart_digital_hw_info{ u32 hw_connection_type; u32 presence; u32 clock; u32 reserved;} __attribute__((packed));typedef struct mixart_analog_info mixart_analog_info_t;struct mixart_analog_info{ u32 type_mask; mixart_analog_hw_info_t micro_info; mixart_analog_hw_info_t line_info; mixart_analog_hw_info_t cd_info; u32 analog_level_present;} __attribute__((packed));typedef struct mixart_digital_info mixart_digital_info_t;struct mixart_digital_info{ u32 type_mask; mixart_digital_hw_info_t aes_info; mixart_digital_hw_info_t adat_info;} __attribute__((packed));typedef struct mixart_audio_info mixart_audio_info_t;struct mixart_audio_info{ u32 clock_type_mask; mixart_analog_info_t analog_info; mixart_digital_info_t digital_info;} __attribute__((packed));typedef struct mixart_audio_info_resp mixart_audio_info_resp_t;struct mixart_audio_info_resp{ u32 txx_status; mixart_audio_info_t info;} __attribute__((packed));/* used for nb_bytes_max_per_sample */#define MIXART_FLOAT_P__4_0_TO_HEX 0x40800000 /* +4.0f */#define MIXART_FLOAT_P__8_0_TO_HEX 0x41000000 /* +8.0f */typedef struct mixart_stream_info mixart_stream_info_t;struct mixart_stream_info{ u32 size_max_byte_frame; u32 size_max_sample_frame; u32 nb_bytes_max_per_sample; /* float */} __attribute__((packed));/* MSG_STREAM_ADD_INPUT_GROUP *//* MSG_STREAM_ADD_OUTPUT_GROUP */typedef struct mixart_streaming_group_req mixart_streaming_group_req_t;struct mixart_streaming_group_req{ u32 stream_count; u32 channel_count; u32 user_grp_number; u32 first_phys_audio; u32 latency; mixart_stream_info_t stream_info[32]; mixart_uid_t connector; u32 flow_entry[32];} __attribute__((packed));typedef struct mixart_stream_desc mixart_stream_desc_t;struct mixart_stream_desc{ mixart_uid_t stream_uid; u32 stream_desc;} __attribute__((packed));typedef struct mixart_streaming_group mixart_streaming_group_t;struct mixart_streaming_group{ u32 status; mixart_uid_t group; u32 pipe_desc; u32 stream_count; mixart_stream_desc_t stream[32];} __attribute__((packed));/* MSG_STREAM_DELETE_GROUP *//* request : mixart_uid_t group */typedef struct mixart_delete_group_resp mixart_delete_group_resp_t;struct mixart_delete_group_resp{ u32 status; u32 unused[2];} __attribute__((packed));/* MSG_STREAM_START_INPUT_STAGE_PACKET = 0x130000 + 7, MSG_STREAM_START_OUTPUT_STAGE_PACKET = 0x130000 + 8, MSG_STREAM_STOP_INPUT_STAGE_PACKET = 0x130000 + 10, MSG_STREAM_STOP_OUTPUT_STAGE_PACKET = 0x130000 + 11, */typedef struct mixart_fx_couple_uid mixart_fx_couple_uid_t;struct mixart_fx_couple_uid{ mixart_uid_t uid_fx_code; mixart_uid_t uid_fx_data;} __attribute__((packed));typedef struct mixart_txx_stream_desc mixart_txx_stream_desc_t;struct mixart_txx_stream_desc{ mixart_uid_t uid_pipe; u32 stream_idx; u32 fx_number; mixart_fx_couple_uid_t uid_fx[4];} __attribute__((packed));typedef struct mixart_flow_info mixart_flow_info_t;struct mixart_flow_info{ mixart_txx_stream_desc_t stream_desc; u32 flow_entry; u32 flow_phy_addr;} __attribute__((packed));typedef struct mixart_stream_state_req mixart_stream_state_req_t;struct mixart_stream_state_req{ u32 delayed; u64 scheduler; u32 reserved4np[3]; u32 stream_count; /* set to 1 for instance */ mixart_flow_info_t stream_info; /* could be an array[stream_count] */} __attribute__((packed));/* MSG_STREAM_START_STREAM_GRP_PACKET = 0x130000 + 6 MSG_STREAM_STOP_STREAM_GRP_PACKET = 0x130000 + 9 */typedef struct mixart_group_state_req mixart_group_state_req_t;struct mixart_group_state_req{ u32 delayed; u64 scheduler; u32 reserved4np[2]; u32 pipe_count; /* set to 1 for instance */ mixart_uid_t pipe_uid[1]; /* could be an array[pipe_count] */} __attribute__((packed));typedef struct mixart_group_state_resp mixart_group_state_resp_t;struct mixart_group_state_resp{ u32 txx_status; u64 scheduler;} __attribute__((packed));/* Structures used by the MSG_SERVICES_TIMER_NOTIFY command */typedef struct mixart_sample_pos mixart_sample_pos_t;struct mixart_sample_pos{ u32 buffer_id; u32 validity; u32 sample_pos_high_part; u32 sample_pos_low_part;} __attribute__((packed));typedef struct mixart_timer_notify mixart_timer_notify_t;struct mixart_timer_notify{ u32 stream_count; mixart_sample_pos_t streams[MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS];} __attribute__((packed));/* MSG_CONSOLE_GET_CLOCK_UID = 0x070003, *//* request is a uid with desc = MSG_CONSOLE_MANAGER | cardindex */typedef struct mixart_return_uid mixart_return_uid_t;struct mixart_return_uid{ u32 error_code;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -