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;
- mixart_group_state_resp_t group_state_resp;
- mixart_msg_t request;
+ struct mixart_group_state_req group_state;
+ struct mixart_group_state_resp group_state_resp;
+ struct mixart_msg request;
int err;
u32 system_msg_uid;
/* wait on the last MSG_SYSTEM_SEND_SYNCHRO_CMD command to be really finished */
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.size = sizeof(system_msg_uid);
else
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.size = sizeof(group_state);
/* in case of start send a synchro top */
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;
}
-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;
- mixart_clock_properties_t clock_properties;
- mixart_clock_properties_resp_t clock_prop_resp;
+ struct mixart_msg request;
+ struct mixart_clock_properties clock_properties;
+ struct mixart_clock_properties_resp clock_prop_resp;
int err;
switch(pipe->status) {
/*
* 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;
- mixart_pipe_t *pipe;
- mixart_msg_t request;
+ struct mixart_pipe *pipe;
+ struct mixart_msg request;
if(capture) {
if (pcm_number == MIXART_PCM_ANALOG) {
if( pipe->status == PIPE_UNDEFINED ) {
int err, i;
struct {
- mixart_streaming_group_req_t sgroup_req;
- mixart_streaming_group_t sgroup_resp;
+ struct mixart_streaming_group_req sgroup_req;
+ struct mixart_streaming_group sgroup_resp;
} *buf;
snd_printdd("add_ref_pipe audio chip(%d) pcm(%d)\n", chip->chip_idx, pcm_number);
if (!buf)
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.size = sizeof(buf->sgroup_req);
buf->sgroup_req.flow_entry[i] = j;
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 ! */
bufferinfo = (struct mixart_bufferinfo *)chip->mgr->bufferinfo.area;
}
-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;
if((pipe->references <= 0) && (pipe->monitoring == 0)) {
- mixart_msg_t request;
- mixart_delete_group_resp_t delete_resp;
+ struct mixart_msg request;
+ struct mixart_delete_group_resp delete_resp;
/* release the clock */
err = mixart_set_clock( mgr, pipe, 0);
}
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.size = sizeof(pipe->group_uid);
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->status = PIPE_UNDEFINED;
}
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;
- mixart_stream_state_req_t stream_state_req;
- mixart_msg_t request;
+ struct snd_mixart *chip;
+ struct mixart_stream_state_req stream_state_req;
+ struct mixart_msg request;
if(!stream->substream)
return -EINVAL;
else
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.size = sizeof(stream_state_req);
* 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) {
case SNDRV_PCM_TRIGGER_START:
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;
while (atomic_read(&mgr->msg_processed) > 0) {
/*
* 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);
- mixart_stream_t *stream = (mixart_stream_t*)subs->runtime->private_data;
+ struct snd_mixart *chip = snd_pcm_substream_chip(subs);
+ struct mixart_stream *stream = subs->runtime->private_data;
/* TODO de façon non bloquante, réappliquer les hw_params (rate, bits, codec) */
}
-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;
- mixart_t *chip;
- mixart_msg_t request;
- mixart_stream_param_desc_t stream_param;
- mixart_return_uid_t resp;
+ struct snd_mixart *chip;
+ struct mixart_msg request;
+ struct mixart_stream_param_desc stream_param;
+ struct mixart_return_uid resp;
chip = snd_pcm_substream_chip(stream->substream);
stream_param.stream_desc[0].stream_idx = stream->substream->number;
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.size = sizeof(stream_param);
/*
* HW_PARAMS callback for all pcms
*/
-static int snd_mixart_hw_params(snd_pcm_substream_t *subs,
- snd_pcm_hw_params_t *hw)
+static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
+ struct snd_pcm_hw_params *hw)
{
- mixart_t *chip = snd_pcm_substream_chip(subs);
- mixart_mgr_t *mgr = chip->mgr;
- mixart_stream_t *stream = (mixart_stream_t*)subs->runtime->private_data;
+ struct snd_mixart *chip = snd_pcm_substream_chip(subs);
+ struct mixart_mgr *mgr = chip->mgr;
+ struct mixart_stream *stream = subs->runtime->private_data;
snd_pcm_format_t format;
int err;
int channels;
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);
mixart_sync_nonblock_events(chip->mgr);
return 0;
/*
* 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 |
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START |
.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 |
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START |
};
-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);
- mixart_mgr_t *mgr = chip->mgr;
- snd_pcm_runtime_t *runtime = subs->runtime;
- snd_pcm_t *pcm = subs->pcm;
- mixart_stream_t *stream;
- mixart_pipe_t *pipe;
+ struct snd_mixart *chip = snd_pcm_substream_chip(subs);
+ struct mixart_mgr *mgr = chip->mgr;
+ struct snd_pcm_runtime *runtime = subs->runtime;
+ struct snd_pcm *pcm = subs->pcm;
+ struct mixart_stream *stream;
+ struct mixart_pipe *pipe;
int err = 0;
int pcm_number;
}
-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);
- mixart_mgr_t *mgr = chip->mgr;
- snd_pcm_runtime_t *runtime = subs->runtime;
- snd_pcm_t *pcm = subs->pcm;
- mixart_stream_t *stream;
- mixart_pipe_t *pipe;
+ struct snd_mixart *chip = snd_pcm_substream_chip(subs);
+ struct mixart_mgr *mgr = chip->mgr;
+ struct snd_pcm_runtime *runtime = subs->runtime;
+ struct snd_pcm *pcm = subs->pcm;
+ struct mixart_stream *stream;
+ struct mixart_pipe *pipe;
int err = 0;
int pcm_number;
-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);
- mixart_mgr_t *mgr = chip->mgr;
- mixart_stream_t *stream = (mixart_stream_t*)subs->runtime->private_data;
+ struct snd_mixart *chip = snd_pcm_substream_chip(subs);
+ struct mixart_mgr *mgr = chip->mgr;
+ struct mixart_stream *stream = subs->runtime->private_data;
down(&mgr->setup_mutex);
}
-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;
- mixart_stream_t *stream = (mixart_stream_t*)runtime->private_data;
+ struct snd_pcm_runtime *runtime = subs->runtime;
+ struct mixart_stream *stream = runtime->private_data;
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,
.close = snd_mixart_close,
.ioctl = snd_pcm_lib_ioctl,
.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,
.close = snd_mixart_close,
.ioctl = snd_pcm_lib_ioctl,
.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
- snd_pcm_substream_t *subs;
+ struct snd_pcm_substream *subs;
int stream;
for (stream = 0; stream < 2; stream++) {
/*
*/
-static int snd_mixart_pcm_analog(mixart_t *chip)
+static int snd_mixart_pcm_analog(struct snd_mixart *chip)
{
int err;
- snd_pcm_t *pcm;
+ struct snd_pcm *pcm;
char name[32];
sprintf(name, "miXart analog %d", chip->chip_idx);
/*
*/
-static int snd_mixart_pcm_digital(mixart_t *chip)
+static int snd_mixart_pcm_digital(struct snd_mixart *chip)
{
int err;
- snd_pcm_t *pcm;
+ struct snd_pcm *pcm;
char name[32];
sprintf(name, "miXart AES/EBU %d", chip->chip_idx);
return 0;
}
-static int snd_mixart_chip_free(mixart_t *chip)
+static int snd_mixart_chip_free(struct snd_mixart *chip)
{
kfree(chip);
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);
}
/*
*/
-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;
- mixart_t *chip;
- static snd_device_ops_t ops = {
+ struct snd_mixart *chip;
+ static struct snd_device_ops ops = {
.dev_free = snd_mixart_chip_dev_free,
};
return 0;
}
-int snd_mixart_create_pcm(mixart_t* chip)
+int snd_mixart_create_pcm(struct snd_mixart* chip)
{
int err;
/*
* 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;
/*
* 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,
struct file *file,
long long offset,
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,
struct file *file,
long long offset,
/*
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,
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 */
if(count <= 0)
/*
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,
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 */
if(count <= 0)
};
-static void snd_mixart_proc_read(snd_info_entry_t *entry,
- snd_info_buffer_t * buffer)
+static void snd_mixart_proc_read(struct snd_info_entry *entry,
+ struct snd_info_buffer *buffer)
{
- mixart_t *chip = entry->private_data;
+ struct snd_mixart *chip = entry->private_data;
u32 ref;
snd_iprintf(buffer, "Digigram miXart (alsa card %d)\n\n", chip->chip_idx);
} /* 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 */
if (! snd_card_proc_new(chip->card, "board_info", &entry)) {
const struct pci_device_id *pci_id)
{
static int dev;
- mixart_mgr_t *mgr;
+ struct mixart_mgr *mgr;
unsigned int i;
int err;
size_t size;
init_MUTEX(&mgr->setup_mutex);
/* 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 */
mgr->num_cards = MIXART_MAX_CARDS; /* 4 FIXME: configurable? */
for (i = 0; i < mgr->num_cards; i++) {
- snd_card_t *card;
+ struct snd_card *card;
char tmpid[16];
int idx;
mgr->board_type = MIXART_DAUGHTER_TYPE_NONE;
/* 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),
size, &mgr->flowinfo) < 0) {
snd_mixart_free(mgr);
memset(mgr->flowinfo.area, 0, size);
/* 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),
size, &mgr->bufferinfo) < 0) {
snd_mixart_free(mgr);
/*
*/
-#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;
};
};
-typedef struct mixart_route mixart_route_t;
struct mixart_route {
unsigned char connected;
unsigned char phase_inv;
#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;
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;
#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 */
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 */
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 */
};
/* 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 */
#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;
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;
* 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)
}
-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;
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;
}
-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;
}
-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;
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;
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;
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;
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++) {
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",
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;
}
-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 ) );
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) );
};
-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));
#define MIXART_FLOAT_M_20_0_TO_HEX 0xc1a00000 /* -20.0f */
#define MIXART_FLOAT____0_0_TO_HEX 0x00000000 /* 0.0f */
-typedef struct mixart_audio_info_req mixart_audio_info_req_t;
struct mixart_audio_info_req
{
u32 line_max_level; /* float */
u32 cd_max_level; /* float */
} __attribute__((packed));
-typedef struct mixart_analog_hw_info mixart_analog_hw_info_t;
struct mixart_analog_hw_info
{
u32 is_present;
u32 zero_var; /* float */
} __attribute__((packed));
-typedef struct mixart_digital_hw_info mixart_digital_hw_info_t;
struct mixart_digital_hw_info
{
u32 hw_connection_type;
u32 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));
#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;
/* MSG_STREAM_ADD_INPUT_GROUP */
/* MSG_STREAM_ADD_OUTPUT_GROUP */
-typedef struct mixart_streaming_group_req mixart_streaming_group_req_t;
struct mixart_streaming_group_req
{
u32 stream_count;
u32 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;
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;
/* Structures used by the MSG_SERVICES_TIMER_NOTIFY command */
-typedef struct mixart_sample_pos mixart_sample_pos_t;
struct mixart_sample_pos
{
u32 buffer_id;
u32 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));
/* 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,
};
-typedef struct mixart_clock_properties mixart_clock_properties_t;
struct mixart_clock_properties
{
u32 error_code;
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;
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 */
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));
*/
-typedef struct mixart_get_out_audio_level mixart_get_out_audio_level_t;
struct mixart_get_out_audio_level
{
u32 txx_status;
#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;
#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));
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 */
#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;
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 */
* @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;
/*
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;
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;
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));
#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);
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;
}
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;
}
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;
}
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;
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;
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);
}
-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;
/* 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 */
/* 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;
/* 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;
#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"
/* 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;
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;
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)
#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 */
#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 */
/*
* 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;
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];
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;
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,
};
/* 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;
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];
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++) {
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 */
#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;
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);
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) {
}
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);
/* 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;
#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;
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;
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 */
};
-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);
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 */
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,
.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)
* 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];
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);
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 */
* 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];
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);
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 */
};
-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);
}
-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 */
#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 */