#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;
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;
#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);
-
-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);
+ struct snd_cs46xx **rcodec);
+
+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 */
/* 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]
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:
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
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
/* 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
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
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
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 */
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 */
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 */
)
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 */
)
/* 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
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)
*/
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
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 */
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 */
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;
)
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
)
u32 free1;
-} spdifiscb_t;
+};
/* SCB for the SP/DIF CODEC input and output */
-typedef struct _spdifoscb_t {
-
+struct dsp_spdifoscb {
u32 free2;
)
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
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
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 */
reserved,
input_scb
)
-} output_snoop_scb_t;
+};
-typedef struct _spio_write_scb_t {
+struct dsp_spio_write_scb {
___DSP_DUAL_16BIT_ALLOC(
address1,
address2
)
u32 unused3[5];
-} spio_write_scb_t;
+};
-typedef struct _magic_snoop_task_t {
+struct dsp_magic_snoop_task {
u32 i0;
u32 i1;
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
b2_right, /* 0x0F */
b2_left
)
-} filter_scb_t;
+};
#endif /* __DSP_SCB_TYPES_H__ */
#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;
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__ */
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;
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,
/* 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,
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(
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 */
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__ */
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)
#include "cs46xx_lib.h"
#include "dsp_spos.h"
-static void amp_voyetra(cs46xx_t *chip, int change);
+static void amp_voyetra(struct snd_cs46xx *chip, int change);
#ifdef CONFIG_SND_CS46XX_NEW_DSP
-static snd_pcm_ops_t snd_cs46xx_playback_rear_ops;
-static snd_pcm_ops_t snd_cs46xx_playback_indirect_rear_ops;
-static snd_pcm_ops_t snd_cs46xx_playback_clfe_ops;
-static snd_pcm_ops_t snd_cs46xx_playback_indirect_clfe_ops;
-static snd_pcm_ops_t snd_cs46xx_playback_iec958_ops;
-static snd_pcm_ops_t snd_cs46xx_playback_indirect_iec958_ops;
+static struct snd_pcm_ops snd_cs46xx_playback_rear_ops;
+static struct snd_pcm_ops snd_cs46xx_playback_indirect_rear_ops;
+static struct snd_pcm_ops snd_cs46xx_playback_clfe_ops;
+static struct snd_pcm_ops snd_cs46xx_playback_indirect_clfe_ops;
+static struct snd_pcm_ops snd_cs46xx_playback_iec958_ops;
+static struct snd_pcm_ops snd_cs46xx_playback_indirect_iec958_ops;
#endif
-static snd_pcm_ops_t snd_cs46xx_playback_ops;
-static snd_pcm_ops_t snd_cs46xx_playback_indirect_ops;
-static snd_pcm_ops_t snd_cs46xx_capture_ops;
-static snd_pcm_ops_t snd_cs46xx_capture_indirect_ops;
+static struct snd_pcm_ops snd_cs46xx_playback_ops;
+static struct snd_pcm_ops snd_cs46xx_playback_indirect_ops;
+static struct snd_pcm_ops snd_cs46xx_capture_ops;
+static struct snd_pcm_ops snd_cs46xx_capture_indirect_ops;
-static unsigned short snd_cs46xx_codec_read(cs46xx_t *chip,
+static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
unsigned short reg,
int codec_index)
{
return result;
}
-static unsigned short snd_cs46xx_ac97_read(ac97_t * ac97,
+static unsigned short snd_cs46xx_ac97_read(struct snd_ac97 * ac97,
unsigned short reg)
{
- cs46xx_t *chip = ac97->private_data;
+ struct snd_cs46xx *chip = ac97->private_data;
unsigned short val;
int codec_index = ac97->num;
}
-static void snd_cs46xx_codec_write(cs46xx_t *chip,
+static void snd_cs46xx_codec_write(struct snd_cs46xx *chip,
unsigned short reg,
unsigned short val,
int codec_index)
chip->active_ctrl(chip, -1);
}
-static void snd_cs46xx_ac97_write(ac97_t *ac97,
+static void snd_cs46xx_ac97_write(struct snd_ac97 *ac97,
unsigned short reg,
unsigned short val)
{
- cs46xx_t *chip = ac97->private_data;
+ struct snd_cs46xx *chip = ac97->private_data;
int codec_index = ac97->num;
snd_assert(codec_index == CS46XX_PRIMARY_CODEC_INDEX ||
* Chip initialization
*/
-int snd_cs46xx_download(cs46xx_t *chip,
+int snd_cs46xx_download(struct snd_cs46xx *chip,
u32 *src,
unsigned long offset,
unsigned long len)
#include "imgs/cwcbinhack.h"
#include "imgs/cwcdma.h"
-int snd_cs46xx_clear_BA1(cs46xx_t *chip,
+int snd_cs46xx_clear_BA1(struct snd_cs46xx *chip,
unsigned long offset,
unsigned long len)
{
#include "cs46xx_image.h"
-int snd_cs46xx_download_image(cs46xx_t *chip)
+int snd_cs46xx_download_image(struct snd_cs46xx *chip)
{
int idx, err;
unsigned long offset = 0;
* Chip reset
*/
-static void snd_cs46xx_reset(cs46xx_t *chip)
+static void snd_cs46xx_reset(struct snd_cs46xx *chip)
{
int idx;
snd_cs46xx_poke(chip, BA1_FRMT, 0xadf);
}
-static int cs46xx_wait_for_fifo(cs46xx_t * chip,int retry_timeout)
+static int cs46xx_wait_for_fifo(struct snd_cs46xx * chip,int retry_timeout)
{
u32 i, status = 0;
/*
return 0;
}
-static void snd_cs46xx_clear_serial_FIFOs(cs46xx_t *chip)
+static void snd_cs46xx_clear_serial_FIFOs(struct snd_cs46xx *chip)
{
int idx, powerdown = 0;
unsigned int tmp;
snd_cs46xx_pokeBA0(chip, BA0_CLKCR1, tmp);
}
-static void snd_cs46xx_proc_start(cs46xx_t *chip)
+static void snd_cs46xx_proc_start(struct snd_cs46xx *chip)
{
int cnt;
snd_printk(KERN_ERR "SPCR_RUNFR never reset\n");
}
-static void snd_cs46xx_proc_stop(cs46xx_t *chip)
+static void snd_cs46xx_proc_stop(struct snd_cs46xx *chip)
{
/*
* Turn off the run, run at frame, and DMA enable bits in the local copy of
#define GOF_PER_SEC 200
-static void snd_cs46xx_set_play_sample_rate(cs46xx_t *chip, unsigned int rate)
+static void snd_cs46xx_set_play_sample_rate(struct snd_cs46xx *chip, unsigned int rate)
{
unsigned long flags;
unsigned int tmp1, tmp2;
spin_unlock_irqrestore(&chip->reg_lock, flags);
}
-static void snd_cs46xx_set_capture_sample_rate(cs46xx_t *chip, unsigned int rate)
+static void snd_cs46xx_set_capture_sample_rate(struct snd_cs46xx *chip, unsigned int rate)
{
unsigned long flags;
unsigned int phiIncr, coeffIncr, tmp1, tmp2;
* PCM part
*/
-static void snd_cs46xx_pb_trans_copy(snd_pcm_substream_t *substream,
- snd_pcm_indirect_t *rec, size_t bytes)
+static void snd_cs46xx_pb_trans_copy(struct snd_pcm_substream *substream,
+ struct snd_pcm_indirect *rec, size_t bytes)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
- cs46xx_pcm_t * cpcm = runtime->private_data;
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_cs46xx_pcm * cpcm = runtime->private_data;
memcpy(cpcm->hw_buf.area + rec->hw_data, runtime->dma_area + rec->sw_data, bytes);
}
-static int snd_cs46xx_playback_transfer(snd_pcm_substream_t *substream)
+static int snd_cs46xx_playback_transfer(struct snd_pcm_substream *substream)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
- cs46xx_pcm_t * cpcm = runtime->private_data;
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_cs46xx_pcm * cpcm = runtime->private_data;
snd_pcm_indirect_playback_transfer(substream, &cpcm->pcm_rec, snd_cs46xx_pb_trans_copy);
return 0;
}
-static void snd_cs46xx_cp_trans_copy(snd_pcm_substream_t *substream,
- snd_pcm_indirect_t *rec, size_t bytes)
+static void snd_cs46xx_cp_trans_copy(struct snd_pcm_substream *substream,
+ struct snd_pcm_indirect *rec, size_t bytes)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
memcpy(runtime->dma_area + rec->sw_data,
chip->capt.hw_buf.area + rec->hw_data, bytes);
}
-static int snd_cs46xx_capture_transfer(snd_pcm_substream_t *substream)
+static int snd_cs46xx_capture_transfer(struct snd_pcm_substream *substream)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
snd_pcm_indirect_capture_transfer(substream, &chip->capt.pcm_rec, snd_cs46xx_cp_trans_copy);
return 0;
}
-static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(snd_pcm_substream_t * substream)
+static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(struct snd_pcm_substream *substream)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
size_t ptr;
- cs46xx_pcm_t *cpcm = substream->runtime->private_data;
+ struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data;
snd_assert (cpcm->pcm_channel,return -ENXIO);
#ifdef CONFIG_SND_CS46XX_NEW_DSP
return ptr >> cpcm->shift;
}
-static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(snd_pcm_substream_t * substream)
+static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(struct snd_pcm_substream *substream)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
size_t ptr;
- cs46xx_pcm_t *cpcm = substream->runtime->private_data;
+ struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data;
#ifdef CONFIG_SND_CS46XX_NEW_DSP
snd_assert (cpcm->pcm_channel,return -ENXIO);
return snd_pcm_indirect_playback_pointer(substream, &cpcm->pcm_rec, ptr);
}
-static snd_pcm_uframes_t snd_cs46xx_capture_direct_pointer(snd_pcm_substream_t * substream)
+static snd_pcm_uframes_t snd_cs46xx_capture_direct_pointer(struct snd_pcm_substream *substream)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
size_t ptr = snd_cs46xx_peek(chip, BA1_CBA) - chip->capt.hw_buf.addr;
return ptr >> chip->capt.shift;
}
-static snd_pcm_uframes_t snd_cs46xx_capture_indirect_pointer(snd_pcm_substream_t * substream)
+static snd_pcm_uframes_t snd_cs46xx_capture_indirect_pointer(struct snd_pcm_substream *substream)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
size_t ptr = snd_cs46xx_peek(chip, BA1_CBA) - chip->capt.hw_buf.addr;
return snd_pcm_indirect_capture_pointer(substream, &chip->capt.pcm_rec, ptr);
}
-static int snd_cs46xx_playback_trigger(snd_pcm_substream_t * substream,
+static int snd_cs46xx_playback_trigger(struct snd_pcm_substream *substream,
int cmd)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
- /*snd_pcm_runtime_t *runtime = substream->runtime;*/
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
+ /*struct snd_pcm_runtime *runtime = substream->runtime;*/
int result = 0;
#ifdef CONFIG_SND_CS46XX_NEW_DSP
- cs46xx_pcm_t *cpcm = substream->runtime->private_data;
+ struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data;
if (! cpcm->pcm_channel) {
return -ENXIO;
}
return result;
}
-static int snd_cs46xx_capture_trigger(snd_pcm_substream_t * substream,
+static int snd_cs46xx_capture_trigger(struct snd_pcm_substream *substream,
int cmd)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
unsigned int tmp;
int result = 0;
}
#ifdef CONFIG_SND_CS46XX_NEW_DSP
-static int _cs46xx_adjust_sample_rate (cs46xx_t *chip, cs46xx_pcm_t *cpcm,
+static int _cs46xx_adjust_sample_rate (struct snd_cs46xx *chip, struct snd_cs46xx_pcm *cpcm,
int sample_rate)
{
#endif
-static int snd_cs46xx_playback_hw_params(snd_pcm_substream_t * substream,
- snd_pcm_hw_params_t * hw_params)
+static int snd_cs46xx_playback_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *hw_params)
{
- snd_pcm_runtime_t *runtime = substream->runtime;
- cs46xx_pcm_t *cpcm;
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_cs46xx_pcm *cpcm;
int err;
#ifdef CONFIG_SND_CS46XX_NEW_DSP
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
int sample_rate = params_rate(hw_params);
int period_size = params_period_bytes(hw_params);
#endif
return 0;
}
-static int snd_cs46xx_playback_hw_free(snd_pcm_substream_t * substream)
+static int snd_cs46xx_playback_hw_free(struct snd_pcm_substream *substream)
{
- /*cs46xx_t *chip = snd_pcm_substream_chip(substream);*/
- snd_pcm_runtime_t *runtime = substream->runtime;
- cs46xx_pcm_t *cpcm;
+ /*struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);*/
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_cs46xx_pcm *cpcm;
cpcm = runtime->private_data;
return 0;
}
-static int snd_cs46xx_playback_prepare(snd_pcm_substream_t * substream)
+static int snd_cs46xx_playback_prepare(struct snd_pcm_substream *substream)
{
unsigned int tmp;
unsigned int pfie;
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- cs46xx_pcm_t *cpcm;
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_cs46xx_pcm *cpcm;
cpcm = runtime->private_data;
return 0;
}
-static int snd_cs46xx_capture_hw_params(snd_pcm_substream_t * substream,
- snd_pcm_hw_params_t * hw_params)
+static int snd_cs46xx_capture_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *hw_params)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
int err;
#ifdef CONFIG_SND_CS46XX_NEW_DSP
return 0;
}
-static int snd_cs46xx_capture_hw_free(snd_pcm_substream_t * substream)
+static int snd_cs46xx_capture_hw_free(struct snd_pcm_substream *substream)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
if (runtime->dma_area != chip->capt.hw_buf.area)
snd_pcm_lib_free_pages(substream);
return 0;
}
-static int snd_cs46xx_capture_prepare(snd_pcm_substream_t * substream)
+static int snd_cs46xx_capture_prepare(struct snd_pcm_substream *substream)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
snd_cs46xx_poke(chip, BA1_CBA, chip->capt.hw_buf.addr);
chip->capt.shift = 2;
static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
- cs46xx_t *chip = dev_id;
+ struct snd_cs46xx *chip = dev_id;
u32 status1;
#ifdef CONFIG_SND_CS46XX_NEW_DSP
- dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance * ins = chip->dsp_spos_instance;
u32 status2;
int i;
- cs46xx_pcm_t *cpcm = NULL;
+ struct snd_cs46xx_pcm *cpcm = NULL;
#endif
/*
return IRQ_HANDLED;
}
-static snd_pcm_hardware_t snd_cs46xx_playback =
+static struct snd_pcm_hardware snd_cs46xx_playback =
{
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
.fifo_size = 0,
};
-static snd_pcm_hardware_t snd_cs46xx_capture =
+static struct snd_pcm_hardware snd_cs46xx_capture =
{
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
static unsigned int period_sizes[] = { 32, 64, 128, 256, 512, 1024, 2048 };
-static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = {
+static struct snd_pcm_hw_constraint_list hw_constraints_period_sizes = {
.count = ARRAY_SIZE(period_sizes),
.list = period_sizes,
.mask = 0
#endif
-static void snd_cs46xx_pcm_free_substream(snd_pcm_runtime_t *runtime)
+static void snd_cs46xx_pcm_free_substream(struct snd_pcm_runtime *runtime)
{
kfree(runtime->private_data);
}
-static int _cs46xx_playback_open_channel (snd_pcm_substream_t * substream,int pcm_channel_id)
+static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,int pcm_channel_id)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
- cs46xx_pcm_t * cpcm;
- snd_pcm_runtime_t *runtime = substream->runtime;
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
+ struct snd_cs46xx_pcm * cpcm;
+ struct snd_pcm_runtime *runtime = substream->runtime;
cpcm = kzalloc(sizeof(*cpcm), GFP_KERNEL);
if (cpcm == NULL)
return 0;
}
-static int snd_cs46xx_playback_open(snd_pcm_substream_t * substream)
+static int snd_cs46xx_playback_open(struct snd_pcm_substream *substream)
{
snd_printdd("open front channel\n");
return _cs46xx_playback_open_channel(substream,DSP_PCM_MAIN_CHANNEL);
}
#ifdef CONFIG_SND_CS46XX_NEW_DSP
-static int snd_cs46xx_playback_open_rear(snd_pcm_substream_t * substream)
+static int snd_cs46xx_playback_open_rear(struct snd_pcm_substream *substream)
{
snd_printdd("open rear channel\n");
return _cs46xx_playback_open_channel(substream,DSP_PCM_REAR_CHANNEL);
}
-static int snd_cs46xx_playback_open_clfe(snd_pcm_substream_t * substream)
+static int snd_cs46xx_playback_open_clfe(struct snd_pcm_substream *substream)
{
snd_printdd("open center - LFE channel\n");
return _cs46xx_playback_open_channel(substream,DSP_PCM_CENTER_LFE_CHANNEL);
}
-static int snd_cs46xx_playback_open_iec958(snd_pcm_substream_t * substream)
+static int snd_cs46xx_playback_open_iec958(struct snd_pcm_substream *substream)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
snd_printdd("open raw iec958 channel\n");
return _cs46xx_playback_open_channel(substream,DSP_IEC958_CHANNEL);
}
-static int snd_cs46xx_playback_close(snd_pcm_substream_t * substream);
+static int snd_cs46xx_playback_close(struct snd_pcm_substream *substream);
-static int snd_cs46xx_playback_close_iec958(snd_pcm_substream_t * substream)
+static int snd_cs46xx_playback_close_iec958(struct snd_pcm_substream *substream)
{
int err;
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
snd_printdd("close raw iec958 channel\n");
}
#endif
-static int snd_cs46xx_capture_open(snd_pcm_substream_t * substream)
+static int snd_cs46xx_capture_open(struct snd_pcm_substream *substream)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci),
PAGE_SIZE, &chip->capt.hw_buf) < 0)
return 0;
}
-static int snd_cs46xx_playback_close(snd_pcm_substream_t * substream)
+static int snd_cs46xx_playback_close(struct snd_pcm_substream *substream)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
- snd_pcm_runtime_t *runtime = substream->runtime;
- cs46xx_pcm_t * cpcm;
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_cs46xx_pcm * cpcm;
cpcm = runtime->private_data;
return 0;
}
-static int snd_cs46xx_capture_close(snd_pcm_substream_t * substream)
+static int snd_cs46xx_capture_close(struct snd_pcm_substream *substream)
{
- cs46xx_t *chip = snd_pcm_substream_chip(substream);
+ struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
chip->capt.substream = NULL;
snd_dma_free_pages(&chip->capt.hw_buf);
}
#ifdef CONFIG_SND_CS46XX_NEW_DSP
-static snd_pcm_ops_t snd_cs46xx_playback_rear_ops = {
+static struct snd_pcm_ops snd_cs46xx_playback_rear_ops = {
.open = snd_cs46xx_playback_open_rear,
.close = snd_cs46xx_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.pointer = snd_cs46xx_playback_direct_pointer,
};
-static snd_pcm_ops_t snd_cs46xx_playback_indirect_rear_ops = {
+static struct snd_pcm_ops snd_cs46xx_playback_indirect_rear_ops = {
.open = snd_cs46xx_playback_open_rear,
.close = snd_cs46xx_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.ack = snd_cs46xx_playback_transfer,
};
-static snd_pcm_ops_t snd_cs46xx_playback_clfe_ops = {
+static struct snd_pcm_ops snd_cs46xx_playback_clfe_ops = {
.open = snd_cs46xx_playback_open_clfe,
.close = snd_cs46xx_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.pointer = snd_cs46xx_playback_direct_pointer,
};
-static snd_pcm_ops_t snd_cs46xx_playback_indirect_clfe_ops = {
+static struct snd_pcm_ops snd_cs46xx_playback_indirect_clfe_ops = {
.open = snd_cs46xx_playback_open_clfe,
.close = snd_cs46xx_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.ack = snd_cs46xx_playback_transfer,
};
-static snd_pcm_ops_t snd_cs46xx_playback_iec958_ops = {
+static struct snd_pcm_ops snd_cs46xx_playback_iec958_ops = {
.open = snd_cs46xx_playback_open_iec958,
.close = snd_cs46xx_playback_close_iec958,
.ioctl = snd_pcm_lib_ioctl,
.pointer = snd_cs46xx_playback_direct_pointer,
};
-static snd_pcm_ops_t snd_cs46xx_playback_indirect_iec958_ops = {
+static struct snd_pcm_ops snd_cs46xx_playback_indirect_iec958_ops = {
.open = snd_cs46xx_playback_open_iec958,
.close = snd_cs46xx_playback_close_iec958,
.ioctl = snd_pcm_lib_ioctl,
#endif
-static snd_pcm_ops_t snd_cs46xx_playback_ops = {
+static struct snd_pcm_ops snd_cs46xx_playback_ops = {
.open = snd_cs46xx_playback_open,
.close = snd_cs46xx_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.pointer = snd_cs46xx_playback_direct_pointer,
};
-static snd_pcm_ops_t snd_cs46xx_playback_indirect_ops = {
+static struct snd_pcm_ops snd_cs46xx_playback_indirect_ops = {
.open = snd_cs46xx_playback_open,
.close = snd_cs46xx_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.ack = snd_cs46xx_playback_transfer,
};
-static snd_pcm_ops_t snd_cs46xx_capture_ops = {
+static struct snd_pcm_ops snd_cs46xx_capture_ops = {
.open = snd_cs46xx_capture_open,
.close = snd_cs46xx_capture_close,
.ioctl = snd_pcm_lib_ioctl,
.pointer = snd_cs46xx_capture_direct_pointer,
};
-static snd_pcm_ops_t snd_cs46xx_capture_indirect_ops = {
+static struct snd_pcm_ops snd_cs46xx_capture_indirect_ops = {
.open = snd_cs46xx_capture_open,
.close = snd_cs46xx_capture_close,
.ioctl = snd_pcm_lib_ioctl,
#define MAX_PLAYBACK_CHANNELS 1
#endif
-int __devinit snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t ** rpcm)
+int __devinit snd_cs46xx_pcm(struct snd_cs46xx *chip, int device, struct snd_pcm ** rpcm)
{
- snd_pcm_t *pcm;
+ struct snd_pcm *pcm;
int err;
if (rpcm)
#ifdef CONFIG_SND_CS46XX_NEW_DSP
-int __devinit snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t ** rpcm)
+int __devinit snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device, struct snd_pcm ** rpcm)
{
- snd_pcm_t *pcm;
+ struct snd_pcm *pcm;
int err;
if (rpcm)
return 0;
}
-int __devinit snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t ** rpcm)
+int __devinit snd_cs46xx_pcm_center_lfe(struct snd_cs46xx *chip, int device, struct snd_pcm ** rpcm)
{
- snd_pcm_t *pcm;
+ struct snd_pcm *pcm;
int err;
if (rpcm)
return 0;
}
-int __devinit snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t ** rpcm)
+int __devinit snd_cs46xx_pcm_iec958(struct snd_cs46xx *chip, int device, struct snd_pcm ** rpcm)
{
- snd_pcm_t *pcm;
+ struct snd_pcm *pcm;
int err;
if (rpcm)
/*
* Mixer routines
*/
-static void snd_cs46xx_mixer_free_ac97_bus(ac97_bus_t *bus)
+static void snd_cs46xx_mixer_free_ac97_bus(struct snd_ac97_bus *bus)
{
- cs46xx_t *chip = bus->private_data;
+ struct snd_cs46xx *chip = bus->private_data;
chip->ac97_bus = NULL;
}
-static void snd_cs46xx_mixer_free_ac97(ac97_t *ac97)
+static void snd_cs46xx_mixer_free_ac97(struct snd_ac97 *ac97)
{
- cs46xx_t *chip = ac97->private_data;
+ struct snd_cs46xx *chip = ac97->private_data;
snd_assert ((ac97 == chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]) ||
(ac97 == chip->ac97[CS46XX_SECONDARY_CODEC_INDEX]),
chip->ac97[CS46XX_SECONDARY_CODEC_INDEX] = NULL;
}
-static int snd_cs46xx_vol_info(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_info_t *uinfo)
+static int snd_cs46xx_vol_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
return 0;
}
-static int snd_cs46xx_vol_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_cs46xx_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value;
unsigned int val = snd_cs46xx_peek(chip, reg);
ucontrol->value.integer.value[0] = 0xffff - (val >> 16);
return 0;
}
-static int snd_cs46xx_vol_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_cs46xx_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value;
unsigned int val = ((0xffff - ucontrol->value.integer.value[0]) << 16 |
(0xffff - ucontrol->value.integer.value[1]));
#ifdef CONFIG_SND_CS46XX_NEW_DSP
-static int snd_cs46xx_vol_dac_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_cs46xx_vol_dac_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
ucontrol->value.integer.value[0] = chip->dsp_spos_instance->dac_volume_left;
ucontrol->value.integer.value[1] = chip->dsp_spos_instance->dac_volume_right;
return 0;
}
-static int snd_cs46xx_vol_dac_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_cs46xx_vol_dac_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int change = 0;
if (chip->dsp_spos_instance->dac_volume_right != ucontrol->value.integer.value[0] ||
}
#if 0
-static int snd_cs46xx_vol_iec958_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_cs46xx_vol_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
ucontrol->value.integer.value[0] = chip->dsp_spos_instance->spdif_input_volume_left;
ucontrol->value.integer.value[1] = chip->dsp_spos_instance->spdif_input_volume_right;
return 0;
}
-static int snd_cs46xx_vol_iec958_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+static int snd_cs46xx_vol_iec958_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int change = 0;
if (chip->dsp_spos_instance->spdif_input_volume_left != ucontrol->value.integer.value[0] ||
}
#endif
-static int snd_mixer_boolean_info(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_info_t *uinfo)
+static int snd_mixer_boolean_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1;
return 0;
}
-static int snd_cs46xx_iec958_get(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_cs46xx_iec958_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value;
if (reg == CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT)
return 0;
}
-static int snd_cs46xx_iec958_put(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int change, res;
switch (kcontrol->private_value) {
return res;
}
-static int snd_cs46xx_adc_capture_get(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_cs46xx_adc_capture_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
- dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
+ struct dsp_spos_instance * ins = chip->dsp_spos_instance;
if (ins->adc_input != NULL)
ucontrol->value.integer.value[0] = 1;
return 0;
}
-static int snd_cs46xx_adc_capture_put(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_cs46xx_adc_capture_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
- dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
+ struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int change = 0;
if (ucontrol->value.integer.value[0] && !ins->adc_input) {
return change;
}
-static int snd_cs46xx_pcm_capture_get(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_cs46xx_pcm_capture_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
- dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
+ struct dsp_spos_instance * ins = chip->dsp_spos_instance;
if (ins->pcm_input != NULL)
ucontrol->value.integer.value[0] = 1;
}
-static int snd_cs46xx_pcm_capture_put(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_cs46xx_pcm_capture_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
- dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
+ struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int change = 0;
if (ucontrol->value.integer.value[0] && !ins->pcm_input) {
return change;
}
-static int snd_herc_spdif_select_get(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_herc_spdif_select_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR);
/*
* Game Theatre XP card - EGPIO[0] is used to select SPDIF input optical or coaxial.
*/
-static int snd_herc_spdif_select_put(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_herc_spdif_select_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR);
int val2 = snd_cs46xx_peekBA0(chip, BA0_EGPIOPTR);
}
-static int snd_cs46xx_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+static int snd_cs46xx_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
return 0;
}
-static int snd_cs46xx_spdif_default_get(snd_kcontrol_t * kcontrol,
- snd_ctl_elem_value_t * ucontrol)
+static int snd_cs46xx_spdif_default_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
- dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
+ struct dsp_spos_instance * ins = chip->dsp_spos_instance;
down (&chip->spos_mutex);
ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_default >> 24) & 0xff);
return 0;
}
-static int snd_cs46xx_spdif_default_put(snd_kcontrol_t * kcontrol,
- snd_ctl_elem_value_t * ucontrol)
+static int snd_cs46xx_spdif_default_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t * chip = snd_kcontrol_chip(kcontrol);
- dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+ struct snd_cs46xx * chip = snd_kcontrol_chip(kcontrol);
+ struct dsp_spos_instance * ins = chip->dsp_spos_instance;
unsigned int val;
int change;
return change;
}
-static int snd_cs46xx_spdif_mask_get(snd_kcontrol_t * kcontrol,
- snd_ctl_elem_value_t * ucontrol)
+static int snd_cs46xx_spdif_mask_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
ucontrol->value.iec958.status[0] = 0xff;
ucontrol->value.iec958.status[1] = 0xff;
return 0;
}
-static int snd_cs46xx_spdif_stream_get(snd_kcontrol_t * kcontrol,
- snd_ctl_elem_value_t * ucontrol)
+static int snd_cs46xx_spdif_stream_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
- dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
+ struct dsp_spos_instance * ins = chip->dsp_spos_instance;
down (&chip->spos_mutex);
ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_stream >> 24) & 0xff);
return 0;
}
-static int snd_cs46xx_spdif_stream_put(snd_kcontrol_t * kcontrol,
- snd_ctl_elem_value_t * ucontrol)
+static int snd_cs46xx_spdif_stream_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t * chip = snd_kcontrol_chip(kcontrol);
- dsp_spos_instance_t * ins = chip->dsp_spos_instance;
+ struct snd_cs46xx * chip = snd_kcontrol_chip(kcontrol);
+ struct dsp_spos_instance * ins = chip->dsp_spos_instance;
unsigned int val;
int change;
#ifdef CONFIG_SND_CS46XX_DEBUG_GPIO
-static int snd_cs46xx_egpio_select_info(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_info_t *uinfo)
+static int snd_cs46xx_egpio_select_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
return 0;
}
-static int snd_cs46xx_egpio_select_get(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_cs46xx_egpio_select_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
ucontrol->value.integer.value[0] = chip->current_gpio;
return 0;
}
-static int snd_cs46xx_egpio_select_put(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_cs46xx_egpio_select_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int change = (chip->current_gpio != ucontrol->value.integer.value[0]);
chip->current_gpio = ucontrol->value.integer.value[0];
}
-static int snd_cs46xx_egpio_get(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_cs46xx_egpio_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value;
snd_printdd ("put: reg = %04x, gpio %02x\n",reg,chip->current_gpio);
return 0;
}
-static int snd_cs46xx_egpio_put(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_cs46xx_egpio_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value;
int val = snd_cs46xx_peekBA0(chip, reg);
int oldval = val;
}
#endif /* CONFIG_SND_CS46XX_DEBUG_GPIO */
-static snd_kcontrol_new_t snd_cs46xx_controls[] __devinitdata = {
+static struct snd_kcontrol_new snd_cs46xx_controls[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "DAC Volume",
#ifdef CONFIG_SND_CS46XX_NEW_DSP
/* set primary cs4294 codec into Extended Audio Mode */
-static int snd_cs46xx_front_dup_get(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_cs46xx_front_dup_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
unsigned short val;
val = snd_ac97_read(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX], AC97_CSR_ACMODE);
ucontrol->value.integer.value[0] = (val & 0x200) ? 0 : 1;
return 0;
}
-static int snd_cs46xx_front_dup_put(snd_kcontrol_t *kcontrol,
- snd_ctl_elem_value_t *ucontrol)
+static int snd_cs46xx_front_dup_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
- cs46xx_t *chip = snd_kcontrol_chip(kcontrol);
+ struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
return snd_ac97_update_bits(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX],
AC97_CSR_ACMODE, 0x200,
ucontrol->value.integer.value[0] ? 0 : 0x200);
}
-static snd_kcontrol_new_t snd_cs46xx_front_dup_ctl = {
+static struct snd_kcontrol_new snd_cs46xx_front_dup_ctl = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Duplicate Front",
.info = snd_mixer_boolean_info,
#ifdef CONFIG_SND_CS46XX_NEW_DSP
/* Only available on the Hercules Game Theater XP soundcard */
-static snd_kcontrol_new_t snd_hercules_controls[] __devinitdata = {
+static struct snd_kcontrol_new snd_hercules_controls[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Optical/Coaxial SPDIF Input Switch",
};
-static void snd_cs46xx_codec_reset (ac97_t * ac97)
+static void snd_cs46xx_codec_reset (struct snd_ac97 * ac97)
{
unsigned long end_time;
int err;
}
#endif
-static int __devinit cs46xx_detect_codec(cs46xx_t *chip, int codec)
+static int __devinit cs46xx_detect_codec(struct snd_cs46xx *chip, int codec)
{
int idx, err;
- ac97_template_t ac97;
+ struct snd_ac97_template ac97;
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = chip;
return -ENXIO;
}
-int __devinit snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device)
+int __devinit snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device)
{
- snd_card_t *card = chip->card;
- snd_ctl_elem_id_t id;
+ struct snd_card *card = chip->card;
+ struct snd_ctl_elem_id id;
int err;
unsigned int idx;
- static ac97_bus_ops_t ops = {
+ static struct snd_ac97_bus_ops ops = {
#ifdef CONFIG_SND_CS46XX_NEW_DSP
.reset = snd_cs46xx_codec_reset,
#endif
/* add cs4630 mixer controls */
for (idx = 0; idx < ARRAY_SIZE(snd_cs46xx_controls); idx++) {
- snd_kcontrol_t *kctl;
+ struct snd_kcontrol *kctl;
kctl = snd_ctl_new1(&snd_cs46xx_controls[idx], chip);
if (kctl && kctl->id.iface == SNDRV_CTL_ELEM_IFACE_PCM)
kctl->id.device = spdif_device;
* RawMIDI interface
*/
-static void snd_cs46xx_midi_reset(cs46xx_t *chip)
+static void snd_cs46xx_midi_reset(struct snd_cs46xx *chip)
{
snd_cs46xx_pokeBA0(chip, BA0_MIDCR, MIDCR_MRST);
udelay(100);
snd_cs46xx_pokeBA0(chip, BA0_MIDCR, chip->midcr);
}
-static int snd_cs46xx_midi_input_open(snd_rawmidi_substream_t * substream)
+static int snd_cs46xx_midi_input_open(struct snd_rawmidi_substream *substream)
{
- cs46xx_t *chip = substream->rmidi->private_data;
+ struct snd_cs46xx *chip = substream->rmidi->private_data;
chip->active_ctrl(chip, 1);
spin_lock_irq(&chip->reg_lock);
return 0;
}
-static int snd_cs46xx_midi_input_close(snd_rawmidi_substream_t * substream)
+static int snd_cs46xx_midi_input_close(struct snd_rawmidi_substream *substream)
{
- cs46xx_t *chip = substream->rmidi->private_data;
+ struct snd_cs46xx *chip = substream->rmidi->private_data;
spin_lock_irq(&chip->reg_lock);
chip->midcr &= ~(MIDCR_RXE | MIDCR_RIE);
return 0;
}
-static int snd_cs46xx_midi_output_open(snd_rawmidi_substream_t * substream)
+static int snd_cs46xx_midi_output_open(struct snd_rawmidi_substream *substream)
{
- cs46xx_t *chip = substream->rmidi->private_data;
+ struct snd_cs46xx *chip = substream->rmidi->private_data;
chip->active_ctrl(chip, 1);
return 0;
}
-static int snd_cs46xx_midi_output_close(snd_rawmidi_substream_t * substream)
+static int snd_cs46xx_midi_output_close(struct snd_rawmidi_substream *substream)
{
- cs46xx_t *chip = substream->rmidi->private_data;
+ struct snd_cs46xx *chip = substream->rmidi->private_data;
spin_lock_irq(&chip->reg_lock);
chip->midcr &= ~(MIDCR_TXE | MIDCR_TIE);
return 0;
}
-static void snd_cs46xx_midi_input_trigger(snd_rawmidi_substream_t * substream, int up)
+static void snd_cs46xx_midi_input_trigger(struct snd_rawmidi_substream *substream, int up)
{
unsigned long flags;
- cs46xx_t *chip = substream->rmidi->private_data;
+ struct snd_cs46xx *chip = substream->rmidi->private_data;
spin_lock_irqsave(&chip->reg_lock, flags);
if (up) {
spin_unlock_irqrestore(&chip->reg_lock, flags);
}
-static void snd_cs46xx_midi_output_trigger(snd_rawmidi_substream_t * substream, int up)
+static void snd_cs46xx_midi_output_trigger(struct snd_rawmidi_substream *substream, int up)
{
unsigned long flags;
- cs46xx_t *chip = substream->rmidi->private_data;
+ struct snd_cs46xx *chip = substream->rmidi->private_data;
unsigned char byte;
spin_lock_irqsave(&chip->reg_lock, flags);
spin_unlock_irqrestore(&chip->reg_lock, flags);
}
-static snd_rawmidi_ops_t snd_cs46xx_midi_output =
+static struct snd_rawmidi_ops snd_cs46xx_midi_output =
{
.open = snd_cs46xx_midi_output_open,
.close = snd_cs46xx_midi_output_close,
.trigger = snd_cs46xx_midi_output_trigger,
};
-static snd_rawmidi_ops_t snd_cs46xx_midi_input =
+static struct snd_rawmidi_ops snd_cs46xx_midi_input =
{
.open = snd_cs46xx_midi_input_open,
.close = snd_cs46xx_midi_input_close,
.trigger = snd_cs46xx_midi_input_trigger,
};
-int __devinit snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rrawmidi)
+int __devinit snd_cs46xx_midi(struct snd_cs46xx *chip, int device, struct snd_rawmidi **rrawmidi)
{
- snd_rawmidi_t *rmidi;
+ struct snd_rawmidi *rmidi;
int err;
if (rrawmidi)
static void snd_cs46xx_gameport_trigger(struct gameport *gameport)
{
- cs46xx_t *chip = gameport_get_port_data(gameport);
+ struct snd_cs46xx *chip = gameport_get_port_data(gameport);
snd_assert(chip, return);
snd_cs46xx_pokeBA0(chip, BA0_JSPT, 0xFF); //outb(gameport->io, 0xFF);
static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport)
{
- cs46xx_t *chip = gameport_get_port_data(gameport);
+ struct snd_cs46xx *chip = gameport_get_port_data(gameport);
snd_assert(chip, return 0);
return snd_cs46xx_peekBA0(chip, BA0_JSPT); //inb(gameport->io);
static int snd_cs46xx_gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons)
{
- cs46xx_t *chip = gameport_get_port_data(gameport);
+ struct snd_cs46xx *chip = gameport_get_port_data(gameport);
unsigned js1, js2, jst;
snd_assert(chip, return 0);
return 0;
}
-int __devinit snd_cs46xx_gameport(cs46xx_t *chip)
+int __devinit snd_cs46xx_gameport(struct snd_cs46xx *chip)
{
struct gameport *gp;
return 0;
}
-static inline void snd_cs46xx_remove_gameport(cs46xx_t *chip)
+static inline void snd_cs46xx_remove_gameport(struct snd_cs46xx *chip)
{
if (chip->gameport) {
gameport_unregister_port(chip->gameport);
}
}
#else
-int __devinit snd_cs46xx_gameport(cs46xx_t *chip) { return -ENOSYS; }
-static inline void snd_cs46xx_remove_gameport(cs46xx_t *chip) { }
+int __devinit snd_cs46xx_gameport(struct snd_cs46xx *chip) { return -ENOSYS; }
+static inline void snd_cs46xx_remove_gameport(struct snd_cs46xx *chip) { }
#endif /* CONFIG_GAMEPORT */
/*
* proc interface
*/
-static long snd_cs46xx_io_read(snd_info_entry_t *entry, void *file_private_data,
+static long snd_cs46xx_io_read(struct snd_info_entry *entry, void *file_private_data,
struct file *file, char __user *buf,
unsigned long count, unsigned long pos)
{
long size;
- snd_cs46xx_region_t *region = (snd_cs46xx_region_t *)entry->private_data;
+ struct snd_cs46xx_region *region = entry->private_data;
size = count;
if (pos + (size_t)size > region->size)
.read = snd_cs46xx_io_read,
};
-static int __devinit snd_cs46xx_proc_init(snd_card_t * card, cs46xx_t *chip)
+static int __devinit snd_cs46xx_proc_init(struct snd_card *card, struct snd_cs46xx *chip)
{
- snd_info_entry_t *entry;
+ struct snd_info_entry *entry;
int idx;
for (idx = 0; idx < 5; idx++) {
- snd_cs46xx_region_t *region = &chip->region.idx[idx];
+ struct snd_cs46xx_region *region = &chip->region.idx[idx];
if (! snd_card_proc_new(card, region->name, &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = chip;
return 0;
}
-static int snd_cs46xx_proc_done(cs46xx_t *chip)
+static int snd_cs46xx_proc_done(struct snd_cs46xx *chip)
{
#ifdef CONFIG_SND_CS46XX_NEW_DSP
cs46xx_dsp_proc_done(chip);
/*
* stop the h/w
*/
-static void snd_cs46xx_hw_stop(cs46xx_t *chip)
+static void snd_cs46xx_hw_stop(struct snd_cs46xx *chip)
{
unsigned int tmp;
}
-static int snd_cs46xx_free(cs46xx_t *chip)
+static int snd_cs46xx_free(struct snd_cs46xx *chip)
{
int idx;
snd_cs46xx_hw_stop(chip);
for (idx = 0; idx < 5; idx++) {
- snd_cs46xx_region_t *region = &chip->region.idx[idx];
+ struct snd_cs46xx_region *region = &chip->region.idx[idx];
if (region->remap_addr)
iounmap(region->remap_addr);
release_and_free_resource(region->resource);
}
if (chip->irq >= 0)
- free_irq(chip->irq, (void *)chip);
+ free_irq(chip->irq, chip);
if (chip->active_ctrl)
chip->active_ctrl(chip, -chip->amplifier);
return 0;
}
-static int snd_cs46xx_dev_free(snd_device_t *device)
+static int snd_cs46xx_dev_free(struct snd_device *device)
{
- cs46xx_t *chip = device->device_data;
+ struct snd_cs46xx *chip = device->device_data;
return snd_cs46xx_free(chip);
}
/*
* initialize chip
*/
-static int snd_cs46xx_chip_init(cs46xx_t *chip)
+static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
{
int timeout;
/*
* start and load DSP
*/
-int __devinit snd_cs46xx_start_dsp(cs46xx_t *chip)
+int __devinit snd_cs46xx_start_dsp(struct snd_cs46xx *chip)
{
unsigned int tmp;
/*
* AMP control - null AMP
*/
-static void amp_none(cs46xx_t *chip, int change)
+static void amp_none(struct snd_cs46xx *chip, int change)
{
}
#ifdef CONFIG_SND_CS46XX_NEW_DSP
-static int voyetra_setup_eapd_slot(cs46xx_t *chip)
+static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip)
{
u32 idx, valid_slots,tmp,powerdown = 0;
* Crystal EAPD mode
*/
-static void amp_voyetra(cs46xx_t *chip, int change)
+static void amp_voyetra(struct snd_cs46xx *chip, int change)
{
/* Manage the EAPD bit on the Crystal 4297
and the Analog AD1885 */
#endif
}
-static void hercules_init(cs46xx_t *chip)
+static void hercules_init(struct snd_cs46xx *chip)
{
/* default: AMP off, and SPDIF input optical */
snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, EGPIODR_GPOE0);
/*
* Game Theatre XP card - EGPIO[2] is used to enable the external amp.
*/
-static void amp_hercules(cs46xx_t *chip, int change)
+static void amp_hercules(struct snd_cs46xx *chip, int change)
{
int old = chip->amplifier;
int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR);
}
}
-static void voyetra_mixer_init (cs46xx_t *chip)
+static void voyetra_mixer_init (struct snd_cs46xx *chip)
{
snd_printdd ("initializing Voyetra mixer\n");
snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, EGPIODR_GPOE0);
}
-static void hercules_mixer_init (cs46xx_t *chip)
+static void hercules_mixer_init (struct snd_cs46xx *chip)
{
#ifdef CONFIG_SND_CS46XX_NEW_DSP
unsigned int idx;
int err;
- snd_card_t *card = chip->card;
+ struct snd_card *card = chip->card;
#endif
/* set EGPIO to default */
#ifdef CONFIG_SND_CS46XX_NEW_DSP
for (idx = 0 ; idx < ARRAY_SIZE(snd_hercules_controls); idx++) {
- snd_kcontrol_t *kctl;
+ struct snd_kcontrol *kctl;
kctl = snd_ctl_new1(&snd_hercules_controls[idx], chip);
if ((err = snd_ctl_add(card, kctl)) < 0) {
* Untested
*/
-static void amp_voyetra_4294(cs46xx_t *chip, int change)
+static void amp_voyetra_4294(struct snd_cs46xx *chip, int change)
{
chip->amplifier += change;
* enough to make them useful.
*/
-static void clkrun_hack(cs46xx_t *chip, int change)
+static void clkrun_hack(struct snd_cs46xx *chip, int change)
{
u16 control, nval;
/*
* detect intel piix4
*/
-static void clkrun_init(cs46xx_t *chip)
+static void clkrun_init(struct snd_cs46xx *chip)
{
struct pci_dev *pdev;
u8 pp;
u16 vendor;
u16 id;
char *name;
- void (*init)(cs46xx_t *);
- void (*amp)(cs46xx_t *, int);
- void (*active)(cs46xx_t *, int);
- void (*mixer_init)(cs46xx_t *);
+ void (*init)(struct snd_cs46xx *);
+ void (*amp)(struct snd_cs46xx *, int);
+ void (*active)(struct snd_cs46xx *, int);
+ void (*mixer_init)(struct snd_cs46xx *);
};
static struct cs_card_type __devinitdata cards[] = {
* APM support
*/
#ifdef CONFIG_PM
-static int snd_cs46xx_suspend(snd_card_t *card, pm_message_t state)
+static int snd_cs46xx_suspend(struct snd_card *card, pm_message_t state)
{
- cs46xx_t *chip = card->pm_private_data;
+ struct snd_cs46xx *chip = card->pm_private_data;
int amp_saved;
snd_pcm_suspend_all(chip->pcm);
return 0;
}
-static int snd_cs46xx_resume(snd_card_t *card)
+static int snd_cs46xx_resume(struct snd_card *card)
{
- cs46xx_t *chip = card->pm_private_data;
+ struct snd_cs46xx *chip = card->pm_private_data;
int amp_saved;
pci_enable_device(chip->pci);
/*
*/
-int __devinit snd_cs46xx_create(snd_card_t * card,
+int __devinit snd_cs46xx_create(struct snd_card *card,
struct pci_dev * pci,
int external_amp, int thinkpad,
- cs46xx_t ** rchip)
+ struct snd_cs46xx ** rchip)
{
- cs46xx_t *chip;
+ struct snd_cs46xx *chip;
int err, idx;
- snd_cs46xx_region_t *region;
+ struct snd_cs46xx_region *region;
struct cs_card_type *cp;
u16 ss_card, ss_vendor;
- static snd_device_ops_t ops = {
+ static struct snd_device_ops ops = {
.dev_free = snd_cs46xx_dev_free,
};
chip->ba1_addr = pci_resource_start(pci, 1);
if (chip->ba0_addr == 0 || chip->ba0_addr == (unsigned long)~0 ||
chip->ba1_addr == 0 || chip->ba1_addr == (unsigned long)~0) {
- snd_printk(KERN_ERR "wrong address(es) - ba0 = 0x%lx, ba1 = 0x%lx\n", chip->ba0_addr, chip->ba1_addr);
+ snd_printk(KERN_ERR "wrong address(es) - ba0 = 0x%lx, ba1 = 0x%lx\n",
+ chip->ba0_addr, chip->ba1_addr);
snd_cs46xx_free(chip);
return -ENOMEM;
}
for (idx = 0; idx < 5; idx++) {
region = &chip->region.idx[idx];
- if ((region->resource = request_mem_region(region->base, region->size, region->name)) == NULL) {
- snd_printk(KERN_ERR "unable to request memory region 0x%lx-0x%lx\n", region->base, region->base + region->size - 1);
+ if ((region->resource = request_mem_region(region->base, region->size,
+ region->name)) == NULL) {
+ snd_printk(KERN_ERR "unable to request memory region 0x%lx-0x%lx\n",
+ region->base, region->base + region->size - 1);
snd_cs46xx_free(chip);
return -EBUSY;
}
}
}
- if (request_irq(pci->irq, snd_cs46xx_interrupt, SA_INTERRUPT|SA_SHIRQ, "CS46XX", (void *) chip)) {
+ if (request_irq(pci->irq, snd_cs46xx_interrupt, SA_INTERRUPT|SA_SHIRQ,
+ "CS46XX", chip)) {
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
snd_cs46xx_free(chip);
return -EBUSY;
* 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;
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);
-
-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_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);
+
+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__ */
#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,
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);
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) {
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;
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") &&
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)) {
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) {
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);
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);
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) {
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 ) {
}
-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 ) {
}
-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");
}
-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);
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);
}
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);
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);
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) {
}
}
-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;
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;
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) {
}
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);
}
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);
}
}
-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;
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) {
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");
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) {
}
-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) {
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;
-
- 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_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;
+
+ 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,
{
/* 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,
{
/* 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,
{
/* 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,
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
};
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) {
{
/* 0xBC0 */
- spdifoscb_t spdifo_scb = {
+ struct dsp_spdifoscb spdifo_scb = {
/* 0 */ DSP_SPOS_UUUU,
{
/* 1 */ 0xb0,
};
/* 0xBB0 */
- spdifiscb_t spdifi_scb = {
+ struct dsp_spdifiscb spdifi_scb = {
/* 0 */ DSP_SPOS_UULO,DSP_SPOS_UUHI,
/* 1 */ 0,
/* 2 */ 0,
};
/* 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,
}
-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);
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);
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);
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);
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);
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);
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);
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);
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;
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);
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);
/* 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,
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
#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 */
((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,
(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);
#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);
}
-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;
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 ) {
}
}
-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;
}
}
-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 &&
}
-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);
}
}
-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 &&
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;
}
}
-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;
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);
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,
}
-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,
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,
}
-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
#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;
correctionPerSec = tmp1;
{
- src_task_scb_t src_task_scb = {
+ struct dsp_src_task_scb src_task_scb = {
0x0028,0x00c8,
0x5555,0x0000,
0x0000,0x0000,
}
#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,
}
#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,
}
-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 +
}
-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,
}
-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,
}
-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 */
}
-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 */
#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,
#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; */
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,
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);
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) {
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);
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);
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 );
}
}
-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);
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);
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);
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 );
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 );
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);
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) {
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 */
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);
#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 },
}; /* #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,
#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 },
};
/* #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,
#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 },
};
/* #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,
#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 },
/* #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,
#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 },
}; /* #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,
#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 },
};
/* #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,