提交 67b48b88 编写于 作者: T Takashi Iwai 提交者: Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: PCI miXart

Modules: MIXART driver

Remove xxx_t typedefs from the PCI miXart driver.
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 fcfd3332
此差异已折叠。
......@@ -32,21 +32,7 @@
/*
*/
#define mixart_t_magic 0xa17a3e01
#define mixart_mgr_t_magic 0xa17a3e02
typedef struct snd_mixart mixart_t;
typedef struct snd_mixart_mgr mixart_mgr_t;
typedef struct snd_mixart_stream mixart_stream_t;
typedef struct snd_mixart_pipe mixart_pipe_t;
typedef struct mixart_bufferinfo mixart_bufferinfo_t;
typedef struct mixart_flowinfo mixart_flowinfo_t;
typedef struct mixart_uid mixart_uid_t;
struct mixart_uid
{
struct mixart_uid {
u32 object_id;
u32 desc;
};
......@@ -58,7 +44,6 @@ struct mem_area {
};
typedef struct mixart_route mixart_route_t;
struct mixart_route {
unsigned char connected;
unsigned char phase_inv;
......@@ -77,9 +62,9 @@ struct mixart_route {
#define MIXART_MAX_PHYS_CONNECTORS (MIXART_MAX_CARDS * 2 * 2) /* 4 * stereo * (analog+digital) */
struct snd_mixart_mgr {
struct mixart_mgr {
unsigned int num_cards;
mixart_t *chip[MIXART_MAX_CARDS];
struct snd_mixart *chip[MIXART_MAX_CARDS];
struct pci_dev *pci;
......@@ -118,7 +103,7 @@ struct snd_mixart_mgr {
struct snd_dma_buffer flowinfo;
struct snd_dma_buffer bufferinfo;
mixart_uid_t uid_console_manager;
struct mixart_uid uid_console_manager;
int sample_rate;
int ref_count_rate;
......@@ -151,9 +136,9 @@ struct snd_mixart_mgr {
#define MIXART_NOTIFY_SUBS_MASK 0x007F
struct snd_mixart_stream {
snd_pcm_substream_t *substream;
mixart_pipe_t *pipe;
struct mixart_stream {
struct snd_pcm_substream *substream;
struct mixart_pipe *pipe;
int pcm_number;
int status; /* nothing, running, draining */
......@@ -173,11 +158,11 @@ enum mixart_pipe_status {
PIPE_CLOCK_SET
};
struct snd_mixart_pipe {
mixart_uid_t group_uid; /* id of the pipe, as returned by embedded */
struct mixart_pipe {
struct mixart_uid group_uid; /* id of the pipe, as returned by embedded */
int stream_count;
mixart_uid_t uid_left_connector; /* UID's for the audio connectors */
mixart_uid_t uid_right_connector;
struct mixart_uid uid_left_connector; /* UID's for the audio connectors */
struct mixart_uid uid_right_connector;
enum mixart_pipe_status status;
int references; /* number of subs openned */
int monitoring; /* pipe used for monitoring issue */
......@@ -185,28 +170,28 @@ struct snd_mixart_pipe {
struct snd_mixart {
snd_card_t *card;
mixart_mgr_t *mgr;
struct snd_card *card;
struct mixart_mgr *mgr;
int chip_idx; /* zero based */
snd_hwdep_t *hwdep; /* DSP loader, only for the first card */
struct snd_hwdep *hwdep; /* DSP loader, only for the first card */
snd_pcm_t *pcm; /* PCM analog i/o */
snd_pcm_t *pcm_dig; /* PCM digital i/o */
struct snd_pcm *pcm; /* PCM analog i/o */
struct snd_pcm *pcm_dig; /* PCM digital i/o */
/* allocate stereo pipe for instance */
mixart_pipe_t pipe_in_ana;
mixart_pipe_t pipe_out_ana;
struct mixart_pipe pipe_in_ana;
struct mixart_pipe pipe_out_ana;
/* if AES/EBU daughter board is available, additional pipes possible on pcm_dig */
mixart_pipe_t pipe_in_dig;
mixart_pipe_t pipe_out_dig;
struct mixart_pipe pipe_in_dig;
struct mixart_pipe pipe_out_dig;
mixart_stream_t playback_stream[MIXART_PCM_TOTAL][MIXART_PLAYBACK_STREAMS]; /* 0 = pcm, 1 = pcm_dig */
mixart_stream_t capture_stream[MIXART_PCM_TOTAL]; /* 0 = pcm, 1 = pcm_dig */
struct mixart_stream playback_stream[MIXART_PCM_TOTAL][MIXART_PLAYBACK_STREAMS]; /* 0 = pcm, 1 = pcm_dig */
struct mixart_stream capture_stream[MIXART_PCM_TOTAL]; /* 0 = pcm, 1 = pcm_dig */
/* UID's for the physical io's */
mixart_uid_t uid_out_analog_physio;
mixart_uid_t uid_in_analog_physio;
struct mixart_uid uid_out_analog_physio;
struct mixart_uid uid_in_analog_physio;
int analog_playback_active[2]; /* Mixer : Master Playback active (!mute) */
int analog_playback_volume[2]; /* Mixer : Master Playback Volume */
......@@ -235,8 +220,8 @@ struct mixart_flowinfo
};
/* exported */
int snd_mixart_create_pcm(mixart_t* chip);
mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capture, int monitoring);
int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monitoring);
int snd_mixart_create_pcm(struct snd_mixart * chip);
struct mixart_pipe *snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture, int monitoring);
int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr, struct mixart_pipe *pipe, int monitoring);
#endif /* __SOUND_MIXART_H */
......@@ -44,7 +44,7 @@
#define MSG_CANCEL_NOTIFY_MASK 0x80000000 /* this bit is set for a notification that has been canceled */
static int retrieve_msg_frame(mixart_mgr_t *mgr, u32 *msg_frame)
static int retrieve_msg_frame(struct mixart_mgr *mgr, u32 *msg_frame)
{
/* read the message frame fifo */
u32 headptr, tailptr;
......@@ -69,7 +69,8 @@ static int retrieve_msg_frame(mixart_mgr_t *mgr, u32 *msg_frame)
return 1;
}
static int get_msg(mixart_mgr_t *mgr, mixart_msg_t *resp, u32 msg_frame_address )
static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
u32 msg_frame_address )
{
unsigned long flags;
u32 headptr;
......@@ -137,8 +138,8 @@ static int get_msg(mixart_mgr_t *mgr, mixart_msg_t *resp, u32 msg_frame_address
* send a message to miXart. return: the msg_frame used for this message
*/
/* call with mgr->msg_lock held! */
static int send_msg( mixart_mgr_t *mgr,
mixart_msg_t *msg,
static int send_msg( struct mixart_mgr *mgr,
struct mixart_msg *msg,
int max_answersize,
int mark_pending,
u32 *msg_event)
......@@ -230,9 +231,9 @@ static int send_msg( mixart_mgr_t *mgr,
}
int snd_mixart_send_msg(mixart_mgr_t *mgr, mixart_msg_t *request, int max_resp_size, void *resp_data)
int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int max_resp_size, void *resp_data)
{
mixart_msg_t resp;
struct mixart_msg resp;
u32 msg_frame = 0; /* set to 0, so it's no notification to wait for, but the answer */
int err;
wait_queue_t wait;
......@@ -264,9 +265,9 @@ int snd_mixart_send_msg(mixart_mgr_t *mgr, mixart_msg_t *request, int max_resp_s
return -EIO;
}
/* retrieve the answer into the same mixart_msg_t */
/* retrieve the answer into the same struct mixart_msg */
resp.message_id = 0;
resp.uid = (mixart_uid_t){0,0};
resp.uid = (struct mixart_uid){0,0};
resp.data = resp_data;
resp.size = max_resp_size;
......@@ -280,7 +281,8 @@ int snd_mixart_send_msg(mixart_mgr_t *mgr, mixart_msg_t *request, int max_resp_s
}
int snd_mixart_send_msg_wait_notif(mixart_mgr_t *mgr, mixart_msg_t *request, u32 notif_event)
int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr,
struct mixart_msg *request, u32 notif_event)
{
int err;
wait_queue_t wait;
......@@ -321,7 +323,7 @@ int snd_mixart_send_msg_wait_notif(mixart_mgr_t *mgr, mixart_msg_t *request, u32
}
int snd_mixart_send_msg_nonblock(mixart_mgr_t *mgr, mixart_msg_t *request)
int snd_mixart_send_msg_nonblock(struct mixart_mgr *mgr, struct mixart_msg *request)
{
u32 message_frame;
unsigned long flags;
......@@ -332,7 +334,7 @@ int snd_mixart_send_msg_nonblock(mixart_mgr_t *mgr, mixart_msg_t *request)
err = send_msg(mgr, request, MSG_DEFAULT_SIZE, 0, &message_frame);
spin_unlock_irqrestore(&mgr->msg_lock, flags);
/* the answer will be handled by snd_mixart_msg_tasklet() */
/* the answer will be handled by snd_struct mixart_msgasklet() */
atomic_inc(&mgr->msg_processed);
return err;
......@@ -343,10 +345,10 @@ int snd_mixart_send_msg_nonblock(mixart_mgr_t *mgr, mixart_msg_t *request)
static u32 mixart_msg_data[MSG_DEFAULT_SIZE / 4];
void snd_mixart_msg_tasklet( unsigned long arg)
void snd_mixart_msg_tasklet(unsigned long arg)
{
mixart_mgr_t *mgr = ( mixart_mgr_t*)(arg);
mixart_msg_t resp;
struct mixart_mgr *mgr = ( struct mixart_mgr*)(arg);
struct mixart_msg resp;
u32 msg, addr, type;
int err;
......@@ -406,9 +408,9 @@ void snd_mixart_msg_tasklet( unsigned long arg)
irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
mixart_mgr_t *mgr = dev_id;
struct mixart_mgr *mgr = dev_id;
int err;
mixart_msg_t resp;
struct mixart_msg resp;
u32 msg;
u32 it_reg;
......@@ -448,7 +450,8 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if(resp.message_id == MSG_SERVICES_TIMER_NOTIFY) {
int i;
mixart_timer_notify_t *notify = (mixart_timer_notify_t*)mixart_msg_data;
struct mixart_timer_notify *notify;
notify = (struct mixart_timer_notify *)mixart_msg_data;
for(i=0; i<notify->stream_count; i++) {
......@@ -458,8 +461,8 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs)
unsigned int sub_number = buffer_id & MIXART_NOTIFY_SUBS_MASK; /* 0 to MIXART_PLAYBACK_STREAMS */
unsigned int is_capture = ((buffer_id & MIXART_NOTIFY_CAPT_MASK) != 0); /* playback == 0 / capture == 1 */
mixart_t *chip = mgr->chip[chip_number];
mixart_stream_t *stream;
struct snd_mixart *chip = mgr->chip[chip_number];
struct mixart_stream *stream;
if ((chip_number >= mgr->num_cards) || (pcm_number >= MIXART_PCM_TOTAL) || (sub_number >= MIXART_PLAYBACK_STREAMS)) {
snd_printk(KERN_ERR "error MSG_SERVICES_TIMER_NOTIFY buffer_id (%x) pos(%d)\n",
......@@ -473,7 +476,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs)
stream = &chip->playback_stream[pcm_number][sub_number];
if (stream->substream && (stream->status == MIXART_STREAM_STATUS_RUNNING)) {
snd_pcm_runtime_t *runtime = stream->substream->runtime;
struct snd_pcm_runtime *runtime = stream->substream->runtime;
int elapsed = 0;
u64 sample_count = ((u64)notify->streams[i].sample_pos_high_part) << 32;
sample_count |= notify->streams[i].sample_pos_low_part;
......@@ -561,7 +564,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
void snd_mixart_init_mailbox(mixart_mgr_t *mgr)
void snd_mixart_init_mailbox(struct mixart_mgr *mgr)
{
writel( 0, MIXART_MEM( mgr, MSG_HOST_RSC_PROTECTION ) );
writel( 0, MIXART_MEM( mgr, MSG_AGENT_RSC_PROTECTION ) );
......@@ -573,14 +576,14 @@ void snd_mixart_init_mailbox(mixart_mgr_t *mgr)
return;
}
void snd_mixart_exit_mailbox(mixart_mgr_t *mgr)
void snd_mixart_exit_mailbox(struct mixart_mgr *mgr)
{
/* no more interrupts on outbound messagebox */
writel_le( MIXART_HOST_ALL_INTERRUPT_MASKED, MIXART_REG( mgr, MIXART_PCI_OMIMR_OFFSET));
return;
}
void snd_mixart_reset_board(mixart_mgr_t *mgr)
void snd_mixart_reset_board(struct mixart_mgr *mgr)
{
/* reset miXart */
writel_be( 1, MIXART_REG(mgr, MIXART_BA1_BRUTAL_RESET_OFFSET) );
......
......@@ -63,25 +63,23 @@ enum mixart_message_id {
};
typedef struct mixart_msg mixart_msg_t;
struct mixart_msg
{
u32 message_id;
mixart_uid_t uid;
struct mixart_uid 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];
struct mixart_uid uid[MIXART_MAX_PHYS_CONNECTORS];
} __attribute__((packed));
......@@ -90,7 +88,6 @@ struct mixart_enum_connector_resp
#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 */
......@@ -98,7 +95,6 @@ struct mixart_audio_info_req
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;
......@@ -111,7 +107,6 @@ struct mixart_analog_hw_info
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;
......@@ -120,37 +115,33 @@ struct mixart_digital_hw_info
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;
struct mixart_analog_hw_info micro_info;
struct mixart_analog_hw_info line_info;
struct mixart_analog_hw_info 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;
struct mixart_digital_hw_info aes_info;
struct mixart_digital_hw_info 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;
struct mixart_analog_info analog_info;
struct mixart_digital_info 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;
struct mixart_audio_info info;
} __attribute__((packed));
......@@ -158,7 +149,6 @@ struct mixart_audio_info_resp
#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;
......@@ -169,7 +159,6 @@ struct mixart_stream_info
/* 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;
......@@ -177,33 +166,30 @@ struct mixart_streaming_group_req
u32 user_grp_number;
u32 first_phys_audio;
u32 latency;
mixart_stream_info_t stream_info[32];
mixart_uid_t connector;
struct mixart_stream_info stream_info[32];
struct mixart_uid 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;
struct mixart_uid 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;
struct mixart_uid group;
u32 pipe_desc;
u32 stream_count;
mixart_stream_desc_t stream[32];
struct mixart_stream_desc 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;
......@@ -217,55 +203,49 @@ struct mixart_delete_group_resp
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;
struct mixart_uid uid_fx_code;
struct mixart_uid 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;
struct mixart_uid uid_pipe;
u32 stream_idx;
u32 fx_number;
mixart_fx_couple_uid_t uid_fx[4];
struct mixart_fx_couple_uid 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;
struct mixart_txx_stream_desc 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] */
struct mixart_flow_info 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] */
struct mixart_uid 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;
......@@ -276,7 +256,6 @@ struct mixart_group_state_resp
/* 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;
......@@ -285,11 +264,10 @@ struct mixart_sample_pos
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];
struct mixart_sample_pos streams[MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS];
} __attribute__((packed));
......@@ -298,11 +276,10 @@ struct mixart_timer_notify
/* 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;
mixart_uid_t uid;
struct mixart_uid uid;
} __attribute__((packed));
/* MSG_CLOCK_CHECK_PROPERTIES = 0x200001,
......@@ -327,7 +304,6 @@ enum mixart_clock_mode {
};
typedef struct mixart_clock_properties mixart_clock_properties_t;
struct mixart_clock_properties
{
u32 error_code;
......@@ -336,17 +312,16 @@ struct mixart_clock_properties
u32 reference_frequency;
u32 clock_generic_type;
u32 clock_mode;
mixart_uid_t uid_clock_source;
mixart_uid_t uid_event_source;
struct mixart_uid uid_clock_source;
struct mixart_uid uid_event_source;
u32 event_mode;
u32 synchro_signal_presence;
u32 format;
u32 board_mask;
u32 nb_callers; /* set to 1 (see below) */
mixart_uid_t uid_caller[1];
struct mixart_uid uid_caller[1];
} __attribute__((packed));
typedef struct mixart_clock_properties_resp mixart_clock_properties_resp_t;
struct mixart_clock_properties_resp
{
u32 status;
......@@ -388,7 +363,6 @@ enum mixart_sample_type {
ST_INTEGER_32LE
};
typedef struct mixart_stream_param_desc mixart_stream_param_desc_t;
struct mixart_stream_param_desc
{
u32 coding_type; /* use enum mixart_coding_type */
......@@ -432,7 +406,7 @@ struct mixart_stream_param_desc
u32 reserved4np[3];
u32 pipe_count; /* set to 1 (array size !) */
u32 stream_count; /* set to 1 (array size !) */
mixart_txx_stream_desc_t stream_desc[1]; /* only one stream per command, but this could be an array */
struct mixart_txx_stream_desc stream_desc[1]; /* only one stream per command, but this could be an array */
} __attribute__((packed));
......@@ -441,7 +415,6 @@ struct mixart_stream_param_desc
*/
typedef struct mixart_get_out_audio_level mixart_get_out_audio_level_t;
struct mixart_get_out_audio_level
{
u32 txx_status;
......@@ -465,7 +438,6 @@ struct mixart_get_out_audio_level
#define MIXART_AUDIO_LEVEL_MUTE_M1_MASK 0x10
#define MIXART_AUDIO_LEVEL_MUTE_M2_MASK 0x20
typedef struct mixart_set_out_audio_level mixart_set_out_audio_level_t;
struct mixart_set_out_audio_level
{
u32 delayed;
......@@ -487,14 +459,13 @@ struct mixart_set_out_audio_level
#define MIXART_MAX_PHYS_IO (MIXART_MAX_CARDS * 2 * 2) /* 4 * (analog+digital) * (playback+capture) */
typedef struct mixart_uid_enumeration mixart_uid_enumeration_t;
struct mixart_uid_enumeration
{
u32 error_code;
u32 first_uid_offset;
u32 nb_uid;
u32 current_uid_index;
mixart_uid_t uid[MIXART_MAX_PHYS_IO];
struct mixart_uid uid[MIXART_MAX_PHYS_IO];
} __attribute__((packed));
......@@ -502,42 +473,38 @@ struct mixart_uid_enumeration
MSG_PHYSICALIO_GET_LEVEL = 0x0F000C,
*/
typedef struct mixart_io_channel_level mixart_io_channel_level_t;
struct mixart_io_channel_level
{
u32 analog_level; /* float */
u32 unused[2];
} __attribute__((packed));
typedef struct mixart_io_level mixart_io_level_t;
struct mixart_io_level
{
s32 channel; /* 0=left, 1=right, -1=both, -2=both same */
mixart_io_channel_level_t level[2];
struct mixart_io_channel_level level[2];
} __attribute__((packed));
/* MSG_STREAM_SET_IN_AUDIO_LEVEL = 0x130015,
*/
typedef struct mixart_in_audio_level_info mixart_in_audio_level_info_t;
struct mixart_in_audio_level_info
{
mixart_uid_t connector;
struct mixart_uid connector;
u32 valid_mask1;
u32 valid_mask2;
u32 digital_level;
u32 analog_level;
} __attribute__((packed));
typedef struct mixart_set_in_audio_level_req mixart_set_in_audio_level_req_t;
struct mixart_set_in_audio_level_req
{
u32 delayed;
u64 scheduler;
u32 audio_count; /* set to <= 2 */
u32 reserved4np;
mixart_in_audio_level_info_t level[2];
struct mixart_in_audio_level_info level[2];
} __attribute__((packed));
/* response is a 32 bit status */
......@@ -556,7 +523,6 @@ struct mixart_set_in_audio_level_req
#define MIXART_OUT_STREAM_SET_LEVEL_MUTE_1 0x40
#define MIXART_OUT_STREAM_SET_LEVEL_MUTE_2 0x80
typedef struct mixart_out_stream_level_info mixart_out_stream_level_info_t;
struct mixart_out_stream_level_info
{
u32 valid_mask1;
......@@ -571,37 +537,35 @@ struct mixart_out_stream_level_info
u32 mute2;
} __attribute__((packed));
typedef struct mixart_set_out_stream_level mixart_set_out_stream_level_t;
struct mixart_set_out_stream_level
{
mixart_txx_stream_desc_t desc;
mixart_out_stream_level_info_t out_level;
struct mixart_txx_stream_desc desc;
struct mixart_out_stream_level_info out_level;
} __attribute__((packed));
typedef struct mixart_set_out_stream_level_req mixart_set_out_stream_level_req_t;
struct mixart_set_out_stream_level_req
{
u32 delayed;
u64 scheduler;
u32 reserved4np[2];
u32 nb_of_stream; /* set to 1 */
mixart_set_out_stream_level_t stream_level; /* could be an array */
struct mixart_set_out_stream_level stream_level; /* could be an array */
} __attribute__((packed));
/* response to this request is a u32 status value */
/* exported */
void snd_mixart_init_mailbox(mixart_mgr_t *mgr);
void snd_mixart_exit_mailbox(mixart_mgr_t *mgr);
void snd_mixart_init_mailbox(struct mixart_mgr *mgr);
void snd_mixart_exit_mailbox(struct mixart_mgr *mgr);
int snd_mixart_send_msg(mixart_mgr_t *mgr, mixart_msg_t *request, int max_resp_size, void *resp_data);
int snd_mixart_send_msg_wait_notif(mixart_mgr_t *mgr, mixart_msg_t *request, u32 notif_event);
int snd_mixart_send_msg_nonblock(mixart_mgr_t *mgr, mixart_msg_t *request);
int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int max_resp_size, void *resp_data);
int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr, struct mixart_msg *request, u32 notif_event);
int snd_mixart_send_msg_nonblock(struct mixart_mgr *mgr, struct mixart_msg *request);
irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs);
void snd_mixart_msg_tasklet( unsigned long arg);
void snd_mixart_msg_tasklet(unsigned long arg);
void snd_mixart_reset_board(mixart_mgr_t *mgr);
void snd_mixart_reset_board(struct mixart_mgr *mgr);
#endif /* __SOUND_MIXART_CORE_H */
......@@ -40,7 +40,9 @@
* @param value value
* @param timeout timeout in centisenconds
*/
static int mixart_wait_nice_for_register_value(mixart_mgr_t *mgr, u32 offset, int is_egal, u32 value, unsigned long timeout)
static int mixart_wait_nice_for_register_value(struct mixart_mgr *mgr,
u32 offset, int is_egal,
u32 value, unsigned long timeout)
{
unsigned long end_time = jiffies + (timeout * HZ / 100);
u32 read;
......@@ -66,8 +68,6 @@ static int mixart_wait_nice_for_register_value(mixart_mgr_t *mgr, u32 offset, in
/*
structures needed to upload elf code packets
*/
typedef struct snd_mixart_elf32_ehdr snd_mixart_elf32_ehdr_t;
struct snd_mixart_elf32_ehdr {
u8 e_ident[16];
u16 e_type;
......@@ -85,8 +85,6 @@ struct snd_mixart_elf32_ehdr {
u16 e_shstrndx;
};
typedef struct snd_mixart_elf32_phdr snd_mixart_elf32_phdr_t;
struct snd_mixart_elf32_phdr {
u32 p_type;
u32 p_offset;
......@@ -98,19 +96,19 @@ struct snd_mixart_elf32_phdr {
u32 p_align;
};
static int mixart_load_elf(mixart_mgr_t *mgr, const struct firmware *dsp )
static int mixart_load_elf(struct mixart_mgr *mgr, const struct firmware *dsp )
{
char elf32_magic_number[4] = {0x7f,'E','L','F'};
snd_mixart_elf32_ehdr_t *elf_header;
struct snd_mixart_elf32_ehdr *elf_header;
int i;
elf_header = (snd_mixart_elf32_ehdr_t *)dsp->data;
elf_header = (struct snd_mixart_elf32_ehdr *)dsp->data;
for( i=0; i<4; i++ )
if ( elf32_magic_number[i] != elf_header->e_ident[i] )
return -EINVAL;
if( elf_header->e_phoff != 0 ) {
snd_mixart_elf32_phdr_t elf_programheader;
struct snd_mixart_elf32_phdr elf_programheader;
for( i=0; i < be16_to_cpu(elf_header->e_phnum); i++ ) {
u32 pos = be32_to_cpu(elf_header->e_phoff) + (u32)(i * be16_to_cpu(elf_header->e_phentsize));
......@@ -137,14 +135,14 @@ static int mixart_load_elf(mixart_mgr_t *mgr, const struct firmware *dsp )
#define MIXART_FIRST_ANA_AUDIO_ID 0
#define MIXART_FIRST_DIG_AUDIO_ID 8
static int mixart_enum_connectors(mixart_mgr_t *mgr)
static int mixart_enum_connectors(struct mixart_mgr *mgr)
{
u32 k;
int err;
mixart_msg_t request;
mixart_enum_connector_resp_t *connector;
mixart_audio_info_req_t *audio_info_req;
mixart_audio_info_resp_t *audio_info;
struct mixart_msg request;
struct mixart_enum_connector_resp *connector;
struct mixart_audio_info_req *audio_info_req;
struct mixart_audio_info_resp *audio_info;
connector = kmalloc(sizeof(*connector), GFP_KERNEL);
audio_info_req = kmalloc(sizeof(*audio_info_req), GFP_KERNEL);
......@@ -159,7 +157,7 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr)
audio_info_req->cd_max_level = MIXART_FLOAT____0_0_TO_HEX;
request.message_id = MSG_SYSTEM_ENUM_PLAY_CONNECTOR;
request.uid = (mixart_uid_t){0,0}; /* board num = 0 */
request.uid = (struct mixart_uid){0,0}; /* board num = 0 */
request.data = NULL;
request.size = 0;
......@@ -171,7 +169,7 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr)
}
for(k=0; k < connector->uid_count; k++) {
mixart_pipe_t* pipe;
struct mixart_pipe *pipe;
if(k < MIXART_FIRST_DIG_AUDIO_ID) {
pipe = &mgr->chip[k/2]->pipe_out_ana;
......@@ -201,7 +199,7 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr)
}
request.message_id = MSG_SYSTEM_ENUM_RECORD_CONNECTOR;
request.uid = (mixart_uid_t){0,0}; /* board num = 0 */
request.uid = (struct mixart_uid){0,0}; /* board num = 0 */
request.data = NULL;
request.size = 0;
......@@ -213,7 +211,7 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr)
}
for(k=0; k < connector->uid_count; k++) {
mixart_pipe_t* pipe;
struct mixart_pipe *pipe;
if(k < MIXART_FIRST_DIG_AUDIO_ID) {
pipe = &mgr->chip[k/2]->pipe_in_ana;
......@@ -251,14 +249,14 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr)
return err;
}
static int mixart_enum_physio(mixart_mgr_t *mgr)
static int mixart_enum_physio(struct mixart_mgr *mgr)
{
u32 k;
int err;
mixart_msg_t request;
mixart_uid_t get_console_mgr;
mixart_return_uid_t console_mgr;
mixart_uid_enumeration_t phys_io;
struct mixart_msg request;
struct mixart_uid get_console_mgr;
struct mixart_return_uid console_mgr;
struct mixart_uid_enumeration phys_io;
/* get the uid for the console manager */
get_console_mgr.object_id = 0;
......@@ -280,7 +278,7 @@ static int mixart_enum_physio(mixart_mgr_t *mgr)
mgr->uid_console_manager = console_mgr.uid;
request.message_id = MSG_SYSTEM_ENUM_PHYSICAL_IO;
request.uid = (mixart_uid_t){0,0};
request.uid = (struct mixart_uid){0,0};
request.data = &console_mgr.uid;
request.size = sizeof(console_mgr.uid);
......@@ -301,11 +299,11 @@ static int mixart_enum_physio(mixart_mgr_t *mgr)
}
static int mixart_first_init(mixart_mgr_t *mgr)
static int mixart_first_init(struct mixart_mgr *mgr)
{
u32 k;
int err;
mixart_msg_t request;
struct mixart_msg request;
if((err = mixart_enum_connectors(mgr)) < 0) return err;
......@@ -314,7 +312,7 @@ static int mixart_first_init(mixart_mgr_t *mgr)
/* send a synchro command to card (necessary to do this before first MSG_STREAM_START_STREAM_GRP_PACKET) */
/* though why not here */
request.message_id = MSG_SYSTEM_SEND_SYNCHRO_CMD;
request.uid = (mixart_uid_t){0,0};
request.uid = (struct mixart_uid){0,0};
request.data = NULL;
request.size = 0;
/* this command has no data. response is a 32 bit status */
......@@ -331,7 +329,7 @@ static int mixart_first_init(mixart_mgr_t *mgr)
/* firmware base addresses (when hard coded) */
#define MIXART_MOTHERBOARD_XLX_BASE_ADDRESS 0x00600000
static int mixart_dsp_load(mixart_mgr_t* mgr, int index, const struct firmware *dsp)
static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmware *dsp)
{
int err, card_index;
u32 status_xilinx, status_elf, status_daught;
......@@ -513,7 +511,7 @@ static int mixart_dsp_load(mixart_mgr_t* mgr, int index, const struct firmware *
/* create devices and mixer in accordance with HW options*/
for (card_index = 0; card_index < mgr->num_cards; card_index++) {
mixart_t *chip = mgr->chip[card_index];
struct snd_mixart *chip = mgr->chip[card_index];
if ((err = snd_mixart_create_pcm(chip)) < 0)
return err;
......@@ -541,7 +539,7 @@ static int mixart_dsp_load(mixart_mgr_t* mgr, int index, const struct firmware *
#ifdef SND_MIXART_FW_LOADER
int snd_mixart_setup_firmware(mixart_mgr_t *mgr)
int snd_mixart_setup_firmware(struct mixart_mgr *mgr)
{
static char *fw_files[3] = {
"miXart8.xlx", "miXart8.elf", "miXart8AES.xlx"
......@@ -573,19 +571,20 @@ int snd_mixart_setup_firmware(mixart_mgr_t *mgr)
/* miXart hwdep interface id string */
#define SND_MIXART_HWDEP_ID "miXart Loader"
static int mixart_hwdep_open(snd_hwdep_t *hw, struct file *file)
static int mixart_hwdep_open(struct snd_hwdep *hw, struct file *file)
{
return 0;
}
static int mixart_hwdep_release(snd_hwdep_t *hw, struct file *file)
static int mixart_hwdep_release(struct snd_hwdep *hw, struct file *file)
{
return 0;
}
static int mixart_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info)
static int mixart_hwdep_dsp_status(struct snd_hwdep *hw,
struct snd_hwdep_dsp_status *info)
{
mixart_mgr_t *mgr = hw->private_data;
struct mixart_mgr *mgr = hw->private_data;
strcpy(info->id, "miXart");
info->num_dsps = MIXART_HARDW_FILES_MAX_INDEX;
......@@ -597,9 +596,10 @@ static int mixart_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info
return 0;
}
static int mixart_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp)
static int mixart_hwdep_dsp_load(struct snd_hwdep *hw,
struct snd_hwdep_dsp_image *dsp)
{
mixart_mgr_t* mgr = hw->private_data;
struct mixart_mgr* mgr = hw->private_data;
struct firmware fw;
int err;
......@@ -622,10 +622,10 @@ static int mixart_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp)
return err;
}
int snd_mixart_setup_firmware(mixart_mgr_t *mgr)
int snd_mixart_setup_firmware(struct mixart_mgr *mgr)
{
int err;
snd_hwdep_t *hw;
struct snd_hwdep *hw;
/* only create hwdep interface for first cardX (see "index" module parameter)*/
if ((err = snd_hwdep_new(mgr->chip[0]->card, SND_MIXART_HWDEP_ID, 0, &hw)) < 0)
......
......@@ -140,6 +140,6 @@
#define MIXART_OIDI 0x008 /* 0000 0000 1000 */
int snd_mixart_setup_firmware(mixart_mgr_t *mgr);
int snd_mixart_setup_firmware(struct mixart_mgr *mgr);
#endif /* __SOUND_MIXART_HWDEP_H */
......@@ -298,12 +298,12 @@ static u32 mixart_analog_level[256] = {
#define MIXART_ANALOG_PLAYBACK_LEVEL_MAX 192 /* 0.0 dB + 1.5 dB = 1.5 dB */
#define MIXART_ANALOG_PLAYBACK_ZERO_LEVEL 189 /* -1.5 dB + 1.5 dB = 0.0 dB */
static int mixart_update_analog_audio_level(mixart_t* chip, int is_capture)
static int mixart_update_analog_audio_level(struct snd_mixart* chip, int is_capture)
{
int i, err;
mixart_msg_t request;
mixart_io_level_t io_level;
mixart_return_uid_t resp;
struct mixart_msg request;
struct mixart_io_level io_level;
struct mixart_return_uid resp;
memset(&io_level, 0, sizeof(io_level));
io_level.channel = -1; /* left and right */
......@@ -336,7 +336,7 @@ static int mixart_update_analog_audio_level(mixart_t* chip, int is_capture)
/*
* analog level control
*/
static int mixart_analog_vol_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
static int mixart_analog_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
......@@ -350,9 +350,9 @@ static int mixart_analog_vol_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t
return 0;
}
static int mixart_analog_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
static int mixart_analog_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
mixart_t *chip = snd_kcontrol_chip(kcontrol);
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
down(&chip->mgr->mixer_mutex);
if(kcontrol->private_value == 0) { /* playback */
ucontrol->value.integer.value[0] = chip->analog_playback_volume[0];
......@@ -365,9 +365,9 @@ static int mixart_analog_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
return 0;
}
static int mixart_analog_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
static int mixart_analog_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
mixart_t *chip = snd_kcontrol_chip(kcontrol);
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
int is_capture, i;
......@@ -386,7 +386,7 @@ static int mixart_analog_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
return changed;
}
static snd_kcontrol_new_t mixart_control_analog_level = {
static struct snd_kcontrol_new mixart_control_analog_level = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
/* name will be filled later */
.info = mixart_analog_vol_info,
......@@ -395,7 +395,7 @@ static snd_kcontrol_new_t mixart_control_analog_level = {
};
/* shared */
static int mixart_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
static int mixart_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 2;
......@@ -404,9 +404,9 @@ static int mixart_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
return 0;
}
static int mixart_audio_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
static int mixart_audio_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
mixart_t *chip = snd_kcontrol_chip(kcontrol);
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
down(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->analog_playback_active[0];
......@@ -415,9 +415,9 @@ static int mixart_audio_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u
return 0;
}
static int mixart_audio_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
static int mixart_audio_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
mixart_t *chip = snd_kcontrol_chip(kcontrol);
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
int i, changed = 0;
down(&chip->mgr->mixer_mutex);
for(i=0; i<2; i++) {
......@@ -431,7 +431,7 @@ static int mixart_audio_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u
return changed;
}
static snd_kcontrol_new_t mixart_control_output_switch = {
static struct snd_kcontrol_new mixart_control_output_switch = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Playback Switch",
.info = mixart_sw_info, /* shared */
......@@ -703,14 +703,14 @@ static u32 mixart_digital_level[256] = {
#define MIXART_DIGITAL_ZERO_LEVEL 219 /* 0.0 dB */
int mixart_update_playback_stream_level(mixart_t* chip, int is_aes, int idx)
int mixart_update_playback_stream_level(struct snd_mixart* chip, int is_aes, int idx)
{
int err, i;
int volume[2];
mixart_msg_t request;
mixart_set_out_stream_level_req_t set_level;
struct mixart_msg request;
struct mixart_set_out_stream_level_req set_level;
u32 status;
mixart_pipe_t *pipe;
struct mixart_pipe *pipe;
memset(&set_level, 0, sizeof(set_level));
set_level.nb_of_stream = 1;
......@@ -741,7 +741,7 @@ int mixart_update_playback_stream_level(mixart_t* chip, int is_aes, int idx)
set_level.stream_level.out_level.right_to_out2_level = mixart_digital_level[volume[1]];
request.message_id = MSG_STREAM_SET_OUT_STREAM_LEVEL;
request.uid = (mixart_uid_t){0,0};
request.uid = (struct mixart_uid){0,0};
request.data = &set_level;
request.size = sizeof(set_level);
......@@ -753,12 +753,12 @@ int mixart_update_playback_stream_level(mixart_t* chip, int is_aes, int idx)
return 0;
}
int mixart_update_capture_stream_level(mixart_t* chip, int is_aes)
int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes)
{
int err, i, idx;
mixart_pipe_t* pipe;
mixart_msg_t request;
mixart_set_in_audio_level_req_t set_level;
struct mixart_pipe *pipe;
struct mixart_msg request;
struct mixart_set_in_audio_level_req set_level;
u32 status;
if(is_aes) {
......@@ -784,7 +784,7 @@ int mixart_update_capture_stream_level(mixart_t* chip, int is_aes)
}
request.message_id = MSG_STREAM_SET_IN_AUDIO_LEVEL;
request.uid = (mixart_uid_t){0,0};
request.uid = (struct mixart_uid){0,0};
request.data = &set_level;
request.size = sizeof(set_level);
......@@ -798,7 +798,7 @@ int mixart_update_capture_stream_level(mixart_t* chip, int is_aes)
/* shared */
static int mixart_digital_vol_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
static int mixart_digital_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
......@@ -810,9 +810,9 @@ static int mixart_digital_vol_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t
#define MIXART_VOL_REC_MASK 1
#define MIXART_VOL_AES_MASK 2
static int mixart_pcm_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
static int mixart_pcm_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
mixart_t *chip = snd_kcontrol_chip(kcontrol);
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */
int *stored_volume;
int is_capture = kcontrol->private_value & MIXART_VOL_REC_MASK;
......@@ -832,9 +832,9 @@ static int mixart_pcm_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc
return 0;
}
static int mixart_pcm_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
static int mixart_pcm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
mixart_t *chip = snd_kcontrol_chip(kcontrol);
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */
int changed = 0;
int is_capture = kcontrol->private_value & MIXART_VOL_REC_MASK;
......@@ -864,7 +864,7 @@ static int mixart_pcm_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc
return changed;
}
static snd_kcontrol_new_t snd_mixart_pcm_vol =
static struct snd_kcontrol_new snd_mixart_pcm_vol =
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
/* name will be filled later */
......@@ -875,9 +875,9 @@ static snd_kcontrol_new_t snd_mixart_pcm_vol =
};
static int mixart_pcm_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
static int mixart_pcm_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
mixart_t *chip = snd_kcontrol_chip(kcontrol);
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */
snd_assert ( idx < MIXART_PLAYBACK_STREAMS );
down(&chip->mgr->mixer_mutex);
......@@ -889,9 +889,9 @@ static int mixart_pcm_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
return 0;
}
static int mixart_pcm_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
static int mixart_pcm_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
mixart_t *chip = snd_kcontrol_chip(kcontrol);
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
int is_aes = kcontrol->private_value & MIXART_VOL_AES_MASK;
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */
......@@ -911,7 +911,7 @@ static int mixart_pcm_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
return changed;
}
static snd_kcontrol_new_t mixart_control_pcm_switch = {
static struct snd_kcontrol_new mixart_control_pcm_switch = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
/* name will be filled later */
.count = MIXART_PLAYBACK_STREAMS,
......@@ -920,11 +920,11 @@ static snd_kcontrol_new_t mixart_control_pcm_switch = {
.put = mixart_pcm_sw_put
};
static int mixart_update_monitoring(mixart_t* chip, int channel)
static int mixart_update_monitoring(struct snd_mixart* chip, int channel)
{
int err;
mixart_msg_t request;
mixart_set_out_audio_level_t audio_level;
struct mixart_msg request;
struct mixart_set_out_audio_level audio_level;
u32 resp;
if(chip->pipe_out_ana.status == PIPE_UNDEFINED)
......@@ -953,9 +953,9 @@ static int mixart_update_monitoring(mixart_t* chip, int channel)
* monitoring level control
*/
static int mixart_monitor_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
static int mixart_monitor_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
mixart_t *chip = snd_kcontrol_chip(kcontrol);
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
down(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->monitoring_volume[0];
ucontrol->value.integer.value[1] = chip->monitoring_volume[1];
......@@ -963,9 +963,9 @@ static int mixart_monitor_vol_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
return 0;
}
static int mixart_monitor_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
static int mixart_monitor_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
mixart_t *chip = snd_kcontrol_chip(kcontrol);
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
int i;
down(&chip->mgr->mixer_mutex);
......@@ -980,7 +980,7 @@ static int mixart_monitor_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
return changed;
}
static snd_kcontrol_new_t mixart_control_monitor_vol = {
static struct snd_kcontrol_new mixart_control_monitor_vol = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Monitoring Volume",
.info = mixart_digital_vol_info, /* shared */
......@@ -992,9 +992,9 @@ static snd_kcontrol_new_t mixart_control_monitor_vol = {
* monitoring switch control
*/
static int mixart_monitor_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
static int mixart_monitor_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
mixart_t *chip = snd_kcontrol_chip(kcontrol);
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
down(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->monitoring_active[0];
ucontrol->value.integer.value[1] = chip->monitoring_active[1];
......@@ -1002,9 +1002,9 @@ static int mixart_monitor_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
return 0;
}
static int mixart_monitor_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
static int mixart_monitor_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
mixart_t *chip = snd_kcontrol_chip(kcontrol);
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
int i;
down(&chip->mgr->mixer_mutex);
......@@ -1033,7 +1033,7 @@ static int mixart_monitor_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t
return (changed != 0);
}
static snd_kcontrol_new_t mixart_control_monitor_sw = {
static struct snd_kcontrol_new mixart_control_monitor_sw = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Monitoring Switch",
.info = mixart_sw_info, /* shared */
......@@ -1042,7 +1042,7 @@ static snd_kcontrol_new_t mixart_control_monitor_sw = {
};
static void mixart_reset_audio_levels(mixart_t *chip)
static void mixart_reset_audio_levels(struct snd_mixart *chip)
{
/* analog volumes can be set even if there is no pipe */
mixart_update_analog_audio_level(chip, 0);
......@@ -1054,15 +1054,15 @@ static void mixart_reset_audio_levels(mixart_t *chip)
}
int snd_mixart_create_mixer(mixart_mgr_t *mgr)
int snd_mixart_create_mixer(struct mixart_mgr *mgr)
{
mixart_t *chip;
struct snd_mixart *chip;
int err, i;
init_MUTEX(&mgr->mixer_mutex); /* can be in another place */
for(i=0; i<mgr->num_cards; i++) {
snd_kcontrol_new_t temp;
struct snd_kcontrol_new temp;
chip = mgr->chip[i];
/* analog output level control */
......
......@@ -24,8 +24,8 @@
#define __SOUND_MIXART_MIXER_H
/* exported */
int mixart_update_playback_stream_level(mixart_t* chip, int is_aes, int idx);
int mixart_update_capture_stream_level(mixart_t* chip, int is_aes);
int snd_mixart_create_mixer(mixart_mgr_t* mgr);
int mixart_update_playback_stream_level(struct snd_mixart* chip, int is_aes, int idx);
int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes);
int snd_mixart_create_mixer(struct mixart_mgr* mgr);
#endif /* __SOUND_MIXART_MIXER_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册