[ALSA] Remove xxx_t typedefs: PCI CS46xx

Modules: CS46xx driver

Remove xxx_t typedefs from the PCI CS46xx driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2005-11-17 14:48:14 +01:00 committed by Jaroslav Kysela
parent af26367f69
commit 3d19f804ef
16 changed files with 935 additions and 900 deletions

View file

@ -1631,42 +1631,41 @@
#define CS46XX_MIXER_SPDIF_INPUT_ELEMENT 1
#define CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT 2
typedef struct _snd_cs46xx cs46xx_t;
typedef struct _snd_cs46xx_pcm_t {
struct snd_cs46xx_pcm {
struct snd_dma_buffer hw_buf;
unsigned int ctl;
unsigned int shift; /* Shift count to trasform frames in bytes */
snd_pcm_indirect_t pcm_rec;
snd_pcm_substream_t *substream;
struct snd_pcm_indirect pcm_rec;
struct snd_pcm_substream *substream;
pcm_channel_descriptor_t * pcm_channel;
struct dsp_pcm_channel_descriptor * pcm_channel;
int pcm_channel_id; /* Fron Rear, Center Lfe ... */
} cs46xx_pcm_t;
};
typedef struct {
struct snd_cs46xx_region {
char name[24];
unsigned long base;
void __iomem *remap_addr;
unsigned long size;
struct resource *resource;
} snd_cs46xx_region_t;
};
struct _snd_cs46xx {
struct snd_cs46xx {
int irq;
unsigned long ba0_addr;
unsigned long ba1_addr;
union {
struct {
snd_cs46xx_region_t ba0;
snd_cs46xx_region_t data0;
snd_cs46xx_region_t data1;
snd_cs46xx_region_t pmem;
snd_cs46xx_region_t reg;
struct snd_cs46xx_region ba0;
struct snd_cs46xx_region data0;
struct snd_cs46xx_region data1;
struct snd_cs46xx_region pmem;
struct snd_cs46xx_region reg;
} name;
snd_cs46xx_region_t idx[5];
struct snd_cs46xx_region idx[5];
} region;
unsigned int mode;
@ -1676,34 +1675,34 @@ struct _snd_cs46xx {
unsigned int ctl;
unsigned int shift; /* Shift count to trasform frames in bytes */
snd_pcm_indirect_t pcm_rec;
snd_pcm_substream_t *substream;
struct snd_pcm_indirect pcm_rec;
struct snd_pcm_substream *substream;
} capt;
int nr_ac97_codecs;
ac97_bus_t *ac97_bus;
ac97_t *ac97[MAX_NR_AC97];
struct snd_ac97_bus *ac97_bus;
struct snd_ac97 *ac97[MAX_NR_AC97];
struct pci_dev *pci;
snd_card_t *card;
snd_pcm_t *pcm;
struct snd_card *card;
struct snd_pcm *pcm;
snd_rawmidi_t *rmidi;
snd_rawmidi_substream_t *midi_input;
snd_rawmidi_substream_t *midi_output;
struct snd_rawmidi *rmidi;
struct snd_rawmidi_substream *midi_input;
struct snd_rawmidi_substream *midi_output;
spinlock_t reg_lock;
unsigned int midcr;
unsigned int uartm;
int amplifier;
void (*amplifier_ctrl)(cs46xx_t *, int);
void (*active_ctrl)(cs46xx_t *, int);
void (*mixer_init)(cs46xx_t *);
void (*amplifier_ctrl)(struct snd_cs46xx *, int);
void (*active_ctrl)(struct snd_cs46xx *, int);
void (*mixer_init)(struct snd_cs46xx *);
int acpi_port;
snd_kcontrol_t *eapd_switch; /* for amplifier hack */
struct snd_kcontrol *eapd_switch; /* for amplifier hack */
int accept_valid; /* accept mmap valid (for OSS) */
struct gameport *gameport;
@ -1714,29 +1713,29 @@ struct _snd_cs46xx {
#ifdef CONFIG_SND_CS46XX_NEW_DSP
struct semaphore spos_mutex;
dsp_spos_instance_t * dsp_spos_instance;
struct dsp_spos_instance * dsp_spos_instance;
snd_pcm_t *pcm_rear;
snd_pcm_t *pcm_center_lfe;
snd_pcm_t *pcm_iec958;
struct snd_pcm *pcm_rear;
struct snd_pcm *pcm_center_lfe;
struct snd_pcm *pcm_iec958;
#else /* for compatibility */
cs46xx_pcm_t *playback_pcm;
struct snd_cs46xx_pcm *playback_pcm;
unsigned int play_ctl;
#endif
};
int snd_cs46xx_create(snd_card_t *card,
int snd_cs46xx_create(struct snd_card *card,
struct pci_dev *pci,
int external_amp, int thinkpad,
cs46xx_t **rcodec);
struct snd_cs46xx **rcodec);
int snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t **rpcm);
int snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t **rpcm);
int snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t **rpcm);
int snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t **rpcm);
int snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device);
int snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rmidi);
int snd_cs46xx_start_dsp(cs46xx_t *chip);
int snd_cs46xx_gameport(cs46xx_t *chip);
int snd_cs46xx_pcm(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
int snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
int snd_cs46xx_pcm_iec958(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
int snd_cs46xx_pcm_center_lfe(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
int snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device);
int snd_cs46xx_midi(struct snd_cs46xx *chip, int device, struct snd_rawmidi **rmidi);
int snd_cs46xx_start_dsp(struct snd_cs46xx *chip);
int snd_cs46xx_gameport(struct snd_cs46xx *chip);
#endif /* __SOUND_CS46XX_H */

View file

@ -41,7 +41,7 @@
/* This structs are used internally by the SP */
typedef struct _basic_dma_req_t {
struct dsp_basic_dma_req {
/* DMA Requestor Word 0 (DCW) fields:
31 [30-28]27 [26:24] 23 22 21 20 [19:18] [17:16] 15 14 13 12 11 10 9 8 7 6 [5:0]
@ -53,9 +53,9 @@ typedef struct _basic_dma_req_t {
u32 dmw; /* DMA Mode Word */
u32 saw; /* Source Address Word */
u32 daw; /* Destination Address Word */
} basic_dma_req_t;
};
typedef struct _scatter_gather_ext_t {
struct dsp_scatter_gather_ext {
u32 npaw; /* Next-Page Address Word */
/* DMA Requestor Word 5 (NPCW) fields:
@ -69,9 +69,9 @@ typedef struct _scatter_gather_ext_t {
u32 lbaw; /* Loop-Begin Address Word */
u32 nplbaw; /* Next-Page after Loop-Begin Address Word */
u32 sgaw; /* Scatter/Gather Address Word */
} scatter_gather_ext_t;
};
typedef struct _volume_control_t {
struct dsp_volume_control {
___DSP_DUAL_16BIT_ALLOC(
rightTarg, /* Target volume for left & right channels */
leftTarg
@ -80,10 +80,10 @@ typedef struct _volume_control_t {
rightVol, /* Current left & right channel volumes */
leftVol
)
} volume_control_t;
};
/* Generic stream control block (SCB) structure definition */
typedef struct _generic_scb_t {
struct dsp_generic_scb {
/* For streaming I/O, the DSP should never alter any words in the DMA
requestor or the scatter/gather extension. Only ad hoc DMA request
streams are free to alter the requestor (currently only occur in the
@ -99,13 +99,13 @@ typedef struct _generic_scb_t {
/* Initialized by the host, only modified by DMA
R/O for the DSP task */
basic_dma_req_t basic_req; /* Optional */
struct dsp_basic_dma_req basic_req; /* Optional */
/* Scatter/gather DMA requestor extension (5 ints)
Initialized by the host, only modified by DMA
DSP task never needs to even read these.
*/
scatter_gather_ext_t sg_ext; /* Optional */
struct dsp_scatter_gather_ext sg_ext; /* Optional */
/* Sublist pointer & next stream control block (SCB) link.
Initialized & modified by the host R/O for the DSP task
@ -179,11 +179,11 @@ typedef struct _generic_scb_t {
These two 32-bit words are redefined for wavetable & 3-D voices.
*/
volume_control_t vol_ctrl_t; /* Optional */
} generic_scb_t;
struct dsp_volume_control vol_ctrl_t; /* Optional */
};
typedef struct _spos_control_block_t {
struct dsp_spos_control_block {
/* WARNING: Certain items in this structure are modified by the host
Any dword that can be modified by the host, must not be
modified by the SP as the host can only do atomic dword
@ -273,10 +273,10 @@ typedef struct _spos_control_block_t {
u32 r32_save_for_spurious_int;
u32 r32_save_for_trap;
u32 r32_save_for_HFG;
} spos_control_block_t;
};
/* SPB for MIX_TO_OSTREAM algorithm family */
typedef struct _mix2_ostream_spb_t
struct dsp_mix2_ostream_spb
{
/* 16b.16b integer.frac approximation to the
number of 3 sample triplets to output each
@ -290,13 +290,13 @@ typedef struct _mix2_ostream_spb_t
output triplets since the start of group
*/
u32 accumOutTriplets;
} mix2_ostream_spb_t;
};
/* SCB for Timing master algorithm */
typedef struct _timing_master_scb_t {
struct dsp_timing_master_scb {
/* First 12 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */
struct dsp_basic_dma_req basic_req; /* Optional */
struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */
@ -358,13 +358,13 @@ typedef struct _timing_master_scb_t {
number of samples to output each frame.
(approximation must be floor, to insure */
u32 nsamp_per_frm_q15;
} timing_master_scb_t;
};
/* SCB for CODEC output algorithm */
typedef struct _codec_output_scb_t {
struct dsp_codec_output_scb {
/* First 13 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */
struct dsp_basic_dma_req basic_req; /* Optional */
struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */
@ -422,13 +422,13 @@ typedef struct _codec_output_scb_t {
reserved,
last_sub_ptr
)
} codec_output_scb_t;
};
/* SCB for CODEC input algorithm */
typedef struct _codec_input_scb_t {
struct dsp_codec_input_scb {
/* First 13 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */
struct dsp_basic_dma_req basic_req; /* Optional */
struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */
@ -479,13 +479,13 @@ typedef struct _codec_input_scb_t {
)
u32 reserved2;
} codec_input_scb_t;
};
typedef struct _pcm_serial_input_scb_t {
struct dsp_pcm_serial_input_scb {
/* First 13 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */
struct dsp_basic_dma_req basic_req; /* Optional */
struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */
@ -512,11 +512,11 @@ typedef struct _pcm_serial_input_scb_t {
)
/* Initialized by the host (host updates target volumes) */
volume_control_t psi_vol_ctrl;
struct dsp_volume_control psi_vol_ctrl;
} pcm_serial_input_scb_t;
};
typedef struct _src_task_scb_t {
struct dsp_src_task_scb {
___DSP_DUAL_16BIT_ALLOC(
frames_left_in_gof,
gofs_left_in_sec
@ -571,10 +571,10 @@ typedef struct _src_task_scb_t {
u32 phiIncr6int_26frac;
volume_control_t src_vol_ctrl;
} src_task_scb_t;
struct dsp_volume_control src_vol_ctrl;
};
typedef struct _decimate_by_pow2_scb_t {
struct dsp_decimate_by_pow2_scb {
/* decimationFactor = 2, 4, or 8 (larger factors waste too much memory
when compared to cascading decimators)
*/
@ -648,10 +648,10 @@ typedef struct _decimate_by_pow2_scb_t {
u32 dec2_reserved4;
volume_control_t dec2_vol_ctrl; /* Not used! */
} decimate_by_pow2_scb_t;
struct dsp_volume_control dec2_vol_ctrl; /* Not used! */
};
typedef struct _vari_decimate_scb_t {
struct dsp_vari_decimate_scb {
___DSP_DUAL_16BIT_ALLOC(
vdec_frames_left_in_gof,
vdec_gofs_left_in_sec
@ -711,15 +711,15 @@ typedef struct _vari_decimate_scb_t {
u32 vdec_phi_incr_6int_26frac;
volume_control_t vdec_vol_ctrl;
} vari_decimate_scb_t;
struct dsp_volume_control vdec_vol_ctrl;
};
/* SCB for MIX_TO_OSTREAM algorithm family */
typedef struct _mix2_ostream_scb_t {
struct dsp_mix2_ostream_scb {
/* First 13 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */
struct dsp_basic_dma_req basic_req; /* Optional */
struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */
@ -758,14 +758,14 @@ typedef struct _mix2_ostream_scb_t {
const_FFFF,
const_zero
)
} mix2_ostream_scb_t;
};
/* SCB for S16_MIX algorithm */
typedef struct _mix_only_scb_t {
struct dsp_mix_only_scb {
/* First 13 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */
struct dsp_basic_dma_req basic_req; /* Optional */
struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */
@ -780,11 +780,11 @@ typedef struct _mix_only_scb_t {
u32 strm_buf_ptr; /* REQUIRED */
u32 reserved;
volume_control_t vol_ctrl;
} mix_only_scb_t;
struct dsp_volume_control vol_ctrl;
};
/* SCB for the async. CODEC input algorithm */
typedef struct _async_codec_input_scb_t {
struct dsp_async_codec_input_scb {
u32 io_free2;
u32 io_current_total;
@ -837,11 +837,11 @@ typedef struct _async_codec_input_scb_t {
)
u32 i_free;
} async_codec_input_scb_t;
};
/* SCB for the SP/DIF CODEC input and output */
typedef struct _spdifiscb_t {
struct dsp_spdifiscb {
___DSP_DUAL_16BIT_ALLOC(
status_ptr,
status_start_ptr
@ -895,12 +895,11 @@ typedef struct _spdifiscb_t {
)
u32 free1;
} spdifiscb_t;
};
/* SCB for the SP/DIF CODEC input and output */
typedef struct _spdifoscb_t {
struct dsp_spdifoscb {
u32 free2;
@ -941,11 +940,10 @@ typedef struct _spdifoscb_t {
)
u32 free1;
} spdifoscb_t;
};
typedef struct _asynch_fg_rx_scb_t {
struct dsp_asynch_fg_rx_scb {
___DSP_DUAL_16BIT_ALLOC(
bot_buf_mask,
buf_Mask
@ -993,11 +991,10 @@ typedef struct _asynch_fg_rx_scb_t {
right_vol,
left_vol
)
} asynch_fg_rx_scb_t;
};
typedef struct _asynch_fg_tx_scb_t {
struct dsp_asynch_fg_tx_scb {
___DSP_DUAL_16BIT_ALLOC(
not_buf_mask,
buf_mask
@ -1052,13 +1049,13 @@ typedef struct _asynch_fg_tx_scb_t {
unused_right_vol,
unused_left_vol
)
} asynch_fg_tx_scb_t;
};
typedef struct _output_snoop_scb_t {
struct dsp_output_snoop_scb {
/* First 13 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */
struct dsp_basic_dma_req basic_req; /* Optional */
struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */
@ -1083,9 +1080,9 @@ typedef struct _output_snoop_scb_t {
reserved,
input_scb
)
} output_snoop_scb_t;
};
typedef struct _spio_write_scb_t {
struct dsp_spio_write_scb {
___DSP_DUAL_16BIT_ALLOC(
address1,
address2
@ -1122,9 +1119,9 @@ typedef struct _spio_write_scb_t {
)
u32 unused3[5];
} spio_write_scb_t;
};
typedef struct _magic_snoop_task_t {
struct dsp_magic_snoop_task {
u32 i0;
u32 i1;
@ -1155,11 +1152,11 @@ typedef struct _magic_snoop_task_t {
u32 i8;
volume_control_t vdec_vol_ctrl;
} magic_snoop_task_t;
struct dsp_volume_control vdec_vol_ctrl;
};
typedef struct _filter_scb_t {
struct dsp_filter_scb {
___DSP_DUAL_16BIT_ALLOC(
a0_right, /* 0x00 */
a0_left
@ -1212,5 +1209,5 @@ typedef struct _filter_scb_t {
b2_right, /* 0x0F */
b2_left
)
} filter_scb_t;
};
#endif /* __DSP_SCB_TYPES_H__ */

View file

@ -65,133 +65,130 @@
#define DSP_SPDIF_STATUS_HW_ENABLED 4
#define DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED 8
struct _dsp_module_desc_t;
typedef struct _symbol_entry_t {
struct dsp_symbol_entry {
u32 address;
char symbol_name[DSP_MAX_SYMBOL_NAME];
int symbol_type;
/* initialized by driver */
struct _dsp_module_desc_t * module;
struct dsp_module_desc * module;
int deleted;
} symbol_entry_t;
};
typedef struct _symbol_desc_t {
struct dsp_symbol_desc {
int nsymbols;
symbol_entry_t * symbols;
struct dsp_symbol_entry *symbols;
/* initialized by driver */
int highest_frag_index;
} symbol_desc_t;
};
typedef struct _segment_desc_t {
struct dsp_segment_desc {
int segment_type;
u32 offset;
u32 size;
u32 * data;
} segment_desc_t;
};
typedef struct _dsp_module_desc_t {
struct dsp_module_desc {
char * module_name;
symbol_desc_t symbol_table;
struct dsp_symbol_desc symbol_table;
int nsegments;
segment_desc_t * segments;
struct dsp_segment_desc * segments;
/* initialized by driver */
u32 overlay_begin_address;
u32 load_address;
int nfixups;
} dsp_module_desc_t;
};
typedef struct _dsp_scb_descriptor_t {
struct dsp_scb_descriptor {
char scb_name[DSP_MAX_SCB_NAME];
u32 address;
int index;
struct _dsp_scb_descriptor_t * sub_list_ptr;
struct _dsp_scb_descriptor_t * next_scb_ptr;
struct _dsp_scb_descriptor_t * parent_scb_ptr;
struct dsp_scb_descriptor * sub_list_ptr;
struct dsp_scb_descriptor * next_scb_ptr;
struct dsp_scb_descriptor * parent_scb_ptr;
symbol_entry_t * task_entry;
symbol_entry_t * scb_symbol;
struct dsp_symbol_entry * task_entry;
struct dsp_symbol_entry * scb_symbol;
snd_info_entry_t *proc_info;
struct snd_info_entry *proc_info;
int ref_count;
spinlock_t lock;
int deleted;
} dsp_scb_descriptor_t;
};
typedef struct _dsp_task_descriptor_t {
struct dsp_task_descriptor {
char task_name[DSP_MAX_TASK_NAME];
int size;
u32 address;
int index;
} dsp_task_descriptor_t;
};
typedef struct _pcm_channel_descriptor_t {
struct dsp_pcm_channel_descriptor {
int active;
int src_slot;
int pcm_slot;
u32 sample_rate;
u32 unlinked;
dsp_scb_descriptor_t * pcm_reader_scb;
dsp_scb_descriptor_t * src_scb;
dsp_scb_descriptor_t * mixer_scb;
struct dsp_scb_descriptor * pcm_reader_scb;
struct dsp_scb_descriptor * src_scb;
struct dsp_scb_descriptor * mixer_scb;
void * private_data;
} pcm_channel_descriptor_t;
};
typedef struct _dsp_spos_instance_t {
symbol_desc_t symbol_table; /* currently availble loaded symbols in SP */
struct dsp_spos_instance {
struct dsp_symbol_desc symbol_table; /* currently availble loaded symbols in SP */
int nmodules;
dsp_module_desc_t * modules; /* modules loaded into SP */
struct dsp_module_desc * modules; /* modules loaded into SP */
segment_desc_t code;
struct dsp_segment_desc code;
/* Main PCM playback mixer */
dsp_scb_descriptor_t * master_mix_scb;
struct dsp_scb_descriptor * master_mix_scb;
u16 dac_volume_right;
u16 dac_volume_left;
/* Rear/surround PCM playback mixer */
dsp_scb_descriptor_t * rear_mix_scb;
struct dsp_scb_descriptor * rear_mix_scb;
/* Center/LFE mixer */
dsp_scb_descriptor_t * center_lfe_mix_scb;
struct dsp_scb_descriptor * center_lfe_mix_scb;
int npcm_channels;
int nsrc_scb;
pcm_channel_descriptor_t pcm_channels[DSP_MAX_PCM_CHANNELS];
struct dsp_pcm_channel_descriptor pcm_channels[DSP_MAX_PCM_CHANNELS];
int src_scb_slots[DSP_MAX_SRC_NR];
/* cache this symbols */
symbol_entry_t * null_algorithm; /* used by PCMreaderSCB's */
symbol_entry_t * s16_up; /* used by SRCtaskSCB's */
struct dsp_symbol_entry * null_algorithm; /* used by PCMreaderSCB's */
struct dsp_symbol_entry * s16_up; /* used by SRCtaskSCB's */
/* proc fs */
snd_card_t * snd_card;
snd_info_entry_t * proc_dsp_dir;
snd_info_entry_t * proc_sym_info_entry;
snd_info_entry_t * proc_modules_info_entry;
snd_info_entry_t * proc_parameter_dump_info_entry;
snd_info_entry_t * proc_sample_dump_info_entry;
struct snd_card *snd_card;
struct snd_info_entry * proc_dsp_dir;
struct snd_info_entry * proc_sym_info_entry;
struct snd_info_entry * proc_modules_info_entry;
struct snd_info_entry * proc_parameter_dump_info_entry;
struct snd_info_entry * proc_sample_dump_info_entry;
/* SCB's descriptors */
int nscb;
int scb_highest_frag_index;
dsp_scb_descriptor_t scbs[DSP_MAX_SCB_DESC];
snd_info_entry_t * proc_scb_info_entry;
dsp_scb_descriptor_t * the_null_scb;
struct dsp_scb_descriptor scbs[DSP_MAX_SCB_DESC];
struct snd_info_entry * proc_scb_info_entry;
struct dsp_scb_descriptor * the_null_scb;
/* Task's descriptors */
int ntask;
dsp_task_descriptor_t tasks[DSP_MAX_TASK_DESC];
snd_info_entry_t * proc_task_info_entry;
struct dsp_task_descriptor tasks[DSP_MAX_TASK_DESC];
struct snd_info_entry * proc_task_info_entry;
/* SPDIF status */
int spdif_status_out;
@ -204,30 +201,30 @@ typedef struct _dsp_spos_instance_t {
unsigned int spdif_csuv_stream;
/* SPDIF input sample rate converter */
dsp_scb_descriptor_t * spdif_in_src;
struct dsp_scb_descriptor * spdif_in_src;
/* SPDIF input asynch. receiver */
dsp_scb_descriptor_t * asynch_rx_scb;
struct dsp_scb_descriptor * asynch_rx_scb;
/* Capture record mixer SCB */
dsp_scb_descriptor_t * record_mixer_scb;
struct dsp_scb_descriptor * record_mixer_scb;
/* CODEC input SCB */
dsp_scb_descriptor_t * codec_in_scb;
struct dsp_scb_descriptor * codec_in_scb;
/* reference snooper */
dsp_scb_descriptor_t * ref_snoop_scb;
struct dsp_scb_descriptor * ref_snoop_scb;
/* SPDIF output PCM reference */
dsp_scb_descriptor_t * spdif_pcm_input_scb;
struct dsp_scb_descriptor * spdif_pcm_input_scb;
/* asynch TX task */
dsp_scb_descriptor_t * asynch_tx_scb;
struct dsp_scb_descriptor * asynch_tx_scb;
/* record sources */
dsp_scb_descriptor_t * pcm_input;
dsp_scb_descriptor_t * adc_input;
struct dsp_scb_descriptor * pcm_input;
struct dsp_scb_descriptor * adc_input;
int spdif_in_sample_rate;
} dsp_spos_instance_t;
};
#endif /* __DSP_SPOS_H__ */

View file

@ -71,7 +71,7 @@ Ptr____Call (c)
at the end of BG */
/* Minimal context save area for Hyper Forground */
typedef struct _hf_save_area_t {
struct dsp_hf_save_area {
u32 r10_save;
u32 r54_save;
u32 r98_save;
@ -96,11 +96,11 @@ typedef struct _hf_save_area_t {
rsa2Save
)
/* saved as part of HFG context */
} hf_save_area_t;
};
/* Task link data structure */
typedef struct _tree_link_t {
struct dsp_tree_link {
___DSP_DUAL_16BIT_ALLOC(
/* Pointer to sibling task control block */
next_scb,
@ -114,10 +114,10 @@ typedef struct _tree_link_t {
/* Pointer to local data */
this_spb
)
} tree_link_t;
};
typedef struct _task_tree_data_t {
struct dsp_task_tree_data {
___DSP_DUAL_16BIT_ALLOC(
/* Initial tock count; controls task tree execution rate */
tock_count_limit,
@ -155,11 +155,10 @@ typedef struct _task_tree_data_t {
data_stack_base_ptr
)
} task_tree_data_t;
};
typedef struct _interval_timer_data_t
struct dsp_interval_timer_data
{
/* These data items have the same relative locations to those */
___DSP_DUAL_16BIT_ALLOC(
@ -172,12 +171,12 @@ typedef struct _interval_timer_data_t
num_FG_ticks_this_interval,
num_intervals
)
} interval_timer_data_t;
};
/* This structure contains extra storage for the task tree
Currently, this additional data is related only to a full context save */
typedef struct _task_tree_context_block_t {
struct dsp_task_tree_context_block {
/* Up to 10 values are saved onto the stack. 8 for the task tree, 1 for
The access to the context switch (call or interrupt), and 1 spare that
users should never use. This last may be required by the system */
@ -238,16 +237,16 @@ typedef struct _task_tree_context_block_t {
u32 saveaux2xaux3x;
u32 savershouthl;
u32 savershoutxmacmode;
} task_tree_context_block_t;
};
typedef struct _task_tree_control_block_t {
hf_save_area_t context;
tree_link_t links;
task_tree_data_t data;
task_tree_context_block_t context_blk;
interval_timer_data_t int_timer;
} task_tree_control_block_t;
struct dsp_task_tree_control_block {
struct dsp_hf_save_area context;
struct dsp_tree_link links;
struct dsp_task_tree_data data;
struct dsp_task_tree_context_block context_blk;
struct dsp_interval_timer_data int_timer;
};
#endif /* __DSP_TASK_TYPES_H__ */

View file

@ -78,8 +78,8 @@ static int __devinit snd_card_cs46xx_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{
static int dev;
snd_card_t *card;
cs46xx_t *chip;
struct snd_card *card;
struct snd_cs46xx *chip;
int err;
if (dev >= SNDRV_CARDS)

File diff suppressed because it is too large Load diff

View file

@ -57,7 +57,7 @@
* common I/O routines
*/
static inline void snd_cs46xx_poke(cs46xx_t *chip, unsigned long reg, unsigned int val)
static inline void snd_cs46xx_poke(struct snd_cs46xx *chip, unsigned long reg, unsigned int val)
{
unsigned int bank = reg >> 16;
unsigned int offset = reg & 0xffff;
@ -66,117 +66,128 @@ static inline void snd_cs46xx_poke(cs46xx_t *chip, unsigned long reg, unsigned i
writel(val, chip->region.idx[bank+1].remap_addr + offset);
}
static inline unsigned int snd_cs46xx_peek(cs46xx_t *chip, unsigned long reg)
static inline unsigned int snd_cs46xx_peek(struct snd_cs46xx *chip, unsigned long reg)
{
unsigned int bank = reg >> 16;
unsigned int offset = reg & 0xffff;
return readl(chip->region.idx[bank+1].remap_addr + offset);
}
static inline void snd_cs46xx_pokeBA0(cs46xx_t *chip, unsigned long offset, unsigned int val)
static inline void snd_cs46xx_pokeBA0(struct snd_cs46xx *chip, unsigned long offset, unsigned int val)
{
writel(val, chip->region.name.ba0.remap_addr + offset);
}
static inline unsigned int snd_cs46xx_peekBA0(cs46xx_t *chip, unsigned long offset)
static inline unsigned int snd_cs46xx_peekBA0(struct snd_cs46xx *chip, unsigned long offset)
{
return readl(chip->region.name.ba0.remap_addr + offset);
}
dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip);
void cs46xx_dsp_spos_destroy (cs46xx_t * chip);
int cs46xx_dsp_load_module (cs46xx_t * chip,dsp_module_desc_t * module);
symbol_entry_t * cs46xx_dsp_lookup_symbol (cs46xx_t * chip,char * symbol_name,int symbol_type);
int cs46xx_dsp_proc_init (snd_card_t * card, cs46xx_t *chip);
int cs46xx_dsp_proc_done (cs46xx_t *chip);
int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip);
int snd_cs46xx_download (cs46xx_t *chip,u32 *src,unsigned long offset,
unsigned long len);
int snd_cs46xx_clear_BA1(cs46xx_t *chip,unsigned long offset,unsigned long len);
int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip);
int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip);
int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip);
int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip);
int cs46xx_dsp_disable_spdif_in (cs46xx_t *chip);
int cs46xx_dsp_enable_pcm_capture (cs46xx_t *chip);
int cs46xx_dsp_disable_pcm_capture (cs46xx_t *chip);
int cs46xx_dsp_enable_adc_capture (cs46xx_t *chip);
int cs46xx_dsp_disable_adc_capture (cs46xx_t *chip);
int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data);
dsp_scb_descriptor_t * cs46xx_dsp_create_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest);
void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb);
void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * scb);
dsp_scb_descriptor_t * cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip);
dsp_scb_descriptor_t * cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name,
u16 channel_disp,u16 fifo_addr,
u16 child_scb_addr,
u32 dest,
dsp_scb_descriptor_t * parent_scb,
int scb_child_type);
dsp_scb_descriptor_t * cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name,
u16 channel_disp,u16 fifo_addr,
u16 sample_buffer_addr,
u32 dest,
dsp_scb_descriptor_t * parent_scb,
int scb_child_type);
void cs46xx_dsp_remove_scb (cs46xx_t *chip,dsp_scb_descriptor_t * scb);
dsp_scb_descriptor_t * cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name,
u16 channel_disp,u16 fifo_addr,
u16 sample_buffer_addr,
u32 dest,dsp_scb_descriptor_t * parent_scb,
int scb_child_type);
dsp_scb_descriptor_t * cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name,
int sample_rate,
u16 src_buffer_addr,
u16 src_delay_buffer_addr,u32 dest,
dsp_scb_descriptor_t * parent_scb,
int scb_child_type,
int pass_through);
dsp_scb_descriptor_t * cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name,
u16 mix_buffer_addr,u32 dest,
dsp_scb_descriptor_t * parent_scb,
int scb_child_type);
struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip);
void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip);
int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module);
struct dsp_symbol_entry *cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name,
int symbol_type);
int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip);
int cs46xx_dsp_proc_done (struct snd_cs46xx *chip);
int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip);
int snd_cs46xx_download (struct snd_cs46xx *chip, u32 *src, unsigned long offset,
unsigned long len);
int snd_cs46xx_clear_BA1(struct snd_cs46xx *chip, unsigned long offset, unsigned long len);
int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip);
int cs46xx_dsp_enable_spdif_hw (struct snd_cs46xx *chip);
int cs46xx_dsp_disable_spdif_out (struct snd_cs46xx *chip);
int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip);
int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip);
int cs46xx_dsp_enable_pcm_capture (struct snd_cs46xx *chip);
int cs46xx_dsp_disable_pcm_capture (struct snd_cs46xx *chip);
int cs46xx_dsp_enable_adc_capture (struct snd_cs46xx *chip);
int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip);
int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data);
struct dsp_scb_descriptor * cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name,
u32 * scb_data, u32 dest);
void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb);
void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
struct dsp_scb_descriptor * scb);
struct dsp_scb_descriptor * cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip);
struct dsp_scb_descriptor *
cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip,
char * codec_name, u16 channel_disp, u16 fifo_addr,
u16 child_scb_addr, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type);
struct dsp_scb_descriptor *
cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
u16 channel_disp, u16 fifo_addr,
u16 sample_buffer_addr, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type);
void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip,
struct dsp_scb_descriptor * scb);
struct dsp_scb_descriptor *
cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
u16 channel_disp, u16 fifo_addr,
u16 sample_buffer_addr, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type);
struct dsp_scb_descriptor *
cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name,
int sample_rate, u16 src_buffer_addr,
u16 src_delay_buffer_addr, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type, int pass_through);
struct dsp_scb_descriptor *
cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name,
u16 mix_buffer_addr, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type);
dsp_scb_descriptor_t * cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name,
u16 vari_buffer_addr0,
u16 vari_buffer_addr1,
u32 dest,
dsp_scb_descriptor_t * parent_scb,
int scb_child_type);
dsp_scb_descriptor_t * cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
u16 hfg_scb_address,
u16 asynch_buffer_address,
dsp_scb_descriptor_t * parent_scb,
int scb_child_type);
dsp_scb_descriptor_t * cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest,
dsp_scb_descriptor_t * parent_scb,
int scb_child_type);
dsp_scb_descriptor_t * cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name,
u16 mix_buffer_addr,u16 writeback_spb,u32 dest,
dsp_scb_descriptor_t * parent_scb,
int scb_child_type);
dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest,
u16 snoop_buffer_address,
dsp_scb_descriptor_t * snoop_scb,
dsp_scb_descriptor_t * parent_scb,
int scb_child_type);
pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,u32 sample_rate, void * private_data, u32 hw_dma_addr,
int pcm_channel_id);
void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip,
pcm_channel_descriptor_t * pcm_channel);
int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel);
int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel);
dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descriptor_t * source,
u16 addr,char * scb_name);
int cs46xx_src_unlink(cs46xx_t *chip,dsp_scb_descriptor_t * src);
int cs46xx_src_link(cs46xx_t *chip,dsp_scb_descriptor_t * src);
int cs46xx_iec958_pre_open (cs46xx_t *chip);
int cs46xx_iec958_post_close (cs46xx_t *chip);
int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip,
pcm_channel_descriptor_t * pcm_channel,
int period_size);
int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip,
int period_size);
int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right);
int cs46xx_dsp_set_iec958_volume (cs46xx_t * chip,u16 left,u16 right);
struct dsp_scb_descriptor *
cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx * chip, char * scb_name,
u16 vari_buffer_addr0, u16 vari_buffer_addr1, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type);
struct dsp_scb_descriptor *
cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name,
u32 dest, u16 hfg_scb_address, u16 asynch_buffer_address,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type);
struct dsp_scb_descriptor *
cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type);
struct dsp_scb_descriptor *
cs46xx_dsp_create_mix_to_ostream_scb(struct snd_cs46xx * chip, char * scb_name,
u16 mix_buffer_addr, u16 writeback_spb, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type);
struct dsp_scb_descriptor *
cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx * chip, char * scb_name,
u32 dest, u16 snoop_buffer_address,
struct dsp_scb_descriptor * snoop_scb,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type);
struct dsp_pcm_channel_descriptor *
cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip, u32 sample_rate,
void * private_data, u32 hw_dma_addr,
int pcm_channel_id);
void cs46xx_dsp_destroy_pcm_channel (struct snd_cs46xx * chip,
struct dsp_pcm_channel_descriptor * pcm_channel);
int cs46xx_dsp_pcm_unlink (struct snd_cs46xx * chip,
struct dsp_pcm_channel_descriptor * pcm_channel);
int cs46xx_dsp_pcm_link (struct snd_cs46xx * chip,
struct dsp_pcm_channel_descriptor * pcm_channel);
struct dsp_scb_descriptor *
cs46xx_add_record_source (struct snd_cs46xx *chip, struct dsp_scb_descriptor * source,
u16 addr, char * scb_name);
int cs46xx_src_unlink(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src);
int cs46xx_src_link(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src);
int cs46xx_iec958_pre_open (struct snd_cs46xx *chip);
int cs46xx_iec958_post_close (struct snd_cs46xx *chip);
int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip,
struct dsp_pcm_channel_descriptor * pcm_channel,
int period_size);
int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip, int period_size);
int cs46xx_dsp_set_dac_volume (struct snd_cs46xx * chip, u16 left, u16 right);
int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right);
#endif /* __CS46XX_LIB_H__ */

View file

@ -37,9 +37,10 @@
#include "cs46xx_lib.h"
#include "dsp_spos.h"
static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entry);
static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
struct dsp_scb_descriptor * fg_entry);
static wide_opcode_t wide_opcodes[] = {
static enum wide_opcode wide_opcodes[] = {
WIDE_FOR_BEGIN_LOOP,
WIDE_FOR_BEGIN_LOOP2,
WIDE_COND_GOTO_ADDR,
@ -54,12 +55,13 @@ static wide_opcode_t wide_opcodes[] = {
WIDE_TBEQ_NCOND_CALL1_ADDR
};
static int shadow_and_reallocate_code (cs46xx_t * chip,u32 * data,u32 size, u32 overlay_begin_address)
static int shadow_and_reallocate_code (struct snd_cs46xx * chip, u32 * data, u32 size,
u32 overlay_begin_address)
{
unsigned int i = 0, j, nreallocated = 0;
u32 hival,loval,address;
u32 mop_operands,mop_type,wide_op;
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
snd_assert( ((size % 2) == 0), return -EINVAL);
@ -114,7 +116,7 @@ static int shadow_and_reallocate_code (cs46xx_t * chip,u32 * data,u32 size, u32
return nreallocated;
}
static segment_desc_t * get_segment_desc (dsp_module_desc_t * module, int seg_type)
static struct dsp_segment_desc * get_segment_desc (struct dsp_module_desc * module, int seg_type)
{
int i;
for (i = 0;i < module->nsegments; ++i) {
@ -126,7 +128,7 @@ static segment_desc_t * get_segment_desc (dsp_module_desc_t * module, int seg_ty
return NULL;
};
static int find_free_symbol_index (dsp_spos_instance_t * ins)
static int find_free_symbol_index (struct dsp_spos_instance * ins)
{
int index = ins->symbol_table.nsymbols,i;
@ -140,10 +142,10 @@ static int find_free_symbol_index (dsp_spos_instance_t * ins)
return index;
}
static int add_symbols (cs46xx_t * chip, dsp_module_desc_t * module)
static int add_symbols (struct snd_cs46xx * chip, struct dsp_module_desc * module)
{
int i;
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
if (module->symbol_table.nsymbols > 0) {
if (!strcmp(module->symbol_table.symbols[0].symbol_name, "OVERLAYBEGINADDRESS") &&
@ -181,10 +183,11 @@ static int add_symbols (cs46xx_t * chip, dsp_module_desc_t * module)
return 0;
}
static symbol_entry_t * add_symbol (cs46xx_t * chip, char * symbol_name, u32 address, int type)
static struct dsp_symbol_entry *
add_symbol (struct snd_cs46xx * chip, char * symbol_name, u32 address, int type)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
symbol_entry_t * symbol = NULL;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_symbol_entry * symbol = NULL;
int index;
if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) {
@ -217,17 +220,17 @@ static symbol_entry_t * add_symbol (cs46xx_t * chip, char * symbol_name, u32 add
return symbol;
}
dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip)
struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
{
dsp_spos_instance_t * ins = kmalloc(sizeof(dsp_spos_instance_t), GFP_KERNEL);
struct dsp_spos_instance * ins = kzalloc(sizeof(struct dsp_spos_instance), GFP_KERNEL);
if (ins == NULL)
return NULL;
memset(ins, 0, sizeof(*ins));
/* better to use vmalloc for this big table */
ins->symbol_table.nsymbols = 0;
ins->symbol_table.symbols = vmalloc(sizeof(symbol_entry_t) * DSP_MAX_SYMBOLS);
ins->symbol_table.symbols = vmalloc(sizeof(struct dsp_symbol_entry) *
DSP_MAX_SYMBOLS);
ins->symbol_table.highest_frag_index = 0;
if (ins->symbol_table.symbols == NULL) {
@ -248,7 +251,7 @@ dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip)
ins->ntask = 0;
ins->nmodules = 0;
ins->modules = kmalloc(sizeof(dsp_module_desc_t) * DSP_MAX_MODULES, GFP_KERNEL);
ins->modules = kmalloc(sizeof(struct dsp_module_desc) * DSP_MAX_MODULES, GFP_KERNEL);
if (ins->modules == NULL) {
cs46xx_dsp_spos_destroy(chip);
@ -277,10 +280,10 @@ dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip)
return ins;
}
void cs46xx_dsp_spos_destroy (cs46xx_t * chip)
void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip)
{
int i;
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
snd_assert(ins != NULL, return);
@ -298,12 +301,12 @@ void cs46xx_dsp_spos_destroy (cs46xx_t * chip)
up(&chip->spos_mutex);
}
int cs46xx_dsp_load_module (cs46xx_t * chip, dsp_module_desc_t * module)
int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
segment_desc_t * code = get_segment_desc (module,SEGTYPE_SP_PROGRAM);
segment_desc_t * parameter = get_segment_desc (module,SEGTYPE_SP_PARAMETER);
segment_desc_t * sample = get_segment_desc (module,SEGTYPE_SP_SAMPLE);
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_segment_desc * code = get_segment_desc (module,SEGTYPE_SP_PROGRAM);
struct dsp_segment_desc * parameter = get_segment_desc (module,SEGTYPE_SP_PARAMETER);
struct dsp_segment_desc * sample = get_segment_desc (module,SEGTYPE_SP_SAMPLE);
u32 doffset, dsize;
if (ins->nmodules == DSP_MAX_MODULES - 1) {
@ -410,10 +413,11 @@ int cs46xx_dsp_load_module (cs46xx_t * chip, dsp_module_desc_t * module)
return 0;
}
symbol_entry_t * cs46xx_dsp_lookup_symbol (cs46xx_t * chip, char * symbol_name, int symbol_type)
struct dsp_symbol_entry *
cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, int symbol_type)
{
int i;
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) {
@ -435,10 +439,11 @@ symbol_entry_t * cs46xx_dsp_lookup_symbol (cs46xx_t * chip, char * symbol_name,
}
static symbol_entry_t * cs46xx_dsp_lookup_symbol_addr (cs46xx_t * chip, u32 address, int symbol_type)
static struct dsp_symbol_entry *
cs46xx_dsp_lookup_symbol_addr (struct snd_cs46xx * chip, u32 address, int symbol_type)
{
int i;
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) {
@ -456,10 +461,11 @@ static symbol_entry_t * cs46xx_dsp_lookup_symbol_addr (cs46xx_t * chip, u32 addr
}
static void cs46xx_dsp_proc_symbol_table_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer)
static void cs46xx_dsp_proc_symbol_table_read (struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
cs46xx_t *chip = entry->private_data;
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct snd_cs46xx *chip = entry->private_data;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int i;
snd_iprintf(buffer, "SYMBOLS:\n");
@ -483,10 +489,11 @@ static void cs46xx_dsp_proc_symbol_table_read (snd_info_entry_t *entry, snd_info
}
static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer)
static void cs46xx_dsp_proc_modules_read (struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
cs46xx_t *chip = entry->private_data;
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct snd_cs46xx *chip = entry->private_data;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int i,j;
down(&chip->spos_mutex);
@ -497,7 +504,7 @@ static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buff
snd_iprintf(buffer, " %d fixups\n", ins->modules[i].nfixups);
for (j = 0; j < ins->modules[i].nsegments; ++ j) {
segment_desc_t * desc = (ins->modules[i].segments + j);
struct dsp_segment_desc * desc = (ins->modules[i].segments + j);
snd_iprintf(buffer, " segment %02x offset %08x size %08x\n",
desc->segment_type,desc->offset, desc->size);
}
@ -505,11 +512,12 @@ static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buff
up(&chip->spos_mutex);
}
static void cs46xx_dsp_proc_task_tree_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer)
static void cs46xx_dsp_proc_task_tree_read (struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
cs46xx_t *chip = entry->private_data;
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
int i,j,col;
struct snd_cs46xx *chip = entry->private_data;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int i, j, col;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
down(&chip->spos_mutex);
@ -532,10 +540,11 @@ static void cs46xx_dsp_proc_task_tree_read (snd_info_entry_t *entry, snd_info_bu
up(&chip->spos_mutex);
}
static void cs46xx_dsp_proc_scb_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer)
static void cs46xx_dsp_proc_scb_read (struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
cs46xx_t *chip = entry->private_data;
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct snd_cs46xx *chip = entry->private_data;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int i;
down(&chip->spos_mutex);
@ -564,13 +573,14 @@ static void cs46xx_dsp_proc_scb_read (snd_info_entry_t *entry, snd_info_buffer_t
up(&chip->spos_mutex);
}
static void cs46xx_dsp_proc_parameter_dump_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer)
static void cs46xx_dsp_proc_parameter_dump_read (struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
cs46xx_t *chip = entry->private_data;
/*dsp_spos_instance_t * ins = chip->dsp_spos_instance; */
unsigned int i,col = 0;
struct snd_cs46xx *chip = entry->private_data;
/*struct dsp_spos_instance * ins = chip->dsp_spos_instance; */
unsigned int i, col = 0;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
symbol_entry_t * symbol;
struct dsp_symbol_entry * symbol;
for (i = 0;i < DSP_PARAMETER_BYTE_SIZE; i += sizeof(u32),col ++) {
if (col == 4) {
@ -591,9 +601,10 @@ static void cs46xx_dsp_proc_parameter_dump_read (snd_info_entry_t *entry, snd_in
}
}
static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer)
static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
cs46xx_t *chip = entry->private_data;
struct snd_cs46xx *chip = entry->private_data;
int i,col = 0;
void __iomem *dst = chip->region.idx[2].remap_addr;
@ -738,10 +749,10 @@ static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_
snd_iprintf(buffer,"\n");
}
int cs46xx_dsp_proc_init (snd_card_t * card, cs46xx_t *chip)
int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
{
snd_info_entry_t *entry;
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct snd_info_entry *entry;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int i;
ins->snd_card = card;
@ -852,9 +863,9 @@ int cs46xx_dsp_proc_init (snd_card_t * card, cs46xx_t *chip)
return 0;
}
int cs46xx_dsp_proc_done (cs46xx_t *chip)
int cs46xx_dsp_proc_done (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int i;
if (ins->proc_sym_info_entry) {
@ -903,7 +914,8 @@ int cs46xx_dsp_proc_done (cs46xx_t *chip)
}
static int debug_tree;
static void _dsp_create_task_tree (cs46xx_t *chip,u32 * task_data, u32 dest, int size)
static void _dsp_create_task_tree (struct snd_cs46xx *chip, u32 * task_data,
u32 dest, int size)
{
void __iomem *spdst = chip->region.idx[1].remap_addr +
DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32);
@ -917,7 +929,7 @@ static void _dsp_create_task_tree (cs46xx_t *chip,u32 * task_data, u32 dest, in
}
static int debug_scb;
static void _dsp_create_scb (cs46xx_t *chip,u32 * scb_data, u32 dest)
static void _dsp_create_scb (struct snd_cs46xx *chip, u32 * scb_data, u32 dest)
{
void __iomem *spdst = chip->region.idx[1].remap_addr +
DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32);
@ -930,7 +942,7 @@ static void _dsp_create_scb (cs46xx_t *chip,u32 * scb_data, u32 dest)
}
}
static int find_free_scb_index (dsp_spos_instance_t * ins)
static int find_free_scb_index (struct dsp_spos_instance * ins)
{
int index = ins->nscb, i;
@ -944,10 +956,10 @@ static int find_free_scb_index (dsp_spos_instance_t * ins)
return index;
}
static dsp_scb_descriptor_t * _map_scb (cs46xx_t *chip,char * name,u32 dest)
static struct dsp_scb_descriptor * _map_scb (struct snd_cs46xx *chip, char * name, u32 dest)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * desc = NULL;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_scb_descriptor * desc = NULL;
int index;
if (ins->nscb == DSP_MAX_SCB_DESC - 1) {
@ -977,10 +989,11 @@ static dsp_scb_descriptor_t * _map_scb (cs46xx_t *chip,char * name,u32 dest)
return desc;
}
static dsp_task_descriptor_t * _map_task_tree (cs46xx_t *chip,char * name,u32 dest,u32 size)
static struct dsp_task_descriptor *
_map_task_tree (struct snd_cs46xx *chip, char * name, u32 dest, u32 size)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_task_descriptor_t * desc = NULL;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_task_descriptor * desc = NULL;
if (ins->ntask == DSP_MAX_TASK_DESC - 1) {
snd_printk(KERN_ERR "dsp_spos: got no place for other TASK\n");
@ -1000,9 +1013,10 @@ static dsp_task_descriptor_t * _map_task_tree (cs46xx_t *chip,char * name,u32 de
return desc;
}
dsp_scb_descriptor_t * cs46xx_dsp_create_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest)
struct dsp_scb_descriptor *
cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest)
{
dsp_scb_descriptor_t * desc;
struct dsp_scb_descriptor * desc;
desc = _map_scb (chip,name,dest);
if (desc) {
@ -1015,9 +1029,11 @@ dsp_scb_descriptor_t * cs46xx_dsp_create_scb (cs46xx_t *chip,char * name, u32 *
}
static dsp_task_descriptor_t * cs46xx_dsp_create_task_tree (cs46xx_t *chip,char * name, u32 * task_data,u32 dest,int size)
static struct dsp_task_descriptor *
cs46xx_dsp_create_task_tree (struct snd_cs46xx *chip, char * name, u32 * task_data,
u32 dest, int size)
{
dsp_task_descriptor_t * desc;
struct dsp_task_descriptor * desc;
desc = _map_task_tree (chip,name,dest,size);
if (desc) {
@ -1029,31 +1045,31 @@ static dsp_task_descriptor_t * cs46xx_dsp_create_task_tree (cs46xx_t *chip,char
return desc;
}
int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
symbol_entry_t * fg_task_tree_header_code;
symbol_entry_t * task_tree_header_code;
symbol_entry_t * task_tree_thread;
symbol_entry_t * null_algorithm;
symbol_entry_t * magic_snoop_task;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_symbol_entry * fg_task_tree_header_code;
struct dsp_symbol_entry * task_tree_header_code;
struct dsp_symbol_entry * task_tree_thread;
struct dsp_symbol_entry * null_algorithm;
struct dsp_symbol_entry * magic_snoop_task;
dsp_scb_descriptor_t * timing_master_scb;
dsp_scb_descriptor_t * codec_out_scb;
dsp_scb_descriptor_t * codec_in_scb;
dsp_scb_descriptor_t * src_task_scb;
dsp_scb_descriptor_t * master_mix_scb;
dsp_scb_descriptor_t * rear_mix_scb;
dsp_scb_descriptor_t * record_mix_scb;
dsp_scb_descriptor_t * write_back_scb;
dsp_scb_descriptor_t * vari_decimate_scb;
dsp_scb_descriptor_t * rear_codec_out_scb;
dsp_scb_descriptor_t * clfe_codec_out_scb;
dsp_scb_descriptor_t * magic_snoop_scb;
struct dsp_scb_descriptor * timing_master_scb;
struct dsp_scb_descriptor * codec_out_scb;
struct dsp_scb_descriptor * codec_in_scb;
struct dsp_scb_descriptor * src_task_scb;
struct dsp_scb_descriptor * master_mix_scb;
struct dsp_scb_descriptor * rear_mix_scb;
struct dsp_scb_descriptor * record_mix_scb;
struct dsp_scb_descriptor * write_back_scb;
struct dsp_scb_descriptor * vari_decimate_scb;
struct dsp_scb_descriptor * rear_codec_out_scb;
struct dsp_scb_descriptor * clfe_codec_out_scb;
struct dsp_scb_descriptor * magic_snoop_scb;
int fifo_addr,fifo_span,valid_slots;
int fifo_addr, fifo_span, valid_slots;
static spos_control_block_t sposcb = {
static struct dsp_spos_control_block sposcb = {
/* 0 */ HFG_TREE_SCB,HFG_STACK,
/* 1 */ SPOSCB_ADDR,BG_TREE_SCB_ADDR,
/* 2 */ DSP_SPOS_DC,0,
@ -1106,7 +1122,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
{
/* create the null SCB */
static generic_scb_t null_scb = {
static struct dsp_generic_scb null_scb = {
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
NULL_SCB_ADDR, NULL_SCB_ADDR,
@ -1128,7 +1144,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
{
/* setup foreground task tree */
static task_tree_control_block_t fg_task_tree_hdr = {
static struct dsp_task_tree_control_block fg_task_tree_hdr = {
{ FG_TASK_HEADER_ADDR | (DSP_SPOS_DC << 0x10),
DSP_SPOS_DC_DC,
DSP_SPOS_DC_DC,
@ -1204,7 +1220,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
{
/* setup foreground task tree */
static task_tree_control_block_t bg_task_tree_hdr = {
static struct dsp_task_tree_control_block bg_task_tree_hdr = {
{ DSP_SPOS_DC_DC,
DSP_SPOS_DC_DC,
DSP_SPOS_DC_DC,
@ -1313,7 +1329,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
if (!write_back_scb) goto _fail_end;
{
static mix2_ostream_spb_t mix2_ostream_spb = {
static struct dsp_mix2_ostream_spb mix2_ostream_spb = {
0x00020000,
0x0000ffff
};
@ -1448,13 +1464,14 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
return -EINVAL;
}
static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entry)
static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
struct dsp_scb_descriptor * fg_entry)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
symbol_entry_t * s16_async_codec_input_task;
symbol_entry_t * spdifo_task;
symbol_entry_t * spdifi_task;
dsp_scb_descriptor_t * spdifi_scb_desc,* spdifo_scb_desc,* async_codec_scb_desc;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_symbol_entry * s16_async_codec_input_task;
struct dsp_symbol_entry * spdifo_task;
struct dsp_symbol_entry * spdifi_task;
struct dsp_scb_descriptor * spdifi_scb_desc, * spdifo_scb_desc, * async_codec_scb_desc;
s16_async_codec_input_task = cs46xx_dsp_lookup_symbol(chip, "S16_ASYNCCODECINPUTTASK", SYMBOL_CODE);
if (s16_async_codec_input_task == NULL) {
@ -1475,7 +1492,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr
{
/* 0xBC0 */
spdifoscb_t spdifo_scb = {
struct dsp_spdifoscb spdifo_scb = {
/* 0 */ DSP_SPOS_UUUU,
{
/* 1 */ 0xb0,
@ -1504,7 +1521,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr
};
/* 0xBB0 */
spdifiscb_t spdifi_scb = {
struct dsp_spdifiscb spdifi_scb = {
/* 0 */ DSP_SPOS_UULO,DSP_SPOS_UUHI,
/* 1 */ 0,
/* 2 */ 0,
@ -1529,7 +1546,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr
};
/* 0xBA0 */
async_codec_input_scb_t async_codec_input_scb = {
struct dsp_async_codec_input_scb async_codec_input_scb = {
/* 0 */ DSP_SPOS_UUUU,
/* 1 */ 0,
/* 2 */ 0,
@ -1620,9 +1637,9 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr
}
static void cs46xx_dsp_disable_spdif_hw (cs46xx_t *chip)
static void cs46xx_dsp_disable_spdif_hw (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
/* set SPDIF output FIFO slot */
snd_cs46xx_pokeBA0(chip, BA0_ASER_FADDR, 0);
@ -1641,9 +1658,9 @@ static void cs46xx_dsp_disable_spdif_hw (cs46xx_t *chip)
ins->spdif_status_out &= ~DSP_SPDIF_STATUS_HW_ENABLED;
}
int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip)
int cs46xx_dsp_enable_spdif_hw (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
/* if hw-ctrl already enabled, turn off to reset logic ... */
cs46xx_dsp_disable_spdif_hw (chip);
@ -1664,9 +1681,9 @@ int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip)
return 0;
}
int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip)
int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
/* turn on amplifier */
chip->active_ctrl(chip, 1);
@ -1724,9 +1741,9 @@ int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip)
return 0;
}
int cs46xx_dsp_disable_spdif_in (cs46xx_t *chip)
int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
snd_assert (ins->asynch_rx_scb != NULL, return -EINVAL);
snd_assert (ins->spdif_in_src != NULL,return -EINVAL);
@ -1750,9 +1767,9 @@ int cs46xx_dsp_disable_spdif_in (cs46xx_t *chip)
return 0;
}
int cs46xx_dsp_enable_pcm_capture (cs46xx_t *chip)
int cs46xx_dsp_enable_pcm_capture (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
snd_assert (ins->pcm_input == NULL,return -EINVAL);
snd_assert (ins->ref_snoop_scb != NULL,return -EINVAL);
@ -1765,9 +1782,9 @@ int cs46xx_dsp_enable_pcm_capture (cs46xx_t *chip)
return 0;
}
int cs46xx_dsp_disable_pcm_capture (cs46xx_t *chip)
int cs46xx_dsp_disable_pcm_capture (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
snd_assert (ins->pcm_input != NULL,return -EINVAL);
@ -1779,9 +1796,9 @@ int cs46xx_dsp_disable_pcm_capture (cs46xx_t *chip)
return 0;
}
int cs46xx_dsp_enable_adc_capture (cs46xx_t *chip)
int cs46xx_dsp_enable_adc_capture (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
snd_assert (ins->adc_input == NULL,return -EINVAL);
snd_assert (ins->codec_in_scb != NULL,return -EINVAL);
@ -1794,9 +1811,9 @@ int cs46xx_dsp_enable_adc_capture (cs46xx_t *chip)
return 0;
}
int cs46xx_dsp_disable_adc_capture (cs46xx_t *chip)
int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
snd_assert (ins->adc_input != NULL,return -EINVAL);
@ -1808,7 +1825,7 @@ int cs46xx_dsp_disable_adc_capture (cs46xx_t *chip)
return 0;
}
int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data)
int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data)
{
u32 temp;
int i;
@ -1845,10 +1862,10 @@ int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data)
return 0;
}
int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right)
int cs46xx_dsp_set_dac_volume (struct snd_cs46xx * chip, u16 left, u16 right)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_scb_descriptor * scb;
down(&chip->spos_mutex);
@ -1874,8 +1891,9 @@ int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right)
return 0;
}
int cs46xx_dsp_set_iec958_volume (cs46xx_t * chip,u16 left,u16 right) {
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right)
{
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
down(&chip->spos_mutex);

View file

@ -43,7 +43,7 @@
/* this instruction types
needs to be reallocated when load
code into DSP */
typedef enum {
enum wide_opcode {
WIDE_FOR_BEGIN_LOOP = 0x20,
WIDE_FOR_BEGIN_LOOP2,
@ -58,7 +58,7 @@ typedef enum {
WIDE_TBEQ_COND_CALL1_ADDR,
WIDE_TBEQ_NCOND_GOTOI_ADDR,
WIDE_TBEQ_NCOND_CALL1_ADDR,
} wide_opcode_t;
};
/* SAMPLE segment */
#define VARI_DECIMATE_BUF1 0x0000
@ -186,7 +186,8 @@ typedef enum {
#define SP_SPDOUT_CONTROL 0x804D
#define SP_SPDOUT_CSUV 0x808E
static inline u8 _wrap_all_bits (u8 val) {
static inline u8 _wrap_all_bits (u8 val)
{
u8 wrapped;
/* wrap all 8 bits */
@ -201,11 +202,10 @@ static inline u8 _wrap_all_bits (u8 val) {
((val & 0x80) >> 7);
return wrapped;
}
static inline void cs46xx_dsp_spos_update_scb (cs46xx_t * chip,dsp_scb_descriptor_t * scb)
static inline void cs46xx_dsp_spos_update_scb (struct snd_cs46xx * chip,
struct dsp_scb_descriptor * scb)
{
/* update nextSCB and subListPtr in SCB */
snd_cs46xx_poke(chip,
@ -214,8 +214,10 @@ static inline void cs46xx_dsp_spos_update_scb (cs46xx_t * chip,dsp_scb_descripto
(scb->next_scb_ptr->address));
}
static inline void cs46xx_dsp_scb_set_volume (cs46xx_t * chip,dsp_scb_descriptor_t * scb,
u16 left,u16 right) {
static inline void cs46xx_dsp_scb_set_volume (struct snd_cs46xx * chip,
struct dsp_scb_descriptor * scb,
u16 left, u16 right)
{
unsigned int val = ((0xffff - left) << 16 | (0xffff - right));
snd_cs46xx_poke(chip, (scb->address + SCBVolumeCtrl) << 2, val);

View file

@ -36,14 +36,14 @@
#include "cs46xx_lib.h"
#include "dsp_spos.h"
typedef struct _proc_scb_info_t {
dsp_scb_descriptor_t * scb_desc;
cs46xx_t *chip;
} proc_scb_info_t;
struct proc_scb_info {
struct dsp_scb_descriptor * scb_desc;
struct snd_cs46xx *chip;
};
static void remove_symbol (cs46xx_t * chip,symbol_entry_t * symbol)
static void remove_symbol (struct snd_cs46xx * chip, struct dsp_symbol_entry * symbol)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int symbol_index = (int)(symbol - ins->symbol_table.symbols);
snd_assert(ins->symbol_table.nsymbols > 0,return);
@ -64,12 +64,13 @@ static void remove_symbol (cs46xx_t * chip,symbol_entry_t * symbol)
}
static void cs46xx_dsp_proc_scb_info_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer)
static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
proc_scb_info_t * scb_info = (proc_scb_info_t *)entry->private_data;
dsp_scb_descriptor_t * scb = scb_info->scb_desc;
dsp_spos_instance_t * ins;
cs46xx_t *chip = scb_info->chip;
struct proc_scb_info * scb_info = entry->private_data;
struct dsp_scb_descriptor * scb = scb_info->scb_desc;
struct dsp_spos_instance * ins;
struct snd_cs46xx *chip = scb_info->chip;
int j,col;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
@ -106,9 +107,9 @@ static void cs46xx_dsp_proc_scb_info_read (snd_info_entry_t *entry, snd_info_buf
up(&chip->spos_mutex);
}
static void _dsp_unlink_scb (cs46xx_t *chip,dsp_scb_descriptor_t * scb)
static void _dsp_unlink_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
unsigned long flags;
if ( scb->parent_scb_ptr ) {
@ -160,7 +161,8 @@ static void _dsp_unlink_scb (cs46xx_t *chip,dsp_scb_descriptor_t * scb)
}
}
static void _dsp_clear_sample_buffer (cs46xx_t *chip, u32 sample_buffer_addr, int dword_count)
static void _dsp_clear_sample_buffer (struct snd_cs46xx *chip, u32 sample_buffer_addr,
int dword_count)
{
void __iomem *dst = chip->region.idx[2].remap_addr + sample_buffer_addr;
int i;
@ -171,9 +173,9 @@ static void _dsp_clear_sample_buffer (cs46xx_t *chip, u32 sample_buffer_addr, in
}
}
void cs46xx_dsp_remove_scb (cs46xx_t *chip, dsp_scb_descriptor_t * scb)
void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
/* check integrety */
snd_assert ( (scb->index >= 0 &&
@ -218,10 +220,10 @@ void cs46xx_dsp_remove_scb (cs46xx_t *chip, dsp_scb_descriptor_t * scb)
}
void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb)
void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb)
{
if (scb->proc_info) {
proc_scb_info_t * scb_info = (proc_scb_info_t *)scb->proc_info->private_data;
struct proc_scb_info * scb_info = scb->proc_info->private_data;
snd_printdd("cs46xx_dsp_proc_free_scb_desc: freeing %s\n",scb->scb_name);
@ -233,11 +235,12 @@ void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb)
}
}
void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * scb)
void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
struct dsp_scb_descriptor * scb)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
snd_info_entry_t * entry;
proc_scb_info_t * scb_info;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct snd_info_entry * entry;
struct proc_scb_info * scb_info;
/* register to proc */
if (ins->snd_card != NULL && ins->proc_dsp_dir != NULL &&
@ -245,7 +248,7 @@ void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * sc
if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name,
ins->proc_dsp_dir)) != NULL) {
scb_info = kmalloc(sizeof(proc_scb_info_t), GFP_KERNEL);
scb_info = kmalloc(sizeof(struct proc_scb_info), GFP_KERNEL);
if (!scb_info) {
snd_info_free_entry(entry);
entry = NULL;
@ -273,14 +276,14 @@ out:
}
}
static dsp_scb_descriptor_t *
_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest,
symbol_entry_t * task_entry,
dsp_scb_descriptor_t * parent_scb,
static struct dsp_scb_descriptor *
_dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest,
struct dsp_symbol_entry * task_entry,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_scb_descriptor * scb;
unsigned long flags;
@ -342,13 +345,13 @@ _dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest,
return scb;
}
static dsp_scb_descriptor_t *
cs46xx_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest,
char * task_entry_name,
dsp_scb_descriptor_t * parent_scb,
static struct dsp_scb_descriptor *
cs46xx_dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data,
u32 dest, char * task_entry_name,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
symbol_entry_t * task_entry;
struct dsp_symbol_entry * task_entry;
task_entry = cs46xx_dsp_lookup_symbol (chip,task_entry_name,
SYMBOL_CODE);
@ -362,12 +365,12 @@ cs46xx_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 de
parent_scb,scb_child_type);
}
dsp_scb_descriptor_t *
cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip)
struct dsp_scb_descriptor *
cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip)
{
dsp_scb_descriptor_t * scb;
struct dsp_scb_descriptor * scb;
timing_master_scb_t timing_master_scb = {
struct dsp_timing_master_scb timing_master_scb = {
{ 0,
0,
0,
@ -396,16 +399,15 @@ cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip)
}
dsp_scb_descriptor_t *
cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name,
u16 channel_disp,u16 fifo_addr,
u16 child_scb_addr,
u32 dest,dsp_scb_descriptor_t * parent_scb,
struct dsp_scb_descriptor *
cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip, char * codec_name,
u16 channel_disp, u16 fifo_addr, u16 child_scb_addr,
u32 dest, struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_scb_descriptor_t * scb;
struct dsp_scb_descriptor * scb;
codec_output_scb_t codec_out_scb = {
struct dsp_codec_output_scb codec_out_scb = {
{ 0,
0,
0,
@ -435,16 +437,15 @@ cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name,
return scb;
}
dsp_scb_descriptor_t *
cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name,
u16 channel_disp,u16 fifo_addr,
u16 sample_buffer_addr,
u32 dest,dsp_scb_descriptor_t * parent_scb,
int scb_child_type)
struct dsp_scb_descriptor *
cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
u16 channel_disp, u16 fifo_addr, u16 sample_buffer_addr,
u32 dest, struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_scb_descriptor_t * scb;
codec_input_scb_t codec_input_scb = {
struct dsp_scb_descriptor * scb;
struct dsp_codec_input_scb codec_input_scb = {
{ 0,
0,
0,
@ -481,17 +482,17 @@ cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name,
}
static dsp_scb_descriptor_t *
cs46xx_dsp_create_pcm_reader_scb(cs46xx_t * chip,char * scb_name,
u16 sample_buffer_addr,u32 dest,
static struct dsp_scb_descriptor *
cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
u16 sample_buffer_addr, u32 dest,
int virtual_channel, u32 playback_hw_addr,
dsp_scb_descriptor_t * parent_scb,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_scb_descriptor * scb;
generic_scb_t pcm_reader_scb = {
struct dsp_generic_scb pcm_reader_scb = {
/*
Play DMA Task xfers data from host buffer to SP buffer
@ -584,18 +585,18 @@ cs46xx_dsp_create_pcm_reader_scb(cs46xx_t * chip,char * scb_name,
#define GOF_PER_SEC 200
dsp_scb_descriptor_t *
cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name,
struct dsp_scb_descriptor *
cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name,
int rate,
u16 src_buffer_addr,
u16 src_delay_buffer_addr,u32 dest,
dsp_scb_descriptor_t * parent_scb,
u16 src_delay_buffer_addr, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type,
int pass_through)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_scb_descriptor * scb;
unsigned int tmp1, tmp2;
unsigned int phiIncr;
unsigned int correctionPerGOF, correctionPerSec;
@ -632,7 +633,7 @@ cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name,
correctionPerSec = tmp1;
{
src_task_scb_t src_task_scb = {
struct dsp_src_task_scb src_task_scb = {
0x0028,0x00c8,
0x5555,0x0000,
0x0000,0x0000,
@ -688,14 +689,14 @@ cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name,
}
#if 0 /* not used */
dsp_scb_descriptor_t *
cs46xx_dsp_create_filter_scb(cs46xx_t * chip,char * scb_name,
u16 buffer_addr,u32 dest,
dsp_scb_descriptor_t * parent_scb,
struct dsp_scb_descriptor *
cs46xx_dsp_create_filter_scb(struct snd_cs46xx * chip, char * scb_name,
u16 buffer_addr, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type) {
dsp_scb_descriptor_t * scb;
struct dsp_scb_descriptor * scb;
filter_scb_t filter_scb = {
struct dsp_filter_scb filter_scb = {
.a0_right = 0x41a9,
.a0_left = 0x41a9,
.a1_right = 0xb8e4,
@ -738,15 +739,15 @@ cs46xx_dsp_create_filter_scb(cs46xx_t * chip,char * scb_name,
}
#endif /* not used */
dsp_scb_descriptor_t *
cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name,
u16 mix_buffer_addr,u32 dest,
dsp_scb_descriptor_t * parent_scb,
struct dsp_scb_descriptor *
cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name,
u16 mix_buffer_addr, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_scb_descriptor_t * scb;
struct dsp_scb_descriptor * scb;
mix_only_scb_t master_mix_scb = {
struct dsp_mix_only_scb master_mix_scb = {
/* 0 */ { 0,
/* 1 */ 0,
/* 2 */ mix_buffer_addr,
@ -778,15 +779,15 @@ cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name,
}
dsp_scb_descriptor_t *
cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name,
u16 mix_buffer_addr,u16 writeback_spb,u32 dest,
dsp_scb_descriptor_t * parent_scb,
struct dsp_scb_descriptor *
cs46xx_dsp_create_mix_to_ostream_scb(struct snd_cs46xx * chip, char * scb_name,
u16 mix_buffer_addr, u16 writeback_spb, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_scb_descriptor_t * scb;
struct dsp_scb_descriptor * scb;
mix2_ostream_scb_t mix2_ostream_scb = {
struct dsp_mix2_ostream_scb mix2_ostream_scb = {
/* Basic (non scatter/gather) DMA requestor (4 ints) */
{
DMA_RQ_C1_SOURCE_MOD64 +
@ -832,18 +833,18 @@ cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name,
}
dsp_scb_descriptor_t *
cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name,
struct dsp_scb_descriptor *
cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx * chip,char * scb_name,
u16 vari_buffer_addr0,
u16 vari_buffer_addr1,
u32 dest,
dsp_scb_descriptor_t * parent_scb,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_scb_descriptor_t * scb;
struct dsp_scb_descriptor * scb;
vari_decimate_scb_t vari_decimate_scb = {
struct dsp_vari_decimate_scb vari_decimate_scb = {
0x0028,0x00c8,
0x5555,0x0000,
0x0000,0x0000,
@ -876,17 +877,17 @@ cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name,
}
static dsp_scb_descriptor_t *
cs46xx_dsp_create_pcm_serial_input_scb(cs46xx_t * chip,char * scb_name,u32 dest,
dsp_scb_descriptor_t * input_scb,
dsp_scb_descriptor_t * parent_scb,
static struct dsp_scb_descriptor *
cs46xx_dsp_create_pcm_serial_input_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
struct dsp_scb_descriptor * input_scb,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_scb_descriptor_t * scb;
struct dsp_scb_descriptor * scb;
pcm_serial_input_scb_t pcm_serial_input_scb = {
struct dsp_pcm_serial_input_scb pcm_serial_input_scb = {
{ 0,
0,
0,
@ -919,17 +920,17 @@ cs46xx_dsp_create_pcm_serial_input_scb(cs46xx_t * chip,char * scb_name,u32 dest,
}
static dsp_scb_descriptor_t *
cs46xx_dsp_create_asynch_fg_tx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
static struct dsp_scb_descriptor *
cs46xx_dsp_create_asynch_fg_tx_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
u16 hfg_scb_address,
u16 asynch_buffer_address,
dsp_scb_descriptor_t * parent_scb,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_scb_descriptor_t * scb;
struct dsp_scb_descriptor * scb;
asynch_fg_tx_scb_t asynch_fg_tx_scb = {
struct dsp_asynch_fg_tx_scb asynch_fg_tx_scb = {
0xfc00,0x03ff, /* Prototype sample buffer size of 256 dwords */
0x0058,0x0028, /* Min Delta 7 dwords == 28 bytes */
/* : Max delta 25 dwords == 100 bytes */
@ -966,17 +967,17 @@ cs46xx_dsp_create_asynch_fg_tx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
}
dsp_scb_descriptor_t *
cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
struct dsp_scb_descriptor *
cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
u16 hfg_scb_address,
u16 asynch_buffer_address,
dsp_scb_descriptor_t * parent_scb,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_scb_descriptor * scb;
asynch_fg_rx_scb_t asynch_fg_rx_scb = {
struct dsp_asynch_fg_rx_scb asynch_fg_rx_scb = {
0xfe00,0x01ff, /* Prototype sample buffer size of 128 dwords */
0x0064,0x001c, /* Min Delta 7 dwords == 28 bytes */
/* : Max delta 25 dwords == 100 bytes */
@ -1016,17 +1017,17 @@ cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
#if 0 /* not used */
dsp_scb_descriptor_t *
cs46xx_dsp_create_output_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest,
struct dsp_scb_descriptor *
cs46xx_dsp_create_output_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
u16 snoop_buffer_address,
dsp_scb_descriptor_t * snoop_scb,
dsp_scb_descriptor_t * parent_scb,
struct dsp_scb_descriptor * snoop_scb,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_scb_descriptor_t * scb;
struct dsp_scb_descriptor * scb;
output_snoop_scb_t output_snoop_scb = {
struct dsp_output_snoop_scb output_snoop_scb = {
{ 0, /* not used. Zero */
0,
0,
@ -1058,14 +1059,14 @@ cs46xx_dsp_create_output_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest,
#endif /* not used */
dsp_scb_descriptor_t *
cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest,
dsp_scb_descriptor_t * parent_scb,
struct dsp_scb_descriptor *
cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_scb_descriptor_t * scb;
struct dsp_scb_descriptor * scb;
spio_write_scb_t spio_write_scb = {
struct dsp_spio_write_scb spio_write_scb = {
0,0, /* SPIOWAddress2:SPIOWAddress1; */
0, /* SPIOWData1; */
0, /* SPIOWData2; */
@ -1094,15 +1095,16 @@ cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest,
return scb;
}
dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest,
u16 snoop_buffer_address,
dsp_scb_descriptor_t * snoop_scb,
dsp_scb_descriptor_t * parent_scb,
int scb_child_type)
struct dsp_scb_descriptor *
cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
u16 snoop_buffer_address,
struct dsp_scb_descriptor * snoop_scb,
struct dsp_scb_descriptor * parent_scb,
int scb_child_type)
{
dsp_scb_descriptor_t * scb;
struct dsp_scb_descriptor * scb;
magic_snoop_task_t magic_snoop_scb = {
struct dsp_magic_snoop_task magic_snoop_scb = {
/* 0 */ 0, /* i0 */
/* 1 */ 0, /* i1 */
/* 2 */ snoop_buffer_address << 0x10,
@ -1129,10 +1131,11 @@ dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char *
return scb;
}
static dsp_scb_descriptor_t * find_next_free_scb (cs46xx_t * chip,dsp_scb_descriptor_t * from)
static struct dsp_scb_descriptor *
find_next_free_scb (struct snd_cs46xx * chip, struct dsp_scb_descriptor * from)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb = from;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_scb_descriptor * scb = from;
while (scb->next_scb_ptr != ins->the_null_scb) {
snd_assert (scb->next_scb_ptr != NULL, return NULL);
@ -1212,18 +1215,19 @@ static u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = {
0x2B00
};
pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,
u32 sample_rate, void * private_data,
u32 hw_dma_addr,
int pcm_channel_id)
struct dsp_pcm_channel_descriptor *
cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
u32 sample_rate, void * private_data,
u32 hw_dma_addr,
int pcm_channel_id)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * src_scb = NULL,* pcm_scb, * mixer_scb = NULL;
dsp_scb_descriptor_t * src_parent_scb = NULL;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_scb_descriptor * src_scb = NULL, * pcm_scb, * mixer_scb = NULL;
struct dsp_scb_descriptor * src_parent_scb = NULL;
/* dsp_scb_descriptor_t * pcm_parent_scb; */
/* struct dsp_scb_descriptor * pcm_parent_scb; */
char scb_name[DSP_MAX_SCB_NAME];
int i,pcm_index = -1, insert_point, src_index = -1,pass_through = 0;
int i, pcm_index = -1, insert_point, src_index = -1, pass_through = 0;
unsigned long flags;
switch (pcm_channel_id) {
@ -1371,8 +1375,8 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,
return (ins->pcm_channels + pcm_index);
}
int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip,
pcm_channel_descriptor_t * pcm_channel,
int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip,
struct dsp_pcm_channel_descriptor * pcm_channel,
int period_size)
{
u32 temp = snd_cs46xx_peek (chip,pcm_channel->pcm_reader_scb->address << 2);
@ -1410,7 +1414,7 @@ int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip,
return 0;
}
int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip,
int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip,
int period_size)
{
u32 temp = snd_cs46xx_peek (chip,WRITEBACK_SCB_ADDR << 2);
@ -1448,9 +1452,10 @@ int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip,
return 0;
}
void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel)
void cs46xx_dsp_destroy_pcm_channel (struct snd_cs46xx * chip,
struct dsp_pcm_channel_descriptor * pcm_channel)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
unsigned long flags;
snd_assert(pcm_channel->active, return );
@ -1478,9 +1483,10 @@ void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip,pcm_channel_descriptor_t *
}
}
int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel)
int cs46xx_dsp_pcm_unlink (struct snd_cs46xx * chip,
struct dsp_pcm_channel_descriptor * pcm_channel)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
unsigned long flags;
snd_assert(pcm_channel->active,return -EIO);
@ -1503,11 +1509,12 @@ int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channe
return 0;
}
int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel)
int cs46xx_dsp_pcm_link (struct snd_cs46xx * chip,
struct dsp_pcm_channel_descriptor * pcm_channel)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * parent_scb;
dsp_scb_descriptor_t * src_scb = pcm_channel->src_scb;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_scb_descriptor * parent_scb;
struct dsp_scb_descriptor * src_scb = pcm_channel->src_scb;
unsigned long flags;
spin_lock(&pcm_channel->src_scb->lock);
@ -1544,12 +1551,13 @@ int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel)
return 0;
}
dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descriptor_t * source,
u16 addr,char * scb_name)
struct dsp_scb_descriptor *
cs46xx_add_record_source (struct snd_cs46xx *chip, struct dsp_scb_descriptor * source,
u16 addr, char * scb_name)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * parent;
dsp_scb_descriptor_t * pcm_input;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_scb_descriptor * parent;
struct dsp_scb_descriptor * pcm_input;
int insert_point;
snd_assert (ins->record_mixer_scb != NULL,return NULL);
@ -1569,7 +1577,7 @@ dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descript
return pcm_input;
}
int cs46xx_src_unlink(cs46xx_t *chip,dsp_scb_descriptor_t * src)
int cs46xx_src_unlink(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src)
{
snd_assert (src->parent_scb_ptr != NULL, return -EINVAL );
@ -1581,10 +1589,10 @@ int cs46xx_src_unlink(cs46xx_t *chip,dsp_scb_descriptor_t * src)
return 0;
}
int cs46xx_src_link(cs46xx_t *chip,dsp_scb_descriptor_t * src)
int cs46xx_src_link(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * parent_scb;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
struct dsp_scb_descriptor * parent_scb;
snd_assert (src->parent_scb_ptr == NULL, return -EINVAL );
snd_assert(ins->master_mix_scb !=NULL, return -EINVAL );
@ -1605,9 +1613,9 @@ int cs46xx_src_link(cs46xx_t *chip,dsp_scb_descriptor_t * src)
return 0;
}
int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip)
int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
if ( ! (ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED) ) {
cs46xx_dsp_enable_spdif_hw (chip);
@ -1653,9 +1661,9 @@ int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip)
return 0;
}
int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip)
int cs46xx_dsp_disable_spdif_out (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
/* dont touch anything if SPDIF is open */
if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) {
@ -1685,9 +1693,9 @@ int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip)
return 0;
}
int cs46xx_iec958_pre_open (cs46xx_t *chip)
int cs46xx_iec958_pre_open (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
if ( ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED ) {
/* remove AsynchFGTxSCB and and PCMSerialInput_II */
@ -1718,9 +1726,9 @@ int cs46xx_iec958_pre_open (cs46xx_t *chip)
return 0;
}
int cs46xx_iec958_post_close (cs46xx_t *chip)
int cs46xx_iec958_post_close (struct snd_cs46xx *chip)
{
dsp_spos_instance_t * ins = chip->dsp_spos_instance;
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
snd_assert (ins->asynch_tx_scb != NULL, return -EINVAL);

View file

@ -3,7 +3,7 @@
#ifndef __HEADER_cwc4630_H__
#define __HEADER_cwc4630_H__
static symbol_entry_t cwc4630_symbols[] = {
static struct dsp_symbol_entry cwc4630_symbols[] = {
{ 0x0000, "BEGINADDRESS",0x00 },
{ 0x8000, "EXECCHILD",0x03 },
{ 0x8001, "EXECCHILD_98",0x03 },
@ -302,12 +302,12 @@ static u32 cwc4630_parameter[] = {
}; /* #PARAMETER_END */
static segment_desc_t cwc4630_segments[] = {
static struct dsp_segment_desc cwc4630_segments[] = {
{ SEGTYPE_SP_PROGRAM, 0x00000000, 0x00000328, cwc4630_code },
{ SEGTYPE_SP_PARAMETER, 0x00000000, 0x00000080, cwc4630_parameter },
};
static dsp_module_desc_t cwc4630_module = {
static struct dsp_module_desc cwc4630_module = {
"cwc4630",
{
38,

View file

@ -3,7 +3,7 @@
#ifndef __HEADER_cwcasync_H__
#define __HEADER_cwcasync_H__
static symbol_entry_t cwcasync_symbols[] = {
static struct dsp_symbol_entry cwcasync_symbols[] = {
{ 0x8000, "EXECCHILD",0x03 },
{ 0x8001, "EXECCHILD_98",0x03 },
{ 0x8003, "EXECCHILD_PUSH1IND",0x03 },
@ -159,11 +159,11 @@ static u32 cwcasync_code[] = {
};
/* #CODE_END */
static segment_desc_t cwcasync_segments[] = {
static struct dsp_segment_desc cwcasync_segments[] = {
{ SEGTYPE_SP_PROGRAM, 0x00000000, 0x000001b6, cwcasync_code },
};
static dsp_module_desc_t cwcasync_module = {
static struct dsp_module_desc cwcasync_module = {
"cwcasync",
{
32,

View file

@ -4,7 +4,7 @@
#ifndef __HEADER_cwcbinhack_H__
#define __HEADER_cwcbinhack_H__
static symbol_entry_t cwcbinhack_symbols[] = {
static struct dsp_symbol_entry cwcbinhack_symbols[] = {
{ 0x02c8, "OVERLAYBEGINADDRESS",0x00 },
{ 0x02c8, "MAGICSNOOPTASK",0x03 },
{ 0x0308, "#CODE_END",0x00 },
@ -31,11 +31,11 @@ static u32 cwcbinhack_code[] = {
};
/* #CODE_END */
static segment_desc_t cwcbinhack_segments[] = {
static struct dsp_segment_desc cwcbinhack_segments[] = {
{ SEGTYPE_SP_PROGRAM, 0x00000000, 64, cwcbinhack_code },
};
static dsp_module_desc_t cwcbinhack_module = {
static struct dsp_module_desc cwcbinhack_module = {
"cwcbinhack",
{
3,

View file

@ -3,7 +3,7 @@
#ifndef __HEADER_cwcdma_H__
#define __HEADER_cwcdma_H__
static symbol_entry_t cwcdma_symbols[] = {
static struct dsp_symbol_entry cwcdma_symbols[] = {
{ 0x8000, "EXECCHILD",0x03 },
{ 0x8001, "EXECCHILD_98",0x03 },
{ 0x8003, "EXECCHILD_PUSH1IND",0x03 },
@ -51,11 +51,11 @@ static u32 cwcdma_code[] = {
/* #CODE_END */
static segment_desc_t cwcdma_segments[] = {
static struct dsp_segment_desc cwcdma_segments[] = {
{ SEGTYPE_SP_PROGRAM, 0x00000000, 0x00000030, cwcdma_code },
};
static dsp_module_desc_t cwcdma_module = {
static struct dsp_module_desc cwcdma_module = {
"cwcdma",
{
27,

View file

@ -3,7 +3,7 @@
#ifndef __HEADER_cwcemb80_H__
#define __HEADER_cwcemb80_H__
static symbol_entry_t cwcemb80_symbols[] = {
static struct dsp_symbol_entry cwcemb80_symbols[] = {
{ 0x0000, "BEGINADDRESS",0x00 },
{ 0x8000, "EXECCHILD",0x03 },
{ 0x8001, "EXECCHILD_98",0x03 },
@ -1588,13 +1588,13 @@ static u32 cwcemb80_sample[] = {
}; /* #SAMPLE_END */
static segment_desc_t cwcemb80_segments[] = {
static struct dsp_segment_desc cwcemb80_segments[] = {
{ SEGTYPE_SP_PROGRAM, 0x00000000, 0x0000031c, cwcemb80_code },
{ SEGTYPE_SP_PARAMETER, 0x00000000, 0x00000697, cwcemb80_parameter },
{ SEGTYPE_SP_SAMPLE, 0x00000000, 0x00000e00, cwcemb80_sample },
};
static dsp_module_desc_t cwcemb80_module = {
static struct dsp_module_desc cwcemb80_module = {
"cwcemb80",
{
38,

View file

@ -3,7 +3,7 @@
#ifndef __HEADER_cwcsnoop_H__
#define __HEADER_cwcsnoop_H__
static symbol_entry_t cwcsnoop_symbols[] = {
static struct dsp_symbol_entry cwcsnoop_symbols[] = {
{ 0x0500, "OVERLAYBEGINADDRESS",0x00 },
{ 0x0500, "OUTPUTSNOOP",0x03 },
{ 0x051f, "#CODE_END",0x00 },
@ -29,11 +29,11 @@ static u32 cwcsnoop_code[] = {
};
/* #CODE_END */
static segment_desc_t cwcsnoop_segments[] = {
static struct dsp_segment_desc cwcsnoop_segments[] = {
{ SEGTYPE_SP_PROGRAM, 0x00000000, 0x0000003e, cwcsnoop_code },
};
static dsp_module_desc_t cwcsnoop_module = {
static struct dsp_module_desc cwcsnoop_module = {
"cwcsnoop",
{
3,