[ALSA] Remove xxx_t typedefs: PCI miXart

Modules: MIXART driver

Remove xxx_t typedefs from the PCI miXart driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2005-11-17 15:01:08 +01:00 committed by Jaroslav Kysela
parent fcfd3332e3
commit 67b48b8800
8 changed files with 300 additions and 341 deletions

View File

@ -66,11 +66,12 @@ static struct pci_device_id snd_mixart_ids[] = {
MODULE_DEVICE_TABLE(pci, snd_mixart_ids); MODULE_DEVICE_TABLE(pci, snd_mixart_ids);
static int mixart_set_pipe_state(mixart_mgr_t *mgr, mixart_pipe_t* pipe, int start) static int mixart_set_pipe_state(struct mixart_mgr *mgr,
struct mixart_pipe *pipe, int start)
{ {
mixart_group_state_req_t group_state; struct mixart_group_state_req group_state;
mixart_group_state_resp_t group_state_resp; struct mixart_group_state_resp group_state_resp;
mixart_msg_t request; struct mixart_msg request;
int err; int err;
u32 system_msg_uid; u32 system_msg_uid;
@ -92,7 +93,7 @@ static int mixart_set_pipe_state(mixart_mgr_t *mgr, mixart_pipe_t* pipe, int sta
/* wait on the last MSG_SYSTEM_SEND_SYNCHRO_CMD command to be really finished */ /* wait on the last MSG_SYSTEM_SEND_SYNCHRO_CMD command to be really finished */
request.message_id = MSG_SYSTEM_WAIT_SYNCHRO_CMD; request.message_id = MSG_SYSTEM_WAIT_SYNCHRO_CMD;
request.uid = (mixart_uid_t){0,0}; request.uid = (struct mixart_uid){0,0};
request.data = &system_msg_uid; request.data = &system_msg_uid;
request.size = sizeof(system_msg_uid); request.size = sizeof(system_msg_uid);
@ -113,7 +114,7 @@ static int mixart_set_pipe_state(mixart_mgr_t *mgr, mixart_pipe_t* pipe, int sta
else else
request.message_id = MSG_STREAM_STOP_STREAM_GRP_PACKET; request.message_id = MSG_STREAM_STOP_STREAM_GRP_PACKET;
request.uid = pipe->group_uid; /*(mixart_uid_t){0,0};*/ request.uid = pipe->group_uid; /*(struct mixart_uid){0,0};*/
request.data = &group_state; request.data = &group_state;
request.size = sizeof(group_state); request.size = sizeof(group_state);
@ -137,7 +138,7 @@ static int mixart_set_pipe_state(mixart_mgr_t *mgr, mixart_pipe_t* pipe, int sta
/* in case of start send a synchro top */ /* in case of start send a synchro top */
request.message_id = MSG_SYSTEM_SEND_SYNCHRO_CMD; 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.data = NULL;
request.size = 0; request.size = 0;
@ -156,11 +157,12 @@ static int mixart_set_pipe_state(mixart_mgr_t *mgr, mixart_pipe_t* pipe, int sta
} }
static int mixart_set_clock(mixart_mgr_t *mgr, mixart_pipe_t *pipe, unsigned int rate) static int mixart_set_clock(struct mixart_mgr *mgr,
struct mixart_pipe *pipe, unsigned int rate)
{ {
mixart_msg_t request; struct mixart_msg request;
mixart_clock_properties_t clock_properties; struct mixart_clock_properties clock_properties;
mixart_clock_properties_resp_t clock_prop_resp; struct mixart_clock_properties_resp clock_prop_resp;
int err; int err;
switch(pipe->status) { switch(pipe->status) {
@ -208,11 +210,13 @@ static int mixart_set_clock(mixart_mgr_t *mgr, mixart_pipe_t *pipe, unsigned int
/* /*
* Allocate or reference output pipe for analog IOs (pcmp0/1) * Allocate or reference output pipe for analog IOs (pcmp0/1)
*/ */
mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capture, int monitoring) struct mixart_pipe *
snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
int monitoring)
{ {
int stream_count; int stream_count;
mixart_pipe_t *pipe; struct mixart_pipe *pipe;
mixart_msg_t request; struct mixart_msg request;
if(capture) { if(capture) {
if (pcm_number == MIXART_PCM_ANALOG) { if (pcm_number == MIXART_PCM_ANALOG) {
@ -241,8 +245,8 @@ mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capt
if( pipe->status == PIPE_UNDEFINED ) { if( pipe->status == PIPE_UNDEFINED ) {
int err, i; int err, i;
struct { struct {
mixart_streaming_group_req_t sgroup_req; struct mixart_streaming_group_req sgroup_req;
mixart_streaming_group_t sgroup_resp; struct mixart_streaming_group sgroup_resp;
} *buf; } *buf;
snd_printdd("add_ref_pipe audio chip(%d) pcm(%d)\n", chip->chip_idx, pcm_number); snd_printdd("add_ref_pipe audio chip(%d) pcm(%d)\n", chip->chip_idx, pcm_number);
@ -251,7 +255,7 @@ mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capt
if (!buf) if (!buf)
return NULL; return NULL;
request.uid = (mixart_uid_t){0,0}; /* should be StreamManagerUID, but zero is OK if there is only one ! */ request.uid = (struct mixart_uid){0,0}; /* should be StreamManagerUID, but zero is OK if there is only one ! */
request.data = &buf->sgroup_req; request.data = &buf->sgroup_req;
request.size = sizeof(buf->sgroup_req); request.size = sizeof(buf->sgroup_req);
@ -279,7 +283,7 @@ mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capt
buf->sgroup_req.flow_entry[i] = j; buf->sgroup_req.flow_entry[i] = j;
flowinfo = (struct mixart_flowinfo *)chip->mgr->flowinfo.area; flowinfo = (struct mixart_flowinfo *)chip->mgr->flowinfo.area;
flowinfo[j].bufferinfo_array_phy_address = (u32)chip->mgr->bufferinfo.addr + (j * sizeof(mixart_bufferinfo_t)); flowinfo[j].bufferinfo_array_phy_address = (u32)chip->mgr->bufferinfo.addr + (j * sizeof(struct mixart_bufferinfo));
flowinfo[j].bufferinfo_count = 1; /* 1 will set the miXart to ring-buffer mode ! */ flowinfo[j].bufferinfo_count = 1; /* 1 will set the miXart to ring-buffer mode ! */
bufferinfo = (struct mixart_bufferinfo *)chip->mgr->bufferinfo.area; bufferinfo = (struct mixart_bufferinfo *)chip->mgr->bufferinfo.area;
@ -315,7 +319,8 @@ mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capt
} }
int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monitoring) int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr,
struct mixart_pipe *pipe, int monitoring)
{ {
int err = 0; int err = 0;
@ -329,8 +334,8 @@ int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monito
if((pipe->references <= 0) && (pipe->monitoring == 0)) { if((pipe->references <= 0) && (pipe->monitoring == 0)) {
mixart_msg_t request; struct mixart_msg request;
mixart_delete_group_resp_t delete_resp; struct mixart_delete_group_resp delete_resp;
/* release the clock */ /* release the clock */
err = mixart_set_clock( mgr, pipe, 0); err = mixart_set_clock( mgr, pipe, 0);
@ -345,7 +350,7 @@ int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monito
} }
request.message_id = MSG_STREAM_DELETE_GROUP; request.message_id = MSG_STREAM_DELETE_GROUP;
request.uid = (mixart_uid_t){0,0}; request.uid = (struct mixart_uid){0,0};
request.data = &pipe->group_uid; /* the streaming group ! */ request.data = &pipe->group_uid; /* the streaming group ! */
request.size = sizeof(pipe->group_uid); request.size = sizeof(pipe->group_uid);
@ -355,7 +360,7 @@ int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monito
snd_printk(KERN_ERR "error MSG_STREAM_DELETE_GROUP err(%x), status(%x)\n", err, delete_resp.status); snd_printk(KERN_ERR "error MSG_STREAM_DELETE_GROUP err(%x), status(%x)\n", err, delete_resp.status);
} }
pipe->group_uid = (mixart_uid_t){0,0}; pipe->group_uid = (struct mixart_uid){0,0};
pipe->stream_count = 0; pipe->stream_count = 0;
pipe->status = PIPE_UNDEFINED; pipe->status = PIPE_UNDEFINED;
} }
@ -363,11 +368,11 @@ int snd_mixart_kill_ref_pipe( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monito
return err; return err;
} }
static int mixart_set_stream_state(mixart_stream_t *stream, int start) static int mixart_set_stream_state(struct mixart_stream *stream, int start)
{ {
mixart_t *chip; struct snd_mixart *chip;
mixart_stream_state_req_t stream_state_req; struct mixart_stream_state_req stream_state_req;
mixart_msg_t request; struct mixart_msg request;
if(!stream->substream) if(!stream->substream)
return -EINVAL; return -EINVAL;
@ -382,7 +387,7 @@ static int mixart_set_stream_state(mixart_stream_t *stream, int start)
else else
request.message_id = start ? MSG_STREAM_START_OUTPUT_STAGE_PACKET : MSG_STREAM_STOP_OUTPUT_STAGE_PACKET; request.message_id = start ? MSG_STREAM_START_OUTPUT_STAGE_PACKET : MSG_STREAM_STOP_OUTPUT_STAGE_PACKET;
request.uid = (mixart_uid_t){0,0}; request.uid = (struct mixart_uid){0,0};
request.data = &stream_state_req; request.data = &stream_state_req;
request.size = sizeof(stream_state_req); request.size = sizeof(stream_state_req);
@ -399,9 +404,9 @@ static int mixart_set_stream_state(mixart_stream_t *stream, int start)
* Trigger callback * Trigger callback
*/ */
static int snd_mixart_trigger(snd_pcm_substream_t *subs, int cmd) static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd)
{ {
mixart_stream_t *stream = (mixart_stream_t*)subs->runtime->private_data; struct mixart_stream *stream = subs->runtime->private_data;
switch (cmd) { switch (cmd) {
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
@ -443,7 +448,7 @@ static int snd_mixart_trigger(snd_pcm_substream_t *subs, int cmd)
return 0; return 0;
} }
static int mixart_sync_nonblock_events(mixart_mgr_t *mgr) static int mixart_sync_nonblock_events(struct mixart_mgr *mgr)
{ {
unsigned long timeout = jiffies + HZ; unsigned long timeout = jiffies + HZ;
while (atomic_read(&mgr->msg_processed) > 0) { while (atomic_read(&mgr->msg_processed) > 0) {
@ -459,10 +464,10 @@ static int mixart_sync_nonblock_events(mixart_mgr_t *mgr)
/* /*
* prepare callback for all pcms * prepare callback for all pcms
*/ */
static int snd_mixart_prepare(snd_pcm_substream_t *subs) static int snd_mixart_prepare(struct snd_pcm_substream *subs)
{ {
mixart_t *chip = snd_pcm_substream_chip(subs); struct snd_mixart *chip = snd_pcm_substream_chip(subs);
mixart_stream_t *stream = (mixart_stream_t*)subs->runtime->private_data; struct mixart_stream *stream = subs->runtime->private_data;
/* TODO de façon non bloquante, réappliquer les hw_params (rate, bits, codec) */ /* TODO de façon non bloquante, réappliquer les hw_params (rate, bits, codec) */
@ -485,13 +490,13 @@ static int snd_mixart_prepare(snd_pcm_substream_t *subs)
} }
static int mixart_set_format(mixart_stream_t *stream, snd_pcm_format_t format) static int mixart_set_format(struct mixart_stream *stream, snd_pcm_format_t format)
{ {
int err; int err;
mixart_t *chip; struct snd_mixart *chip;
mixart_msg_t request; struct mixart_msg request;
mixart_stream_param_desc_t stream_param; struct mixart_stream_param_desc stream_param;
mixart_return_uid_t resp; struct mixart_return_uid resp;
chip = snd_pcm_substream_chip(stream->substream); chip = snd_pcm_substream_chip(stream->substream);
@ -552,7 +557,7 @@ static int mixart_set_format(mixart_stream_t *stream, snd_pcm_format_t format)
stream_param.stream_desc[0].stream_idx = stream->substream->number; stream_param.stream_desc[0].stream_idx = stream->substream->number;
request.message_id = MSG_STREAM_SET_INPUT_STAGE_PARAM; request.message_id = MSG_STREAM_SET_INPUT_STAGE_PARAM;
request.uid = (mixart_uid_t){0,0}; request.uid = (struct mixart_uid){0,0};
request.data = &stream_param; request.data = &stream_param;
request.size = sizeof(stream_param); request.size = sizeof(stream_param);
@ -568,12 +573,12 @@ static int mixart_set_format(mixart_stream_t *stream, snd_pcm_format_t format)
/* /*
* HW_PARAMS callback for all pcms * HW_PARAMS callback for all pcms
*/ */
static int snd_mixart_hw_params(snd_pcm_substream_t *subs, static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
snd_pcm_hw_params_t *hw) struct snd_pcm_hw_params *hw)
{ {
mixart_t *chip = snd_pcm_substream_chip(subs); struct snd_mixart *chip = snd_pcm_substream_chip(subs);
mixart_mgr_t *mgr = chip->mgr; struct mixart_mgr *mgr = chip->mgr;
mixart_stream_t *stream = (mixart_stream_t*)subs->runtime->private_data; struct mixart_stream *stream = subs->runtime->private_data;
snd_pcm_format_t format; snd_pcm_format_t format;
int err; int err;
int channels; int channels;
@ -628,9 +633,9 @@ static int snd_mixart_hw_params(snd_pcm_substream_t *subs,
return err; return err;
} }
static int snd_mixart_hw_free(snd_pcm_substream_t *subs) static int snd_mixart_hw_free(struct snd_pcm_substream *subs)
{ {
mixart_t *chip = snd_pcm_substream_chip(subs); struct snd_mixart *chip = snd_pcm_substream_chip(subs);
snd_pcm_lib_free_pages(subs); snd_pcm_lib_free_pages(subs);
mixart_sync_nonblock_events(chip->mgr); mixart_sync_nonblock_events(chip->mgr);
return 0; return 0;
@ -641,7 +646,7 @@ static int snd_mixart_hw_free(snd_pcm_substream_t *subs)
/* /*
* TODO CONFIGURATION SPACE for all pcms, mono pcm must update channels_max * TODO CONFIGURATION SPACE for all pcms, mono pcm must update channels_max
*/ */
static snd_pcm_hardware_t snd_mixart_analog_caps = static struct snd_pcm_hardware snd_mixart_analog_caps =
{ {
.info = ( SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = ( SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START |
@ -662,7 +667,7 @@ static snd_pcm_hardware_t snd_mixart_analog_caps =
.periods_max = (32*1024/256), .periods_max = (32*1024/256),
}; };
static snd_pcm_hardware_t snd_mixart_digital_caps = static struct snd_pcm_hardware snd_mixart_digital_caps =
{ {
.info = ( SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = ( SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START |
@ -684,14 +689,14 @@ static snd_pcm_hardware_t snd_mixart_digital_caps =
}; };
static int snd_mixart_playback_open(snd_pcm_substream_t *subs) static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
{ {
mixart_t *chip = snd_pcm_substream_chip(subs); struct snd_mixart *chip = snd_pcm_substream_chip(subs);
mixart_mgr_t *mgr = chip->mgr; struct mixart_mgr *mgr = chip->mgr;
snd_pcm_runtime_t *runtime = subs->runtime; struct snd_pcm_runtime *runtime = subs->runtime;
snd_pcm_t *pcm = subs->pcm; struct snd_pcm *pcm = subs->pcm;
mixart_stream_t *stream; struct mixart_stream *stream;
mixart_pipe_t *pipe; struct mixart_pipe *pipe;
int err = 0; int err = 0;
int pcm_number; int pcm_number;
@ -759,14 +764,14 @@ static int snd_mixart_playback_open(snd_pcm_substream_t *subs)
} }
static int snd_mixart_capture_open(snd_pcm_substream_t *subs) static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
{ {
mixart_t *chip = snd_pcm_substream_chip(subs); struct snd_mixart *chip = snd_pcm_substream_chip(subs);
mixart_mgr_t *mgr = chip->mgr; struct mixart_mgr *mgr = chip->mgr;
snd_pcm_runtime_t *runtime = subs->runtime; struct snd_pcm_runtime *runtime = subs->runtime;
snd_pcm_t *pcm = subs->pcm; struct snd_pcm *pcm = subs->pcm;
mixart_stream_t *stream; struct mixart_stream *stream;
mixart_pipe_t *pipe; struct mixart_pipe *pipe;
int err = 0; int err = 0;
int pcm_number; int pcm_number;
@ -838,11 +843,11 @@ static int snd_mixart_capture_open(snd_pcm_substream_t *subs)
static int snd_mixart_close(snd_pcm_substream_t *subs) static int snd_mixart_close(struct snd_pcm_substream *subs)
{ {
mixart_t *chip = snd_pcm_substream_chip(subs); struct snd_mixart *chip = snd_pcm_substream_chip(subs);
mixart_mgr_t *mgr = chip->mgr; struct mixart_mgr *mgr = chip->mgr;
mixart_stream_t *stream = (mixart_stream_t*)subs->runtime->private_data; struct mixart_stream *stream = subs->runtime->private_data;
down(&mgr->setup_mutex); down(&mgr->setup_mutex);
@ -868,17 +873,17 @@ static int snd_mixart_close(snd_pcm_substream_t *subs)
} }
static snd_pcm_uframes_t snd_mixart_stream_pointer(snd_pcm_substream_t * subs) static snd_pcm_uframes_t snd_mixart_stream_pointer(struct snd_pcm_substream *subs)
{ {
snd_pcm_runtime_t *runtime = subs->runtime; struct snd_pcm_runtime *runtime = subs->runtime;
mixart_stream_t *stream = (mixart_stream_t*)runtime->private_data; struct mixart_stream *stream = runtime->private_data;
return (snd_pcm_uframes_t)((stream->buf_periods * runtime->period_size) + stream->buf_period_frag); return (snd_pcm_uframes_t)((stream->buf_periods * runtime->period_size) + stream->buf_period_frag);
} }
static snd_pcm_ops_t snd_mixart_playback_ops = { static struct snd_pcm_ops snd_mixart_playback_ops = {
.open = snd_mixart_playback_open, .open = snd_mixart_playback_open,
.close = snd_mixart_close, .close = snd_mixart_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
@ -889,7 +894,7 @@ static snd_pcm_ops_t snd_mixart_playback_ops = {
.pointer = snd_mixart_stream_pointer, .pointer = snd_mixart_stream_pointer,
}; };
static snd_pcm_ops_t snd_mixart_capture_ops = { static struct snd_pcm_ops snd_mixart_capture_ops = {
.open = snd_mixart_capture_open, .open = snd_mixart_capture_open,
.close = snd_mixart_close, .close = snd_mixart_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
@ -900,10 +905,10 @@ static snd_pcm_ops_t snd_mixart_capture_ops = {
.pointer = snd_mixart_stream_pointer, .pointer = snd_mixart_stream_pointer,
}; };
static void preallocate_buffers(mixart_t *chip, snd_pcm_t *pcm) static void preallocate_buffers(struct snd_mixart *chip, struct snd_pcm *pcm)
{ {
#if 0 #if 0
snd_pcm_substream_t *subs; struct snd_pcm_substream *subs;
int stream; int stream;
for (stream = 0; stream < 2; stream++) { for (stream = 0; stream < 2; stream++) {
@ -921,10 +926,10 @@ static void preallocate_buffers(mixart_t *chip, snd_pcm_t *pcm)
/* /*
*/ */
static int snd_mixart_pcm_analog(mixart_t *chip) static int snd_mixart_pcm_analog(struct snd_mixart *chip)
{ {
int err; int err;
snd_pcm_t *pcm; struct snd_pcm *pcm;
char name[32]; char name[32];
sprintf(name, "miXart analog %d", chip->chip_idx); sprintf(name, "miXart analog %d", chip->chip_idx);
@ -952,10 +957,10 @@ static int snd_mixart_pcm_analog(mixart_t *chip)
/* /*
*/ */
static int snd_mixart_pcm_digital(mixart_t *chip) static int snd_mixart_pcm_digital(struct snd_mixart *chip)
{ {
int err; int err;
snd_pcm_t *pcm; struct snd_pcm *pcm;
char name[32]; char name[32];
sprintf(name, "miXart AES/EBU %d", chip->chip_idx); sprintf(name, "miXart AES/EBU %d", chip->chip_idx);
@ -980,26 +985,26 @@ static int snd_mixart_pcm_digital(mixart_t *chip)
return 0; return 0;
} }
static int snd_mixart_chip_free(mixart_t *chip) static int snd_mixart_chip_free(struct snd_mixart *chip)
{ {
kfree(chip); kfree(chip);
return 0; return 0;
} }
static int snd_mixart_chip_dev_free(snd_device_t *device) static int snd_mixart_chip_dev_free(struct snd_device *device)
{ {
mixart_t *chip = device->device_data; struct snd_mixart *chip = device->device_data;
return snd_mixart_chip_free(chip); return snd_mixart_chip_free(chip);
} }
/* /*
*/ */
static int __devinit snd_mixart_create(mixart_mgr_t *mgr, snd_card_t *card, int idx) static int __devinit snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int idx)
{ {
int err; int err;
mixart_t *chip; struct snd_mixart *chip;
static snd_device_ops_t ops = { static struct snd_device_ops ops = {
.dev_free = snd_mixart_chip_dev_free, .dev_free = snd_mixart_chip_dev_free,
}; };
@ -1023,7 +1028,7 @@ static int __devinit snd_mixart_create(mixart_mgr_t *mgr, snd_card_t *card, int
return 0; return 0;
} }
int snd_mixart_create_pcm(mixart_t* chip) int snd_mixart_create_pcm(struct snd_mixart* chip)
{ {
int err; int err;
@ -1044,7 +1049,7 @@ int snd_mixart_create_pcm(mixart_t* chip)
/* /*
* release all the cards assigned to a manager instance * release all the cards assigned to a manager instance
*/ */
static int snd_mixart_free(mixart_mgr_t *mgr) static int snd_mixart_free(struct mixart_mgr *mgr)
{ {
unsigned int i; unsigned int i;
@ -1092,7 +1097,7 @@ static int snd_mixart_free(mixart_mgr_t *mgr)
/* /*
* proc interface * proc interface
*/ */
static long long snd_mixart_BA0_llseek(snd_info_entry_t *entry, static long long snd_mixart_BA0_llseek(struct snd_info_entry *entry,
void *private_file_data, void *private_file_data,
struct file *file, struct file *file,
long long offset, long long offset,
@ -1118,7 +1123,7 @@ static long long snd_mixart_BA0_llseek(snd_info_entry_t *entry,
return file->f_pos; return file->f_pos;
} }
static long long snd_mixart_BA1_llseek(snd_info_entry_t *entry, static long long snd_mixart_BA1_llseek(struct snd_info_entry *entry,
void *private_file_data, void *private_file_data,
struct file *file, struct file *file,
long long offset, long long offset,
@ -1147,11 +1152,11 @@ static long long snd_mixart_BA1_llseek(snd_info_entry_t *entry,
/* /*
mixart_BA0 proc interface for BAR 0 - read callback mixart_BA0 proc interface for BAR 0 - read callback
*/ */
static long snd_mixart_BA0_read(snd_info_entry_t *entry, void *file_private_data, static long snd_mixart_BA0_read(struct snd_info_entry *entry, void *file_private_data,
struct file *file, char __user *buf, struct file *file, char __user *buf,
unsigned long count, unsigned long pos) unsigned long count, unsigned long pos)
{ {
mixart_mgr_t *mgr = entry->private_data; struct mixart_mgr *mgr = entry->private_data;
count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
if(count <= 0) if(count <= 0)
@ -1166,11 +1171,11 @@ static long snd_mixart_BA0_read(snd_info_entry_t *entry, void *file_private_data
/* /*
mixart_BA1 proc interface for BAR 1 - read callback mixart_BA1 proc interface for BAR 1 - read callback
*/ */
static long snd_mixart_BA1_read(snd_info_entry_t *entry, void *file_private_data, static long snd_mixart_BA1_read(struct snd_info_entry *entry, void *file_private_data,
struct file *file, char __user *buf, struct file *file, char __user *buf,
unsigned long count, unsigned long pos) unsigned long count, unsigned long pos)
{ {
mixart_mgr_t *mgr = entry->private_data; struct mixart_mgr *mgr = entry->private_data;
count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
if(count <= 0) if(count <= 0)
@ -1193,10 +1198,10 @@ static struct snd_info_entry_ops snd_mixart_proc_ops_BA1 = {
}; };
static void snd_mixart_proc_read(snd_info_entry_t *entry, static void snd_mixart_proc_read(struct snd_info_entry *entry,
snd_info_buffer_t * buffer) struct snd_info_buffer *buffer)
{ {
mixart_t *chip = entry->private_data; struct snd_mixart *chip = entry->private_data;
u32 ref; u32 ref;
snd_iprintf(buffer, "Digigram miXart (alsa card %d)\n\n", chip->chip_idx); snd_iprintf(buffer, "Digigram miXart (alsa card %d)\n\n", chip->chip_idx);
@ -1229,9 +1234,9 @@ static void snd_mixart_proc_read(snd_info_entry_t *entry,
} /* endif elf loaded */ } /* endif elf loaded */
} }
static void __devinit snd_mixart_proc_init(mixart_t *chip) static void __devinit snd_mixart_proc_init(struct snd_mixart *chip)
{ {
snd_info_entry_t *entry; struct snd_info_entry *entry;
/* text interface to read perf and temp meters */ /* text interface to read perf and temp meters */
if (! snd_card_proc_new(chip->card, "board_info", &entry)) { if (! snd_card_proc_new(chip->card, "board_info", &entry)) {
@ -1263,7 +1268,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id) const struct pci_device_id *pci_id)
{ {
static int dev; static int dev;
mixart_mgr_t *mgr; struct mixart_mgr *mgr;
unsigned int i; unsigned int i;
int err; int err;
size_t size; size_t size;
@ -1338,12 +1343,12 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
init_MUTEX(&mgr->setup_mutex); init_MUTEX(&mgr->setup_mutex);
/* init message taslket */ /* init message taslket */
tasklet_init( &mgr->msg_taskq, snd_mixart_msg_tasklet, (unsigned long) mgr); tasklet_init(&mgr->msg_taskq, snd_mixart_msg_tasklet, (unsigned long) mgr);
/* card assignment */ /* card assignment */
mgr->num_cards = MIXART_MAX_CARDS; /* 4 FIXME: configurable? */ mgr->num_cards = MIXART_MAX_CARDS; /* 4 FIXME: configurable? */
for (i = 0; i < mgr->num_cards; i++) { for (i = 0; i < mgr->num_cards; i++) {
snd_card_t *card; struct snd_card *card;
char tmpid[16]; char tmpid[16];
int idx; int idx;
@ -1384,7 +1389,8 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
mgr->board_type = MIXART_DAUGHTER_TYPE_NONE; mgr->board_type = MIXART_DAUGHTER_TYPE_NONE;
/* create array of streaminfo */ /* create array of streaminfo */
size = PAGE_ALIGN( (MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS * sizeof(mixart_flowinfo_t)) ); size = PAGE_ALIGN( (MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS *
sizeof(struct mixart_flowinfo)) );
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
size, &mgr->flowinfo) < 0) { size, &mgr->flowinfo) < 0) {
snd_mixart_free(mgr); snd_mixart_free(mgr);
@ -1394,7 +1400,8 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
memset(mgr->flowinfo.area, 0, size); memset(mgr->flowinfo.area, 0, size);
/* create array of bufferinfo */ /* create array of bufferinfo */
size = PAGE_ALIGN( (MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS * sizeof(mixart_bufferinfo_t)) ); size = PAGE_ALIGN( (MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS *
sizeof(struct mixart_bufferinfo)) );
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
size, &mgr->bufferinfo) < 0) { size, &mgr->bufferinfo) < 0) {
snd_mixart_free(mgr); snd_mixart_free(mgr);

View File

@ -32,21 +32,7 @@
/* /*
*/ */
#define mixart_t_magic 0xa17a3e01 struct mixart_uid {
#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
{
u32 object_id; u32 object_id;
u32 desc; u32 desc;
}; };
@ -58,7 +44,6 @@ struct mem_area {
}; };
typedef struct mixart_route mixart_route_t;
struct mixart_route { struct mixart_route {
unsigned char connected; unsigned char connected;
unsigned char phase_inv; 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) */ #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; unsigned int num_cards;
mixart_t *chip[MIXART_MAX_CARDS]; struct snd_mixart *chip[MIXART_MAX_CARDS];
struct pci_dev *pci; struct pci_dev *pci;
@ -118,7 +103,7 @@ struct snd_mixart_mgr {
struct snd_dma_buffer flowinfo; struct snd_dma_buffer flowinfo;
struct snd_dma_buffer bufferinfo; struct snd_dma_buffer bufferinfo;
mixart_uid_t uid_console_manager; struct mixart_uid uid_console_manager;
int sample_rate; int sample_rate;
int ref_count_rate; int ref_count_rate;
@ -151,9 +136,9 @@ struct snd_mixart_mgr {
#define MIXART_NOTIFY_SUBS_MASK 0x007F #define MIXART_NOTIFY_SUBS_MASK 0x007F
struct snd_mixart_stream { struct mixart_stream {
snd_pcm_substream_t *substream; struct snd_pcm_substream *substream;
mixart_pipe_t *pipe; struct mixart_pipe *pipe;
int pcm_number; int pcm_number;
int status; /* nothing, running, draining */ int status; /* nothing, running, draining */
@ -173,11 +158,11 @@ enum mixart_pipe_status {
PIPE_CLOCK_SET PIPE_CLOCK_SET
}; };
struct snd_mixart_pipe { struct mixart_pipe {
mixart_uid_t group_uid; /* id of the pipe, as returned by embedded */ struct mixart_uid group_uid; /* id of the pipe, as returned by embedded */
int stream_count; int stream_count;
mixart_uid_t uid_left_connector; /* UID's for the audio connectors */ struct mixart_uid uid_left_connector; /* UID's for the audio connectors */
mixart_uid_t uid_right_connector; struct mixart_uid uid_right_connector;
enum mixart_pipe_status status; enum mixart_pipe_status status;
int references; /* number of subs openned */ int references; /* number of subs openned */
int monitoring; /* pipe used for monitoring issue */ int monitoring; /* pipe used for monitoring issue */
@ -185,28 +170,28 @@ struct snd_mixart_pipe {
struct snd_mixart { struct snd_mixart {
snd_card_t *card; struct snd_card *card;
mixart_mgr_t *mgr; struct mixart_mgr *mgr;
int chip_idx; /* zero based */ 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 */ struct snd_pcm *pcm; /* PCM analog i/o */
snd_pcm_t *pcm_dig; /* PCM digital i/o */ struct snd_pcm *pcm_dig; /* PCM digital i/o */
/* allocate stereo pipe for instance */ /* allocate stereo pipe for instance */
mixart_pipe_t pipe_in_ana; struct mixart_pipe pipe_in_ana;
mixart_pipe_t pipe_out_ana; struct mixart_pipe pipe_out_ana;
/* if AES/EBU daughter board is available, additional pipes possible on pcm_dig */ /* if AES/EBU daughter board is available, additional pipes possible on pcm_dig */
mixart_pipe_t pipe_in_dig; struct mixart_pipe pipe_in_dig;
mixart_pipe_t pipe_out_dig; struct mixart_pipe pipe_out_dig;
mixart_stream_t playback_stream[MIXART_PCM_TOTAL][MIXART_PLAYBACK_STREAMS]; /* 0 = pcm, 1 = pcm_dig */ struct mixart_stream 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 capture_stream[MIXART_PCM_TOTAL]; /* 0 = pcm, 1 = pcm_dig */
/* UID's for the physical io's */ /* UID's for the physical io's */
mixart_uid_t uid_out_analog_physio; struct mixart_uid uid_out_analog_physio;
mixart_uid_t uid_in_analog_physio; struct mixart_uid uid_in_analog_physio;
int analog_playback_active[2]; /* Mixer : Master Playback active (!mute) */ int analog_playback_active[2]; /* Mixer : Master Playback active (!mute) */
int analog_playback_volume[2]; /* Mixer : Master Playback Volume */ int analog_playback_volume[2]; /* Mixer : Master Playback Volume */
@ -235,8 +220,8 @@ struct mixart_flowinfo
}; };
/* exported */ /* exported */
int snd_mixart_create_pcm(mixart_t* chip); int snd_mixart_create_pcm(struct snd_mixart * chip);
mixart_pipe_t* snd_mixart_add_ref_pipe( mixart_t *chip, int pcm_number, int capture, int monitoring); 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( mixart_mgr_t *mgr, mixart_pipe_t *pipe, int monitoring); int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr, struct mixart_pipe *pipe, int monitoring);
#endif /* __SOUND_MIXART_H */ #endif /* __SOUND_MIXART_H */

View File

@ -44,7 +44,7 @@
#define MSG_CANCEL_NOTIFY_MASK 0x80000000 /* this bit is set for a notification that has been canceled */ #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 */ /* read the message frame fifo */
u32 headptr, tailptr; u32 headptr, tailptr;
@ -69,7 +69,8 @@ static int retrieve_msg_frame(mixart_mgr_t *mgr, u32 *msg_frame)
return 1; 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; unsigned long flags;
u32 headptr; 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 * send a message to miXart. return: the msg_frame used for this message
*/ */
/* call with mgr->msg_lock held! */ /* call with mgr->msg_lock held! */
static int send_msg( mixart_mgr_t *mgr, static int send_msg( struct mixart_mgr *mgr,
mixart_msg_t *msg, struct mixart_msg *msg,
int max_answersize, int max_answersize,
int mark_pending, int mark_pending,
u32 *msg_event) 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 */ u32 msg_frame = 0; /* set to 0, so it's no notification to wait for, but the answer */
int err; int err;
wait_queue_t wait; 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; 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.message_id = 0;
resp.uid = (mixart_uid_t){0,0}; resp.uid = (struct mixart_uid){0,0};
resp.data = resp_data; resp.data = resp_data;
resp.size = max_resp_size; 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; int err;
wait_queue_t wait; 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; u32 message_frame;
unsigned long flags; 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); err = send_msg(mgr, request, MSG_DEFAULT_SIZE, 0, &message_frame);
spin_unlock_irqrestore(&mgr->msg_lock, flags); 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); atomic_inc(&mgr->msg_processed);
return err; 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]; 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); struct mixart_mgr *mgr = ( struct mixart_mgr*)(arg);
mixart_msg_t resp; struct mixart_msg resp;
u32 msg, addr, type; u32 msg, addr, type;
int err; 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) 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; int err;
mixart_msg_t resp; struct mixart_msg resp;
u32 msg; u32 msg;
u32 it_reg; 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) { if(resp.message_id == MSG_SERVICES_TIMER_NOTIFY) {
int i; 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++) { 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 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 */ unsigned int is_capture = ((buffer_id & MIXART_NOTIFY_CAPT_MASK) != 0); /* playback == 0 / capture == 1 */
mixart_t *chip = mgr->chip[chip_number]; struct snd_mixart *chip = mgr->chip[chip_number];
mixart_stream_t *stream; struct mixart_stream *stream;
if ((chip_number >= mgr->num_cards) || (pcm_number >= MIXART_PCM_TOTAL) || (sub_number >= MIXART_PLAYBACK_STREAMS)) { 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", 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]; stream = &chip->playback_stream[pcm_number][sub_number];
if (stream->substream && (stream->status == MIXART_STREAM_STATUS_RUNNING)) { 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; int elapsed = 0;
u64 sample_count = ((u64)notify->streams[i].sample_pos_high_part) << 32; u64 sample_count = ((u64)notify->streams[i].sample_pos_high_part) << 32;
sample_count |= notify->streams[i].sample_pos_low_part; 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_HOST_RSC_PROTECTION ) );
writel( 0, MIXART_MEM( mgr, MSG_AGENT_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; 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 */ /* no more interrupts on outbound messagebox */
writel_le( MIXART_HOST_ALL_INTERRUPT_MASKED, MIXART_REG( mgr, MIXART_PCI_OMIMR_OFFSET)); writel_le( MIXART_HOST_ALL_INTERRUPT_MASKED, MIXART_REG( mgr, MIXART_PCI_OMIMR_OFFSET));
return; return;
} }
void snd_mixart_reset_board(mixart_mgr_t *mgr) void snd_mixart_reset_board(struct mixart_mgr *mgr)
{ {
/* reset miXart */ /* reset miXart */
writel_be( 1, MIXART_REG(mgr, MIXART_BA1_BRUTAL_RESET_OFFSET) ); writel_be( 1, MIXART_REG(mgr, MIXART_BA1_BRUTAL_RESET_OFFSET) );

View File

@ -63,25 +63,23 @@ enum mixart_message_id {
}; };
typedef struct mixart_msg mixart_msg_t;
struct mixart_msg struct mixart_msg
{ {
u32 message_id; u32 message_id;
mixart_uid_t uid; struct mixart_uid uid;
void* data; void* data;
size_t size; size_t size;
}; };
/* structs used to communicate with miXart */ /* structs used to communicate with miXart */
typedef struct mixart_enum_connector_resp mixart_enum_connector_resp_t;
struct mixart_enum_connector_resp struct mixart_enum_connector_resp
{ {
u32 error_code; u32 error_code;
u32 first_uid_offset; u32 first_uid_offset;
u32 uid_count; u32 uid_count;
u32 current_uid_index; u32 current_uid_index;
mixart_uid_t uid[MIXART_MAX_PHYS_CONNECTORS]; struct mixart_uid uid[MIXART_MAX_PHYS_CONNECTORS];
} __attribute__((packed)); } __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_M_20_0_TO_HEX 0xc1a00000 /* -20.0f */
#define MIXART_FLOAT____0_0_TO_HEX 0x00000000 /* 0.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 struct mixart_audio_info_req
{ {
u32 line_max_level; /* float */ u32 line_max_level; /* float */
@ -98,7 +95,6 @@ struct mixart_audio_info_req
u32 cd_max_level; /* float */ u32 cd_max_level; /* float */
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_analog_hw_info mixart_analog_hw_info_t;
struct mixart_analog_hw_info struct mixart_analog_hw_info
{ {
u32 is_present; u32 is_present;
@ -111,7 +107,6 @@ struct mixart_analog_hw_info
u32 zero_var; /* float */ u32 zero_var; /* float */
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_digital_hw_info mixart_digital_hw_info_t;
struct mixart_digital_hw_info struct mixart_digital_hw_info
{ {
u32 hw_connection_type; u32 hw_connection_type;
@ -120,37 +115,33 @@ struct mixart_digital_hw_info
u32 reserved; u32 reserved;
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_analog_info mixart_analog_info_t;
struct mixart_analog_info struct mixart_analog_info
{ {
u32 type_mask; u32 type_mask;
mixart_analog_hw_info_t micro_info; struct mixart_analog_hw_info micro_info;
mixart_analog_hw_info_t line_info; struct mixart_analog_hw_info line_info;
mixart_analog_hw_info_t cd_info; struct mixart_analog_hw_info cd_info;
u32 analog_level_present; u32 analog_level_present;
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_digital_info mixart_digital_info_t;
struct mixart_digital_info struct mixart_digital_info
{ {
u32 type_mask; u32 type_mask;
mixart_digital_hw_info_t aes_info; struct mixart_digital_hw_info aes_info;
mixart_digital_hw_info_t adat_info; struct mixart_digital_hw_info adat_info;
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_audio_info mixart_audio_info_t;
struct mixart_audio_info struct mixart_audio_info
{ {
u32 clock_type_mask; u32 clock_type_mask;
mixart_analog_info_t analog_info; struct mixart_analog_info analog_info;
mixart_digital_info_t digital_info; struct mixart_digital_info digital_info;
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_audio_info_resp mixart_audio_info_resp_t;
struct mixart_audio_info_resp struct mixart_audio_info_resp
{ {
u32 txx_status; u32 txx_status;
mixart_audio_info_t info; struct mixart_audio_info info;
} __attribute__((packed)); } __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__4_0_TO_HEX 0x40800000 /* +4.0f */
#define MIXART_FLOAT_P__8_0_TO_HEX 0x41000000 /* +8.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 struct mixart_stream_info
{ {
u32 size_max_byte_frame; u32 size_max_byte_frame;
@ -169,7 +159,6 @@ struct mixart_stream_info
/* MSG_STREAM_ADD_INPUT_GROUP */ /* MSG_STREAM_ADD_INPUT_GROUP */
/* MSG_STREAM_ADD_OUTPUT_GROUP */ /* MSG_STREAM_ADD_OUTPUT_GROUP */
typedef struct mixart_streaming_group_req mixart_streaming_group_req_t;
struct mixart_streaming_group_req struct mixart_streaming_group_req
{ {
u32 stream_count; u32 stream_count;
@ -177,33 +166,30 @@ struct mixart_streaming_group_req
u32 user_grp_number; u32 user_grp_number;
u32 first_phys_audio; u32 first_phys_audio;
u32 latency; u32 latency;
mixart_stream_info_t stream_info[32]; struct mixart_stream_info stream_info[32];
mixart_uid_t connector; struct mixart_uid connector;
u32 flow_entry[32]; u32 flow_entry[32];
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_stream_desc mixart_stream_desc_t;
struct mixart_stream_desc struct mixart_stream_desc
{ {
mixart_uid_t stream_uid; struct mixart_uid stream_uid;
u32 stream_desc; u32 stream_desc;
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_streaming_group mixart_streaming_group_t;
struct mixart_streaming_group struct mixart_streaming_group
{ {
u32 status; u32 status;
mixart_uid_t group; struct mixart_uid group;
u32 pipe_desc; u32 pipe_desc;
u32 stream_count; u32 stream_count;
mixart_stream_desc_t stream[32]; struct mixart_stream_desc stream[32];
} __attribute__((packed)); } __attribute__((packed));
/* MSG_STREAM_DELETE_GROUP */ /* MSG_STREAM_DELETE_GROUP */
/* request : mixart_uid_t group */ /* request : mixart_uid_t group */
typedef struct mixart_delete_group_resp mixart_delete_group_resp_t;
struct mixart_delete_group_resp struct mixart_delete_group_resp
{ {
u32 status; u32 status;
@ -217,55 +203,49 @@ struct mixart_delete_group_resp
MSG_STREAM_STOP_OUTPUT_STAGE_PACKET = 0x130000 + 11, MSG_STREAM_STOP_OUTPUT_STAGE_PACKET = 0x130000 + 11,
*/ */
typedef struct mixart_fx_couple_uid mixart_fx_couple_uid_t;
struct mixart_fx_couple_uid struct mixart_fx_couple_uid
{ {
mixart_uid_t uid_fx_code; struct mixart_uid uid_fx_code;
mixart_uid_t uid_fx_data; struct mixart_uid uid_fx_data;
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_txx_stream_desc mixart_txx_stream_desc_t;
struct mixart_txx_stream_desc struct mixart_txx_stream_desc
{ {
mixart_uid_t uid_pipe; struct mixart_uid uid_pipe;
u32 stream_idx; u32 stream_idx;
u32 fx_number; u32 fx_number;
mixart_fx_couple_uid_t uid_fx[4]; struct mixart_fx_couple_uid uid_fx[4];
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_flow_info mixart_flow_info_t;
struct mixart_flow_info struct mixart_flow_info
{ {
mixart_txx_stream_desc_t stream_desc; struct mixart_txx_stream_desc stream_desc;
u32 flow_entry; u32 flow_entry;
u32 flow_phy_addr; u32 flow_phy_addr;
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_stream_state_req mixart_stream_state_req_t;
struct mixart_stream_state_req struct mixart_stream_state_req
{ {
u32 delayed; u32 delayed;
u64 scheduler; u64 scheduler;
u32 reserved4np[3]; u32 reserved4np[3];
u32 stream_count; /* set to 1 for instance */ 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)); } __attribute__((packed));
/* MSG_STREAM_START_STREAM_GRP_PACKET = 0x130000 + 6 /* MSG_STREAM_START_STREAM_GRP_PACKET = 0x130000 + 6
MSG_STREAM_STOP_STREAM_GRP_PACKET = 0x130000 + 9 MSG_STREAM_STOP_STREAM_GRP_PACKET = 0x130000 + 9
*/ */
typedef struct mixart_group_state_req mixart_group_state_req_t;
struct mixart_group_state_req struct mixart_group_state_req
{ {
u32 delayed; u32 delayed;
u64 scheduler; u64 scheduler;
u32 reserved4np[2]; u32 reserved4np[2];
u32 pipe_count; /* set to 1 for instance */ 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)); } __attribute__((packed));
typedef struct mixart_group_state_resp mixart_group_state_resp_t;
struct mixart_group_state_resp struct mixart_group_state_resp
{ {
u32 txx_status; u32 txx_status;
@ -276,7 +256,6 @@ struct mixart_group_state_resp
/* Structures used by the MSG_SERVICES_TIMER_NOTIFY command */ /* Structures used by the MSG_SERVICES_TIMER_NOTIFY command */
typedef struct mixart_sample_pos mixart_sample_pos_t;
struct mixart_sample_pos struct mixart_sample_pos
{ {
u32 buffer_id; u32 buffer_id;
@ -285,11 +264,10 @@ struct mixart_sample_pos
u32 sample_pos_low_part; u32 sample_pos_low_part;
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_timer_notify mixart_timer_notify_t;
struct mixart_timer_notify struct mixart_timer_notify
{ {
u32 stream_count; 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)); } __attribute__((packed));
@ -298,11 +276,10 @@ struct mixart_timer_notify
/* request is a uid with desc = MSG_CONSOLE_MANAGER | cardindex */ /* request is a uid with desc = MSG_CONSOLE_MANAGER | cardindex */
typedef struct mixart_return_uid mixart_return_uid_t;
struct mixart_return_uid struct mixart_return_uid
{ {
u32 error_code; u32 error_code;
mixart_uid_t uid; struct mixart_uid uid;
} __attribute__((packed)); } __attribute__((packed));
/* MSG_CLOCK_CHECK_PROPERTIES = 0x200001, /* 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 struct mixart_clock_properties
{ {
u32 error_code; u32 error_code;
@ -336,17 +312,16 @@ struct mixart_clock_properties
u32 reference_frequency; u32 reference_frequency;
u32 clock_generic_type; u32 clock_generic_type;
u32 clock_mode; u32 clock_mode;
mixart_uid_t uid_clock_source; struct mixart_uid uid_clock_source;
mixart_uid_t uid_event_source; struct mixart_uid uid_event_source;
u32 event_mode; u32 event_mode;
u32 synchro_signal_presence; u32 synchro_signal_presence;
u32 format; u32 format;
u32 board_mask; u32 board_mask;
u32 nb_callers; /* set to 1 (see below) */ u32 nb_callers; /* set to 1 (see below) */
mixart_uid_t uid_caller[1]; struct mixart_uid uid_caller[1];
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_clock_properties_resp mixart_clock_properties_resp_t;
struct mixart_clock_properties_resp struct mixart_clock_properties_resp
{ {
u32 status; u32 status;
@ -388,7 +363,6 @@ enum mixart_sample_type {
ST_INTEGER_32LE ST_INTEGER_32LE
}; };
typedef struct mixart_stream_param_desc mixart_stream_param_desc_t;
struct mixart_stream_param_desc struct mixart_stream_param_desc
{ {
u32 coding_type; /* use enum mixart_coding_type */ u32 coding_type; /* use enum mixart_coding_type */
@ -432,7 +406,7 @@ struct mixart_stream_param_desc
u32 reserved4np[3]; u32 reserved4np[3];
u32 pipe_count; /* set to 1 (array size !) */ u32 pipe_count; /* set to 1 (array size !) */
u32 stream_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)); } __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 struct mixart_get_out_audio_level
{ {
u32 txx_status; 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_M1_MASK 0x10
#define MIXART_AUDIO_LEVEL_MUTE_M2_MASK 0x20 #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 struct mixart_set_out_audio_level
{ {
u32 delayed; 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) */ #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 struct mixart_uid_enumeration
{ {
u32 error_code; u32 error_code;
u32 first_uid_offset; u32 first_uid_offset;
u32 nb_uid; u32 nb_uid;
u32 current_uid_index; u32 current_uid_index;
mixart_uid_t uid[MIXART_MAX_PHYS_IO]; struct mixart_uid uid[MIXART_MAX_PHYS_IO];
} __attribute__((packed)); } __attribute__((packed));
@ -502,42 +473,38 @@ struct mixart_uid_enumeration
MSG_PHYSICALIO_GET_LEVEL = 0x0F000C, MSG_PHYSICALIO_GET_LEVEL = 0x0F000C,
*/ */
typedef struct mixart_io_channel_level mixart_io_channel_level_t;
struct mixart_io_channel_level struct mixart_io_channel_level
{ {
u32 analog_level; /* float */ u32 analog_level; /* float */
u32 unused[2]; u32 unused[2];
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_io_level mixart_io_level_t;
struct mixart_io_level struct mixart_io_level
{ {
s32 channel; /* 0=left, 1=right, -1=both, -2=both same */ 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)); } __attribute__((packed));
/* MSG_STREAM_SET_IN_AUDIO_LEVEL = 0x130015, /* 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 struct mixart_in_audio_level_info
{ {
mixart_uid_t connector; struct mixart_uid connector;
u32 valid_mask1; u32 valid_mask1;
u32 valid_mask2; u32 valid_mask2;
u32 digital_level; u32 digital_level;
u32 analog_level; u32 analog_level;
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_set_in_audio_level_req mixart_set_in_audio_level_req_t;
struct mixart_set_in_audio_level_req struct mixart_set_in_audio_level_req
{ {
u32 delayed; u32 delayed;
u64 scheduler; u64 scheduler;
u32 audio_count; /* set to <= 2 */ u32 audio_count; /* set to <= 2 */
u32 reserved4np; u32 reserved4np;
mixart_in_audio_level_info_t level[2]; struct mixart_in_audio_level_info level[2];
} __attribute__((packed)); } __attribute__((packed));
/* response is a 32 bit status */ /* 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_1 0x40
#define MIXART_OUT_STREAM_SET_LEVEL_MUTE_2 0x80 #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 struct mixart_out_stream_level_info
{ {
u32 valid_mask1; u32 valid_mask1;
@ -571,37 +537,35 @@ struct mixart_out_stream_level_info
u32 mute2; u32 mute2;
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_set_out_stream_level mixart_set_out_stream_level_t;
struct mixart_set_out_stream_level struct mixart_set_out_stream_level
{ {
mixart_txx_stream_desc_t desc; struct mixart_txx_stream_desc desc;
mixart_out_stream_level_info_t out_level; struct mixart_out_stream_level_info out_level;
} __attribute__((packed)); } __attribute__((packed));
typedef struct mixart_set_out_stream_level_req mixart_set_out_stream_level_req_t;
struct mixart_set_out_stream_level_req struct mixart_set_out_stream_level_req
{ {
u32 delayed; u32 delayed;
u64 scheduler; u64 scheduler;
u32 reserved4np[2]; u32 reserved4np[2];
u32 nb_of_stream; /* set to 1 */ 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)); } __attribute__((packed));
/* response to this request is a u32 status value */ /* response to this request is a u32 status value */
/* exported */ /* exported */
void snd_mixart_init_mailbox(mixart_mgr_t *mgr); void snd_mixart_init_mailbox(struct mixart_mgr *mgr);
void snd_mixart_exit_mailbox(mixart_mgr_t *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(struct mixart_mgr *mgr, struct mixart_msg *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_wait_notif(struct mixart_mgr *mgr, struct mixart_msg *request, u32 notif_event);
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);
irqreturn_t snd_mixart_interrupt(int irq, void *dev_id, struct pt_regs *regs); 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 */ #endif /* __SOUND_MIXART_CORE_H */

View File

@ -40,7 +40,9 @@
* @param value value * @param value value
* @param timeout timeout in centisenconds * @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); unsigned long end_time = jiffies + (timeout * HZ / 100);
u32 read; 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 structures needed to upload elf code packets
*/ */
typedef struct snd_mixart_elf32_ehdr snd_mixart_elf32_ehdr_t;
struct snd_mixart_elf32_ehdr { struct snd_mixart_elf32_ehdr {
u8 e_ident[16]; u8 e_ident[16];
u16 e_type; u16 e_type;
@ -85,8 +85,6 @@ struct snd_mixart_elf32_ehdr {
u16 e_shstrndx; u16 e_shstrndx;
}; };
typedef struct snd_mixart_elf32_phdr snd_mixart_elf32_phdr_t;
struct snd_mixart_elf32_phdr { struct snd_mixart_elf32_phdr {
u32 p_type; u32 p_type;
u32 p_offset; u32 p_offset;
@ -98,19 +96,19 @@ struct snd_mixart_elf32_phdr {
u32 p_align; 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'}; 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; 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++ ) for( i=0; i<4; i++ )
if ( elf32_magic_number[i] != elf_header->e_ident[i] ) if ( elf32_magic_number[i] != elf_header->e_ident[i] )
return -EINVAL; return -EINVAL;
if( elf_header->e_phoff != 0 ) { 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++ ) { 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)); 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_ANA_AUDIO_ID 0
#define MIXART_FIRST_DIG_AUDIO_ID 8 #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; u32 k;
int err; int err;
mixart_msg_t request; struct mixart_msg request;
mixart_enum_connector_resp_t *connector; struct mixart_enum_connector_resp *connector;
mixart_audio_info_req_t *audio_info_req; struct mixart_audio_info_req *audio_info_req;
mixart_audio_info_resp_t *audio_info; struct mixart_audio_info_resp *audio_info;
connector = kmalloc(sizeof(*connector), GFP_KERNEL); connector = kmalloc(sizeof(*connector), GFP_KERNEL);
audio_info_req = kmalloc(sizeof(*audio_info_req), 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; audio_info_req->cd_max_level = MIXART_FLOAT____0_0_TO_HEX;
request.message_id = MSG_SYSTEM_ENUM_PLAY_CONNECTOR; 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.data = NULL;
request.size = 0; request.size = 0;
@ -171,7 +169,7 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr)
} }
for(k=0; k < connector->uid_count; k++) { for(k=0; k < connector->uid_count; k++) {
mixart_pipe_t* pipe; struct mixart_pipe *pipe;
if(k < MIXART_FIRST_DIG_AUDIO_ID) { if(k < MIXART_FIRST_DIG_AUDIO_ID) {
pipe = &mgr->chip[k/2]->pipe_out_ana; 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.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.data = NULL;
request.size = 0; request.size = 0;
@ -213,7 +211,7 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr)
} }
for(k=0; k < connector->uid_count; k++) { for(k=0; k < connector->uid_count; k++) {
mixart_pipe_t* pipe; struct mixart_pipe *pipe;
if(k < MIXART_FIRST_DIG_AUDIO_ID) { if(k < MIXART_FIRST_DIG_AUDIO_ID) {
pipe = &mgr->chip[k/2]->pipe_in_ana; pipe = &mgr->chip[k/2]->pipe_in_ana;
@ -251,14 +249,14 @@ static int mixart_enum_connectors(mixart_mgr_t *mgr)
return err; return err;
} }
static int mixart_enum_physio(mixart_mgr_t *mgr) static int mixart_enum_physio(struct mixart_mgr *mgr)
{ {
u32 k; u32 k;
int err; int err;
mixart_msg_t request; struct mixart_msg request;
mixart_uid_t get_console_mgr; struct mixart_uid get_console_mgr;
mixart_return_uid_t console_mgr; struct mixart_return_uid console_mgr;
mixart_uid_enumeration_t phys_io; struct mixart_uid_enumeration phys_io;
/* get the uid for the console manager */ /* get the uid for the console manager */
get_console_mgr.object_id = 0; 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; mgr->uid_console_manager = console_mgr.uid;
request.message_id = MSG_SYSTEM_ENUM_PHYSICAL_IO; 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.data = &console_mgr.uid;
request.size = sizeof(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; u32 k;
int err; int err;
mixart_msg_t request; struct mixart_msg request;
if((err = mixart_enum_connectors(mgr)) < 0) return err; 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) */ /* send a synchro command to card (necessary to do this before first MSG_STREAM_START_STREAM_GRP_PACKET) */
/* though why not here */ /* though why not here */
request.message_id = MSG_SYSTEM_SEND_SYNCHRO_CMD; 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.data = NULL;
request.size = 0; request.size = 0;
/* this command has no data. response is a 32 bit status */ /* 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) */ /* firmware base addresses (when hard coded) */
#define MIXART_MOTHERBOARD_XLX_BASE_ADDRESS 0x00600000 #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; int err, card_index;
u32 status_xilinx, status_elf, status_daught; 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*/ /* create devices and mixer in accordance with HW options*/
for (card_index = 0; card_index < mgr->num_cards; card_index++) { 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) if ((err = snd_mixart_create_pcm(chip)) < 0)
return err; 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 #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] = { static char *fw_files[3] = {
"miXart8.xlx", "miXart8.elf", "miXart8AES.xlx" "miXart8.xlx", "miXart8.elf", "miXart8AES.xlx"
@ -573,19 +571,20 @@ int snd_mixart_setup_firmware(mixart_mgr_t *mgr)
/* miXart hwdep interface id string */ /* miXart hwdep interface id string */
#define SND_MIXART_HWDEP_ID "miXart Loader" #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; 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; 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"); strcpy(info->id, "miXart");
info->num_dsps = MIXART_HARDW_FILES_MAX_INDEX; 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; 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; struct firmware fw;
int err; int err;
@ -622,10 +622,10 @@ static int mixart_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp)
return err; return err;
} }
int snd_mixart_setup_firmware(mixart_mgr_t *mgr) int snd_mixart_setup_firmware(struct mixart_mgr *mgr)
{ {
int err; int err;
snd_hwdep_t *hw; struct snd_hwdep *hw;
/* only create hwdep interface for first cardX (see "index" module parameter)*/ /* 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) if ((err = snd_hwdep_new(mgr->chip[0]->card, SND_MIXART_HWDEP_ID, 0, &hw)) < 0)

View File

@ -140,6 +140,6 @@
#define MIXART_OIDI 0x008 /* 0000 0000 1000 */ #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 */ #endif /* __SOUND_MIXART_HWDEP_H */

View File

@ -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_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 */ #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; int i, err;
mixart_msg_t request; struct mixart_msg request;
mixart_io_level_t io_level; struct mixart_io_level io_level;
mixart_return_uid_t resp; struct mixart_return_uid resp;
memset(&io_level, 0, sizeof(io_level)); memset(&io_level, 0, sizeof(io_level));
io_level.channel = -1; /* left and right */ 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 * 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->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2; uinfo->count = 2;
@ -350,9 +350,9 @@ static int mixart_analog_vol_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t
return 0; 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); down(&chip->mgr->mixer_mutex);
if(kcontrol->private_value == 0) { /* playback */ if(kcontrol->private_value == 0) { /* playback */
ucontrol->value.integer.value[0] = chip->analog_playback_volume[0]; 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; 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 changed = 0;
int is_capture, i; 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; 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, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
/* name will be filled later */ /* name will be filled later */
.info = mixart_analog_vol_info, .info = mixart_analog_vol_info,
@ -395,7 +395,7 @@ static snd_kcontrol_new_t mixart_control_analog_level = {
}; };
/* shared */ /* 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->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 2; uinfo->count = 2;
@ -404,9 +404,9 @@ static int mixart_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
return 0; 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); down(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->analog_playback_active[0]; 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; 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; int i, changed = 0;
down(&chip->mgr->mixer_mutex); down(&chip->mgr->mixer_mutex);
for(i=0; i<2; i++) { 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; 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, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Playback Switch", .name = "Master Playback Switch",
.info = mixart_sw_info, /* shared */ .info = mixart_sw_info, /* shared */
@ -703,14 +703,14 @@ static u32 mixart_digital_level[256] = {
#define MIXART_DIGITAL_ZERO_LEVEL 219 /* 0.0 dB */ #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 err, i;
int volume[2]; int volume[2];
mixart_msg_t request; struct mixart_msg request;
mixart_set_out_stream_level_req_t set_level; struct mixart_set_out_stream_level_req set_level;
u32 status; u32 status;
mixart_pipe_t *pipe; struct mixart_pipe *pipe;
memset(&set_level, 0, sizeof(set_level)); memset(&set_level, 0, sizeof(set_level));
set_level.nb_of_stream = 1; 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]]; 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.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.data = &set_level;
request.size = sizeof(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; 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; int err, i, idx;
mixart_pipe_t* pipe; struct mixart_pipe *pipe;
mixart_msg_t request; struct mixart_msg request;
mixart_set_in_audio_level_req_t set_level; struct mixart_set_in_audio_level_req set_level;
u32 status; u32 status;
if(is_aes) { 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.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.data = &set_level;
request.size = sizeof(set_level); request.size = sizeof(set_level);
@ -798,7 +798,7 @@ int mixart_update_capture_stream_level(mixart_t* chip, int is_aes)
/* shared */ /* 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->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2; 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_REC_MASK 1
#define MIXART_VOL_AES_MASK 2 #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 idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */
int *stored_volume; int *stored_volume;
int is_capture = kcontrol->private_value & MIXART_VOL_REC_MASK; 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; 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 idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */
int changed = 0; int changed = 0;
int is_capture = kcontrol->private_value & MIXART_VOL_REC_MASK; 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; 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, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
/* name will be filled later */ /* 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 */ int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */
snd_assert ( idx < MIXART_PLAYBACK_STREAMS ); snd_assert ( idx < MIXART_PLAYBACK_STREAMS );
down(&chip->mgr->mixer_mutex); 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; 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 changed = 0;
int is_aes = kcontrol->private_value & MIXART_VOL_AES_MASK; int is_aes = kcontrol->private_value & MIXART_VOL_AES_MASK;
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */ 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; 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, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
/* name will be filled later */ /* name will be filled later */
.count = MIXART_PLAYBACK_STREAMS, .count = MIXART_PLAYBACK_STREAMS,
@ -920,11 +920,11 @@ static snd_kcontrol_new_t mixart_control_pcm_switch = {
.put = mixart_pcm_sw_put .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; int err;
mixart_msg_t request; struct mixart_msg request;
mixart_set_out_audio_level_t audio_level; struct mixart_set_out_audio_level audio_level;
u32 resp; u32 resp;
if(chip->pipe_out_ana.status == PIPE_UNDEFINED) 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 * 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); down(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->monitoring_volume[0]; ucontrol->value.integer.value[0] = chip->monitoring_volume[0];
ucontrol->value.integer.value[1] = chip->monitoring_volume[1]; 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; 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 changed = 0;
int i; int i;
down(&chip->mgr->mixer_mutex); 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; 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, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Monitoring Volume", .name = "Monitoring Volume",
.info = mixart_digital_vol_info, /* shared */ .info = mixart_digital_vol_info, /* shared */
@ -992,9 +992,9 @@ static snd_kcontrol_new_t mixart_control_monitor_vol = {
* monitoring switch control * 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); down(&chip->mgr->mixer_mutex);
ucontrol->value.integer.value[0] = chip->monitoring_active[0]; ucontrol->value.integer.value[0] = chip->monitoring_active[0];
ucontrol->value.integer.value[1] = chip->monitoring_active[1]; 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; 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 changed = 0;
int i; int i;
down(&chip->mgr->mixer_mutex); 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); 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, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Monitoring Switch", .name = "Monitoring Switch",
.info = mixart_sw_info, /* shared */ .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 */ /* analog volumes can be set even if there is no pipe */
mixart_update_analog_audio_level(chip, 0); 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; int err, i;
init_MUTEX(&mgr->mixer_mutex); /* can be in another place */ init_MUTEX(&mgr->mixer_mutex); /* can be in another place */
for(i=0; i<mgr->num_cards; i++) { for(i=0; i<mgr->num_cards; i++) {
snd_kcontrol_new_t temp; struct snd_kcontrol_new temp;
chip = mgr->chip[i]; chip = mgr->chip[i];
/* analog output level control */ /* analog output level control */

View File

@ -24,8 +24,8 @@
#define __SOUND_MIXART_MIXER_H #define __SOUND_MIXART_MIXER_H
/* exported */ /* exported */
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 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 snd_mixart_create_mixer(mixart_mgr_t* mgr); int snd_mixart_create_mixer(struct mixart_mgr* mgr);
#endif /* __SOUND_MIXART_MIXER_H */ #endif /* __SOUND_MIXART_MIXER_H */