Commit 67b48b88 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: PCI miXart

Modules: MIXART driver

Remove xxx_t typedefs from the PCI miXart driver.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent fcfd3332
This diff is collapsed.
...@@ -32,21 +32,7 @@ ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 ...@@ -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 */
...@@ -44,7 +44,7 @@ ...@@ -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) ...@@ -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 ...@@ -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, ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) );
......
This diff is collapsed.
...@@ -40,7 +40,9 @@ ...@@ -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 ...@@ -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 { ...@@ -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 { ...@@ -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 ) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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 * ...@@ -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 * ...@@ -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) ...@@ -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 ...@@ -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) ...@@ -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)
......
...@@ -140,6 +140,6 @@ ...@@ -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 */
This diff is collapsed.
...@@ -24,8 +24,8 @@ ...@@ -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 */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment