Commit 3d19f804 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: PCI CS46xx

Modules: CS46xx driver

Remove xxx_t typedefs from the PCI CS46xx driver.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent af26367f
...@@ -1631,42 +1631,41 @@ ...@@ -1631,42 +1631,41 @@
#define CS46XX_MIXER_SPDIF_INPUT_ELEMENT 1 #define CS46XX_MIXER_SPDIF_INPUT_ELEMENT 1
#define CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT 2 #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; struct snd_dma_buffer hw_buf;
unsigned int ctl; unsigned int ctl;
unsigned int shift; /* Shift count to trasform frames in bytes */ unsigned int shift; /* Shift count to trasform frames in bytes */
snd_pcm_indirect_t pcm_rec; struct snd_pcm_indirect pcm_rec;
snd_pcm_substream_t *substream; 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 ... */ int pcm_channel_id; /* Fron Rear, Center Lfe ... */
} cs46xx_pcm_t; };
typedef struct { struct snd_cs46xx_region {
char name[24]; char name[24];
unsigned long base; unsigned long base;
void __iomem *remap_addr; void __iomem *remap_addr;
unsigned long size; unsigned long size;
struct resource *resource; struct resource *resource;
} snd_cs46xx_region_t; };
struct _snd_cs46xx { struct snd_cs46xx {
int irq; int irq;
unsigned long ba0_addr; unsigned long ba0_addr;
unsigned long ba1_addr; unsigned long ba1_addr;
union { union {
struct { struct {
snd_cs46xx_region_t ba0; struct snd_cs46xx_region ba0;
snd_cs46xx_region_t data0; struct snd_cs46xx_region data0;
snd_cs46xx_region_t data1; struct snd_cs46xx_region data1;
snd_cs46xx_region_t pmem; struct snd_cs46xx_region pmem;
snd_cs46xx_region_t reg; struct snd_cs46xx_region reg;
} name; } name;
snd_cs46xx_region_t idx[5]; struct snd_cs46xx_region idx[5];
} region; } region;
unsigned int mode; unsigned int mode;
...@@ -1676,34 +1675,34 @@ struct _snd_cs46xx { ...@@ -1676,34 +1675,34 @@ struct _snd_cs46xx {
unsigned int ctl; unsigned int ctl;
unsigned int shift; /* Shift count to trasform frames in bytes */ unsigned int shift; /* Shift count to trasform frames in bytes */
snd_pcm_indirect_t pcm_rec; struct snd_pcm_indirect pcm_rec;
snd_pcm_substream_t *substream; struct snd_pcm_substream *substream;
} capt; } capt;
int nr_ac97_codecs; int nr_ac97_codecs;
ac97_bus_t *ac97_bus; struct snd_ac97_bus *ac97_bus;
ac97_t *ac97[MAX_NR_AC97]; struct snd_ac97 *ac97[MAX_NR_AC97];
struct pci_dev *pci; struct pci_dev *pci;
snd_card_t *card; struct snd_card *card;
snd_pcm_t *pcm; struct snd_pcm *pcm;
snd_rawmidi_t *rmidi; struct snd_rawmidi *rmidi;
snd_rawmidi_substream_t *midi_input; struct snd_rawmidi_substream *midi_input;
snd_rawmidi_substream_t *midi_output; struct snd_rawmidi_substream *midi_output;
spinlock_t reg_lock; spinlock_t reg_lock;
unsigned int midcr; unsigned int midcr;
unsigned int uartm; unsigned int uartm;
int amplifier; int amplifier;
void (*amplifier_ctrl)(cs46xx_t *, int); void (*amplifier_ctrl)(struct snd_cs46xx *, int);
void (*active_ctrl)(cs46xx_t *, int); void (*active_ctrl)(struct snd_cs46xx *, int);
void (*mixer_init)(cs46xx_t *); void (*mixer_init)(struct snd_cs46xx *);
int acpi_port; 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) */ int accept_valid; /* accept mmap valid (for OSS) */
struct gameport *gameport; struct gameport *gameport;
...@@ -1714,29 +1713,29 @@ struct _snd_cs46xx { ...@@ -1714,29 +1713,29 @@ struct _snd_cs46xx {
#ifdef CONFIG_SND_CS46XX_NEW_DSP #ifdef CONFIG_SND_CS46XX_NEW_DSP
struct semaphore spos_mutex; struct semaphore spos_mutex;
dsp_spos_instance_t * dsp_spos_instance; struct dsp_spos_instance * dsp_spos_instance;
snd_pcm_t *pcm_rear; struct snd_pcm *pcm_rear;
snd_pcm_t *pcm_center_lfe; struct snd_pcm *pcm_center_lfe;
snd_pcm_t *pcm_iec958; struct snd_pcm *pcm_iec958;
#else /* for compatibility */ #else /* for compatibility */
cs46xx_pcm_t *playback_pcm; struct snd_cs46xx_pcm *playback_pcm;
unsigned int play_ctl; unsigned int play_ctl;
#endif #endif
}; };
int snd_cs46xx_create(snd_card_t *card, int snd_cs46xx_create(struct snd_card *card,
struct pci_dev *pci, struct pci_dev *pci,
int external_amp, int thinkpad, int external_amp, int thinkpad,
cs46xx_t **rcodec); struct snd_cs46xx **rcodec);
int snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t **rpcm); int snd_cs46xx_pcm(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
int snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t **rpcm); int snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
int snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t **rpcm); int snd_cs46xx_pcm_iec958(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
int snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t **rpcm); int snd_cs46xx_pcm_center_lfe(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
int snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device); int snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device);
int snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rmidi); int snd_cs46xx_midi(struct snd_cs46xx *chip, int device, struct snd_rawmidi **rmidi);
int snd_cs46xx_start_dsp(cs46xx_t *chip); int snd_cs46xx_start_dsp(struct snd_cs46xx *chip);
int snd_cs46xx_gameport(cs46xx_t *chip); int snd_cs46xx_gameport(struct snd_cs46xx *chip);
#endif /* __SOUND_CS46XX_H */ #endif /* __SOUND_CS46XX_H */
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
/* This structs are used internally by the SP */ /* 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: /* 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] 31 [30-28]27 [26:24] 23 22 21 20 [19:18] [17:16] 15 14 13 12 11 10 9 8 7 6 [5:0]
...@@ -53,9 +53,9 @@ typedef struct _basic_dma_req_t { ...@@ -53,9 +53,9 @@ typedef struct _basic_dma_req_t {
u32 dmw; /* DMA Mode Word */ u32 dmw; /* DMA Mode Word */
u32 saw; /* Source Address Word */ u32 saw; /* Source Address Word */
u32 daw; /* Destination 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 */ u32 npaw; /* Next-Page Address Word */
/* DMA Requestor Word 5 (NPCW) fields: /* DMA Requestor Word 5 (NPCW) fields:
...@@ -69,9 +69,9 @@ typedef struct _scatter_gather_ext_t { ...@@ -69,9 +69,9 @@ typedef struct _scatter_gather_ext_t {
u32 lbaw; /* Loop-Begin Address Word */ u32 lbaw; /* Loop-Begin Address Word */
u32 nplbaw; /* Next-Page after Loop-Begin Address Word */ u32 nplbaw; /* Next-Page after Loop-Begin Address Word */
u32 sgaw; /* Scatter/Gather 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( ___DSP_DUAL_16BIT_ALLOC(
rightTarg, /* Target volume for left & right channels */ rightTarg, /* Target volume for left & right channels */
leftTarg leftTarg
...@@ -80,10 +80,10 @@ typedef struct _volume_control_t { ...@@ -80,10 +80,10 @@ typedef struct _volume_control_t {
rightVol, /* Current left & right channel volumes */ rightVol, /* Current left & right channel volumes */
leftVol leftVol
) )
} volume_control_t; };
/* Generic stream control block (SCB) structure definition */ /* 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 /* 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 requestor or the scatter/gather extension. Only ad hoc DMA request
streams are free to alter the requestor (currently only occur in the streams are free to alter the requestor (currently only occur in the
...@@ -99,13 +99,13 @@ typedef struct _generic_scb_t { ...@@ -99,13 +99,13 @@ typedef struct _generic_scb_t {
/* Initialized by the host, only modified by DMA /* Initialized by the host, only modified by DMA
R/O for the DSP task */ 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) /* Scatter/gather DMA requestor extension (5 ints)
Initialized by the host, only modified by DMA Initialized by the host, only modified by DMA
DSP task never needs to even read these. 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. /* Sublist pointer & next stream control block (SCB) link.
Initialized & modified by the host R/O for the DSP task Initialized & modified by the host R/O for the DSP task
...@@ -179,11 +179,11 @@ typedef struct _generic_scb_t { ...@@ -179,11 +179,11 @@ typedef struct _generic_scb_t {
These two 32-bit words are redefined for wavetable & 3-D voices. These two 32-bit words are redefined for wavetable & 3-D voices.
*/ */
volume_control_t vol_ctrl_t; /* Optional */ struct dsp_volume_control vol_ctrl_t; /* Optional */
} generic_scb_t; };
typedef struct _spos_control_block_t { struct dsp_spos_control_block {
/* WARNING: Certain items in this structure are modified by the host /* WARNING: Certain items in this structure are modified by the host
Any dword that can be modified by the host, must not be Any dword that can be modified by the host, must not be
modified by the SP as the host can only do atomic dword modified by the SP as the host can only do atomic dword
...@@ -273,10 +273,10 @@ typedef struct _spos_control_block_t { ...@@ -273,10 +273,10 @@ typedef struct _spos_control_block_t {
u32 r32_save_for_spurious_int; u32 r32_save_for_spurious_int;
u32 r32_save_for_trap; u32 r32_save_for_trap;
u32 r32_save_for_HFG; u32 r32_save_for_HFG;
} spos_control_block_t; };
/* SPB for MIX_TO_OSTREAM algorithm family */ /* 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 /* 16b.16b integer.frac approximation to the
number of 3 sample triplets to output each number of 3 sample triplets to output each
...@@ -290,13 +290,13 @@ typedef struct _mix2_ostream_spb_t ...@@ -290,13 +290,13 @@ typedef struct _mix2_ostream_spb_t
output triplets since the start of group output triplets since the start of group
*/ */
u32 accumOutTriplets; u32 accumOutTriplets;
} mix2_ostream_spb_t; };
/* SCB for Timing master algorithm */ /* SCB for Timing master algorithm */
typedef struct _timing_master_scb_t { struct dsp_timing_master_scb {
/* First 12 dwords from generic_scb_t */ /* First 12 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */ struct dsp_basic_dma_req basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */ struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */ next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */ sub_list_ptr /* REQUIRED */
...@@ -358,13 +358,13 @@ typedef struct _timing_master_scb_t { ...@@ -358,13 +358,13 @@ typedef struct _timing_master_scb_t {
number of samples to output each frame. number of samples to output each frame.
(approximation must be floor, to insure */ (approximation must be floor, to insure */
u32 nsamp_per_frm_q15; u32 nsamp_per_frm_q15;
} timing_master_scb_t; };
/* SCB for CODEC output algorithm */ /* SCB for CODEC output algorithm */
typedef struct _codec_output_scb_t { struct dsp_codec_output_scb {
/* First 13 dwords from generic_scb_t */ /* First 13 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */ struct dsp_basic_dma_req basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */ struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */ next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */ sub_list_ptr /* REQUIRED */
...@@ -422,13 +422,13 @@ typedef struct _codec_output_scb_t { ...@@ -422,13 +422,13 @@ typedef struct _codec_output_scb_t {
reserved, reserved,
last_sub_ptr last_sub_ptr
) )
} codec_output_scb_t; };
/* SCB for CODEC input algorithm */ /* SCB for CODEC input algorithm */
typedef struct _codec_input_scb_t { struct dsp_codec_input_scb {
/* First 13 dwords from generic_scb_t */ /* First 13 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */ struct dsp_basic_dma_req basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */ struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */ next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */ sub_list_ptr /* REQUIRED */
...@@ -479,13 +479,13 @@ typedef struct _codec_input_scb_t { ...@@ -479,13 +479,13 @@ typedef struct _codec_input_scb_t {
) )
u32 reserved2; 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 */ /* First 13 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */ struct dsp_basic_dma_req basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */ struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */ next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */ sub_list_ptr /* REQUIRED */
...@@ -512,11 +512,11 @@ typedef struct _pcm_serial_input_scb_t { ...@@ -512,11 +512,11 @@ typedef struct _pcm_serial_input_scb_t {
) )
/* Initialized by the host (host updates target volumes) */ /* 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( ___DSP_DUAL_16BIT_ALLOC(
frames_left_in_gof, frames_left_in_gof,
gofs_left_in_sec gofs_left_in_sec
...@@ -571,10 +571,10 @@ typedef struct _src_task_scb_t { ...@@ -571,10 +571,10 @@ typedef struct _src_task_scb_t {
u32 phiIncr6int_26frac; u32 phiIncr6int_26frac;
volume_control_t src_vol_ctrl; struct dsp_volume_control src_vol_ctrl;
} src_task_scb_t; };
typedef struct _decimate_by_pow2_scb_t { struct dsp_decimate_by_pow2_scb {
/* decimationFactor = 2, 4, or 8 (larger factors waste too much memory /* decimationFactor = 2, 4, or 8 (larger factors waste too much memory
when compared to cascading decimators) when compared to cascading decimators)
*/ */
...@@ -648,10 +648,10 @@ typedef struct _decimate_by_pow2_scb_t { ...@@ -648,10 +648,10 @@ typedef struct _decimate_by_pow2_scb_t {
u32 dec2_reserved4; u32 dec2_reserved4;
volume_control_t dec2_vol_ctrl; /* Not used! */ struct dsp_volume_control dec2_vol_ctrl; /* Not used! */
} decimate_by_pow2_scb_t; };
typedef struct _vari_decimate_scb_t { struct dsp_vari_decimate_scb {
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
vdec_frames_left_in_gof, vdec_frames_left_in_gof,
vdec_gofs_left_in_sec vdec_gofs_left_in_sec
...@@ -711,15 +711,15 @@ typedef struct _vari_decimate_scb_t { ...@@ -711,15 +711,15 @@ typedef struct _vari_decimate_scb_t {
u32 vdec_phi_incr_6int_26frac; u32 vdec_phi_incr_6int_26frac;
volume_control_t vdec_vol_ctrl; struct dsp_volume_control vdec_vol_ctrl;
} vari_decimate_scb_t; };
/* SCB for MIX_TO_OSTREAM algorithm family */ /* 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 */ /* First 13 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */ struct dsp_basic_dma_req basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */ struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */ next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */ sub_list_ptr /* REQUIRED */
...@@ -758,14 +758,14 @@ typedef struct _mix2_ostream_scb_t { ...@@ -758,14 +758,14 @@ typedef struct _mix2_ostream_scb_t {
const_FFFF, const_FFFF,
const_zero const_zero
) )
} mix2_ostream_scb_t; };
/* SCB for S16_MIX algorithm */ /* SCB for S16_MIX algorithm */
typedef struct _mix_only_scb_t { struct dsp_mix_only_scb {
/* First 13 dwords from generic_scb_t */ /* First 13 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */ struct dsp_basic_dma_req basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */ struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */ next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */ sub_list_ptr /* REQUIRED */
...@@ -780,11 +780,11 @@ typedef struct _mix_only_scb_t { ...@@ -780,11 +780,11 @@ typedef struct _mix_only_scb_t {
u32 strm_buf_ptr; /* REQUIRED */ u32 strm_buf_ptr; /* REQUIRED */
u32 reserved; u32 reserved;
volume_control_t vol_ctrl; struct dsp_volume_control vol_ctrl;
} mix_only_scb_t; };
/* SCB for the async. CODEC input algorithm */ /* 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_free2;
u32 io_current_total; u32 io_current_total;
...@@ -837,11 +837,11 @@ typedef struct _async_codec_input_scb_t { ...@@ -837,11 +837,11 @@ typedef struct _async_codec_input_scb_t {
) )
u32 i_free; u32 i_free;
} async_codec_input_scb_t; };
/* SCB for the SP/DIF CODEC input and output */ /* SCB for the SP/DIF CODEC input and output */
typedef struct _spdifiscb_t { struct dsp_spdifiscb {
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
status_ptr, status_ptr,
status_start_ptr status_start_ptr
...@@ -895,12 +895,11 @@ typedef struct _spdifiscb_t { ...@@ -895,12 +895,11 @@ typedef struct _spdifiscb_t {
) )
u32 free1; u32 free1;
} spdifiscb_t; };
/* SCB for the SP/DIF CODEC input and output */ /* SCB for the SP/DIF CODEC input and output */
typedef struct _spdifoscb_t { struct dsp_spdifoscb {
u32 free2; u32 free2;
...@@ -941,11 +940,10 @@ typedef struct _spdifoscb_t { ...@@ -941,11 +940,10 @@ typedef struct _spdifoscb_t {
) )
u32 free1; u32 free1;
} spdifoscb_t; };
typedef struct _asynch_fg_rx_scb_t { struct dsp_asynch_fg_rx_scb {
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
bot_buf_mask, bot_buf_mask,
buf_Mask buf_Mask
...@@ -993,11 +991,10 @@ typedef struct _asynch_fg_rx_scb_t { ...@@ -993,11 +991,10 @@ typedef struct _asynch_fg_rx_scb_t {
right_vol, right_vol,
left_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( ___DSP_DUAL_16BIT_ALLOC(
not_buf_mask, not_buf_mask,
buf_mask buf_mask
...@@ -1052,13 +1049,13 @@ typedef struct _asynch_fg_tx_scb_t { ...@@ -1052,13 +1049,13 @@ typedef struct _asynch_fg_tx_scb_t {
unused_right_vol, unused_right_vol,
unused_left_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 */ /* First 13 dwords from generic_scb_t */
basic_dma_req_t basic_req; /* Optional */ struct dsp_basic_dma_req basic_req; /* Optional */
scatter_gather_ext_t sg_ext; /* Optional */ struct dsp_scatter_gather_ext sg_ext; /* Optional */
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
next_scb, /* REQUIRED */ next_scb, /* REQUIRED */
sub_list_ptr /* REQUIRED */ sub_list_ptr /* REQUIRED */
...@@ -1083,9 +1080,9 @@ typedef struct _output_snoop_scb_t { ...@@ -1083,9 +1080,9 @@ typedef struct _output_snoop_scb_t {
reserved, reserved,
input_scb input_scb
) )
} output_snoop_scb_t; };
typedef struct _spio_write_scb_t { struct dsp_spio_write_scb {
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
address1, address1,
address2 address2
...@@ -1122,9 +1119,9 @@ typedef struct _spio_write_scb_t { ...@@ -1122,9 +1119,9 @@ typedef struct _spio_write_scb_t {
) )
u32 unused3[5]; u32 unused3[5];
} spio_write_scb_t; };
typedef struct _magic_snoop_task_t { struct dsp_magic_snoop_task {
u32 i0; u32 i0;
u32 i1; u32 i1;
...@@ -1155,11 +1152,11 @@ typedef struct _magic_snoop_task_t { ...@@ -1155,11 +1152,11 @@ typedef struct _magic_snoop_task_t {
u32 i8; u32 i8;
volume_control_t vdec_vol_ctrl; struct dsp_volume_control vdec_vol_ctrl;
} magic_snoop_task_t; };
typedef struct _filter_scb_t { struct dsp_filter_scb {
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
a0_right, /* 0x00 */ a0_right, /* 0x00 */
a0_left a0_left
...@@ -1212,5 +1209,5 @@ typedef struct _filter_scb_t { ...@@ -1212,5 +1209,5 @@ typedef struct _filter_scb_t {
b2_right, /* 0x0F */ b2_right, /* 0x0F */
b2_left b2_left
) )
} filter_scb_t; };
#endif /* __DSP_SCB_TYPES_H__ */ #endif /* __DSP_SCB_TYPES_H__ */
...@@ -65,133 +65,130 @@ ...@@ -65,133 +65,130 @@
#define DSP_SPDIF_STATUS_HW_ENABLED 4 #define DSP_SPDIF_STATUS_HW_ENABLED 4
#define DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED 8 #define DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED 8
struct _dsp_module_desc_t; struct dsp_symbol_entry {
typedef struct _symbol_entry_t {
u32 address; u32 address;
char symbol_name[DSP_MAX_SYMBOL_NAME]; char symbol_name[DSP_MAX_SYMBOL_NAME];
int symbol_type; int symbol_type;
/* initialized by driver */ /* initialized by driver */
struct _dsp_module_desc_t * module; struct dsp_module_desc * module;
int deleted; int deleted;
} symbol_entry_t; };
typedef struct _symbol_desc_t { struct dsp_symbol_desc {
int nsymbols; int nsymbols;
symbol_entry_t * symbols; struct dsp_symbol_entry *symbols;
/* initialized by driver */ /* initialized by driver */
int highest_frag_index; int highest_frag_index;
} symbol_desc_t; };
typedef struct _segment_desc_t { struct dsp_segment_desc {
int segment_type; int segment_type;
u32 offset; u32 offset;
u32 size; u32 size;
u32 * data; u32 * data;
} segment_desc_t; };
typedef struct _dsp_module_desc_t { struct dsp_module_desc {
char * module_name; char * module_name;
symbol_desc_t symbol_table; struct dsp_symbol_desc symbol_table;
int nsegments; int nsegments;
segment_desc_t * segments; struct dsp_segment_desc * segments;
/* initialized by driver */ /* initialized by driver */
u32 overlay_begin_address; u32 overlay_begin_address;
u32 load_address; u32 load_address;
int nfixups; int nfixups;
} dsp_module_desc_t; };
typedef struct _dsp_scb_descriptor_t { struct dsp_scb_descriptor {
char scb_name[DSP_MAX_SCB_NAME]; char scb_name[DSP_MAX_SCB_NAME];
u32 address; u32 address;
int index; int index;
struct _dsp_scb_descriptor_t * sub_list_ptr; struct dsp_scb_descriptor * sub_list_ptr;
struct _dsp_scb_descriptor_t * next_scb_ptr; struct dsp_scb_descriptor * next_scb_ptr;
struct _dsp_scb_descriptor_t * parent_scb_ptr; struct dsp_scb_descriptor * parent_scb_ptr;
symbol_entry_t * task_entry; struct dsp_symbol_entry * task_entry;
symbol_entry_t * scb_symbol; struct dsp_symbol_entry * scb_symbol;
snd_info_entry_t *proc_info; struct snd_info_entry *proc_info;
int ref_count; int ref_count;
spinlock_t lock; spinlock_t lock;
int deleted; int deleted;
} dsp_scb_descriptor_t; };
typedef struct _dsp_task_descriptor_t { struct dsp_task_descriptor {
char task_name[DSP_MAX_TASK_NAME]; char task_name[DSP_MAX_TASK_NAME];
int size; int size;
u32 address; u32 address;
int index; int index;
} dsp_task_descriptor_t; };
typedef struct _pcm_channel_descriptor_t { struct dsp_pcm_channel_descriptor {
int active; int active;
int src_slot; int src_slot;
int pcm_slot; int pcm_slot;
u32 sample_rate; u32 sample_rate;
u32 unlinked; u32 unlinked;
dsp_scb_descriptor_t * pcm_reader_scb; struct dsp_scb_descriptor * pcm_reader_scb;
dsp_scb_descriptor_t * src_scb; struct dsp_scb_descriptor * src_scb;
dsp_scb_descriptor_t * mixer_scb; struct dsp_scb_descriptor * mixer_scb;
void * private_data; void * private_data;
} pcm_channel_descriptor_t; };
typedef struct _dsp_spos_instance_t { struct dsp_spos_instance {
symbol_desc_t symbol_table; /* currently availble loaded symbols in SP */ struct dsp_symbol_desc symbol_table; /* currently availble loaded symbols in SP */
int nmodules; 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 */ /* 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_right;
u16 dac_volume_left; u16 dac_volume_left;
/* Rear/surround PCM playback mixer */ /* Rear/surround PCM playback mixer */
dsp_scb_descriptor_t * rear_mix_scb; struct dsp_scb_descriptor * rear_mix_scb;
/* Center/LFE mixer */ /* Center/LFE mixer */
dsp_scb_descriptor_t * center_lfe_mix_scb; struct dsp_scb_descriptor * center_lfe_mix_scb;
int npcm_channels; int npcm_channels;
int nsrc_scb; 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]; int src_scb_slots[DSP_MAX_SRC_NR];
/* cache this symbols */ /* cache this symbols */
symbol_entry_t * null_algorithm; /* used by PCMreaderSCB's */ struct dsp_symbol_entry * null_algorithm; /* used by PCMreaderSCB's */
symbol_entry_t * s16_up; /* used by SRCtaskSCB's */ struct dsp_symbol_entry * s16_up; /* used by SRCtaskSCB's */
/* proc fs */ /* proc fs */
snd_card_t * snd_card; struct snd_card *snd_card;
snd_info_entry_t * proc_dsp_dir; struct snd_info_entry * proc_dsp_dir;
snd_info_entry_t * proc_sym_info_entry; struct snd_info_entry * proc_sym_info_entry;
snd_info_entry_t * proc_modules_info_entry; struct snd_info_entry * proc_modules_info_entry;
snd_info_entry_t * proc_parameter_dump_info_entry; struct snd_info_entry * proc_parameter_dump_info_entry;
snd_info_entry_t * proc_sample_dump_info_entry; struct snd_info_entry * proc_sample_dump_info_entry;
/* SCB's descriptors */ /* SCB's descriptors */
int nscb; int nscb;
int scb_highest_frag_index; int scb_highest_frag_index;
dsp_scb_descriptor_t scbs[DSP_MAX_SCB_DESC]; struct dsp_scb_descriptor scbs[DSP_MAX_SCB_DESC];
snd_info_entry_t * proc_scb_info_entry; struct snd_info_entry * proc_scb_info_entry;
dsp_scb_descriptor_t * the_null_scb; struct dsp_scb_descriptor * the_null_scb;
/* Task's descriptors */ /* Task's descriptors */
int ntask; int ntask;
dsp_task_descriptor_t tasks[DSP_MAX_TASK_DESC]; struct dsp_task_descriptor tasks[DSP_MAX_TASK_DESC];
snd_info_entry_t * proc_task_info_entry; struct snd_info_entry * proc_task_info_entry;
/* SPDIF status */ /* SPDIF status */
int spdif_status_out; int spdif_status_out;
...@@ -204,30 +201,30 @@ typedef struct _dsp_spos_instance_t { ...@@ -204,30 +201,30 @@ typedef struct _dsp_spos_instance_t {
unsigned int spdif_csuv_stream; unsigned int spdif_csuv_stream;
/* SPDIF input sample rate converter */ /* SPDIF input sample rate converter */
dsp_scb_descriptor_t * spdif_in_src; struct dsp_scb_descriptor * spdif_in_src;
/* SPDIF input asynch. receiver */ /* SPDIF input asynch. receiver */
dsp_scb_descriptor_t * asynch_rx_scb; struct dsp_scb_descriptor * asynch_rx_scb;
/* Capture record mixer SCB */ /* Capture record mixer SCB */
dsp_scb_descriptor_t * record_mixer_scb; struct dsp_scb_descriptor * record_mixer_scb;
/* CODEC input SCB */ /* CODEC input SCB */
dsp_scb_descriptor_t * codec_in_scb; struct dsp_scb_descriptor * codec_in_scb;
/* reference snooper */ /* reference snooper */
dsp_scb_descriptor_t * ref_snoop_scb; struct dsp_scb_descriptor * ref_snoop_scb;
/* SPDIF output PCM reference */ /* SPDIF output PCM reference */
dsp_scb_descriptor_t * spdif_pcm_input_scb; struct dsp_scb_descriptor * spdif_pcm_input_scb;
/* asynch TX task */ /* asynch TX task */
dsp_scb_descriptor_t * asynch_tx_scb; struct dsp_scb_descriptor * asynch_tx_scb;
/* record sources */ /* record sources */
dsp_scb_descriptor_t * pcm_input; struct dsp_scb_descriptor * pcm_input;
dsp_scb_descriptor_t * adc_input; struct dsp_scb_descriptor * adc_input;
int spdif_in_sample_rate; int spdif_in_sample_rate;
} dsp_spos_instance_t; };
#endif /* __DSP_SPOS_H__ */ #endif /* __DSP_SPOS_H__ */
...@@ -71,7 +71,7 @@ Ptr____Call (c) ...@@ -71,7 +71,7 @@ Ptr____Call (c)
at the end of BG */ at the end of BG */
/* Minimal context save area for Hyper Forground */ /* Minimal context save area for Hyper Forground */
typedef struct _hf_save_area_t { struct dsp_hf_save_area {
u32 r10_save; u32 r10_save;
u32 r54_save; u32 r54_save;
u32 r98_save; u32 r98_save;
...@@ -96,11 +96,11 @@ typedef struct _hf_save_area_t { ...@@ -96,11 +96,11 @@ typedef struct _hf_save_area_t {
rsa2Save rsa2Save
) )
/* saved as part of HFG context */ /* saved as part of HFG context */
} hf_save_area_t; };
/* Task link data structure */ /* Task link data structure */
typedef struct _tree_link_t { struct dsp_tree_link {
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
/* Pointer to sibling task control block */ /* Pointer to sibling task control block */
next_scb, next_scb,
...@@ -114,10 +114,10 @@ typedef struct _tree_link_t { ...@@ -114,10 +114,10 @@ typedef struct _tree_link_t {
/* Pointer to local data */ /* Pointer to local data */
this_spb this_spb
) )
} tree_link_t; };
typedef struct _task_tree_data_t { struct dsp_task_tree_data {
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
/* Initial tock count; controls task tree execution rate */ /* Initial tock count; controls task tree execution rate */
tock_count_limit, tock_count_limit,
...@@ -155,11 +155,10 @@ typedef struct _task_tree_data_t { ...@@ -155,11 +155,10 @@ typedef struct _task_tree_data_t {
data_stack_base_ptr data_stack_base_ptr
) )
} task_tree_data_t; };
struct dsp_interval_timer_data
typedef struct _interval_timer_data_t
{ {
/* These data items have the same relative locations to those */ /* These data items have the same relative locations to those */
___DSP_DUAL_16BIT_ALLOC( ___DSP_DUAL_16BIT_ALLOC(
...@@ -172,12 +171,12 @@ typedef struct _interval_timer_data_t ...@@ -172,12 +171,12 @@ typedef struct _interval_timer_data_t
num_FG_ticks_this_interval, num_FG_ticks_this_interval,
num_intervals num_intervals
) )
} interval_timer_data_t; };
/* This structure contains extra storage for the task tree /* This structure contains extra storage for the task tree
Currently, this additional data is related only to a full context save */ 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 /* 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 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 */ users should never use. This last may be required by the system */
...@@ -238,16 +237,16 @@ typedef struct _task_tree_context_block_t { ...@@ -238,16 +237,16 @@ typedef struct _task_tree_context_block_t {
u32 saveaux2xaux3x; u32 saveaux2xaux3x;
u32 savershouthl; u32 savershouthl;
u32 savershoutxmacmode; u32 savershoutxmacmode;
} task_tree_context_block_t; };
typedef struct _task_tree_control_block_t { struct dsp_task_tree_control_block {
hf_save_area_t context; struct dsp_hf_save_area context;
tree_link_t links; struct dsp_tree_link links;
task_tree_data_t data; struct dsp_task_tree_data data;
task_tree_context_block_t context_blk; struct dsp_task_tree_context_block context_blk;
interval_timer_data_t int_timer; struct dsp_interval_timer_data int_timer;
} task_tree_control_block_t; };
#endif /* __DSP_TASK_TYPES_H__ */ #endif /* __DSP_TASK_TYPES_H__ */
...@@ -78,8 +78,8 @@ static int __devinit snd_card_cs46xx_probe(struct pci_dev *pci, ...@@ -78,8 +78,8 @@ static int __devinit snd_card_cs46xx_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id) const struct pci_device_id *pci_id)
{ {
static int dev; static int dev;
snd_card_t *card; struct snd_card *card;
cs46xx_t *chip; struct snd_cs46xx *chip;
int err; int err;
if (dev >= SNDRV_CARDS) if (dev >= SNDRV_CARDS)
......
...@@ -66,23 +66,23 @@ ...@@ -66,23 +66,23 @@
#include "cs46xx_lib.h" #include "cs46xx_lib.h"
#include "dsp_spos.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 #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;
static snd_pcm_ops_t snd_cs46xx_playback_indirect_rear_ops; static struct snd_pcm_ops snd_cs46xx_playback_indirect_rear_ops;
static snd_pcm_ops_t snd_cs46xx_playback_clfe_ops; static struct snd_pcm_ops snd_cs46xx_playback_clfe_ops;
static snd_pcm_ops_t snd_cs46xx_playback_indirect_clfe_ops; static struct snd_pcm_ops snd_cs46xx_playback_indirect_clfe_ops;
static snd_pcm_ops_t snd_cs46xx_playback_iec958_ops; static struct snd_pcm_ops snd_cs46xx_playback_iec958_ops;
static snd_pcm_ops_t snd_cs46xx_playback_indirect_iec958_ops; static struct snd_pcm_ops snd_cs46xx_playback_indirect_iec958_ops;
#endif #endif
static snd_pcm_ops_t snd_cs46xx_playback_ops; static struct snd_pcm_ops snd_cs46xx_playback_ops;
static snd_pcm_ops_t snd_cs46xx_playback_indirect_ops; static struct snd_pcm_ops snd_cs46xx_playback_indirect_ops;
static snd_pcm_ops_t snd_cs46xx_capture_ops; static struct snd_pcm_ops snd_cs46xx_capture_ops;
static snd_pcm_ops_t snd_cs46xx_capture_indirect_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, unsigned short reg,
int codec_index) int codec_index)
{ {
...@@ -204,10 +204,10 @@ static unsigned short snd_cs46xx_codec_read(cs46xx_t *chip, ...@@ -204,10 +204,10 @@ static unsigned short snd_cs46xx_codec_read(cs46xx_t *chip,
return result; 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) unsigned short reg)
{ {
cs46xx_t *chip = ac97->private_data; struct snd_cs46xx *chip = ac97->private_data;
unsigned short val; unsigned short val;
int codec_index = ac97->num; int codec_index = ac97->num;
...@@ -221,7 +221,7 @@ static unsigned short snd_cs46xx_ac97_read(ac97_t * ac97, ...@@ -221,7 +221,7 @@ static unsigned short snd_cs46xx_ac97_read(ac97_t * ac97,
} }
static void snd_cs46xx_codec_write(cs46xx_t *chip, static void snd_cs46xx_codec_write(struct snd_cs46xx *chip,
unsigned short reg, unsigned short reg,
unsigned short val, unsigned short val,
int codec_index) int codec_index)
...@@ -286,11 +286,11 @@ static void snd_cs46xx_codec_write(cs46xx_t *chip, ...@@ -286,11 +286,11 @@ static void snd_cs46xx_codec_write(cs46xx_t *chip,
chip->active_ctrl(chip, -1); 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 reg,
unsigned short val) unsigned short val)
{ {
cs46xx_t *chip = ac97->private_data; struct snd_cs46xx *chip = ac97->private_data;
int codec_index = ac97->num; int codec_index = ac97->num;
snd_assert(codec_index == CS46XX_PRIMARY_CODEC_INDEX || snd_assert(codec_index == CS46XX_PRIMARY_CODEC_INDEX ||
...@@ -305,7 +305,7 @@ static void snd_cs46xx_ac97_write(ac97_t *ac97, ...@@ -305,7 +305,7 @@ static void snd_cs46xx_ac97_write(ac97_t *ac97,
* Chip initialization * Chip initialization
*/ */
int snd_cs46xx_download(cs46xx_t *chip, int snd_cs46xx_download(struct snd_cs46xx *chip,
u32 *src, u32 *src,
unsigned long offset, unsigned long offset,
unsigned long len) unsigned long len)
...@@ -334,7 +334,7 @@ int snd_cs46xx_download(cs46xx_t *chip, ...@@ -334,7 +334,7 @@ int snd_cs46xx_download(cs46xx_t *chip,
#include "imgs/cwcbinhack.h" #include "imgs/cwcbinhack.h"
#include "imgs/cwcdma.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 offset,
unsigned long len) unsigned long len)
{ {
...@@ -358,7 +358,7 @@ int snd_cs46xx_clear_BA1(cs46xx_t *chip, ...@@ -358,7 +358,7 @@ int snd_cs46xx_clear_BA1(cs46xx_t *chip,
#include "cs46xx_image.h" #include "cs46xx_image.h"
int snd_cs46xx_download_image(cs46xx_t *chip) int snd_cs46xx_download_image(struct snd_cs46xx *chip)
{ {
int idx, err; int idx, err;
unsigned long offset = 0; unsigned long offset = 0;
...@@ -379,7 +379,7 @@ int snd_cs46xx_download_image(cs46xx_t *chip) ...@@ -379,7 +379,7 @@ int snd_cs46xx_download_image(cs46xx_t *chip)
* Chip reset * Chip reset
*/ */
static void snd_cs46xx_reset(cs46xx_t *chip) static void snd_cs46xx_reset(struct snd_cs46xx *chip)
{ {
int idx; int idx;
...@@ -408,7 +408,7 @@ static void snd_cs46xx_reset(cs46xx_t *chip) ...@@ -408,7 +408,7 @@ static void snd_cs46xx_reset(cs46xx_t *chip)
snd_cs46xx_poke(chip, BA1_FRMT, 0xadf); 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; u32 i, status = 0;
/* /*
...@@ -432,7 +432,7 @@ static int cs46xx_wait_for_fifo(cs46xx_t * chip,int retry_timeout) ...@@ -432,7 +432,7 @@ static int cs46xx_wait_for_fifo(cs46xx_t * chip,int retry_timeout)
return 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; int idx, powerdown = 0;
unsigned int tmp; unsigned int tmp;
...@@ -486,7 +486,7 @@ static void snd_cs46xx_clear_serial_FIFOs(cs46xx_t *chip) ...@@ -486,7 +486,7 @@ static void snd_cs46xx_clear_serial_FIFOs(cs46xx_t *chip)
snd_cs46xx_pokeBA0(chip, BA0_CLKCR1, 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; int cnt;
...@@ -513,7 +513,7 @@ static void snd_cs46xx_proc_start(cs46xx_t *chip) ...@@ -513,7 +513,7 @@ static void snd_cs46xx_proc_start(cs46xx_t *chip)
snd_printk(KERN_ERR "SPCR_RUNFR never reset\n"); 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 * Turn off the run, run at frame, and DMA enable bits in the local copy of
...@@ -528,7 +528,7 @@ static void snd_cs46xx_proc_stop(cs46xx_t *chip) ...@@ -528,7 +528,7 @@ static void snd_cs46xx_proc_stop(cs46xx_t *chip)
#define GOF_PER_SEC 200 #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 long flags;
unsigned int tmp1, tmp2; unsigned int tmp1, tmp2;
...@@ -574,7 +574,7 @@ static void snd_cs46xx_set_play_sample_rate(cs46xx_t *chip, unsigned int rate) ...@@ -574,7 +574,7 @@ static void snd_cs46xx_set_play_sample_rate(cs46xx_t *chip, unsigned int rate)
spin_unlock_irqrestore(&chip->reg_lock, flags); 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 long flags;
unsigned int phiIncr, coeffIncr, tmp1, tmp2; unsigned int phiIncr, coeffIncr, tmp1, tmp2;
...@@ -684,43 +684,43 @@ static void snd_cs46xx_set_capture_sample_rate(cs46xx_t *chip, unsigned int rate ...@@ -684,43 +684,43 @@ static void snd_cs46xx_set_capture_sample_rate(cs46xx_t *chip, unsigned int rate
* PCM part * PCM part
*/ */
static void snd_cs46xx_pb_trans_copy(snd_pcm_substream_t *substream, static void snd_cs46xx_pb_trans_copy(struct snd_pcm_substream *substream,
snd_pcm_indirect_t *rec, size_t bytes) struct snd_pcm_indirect *rec, size_t bytes)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
cs46xx_pcm_t * cpcm = runtime->private_data; struct snd_cs46xx_pcm * cpcm = runtime->private_data;
memcpy(cpcm->hw_buf.area + rec->hw_data, runtime->dma_area + rec->sw_data, bytes); 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; struct snd_pcm_runtime *runtime = substream->runtime;
cs46xx_pcm_t * cpcm = runtime->private_data; struct snd_cs46xx_pcm * cpcm = runtime->private_data;
snd_pcm_indirect_playback_transfer(substream, &cpcm->pcm_rec, snd_cs46xx_pb_trans_copy); snd_pcm_indirect_playback_transfer(substream, &cpcm->pcm_rec, snd_cs46xx_pb_trans_copy);
return 0; return 0;
} }
static void snd_cs46xx_cp_trans_copy(snd_pcm_substream_t *substream, static void snd_cs46xx_cp_trans_copy(struct snd_pcm_substream *substream,
snd_pcm_indirect_t *rec, size_t bytes) struct snd_pcm_indirect *rec, size_t bytes)
{ {
cs46xx_t *chip = snd_pcm_substream_chip(substream); struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
memcpy(runtime->dma_area + rec->sw_data, memcpy(runtime->dma_area + rec->sw_data,
chip->capt.hw_buf.area + rec->hw_data, bytes); 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); snd_pcm_indirect_capture_transfer(substream, &chip->capt.pcm_rec, snd_cs46xx_cp_trans_copy);
return 0; 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; 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); snd_assert (cpcm->pcm_channel,return -ENXIO);
#ifdef CONFIG_SND_CS46XX_NEW_DSP #ifdef CONFIG_SND_CS46XX_NEW_DSP
...@@ -732,11 +732,11 @@ static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(snd_pcm_substream_t ...@@ -732,11 +732,11 @@ static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(snd_pcm_substream_t
return ptr >> cpcm->shift; 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; 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 #ifdef CONFIG_SND_CS46XX_NEW_DSP
snd_assert (cpcm->pcm_channel,return -ENXIO); snd_assert (cpcm->pcm_channel,return -ENXIO);
...@@ -748,29 +748,29 @@ static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(snd_pcm_substream_ ...@@ -748,29 +748,29 @@ static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(snd_pcm_substream_
return snd_pcm_indirect_playback_pointer(substream, &cpcm->pcm_rec, ptr); 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; size_t ptr = snd_cs46xx_peek(chip, BA1_CBA) - chip->capt.hw_buf.addr;
return ptr >> chip->capt.shift; 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; 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); 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) int cmd)
{ {
cs46xx_t *chip = snd_pcm_substream_chip(substream); struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
/*snd_pcm_runtime_t *runtime = substream->runtime;*/ /*struct snd_pcm_runtime *runtime = substream->runtime;*/
int result = 0; int result = 0;
#ifdef CONFIG_SND_CS46XX_NEW_DSP #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) { if (! cpcm->pcm_channel) {
return -ENXIO; return -ENXIO;
} }
...@@ -827,10 +827,10 @@ static int snd_cs46xx_playback_trigger(snd_pcm_substream_t * substream, ...@@ -827,10 +827,10 @@ static int snd_cs46xx_playback_trigger(snd_pcm_substream_t * substream,
return result; 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) int cmd)
{ {
cs46xx_t *chip = snd_pcm_substream_chip(substream); struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
unsigned int tmp; unsigned int tmp;
int result = 0; int result = 0;
...@@ -858,7 +858,7 @@ static int snd_cs46xx_capture_trigger(snd_pcm_substream_t * substream, ...@@ -858,7 +858,7 @@ static int snd_cs46xx_capture_trigger(snd_pcm_substream_t * substream,
} }
#ifdef CONFIG_SND_CS46XX_NEW_DSP #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) int sample_rate)
{ {
...@@ -893,14 +893,14 @@ static int _cs46xx_adjust_sample_rate (cs46xx_t *chip, cs46xx_pcm_t *cpcm, ...@@ -893,14 +893,14 @@ static int _cs46xx_adjust_sample_rate (cs46xx_t *chip, cs46xx_pcm_t *cpcm,
#endif #endif
static int snd_cs46xx_playback_hw_params(snd_pcm_substream_t * substream, static int snd_cs46xx_playback_hw_params(struct snd_pcm_substream *substream,
snd_pcm_hw_params_t * hw_params) struct snd_pcm_hw_params *hw_params)
{ {
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
cs46xx_pcm_t *cpcm; struct snd_cs46xx_pcm *cpcm;
int err; int err;
#ifdef CONFIG_SND_CS46XX_NEW_DSP #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 sample_rate = params_rate(hw_params);
int period_size = params_period_bytes(hw_params); int period_size = params_period_bytes(hw_params);
#endif #endif
...@@ -995,11 +995,11 @@ static int snd_cs46xx_playback_hw_params(snd_pcm_substream_t * substream, ...@@ -995,11 +995,11 @@ static int snd_cs46xx_playback_hw_params(snd_pcm_substream_t * substream,
return 0; 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);*/ /*struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);*/
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
cs46xx_pcm_t *cpcm; struct snd_cs46xx_pcm *cpcm;
cpcm = runtime->private_data; cpcm = runtime->private_data;
...@@ -1017,13 +1017,13 @@ static int snd_cs46xx_playback_hw_free(snd_pcm_substream_t * substream) ...@@ -1017,13 +1017,13 @@ static int snd_cs46xx_playback_hw_free(snd_pcm_substream_t * substream)
return 0; 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 tmp;
unsigned int pfie; unsigned int pfie;
cs46xx_t *chip = snd_pcm_substream_chip(substream); struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
cs46xx_pcm_t *cpcm; struct snd_cs46xx_pcm *cpcm;
cpcm = runtime->private_data; cpcm = runtime->private_data;
...@@ -1087,11 +1087,11 @@ static int snd_cs46xx_playback_prepare(snd_pcm_substream_t * substream) ...@@ -1087,11 +1087,11 @@ static int snd_cs46xx_playback_prepare(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static int snd_cs46xx_capture_hw_params(snd_pcm_substream_t * substream, static int snd_cs46xx_capture_hw_params(struct snd_pcm_substream *substream,
snd_pcm_hw_params_t * hw_params) struct snd_pcm_hw_params *hw_params)
{ {
cs46xx_t *chip = snd_pcm_substream_chip(substream); struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
int err; int err;
#ifdef CONFIG_SND_CS46XX_NEW_DSP #ifdef CONFIG_SND_CS46XX_NEW_DSP
...@@ -1118,10 +1118,10 @@ static int snd_cs46xx_capture_hw_params(snd_pcm_substream_t * substream, ...@@ -1118,10 +1118,10 @@ static int snd_cs46xx_capture_hw_params(snd_pcm_substream_t * substream,
return 0; 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); struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
if (runtime->dma_area != chip->capt.hw_buf.area) if (runtime->dma_area != chip->capt.hw_buf.area)
snd_pcm_lib_free_pages(substream); snd_pcm_lib_free_pages(substream);
...@@ -1132,10 +1132,10 @@ static int snd_cs46xx_capture_hw_free(snd_pcm_substream_t * substream) ...@@ -1132,10 +1132,10 @@ static int snd_cs46xx_capture_hw_free(snd_pcm_substream_t * substream)
return 0; 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); struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
snd_cs46xx_poke(chip, BA1_CBA, chip->capt.hw_buf.addr); snd_cs46xx_poke(chip, BA1_CBA, chip->capt.hw_buf.addr);
chip->capt.shift = 2; chip->capt.shift = 2;
...@@ -1149,13 +1149,13 @@ static int snd_cs46xx_capture_prepare(snd_pcm_substream_t * substream) ...@@ -1149,13 +1149,13 @@ static int snd_cs46xx_capture_prepare(snd_pcm_substream_t * substream)
static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) 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; u32 status1;
#ifdef CONFIG_SND_CS46XX_NEW_DSP #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; u32 status2;
int i; int i;
cs46xx_pcm_t *cpcm = NULL; struct snd_cs46xx_pcm *cpcm = NULL;
#endif #endif
/* /*
...@@ -1239,7 +1239,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *r ...@@ -1239,7 +1239,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *r
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static snd_pcm_hardware_t snd_cs46xx_playback = static struct snd_pcm_hardware snd_cs46xx_playback =
{ {
.info = (SNDRV_PCM_INFO_MMAP | .info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_INTERLEAVED |
...@@ -1261,7 +1261,7 @@ static snd_pcm_hardware_t snd_cs46xx_playback = ...@@ -1261,7 +1261,7 @@ static snd_pcm_hardware_t snd_cs46xx_playback =
.fifo_size = 0, .fifo_size = 0,
}; };
static snd_pcm_hardware_t snd_cs46xx_capture = static struct snd_pcm_hardware snd_cs46xx_capture =
{ {
.info = (SNDRV_PCM_INFO_MMAP | .info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_INTERLEAVED |
...@@ -1285,7 +1285,7 @@ static snd_pcm_hardware_t snd_cs46xx_capture = ...@@ -1285,7 +1285,7 @@ static snd_pcm_hardware_t snd_cs46xx_capture =
static unsigned int period_sizes[] = { 32, 64, 128, 256, 512, 1024, 2048 }; 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), .count = ARRAY_SIZE(period_sizes),
.list = period_sizes, .list = period_sizes,
.mask = 0 .mask = 0
...@@ -1293,16 +1293,16 @@ static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = { ...@@ -1293,16 +1293,16 @@ static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = {
#endif #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); 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); struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
cs46xx_pcm_t * cpcm; struct snd_cs46xx_pcm * cpcm;
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
cpcm = kzalloc(sizeof(*cpcm), GFP_KERNEL); cpcm = kzalloc(sizeof(*cpcm), GFP_KERNEL);
if (cpcm == NULL) if (cpcm == NULL)
...@@ -1340,30 +1340,30 @@ static int _cs46xx_playback_open_channel (snd_pcm_substream_t * substream,int pc ...@@ -1340,30 +1340,30 @@ static int _cs46xx_playback_open_channel (snd_pcm_substream_t * substream,int pc
return 0; 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"); snd_printdd("open front channel\n");
return _cs46xx_playback_open_channel(substream,DSP_PCM_MAIN_CHANNEL); return _cs46xx_playback_open_channel(substream,DSP_PCM_MAIN_CHANNEL);
} }
#ifdef CONFIG_SND_CS46XX_NEW_DSP #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"); snd_printdd("open rear channel\n");
return _cs46xx_playback_open_channel(substream,DSP_PCM_REAR_CHANNEL); 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"); snd_printdd("open center - LFE channel\n");
return _cs46xx_playback_open_channel(substream,DSP_PCM_CENTER_LFE_CHANNEL); 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"); snd_printdd("open raw iec958 channel\n");
...@@ -1374,12 +1374,12 @@ static int snd_cs46xx_playback_open_iec958(snd_pcm_substream_t * substream) ...@@ -1374,12 +1374,12 @@ static int snd_cs46xx_playback_open_iec958(snd_pcm_substream_t * substream)
return _cs46xx_playback_open_channel(substream,DSP_IEC958_CHANNEL); 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; 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"); snd_printdd("close raw iec958 channel\n");
...@@ -1393,9 +1393,9 @@ static int snd_cs46xx_playback_close_iec958(snd_pcm_substream_t * substream) ...@@ -1393,9 +1393,9 @@ static int snd_cs46xx_playback_close_iec958(snd_pcm_substream_t * substream)
} }
#endif #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), if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci),
PAGE_SIZE, &chip->capt.hw_buf) < 0) PAGE_SIZE, &chip->capt.hw_buf) < 0)
...@@ -1416,11 +1416,11 @@ static int snd_cs46xx_capture_open(snd_pcm_substream_t * substream) ...@@ -1416,11 +1416,11 @@ static int snd_cs46xx_capture_open(snd_pcm_substream_t * substream)
return 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); struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
cs46xx_pcm_t * cpcm; struct snd_cs46xx_pcm * cpcm;
cpcm = runtime->private_data; cpcm = runtime->private_data;
...@@ -1445,9 +1445,9 @@ static int snd_cs46xx_playback_close(snd_pcm_substream_t * substream) ...@@ -1445,9 +1445,9 @@ static int snd_cs46xx_playback_close(snd_pcm_substream_t * substream)
return 0; 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; chip->capt.substream = NULL;
snd_dma_free_pages(&chip->capt.hw_buf); snd_dma_free_pages(&chip->capt.hw_buf);
...@@ -1457,7 +1457,7 @@ static int snd_cs46xx_capture_close(snd_pcm_substream_t * substream) ...@@ -1457,7 +1457,7 @@ static int snd_cs46xx_capture_close(snd_pcm_substream_t * substream)
} }
#ifdef CONFIG_SND_CS46XX_NEW_DSP #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, .open = snd_cs46xx_playback_open_rear,
.close = snd_cs46xx_playback_close, .close = snd_cs46xx_playback_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -1468,7 +1468,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_rear_ops = { ...@@ -1468,7 +1468,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_rear_ops = {
.pointer = snd_cs46xx_playback_direct_pointer, .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, .open = snd_cs46xx_playback_open_rear,
.close = snd_cs46xx_playback_close, .close = snd_cs46xx_playback_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -1480,7 +1480,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_rear_ops = { ...@@ -1480,7 +1480,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_rear_ops = {
.ack = snd_cs46xx_playback_transfer, .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, .open = snd_cs46xx_playback_open_clfe,
.close = snd_cs46xx_playback_close, .close = snd_cs46xx_playback_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -1491,7 +1491,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_clfe_ops = { ...@@ -1491,7 +1491,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_clfe_ops = {
.pointer = snd_cs46xx_playback_direct_pointer, .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, .open = snd_cs46xx_playback_open_clfe,
.close = snd_cs46xx_playback_close, .close = snd_cs46xx_playback_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -1503,7 +1503,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_clfe_ops = { ...@@ -1503,7 +1503,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_clfe_ops = {
.ack = snd_cs46xx_playback_transfer, .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, .open = snd_cs46xx_playback_open_iec958,
.close = snd_cs46xx_playback_close_iec958, .close = snd_cs46xx_playback_close_iec958,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -1514,7 +1514,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_iec958_ops = { ...@@ -1514,7 +1514,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_iec958_ops = {
.pointer = snd_cs46xx_playback_direct_pointer, .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, .open = snd_cs46xx_playback_open_iec958,
.close = snd_cs46xx_playback_close_iec958, .close = snd_cs46xx_playback_close_iec958,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -1528,7 +1528,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_iec958_ops = { ...@@ -1528,7 +1528,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_iec958_ops = {
#endif #endif
static snd_pcm_ops_t snd_cs46xx_playback_ops = { static struct snd_pcm_ops snd_cs46xx_playback_ops = {
.open = snd_cs46xx_playback_open, .open = snd_cs46xx_playback_open,
.close = snd_cs46xx_playback_close, .close = snd_cs46xx_playback_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -1539,7 +1539,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_ops = { ...@@ -1539,7 +1539,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_ops = {
.pointer = snd_cs46xx_playback_direct_pointer, .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, .open = snd_cs46xx_playback_open,
.close = snd_cs46xx_playback_close, .close = snd_cs46xx_playback_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -1551,7 +1551,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_ops = { ...@@ -1551,7 +1551,7 @@ static snd_pcm_ops_t snd_cs46xx_playback_indirect_ops = {
.ack = snd_cs46xx_playback_transfer, .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, .open = snd_cs46xx_capture_open,
.close = snd_cs46xx_capture_close, .close = snd_cs46xx_capture_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -1562,7 +1562,7 @@ static snd_pcm_ops_t snd_cs46xx_capture_ops = { ...@@ -1562,7 +1562,7 @@ static snd_pcm_ops_t snd_cs46xx_capture_ops = {
.pointer = snd_cs46xx_capture_direct_pointer, .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, .open = snd_cs46xx_capture_open,
.close = snd_cs46xx_capture_close, .close = snd_cs46xx_capture_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -1580,9 +1580,9 @@ static snd_pcm_ops_t snd_cs46xx_capture_indirect_ops = { ...@@ -1580,9 +1580,9 @@ static snd_pcm_ops_t snd_cs46xx_capture_indirect_ops = {
#define MAX_PLAYBACK_CHANNELS 1 #define MAX_PLAYBACK_CHANNELS 1
#endif #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; int err;
if (rpcm) if (rpcm)
...@@ -1611,9 +1611,9 @@ int __devinit snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t ** rpcm) ...@@ -1611,9 +1611,9 @@ int __devinit snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t ** rpcm)
#ifdef CONFIG_SND_CS46XX_NEW_DSP #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; int err;
if (rpcm) if (rpcm)
...@@ -1640,9 +1640,9 @@ int __devinit snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t ** rpcm) ...@@ -1640,9 +1640,9 @@ int __devinit snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t ** rpcm)
return 0; 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; int err;
if (rpcm) if (rpcm)
...@@ -1669,9 +1669,9 @@ int __devinit snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t ** ...@@ -1669,9 +1669,9 @@ int __devinit snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t **
return 0; 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; int err;
if (rpcm) if (rpcm)
...@@ -1702,16 +1702,16 @@ int __devinit snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t ** rpc ...@@ -1702,16 +1702,16 @@ int __devinit snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t ** rpc
/* /*
* Mixer routines * 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; 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]) || snd_assert ((ac97 == chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]) ||
(ac97 == chip->ac97[CS46XX_SECONDARY_CODEC_INDEX]), (ac97 == chip->ac97[CS46XX_SECONDARY_CODEC_INDEX]),
...@@ -1725,8 +1725,8 @@ static void snd_cs46xx_mixer_free_ac97(ac97_t *ac97) ...@@ -1725,8 +1725,8 @@ static void snd_cs46xx_mixer_free_ac97(ac97_t *ac97)
chip->ac97[CS46XX_SECONDARY_CODEC_INDEX] = NULL; chip->ac97[CS46XX_SECONDARY_CODEC_INDEX] = NULL;
} }
static int snd_cs46xx_vol_info(snd_kcontrol_t *kcontrol, static int snd_cs46xx_vol_info(struct snd_kcontrol *kcontrol,
snd_ctl_elem_info_t *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2; uinfo->count = 2;
...@@ -1735,9 +1735,9 @@ static int snd_cs46xx_vol_info(snd_kcontrol_t *kcontrol, ...@@ -1735,9 +1735,9 @@ static int snd_cs46xx_vol_info(snd_kcontrol_t *kcontrol,
return 0; 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; int reg = kcontrol->private_value;
unsigned int val = snd_cs46xx_peek(chip, reg); unsigned int val = snd_cs46xx_peek(chip, reg);
ucontrol->value.integer.value[0] = 0xffff - (val >> 16); ucontrol->value.integer.value[0] = 0xffff - (val >> 16);
...@@ -1745,9 +1745,9 @@ static int snd_cs46xx_vol_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ...@@ -1745,9 +1745,9 @@ static int snd_cs46xx_vol_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *
return 0; 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; int reg = kcontrol->private_value;
unsigned int val = ((0xffff - ucontrol->value.integer.value[0]) << 16 | unsigned int val = ((0xffff - ucontrol->value.integer.value[0]) << 16 |
(0xffff - ucontrol->value.integer.value[1])); (0xffff - ucontrol->value.integer.value[1]));
...@@ -1763,9 +1763,9 @@ static int snd_cs46xx_vol_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ...@@ -1763,9 +1763,9 @@ static int snd_cs46xx_vol_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *
#ifdef CONFIG_SND_CS46XX_NEW_DSP #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[0] = chip->dsp_spos_instance->dac_volume_left;
ucontrol->value.integer.value[1] = chip->dsp_spos_instance->dac_volume_right; ucontrol->value.integer.value[1] = chip->dsp_spos_instance->dac_volume_right;
...@@ -1773,9 +1773,9 @@ static int snd_cs46xx_vol_dac_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ ...@@ -1773,9 +1773,9 @@ static int snd_cs46xx_vol_dac_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
return 0; 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; int change = 0;
if (chip->dsp_spos_instance->dac_volume_right != ucontrol->value.integer.value[0] || if (chip->dsp_spos_instance->dac_volume_right != ucontrol->value.integer.value[0] ||
...@@ -1790,18 +1790,18 @@ static int snd_cs46xx_vol_dac_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ ...@@ -1790,18 +1790,18 @@ static int snd_cs46xx_vol_dac_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
} }
#if 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[0] = chip->dsp_spos_instance->spdif_input_volume_left;
ucontrol->value.integer.value[1] = chip->dsp_spos_instance->spdif_input_volume_right; ucontrol->value.integer.value[1] = chip->dsp_spos_instance->spdif_input_volume_right;
return 0; 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; int change = 0;
if (chip->dsp_spos_instance->spdif_input_volume_left != ucontrol->value.integer.value[0] || if (chip->dsp_spos_instance->spdif_input_volume_left != ucontrol->value.integer.value[0] ||
...@@ -1816,8 +1816,8 @@ static int snd_cs46xx_vol_iec958_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_val ...@@ -1816,8 +1816,8 @@ static int snd_cs46xx_vol_iec958_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_val
} }
#endif #endif
static int snd_mixer_boolean_info(snd_kcontrol_t *kcontrol, static int snd_mixer_boolean_info(struct snd_kcontrol *kcontrol,
snd_ctl_elem_info_t *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = 1; uinfo->count = 1;
...@@ -1826,10 +1826,10 @@ static int snd_mixer_boolean_info(snd_kcontrol_t *kcontrol, ...@@ -1826,10 +1826,10 @@ static int snd_mixer_boolean_info(snd_kcontrol_t *kcontrol,
return 0; return 0;
} }
static int snd_cs46xx_iec958_get(snd_kcontrol_t *kcontrol, static int snd_cs46xx_iec958_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) 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 reg = kcontrol->private_value;
if (reg == CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT) if (reg == CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT)
...@@ -1840,10 +1840,10 @@ static int snd_cs46xx_iec958_get(snd_kcontrol_t *kcontrol, ...@@ -1840,10 +1840,10 @@ static int snd_cs46xx_iec958_get(snd_kcontrol_t *kcontrol,
return 0; return 0;
} }
static int snd_cs46xx_iec958_put(snd_kcontrol_t *kcontrol, static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
cs46xx_t *chip = snd_kcontrol_chip(kcontrol); struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int change, res; int change, res;
switch (kcontrol->private_value) { switch (kcontrol->private_value) {
...@@ -1877,11 +1877,11 @@ static int snd_cs46xx_iec958_put(snd_kcontrol_t *kcontrol, ...@@ -1877,11 +1877,11 @@ static int snd_cs46xx_iec958_put(snd_kcontrol_t *kcontrol,
return res; return res;
} }
static int snd_cs46xx_adc_capture_get(snd_kcontrol_t *kcontrol, static int snd_cs46xx_adc_capture_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
cs46xx_t *chip = snd_kcontrol_chip(kcontrol); struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
if (ins->adc_input != NULL) if (ins->adc_input != NULL)
ucontrol->value.integer.value[0] = 1; ucontrol->value.integer.value[0] = 1;
...@@ -1891,11 +1891,11 @@ static int snd_cs46xx_adc_capture_get(snd_kcontrol_t *kcontrol, ...@@ -1891,11 +1891,11 @@ static int snd_cs46xx_adc_capture_get(snd_kcontrol_t *kcontrol,
return 0; return 0;
} }
static int snd_cs46xx_adc_capture_put(snd_kcontrol_t *kcontrol, static int snd_cs46xx_adc_capture_put(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
cs46xx_t *chip = snd_kcontrol_chip(kcontrol); struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int change = 0; int change = 0;
if (ucontrol->value.integer.value[0] && !ins->adc_input) { if (ucontrol->value.integer.value[0] && !ins->adc_input) {
...@@ -1908,11 +1908,11 @@ static int snd_cs46xx_adc_capture_put(snd_kcontrol_t *kcontrol, ...@@ -1908,11 +1908,11 @@ static int snd_cs46xx_adc_capture_put(snd_kcontrol_t *kcontrol,
return change; return change;
} }
static int snd_cs46xx_pcm_capture_get(snd_kcontrol_t *kcontrol, static int snd_cs46xx_pcm_capture_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
cs46xx_t *chip = snd_kcontrol_chip(kcontrol); struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
if (ins->pcm_input != NULL) if (ins->pcm_input != NULL)
ucontrol->value.integer.value[0] = 1; ucontrol->value.integer.value[0] = 1;
...@@ -1923,11 +1923,11 @@ static int snd_cs46xx_pcm_capture_get(snd_kcontrol_t *kcontrol, ...@@ -1923,11 +1923,11 @@ static int snd_cs46xx_pcm_capture_get(snd_kcontrol_t *kcontrol,
} }
static int snd_cs46xx_pcm_capture_put(snd_kcontrol_t *kcontrol, static int snd_cs46xx_pcm_capture_put(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
cs46xx_t *chip = snd_kcontrol_chip(kcontrol); struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int change = 0; int change = 0;
if (ucontrol->value.integer.value[0] && !ins->pcm_input) { if (ucontrol->value.integer.value[0] && !ins->pcm_input) {
...@@ -1941,10 +1941,10 @@ static int snd_cs46xx_pcm_capture_put(snd_kcontrol_t *kcontrol, ...@@ -1941,10 +1941,10 @@ static int snd_cs46xx_pcm_capture_put(snd_kcontrol_t *kcontrol,
return change; return change;
} }
static int snd_herc_spdif_select_get(snd_kcontrol_t *kcontrol, static int snd_herc_spdif_select_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) 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 val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR);
...@@ -1959,10 +1959,10 @@ static int snd_herc_spdif_select_get(snd_kcontrol_t *kcontrol, ...@@ -1959,10 +1959,10 @@ static int snd_herc_spdif_select_get(snd_kcontrol_t *kcontrol,
/* /*
* Game Theatre XP card - EGPIO[0] is used to select SPDIF input optical or coaxial. * 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, static int snd_herc_spdif_select_put(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) 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 val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR);
int val2 = snd_cs46xx_peekBA0(chip, BA0_EGPIOPTR); int val2 = snd_cs46xx_peekBA0(chip, BA0_EGPIOPTR);
...@@ -1984,18 +1984,18 @@ static int snd_herc_spdif_select_put(snd_kcontrol_t *kcontrol, ...@@ -1984,18 +1984,18 @@ static int snd_herc_spdif_select_put(snd_kcontrol_t *kcontrol,
} }
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->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1; uinfo->count = 1;
return 0; return 0;
} }
static int snd_cs46xx_spdif_default_get(snd_kcontrol_t * kcontrol, static int snd_cs46xx_spdif_default_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t * ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
cs46xx_t *chip = snd_kcontrol_chip(kcontrol); struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
down (&chip->spos_mutex); down (&chip->spos_mutex);
ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_default >> 24) & 0xff); ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_default >> 24) & 0xff);
...@@ -2007,11 +2007,11 @@ static int snd_cs46xx_spdif_default_get(snd_kcontrol_t * kcontrol, ...@@ -2007,11 +2007,11 @@ static int snd_cs46xx_spdif_default_get(snd_kcontrol_t * kcontrol,
return 0; return 0;
} }
static int snd_cs46xx_spdif_default_put(snd_kcontrol_t * kcontrol, static int snd_cs46xx_spdif_default_put(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t * ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
cs46xx_t * chip = snd_kcontrol_chip(kcontrol); struct snd_cs46xx * chip = snd_kcontrol_chip(kcontrol);
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
unsigned int val; unsigned int val;
int change; int change;
...@@ -2034,8 +2034,8 @@ static int snd_cs46xx_spdif_default_put(snd_kcontrol_t * kcontrol, ...@@ -2034,8 +2034,8 @@ static int snd_cs46xx_spdif_default_put(snd_kcontrol_t * kcontrol,
return change; return change;
} }
static int snd_cs46xx_spdif_mask_get(snd_kcontrol_t * kcontrol, static int snd_cs46xx_spdif_mask_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t * ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
ucontrol->value.iec958.status[0] = 0xff; ucontrol->value.iec958.status[0] = 0xff;
ucontrol->value.iec958.status[1] = 0xff; ucontrol->value.iec958.status[1] = 0xff;
...@@ -2044,11 +2044,11 @@ static int snd_cs46xx_spdif_mask_get(snd_kcontrol_t * kcontrol, ...@@ -2044,11 +2044,11 @@ static int snd_cs46xx_spdif_mask_get(snd_kcontrol_t * kcontrol,
return 0; return 0;
} }
static int snd_cs46xx_spdif_stream_get(snd_kcontrol_t * kcontrol, static int snd_cs46xx_spdif_stream_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t * ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
cs46xx_t *chip = snd_kcontrol_chip(kcontrol); struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
down (&chip->spos_mutex); down (&chip->spos_mutex);
ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_stream >> 24) & 0xff); ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_stream >> 24) & 0xff);
...@@ -2060,11 +2060,11 @@ static int snd_cs46xx_spdif_stream_get(snd_kcontrol_t * kcontrol, ...@@ -2060,11 +2060,11 @@ static int snd_cs46xx_spdif_stream_get(snd_kcontrol_t * kcontrol,
return 0; return 0;
} }
static int snd_cs46xx_spdif_stream_put(snd_kcontrol_t * kcontrol, static int snd_cs46xx_spdif_stream_put(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t * ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
cs46xx_t * chip = snd_kcontrol_chip(kcontrol); struct snd_cs46xx * chip = snd_kcontrol_chip(kcontrol);
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
unsigned int val; unsigned int val;
int change; int change;
...@@ -2091,8 +2091,8 @@ static int snd_cs46xx_spdif_stream_put(snd_kcontrol_t * kcontrol, ...@@ -2091,8 +2091,8 @@ static int snd_cs46xx_spdif_stream_put(snd_kcontrol_t * kcontrol,
#ifdef CONFIG_SND_CS46XX_DEBUG_GPIO #ifdef CONFIG_SND_CS46XX_DEBUG_GPIO
static int snd_cs46xx_egpio_select_info(snd_kcontrol_t *kcontrol, static int snd_cs46xx_egpio_select_info(struct snd_kcontrol *kcontrol,
snd_ctl_elem_info_t *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1; uinfo->count = 1;
...@@ -2101,19 +2101,19 @@ static int snd_cs46xx_egpio_select_info(snd_kcontrol_t *kcontrol, ...@@ -2101,19 +2101,19 @@ static int snd_cs46xx_egpio_select_info(snd_kcontrol_t *kcontrol,
return 0; return 0;
} }
static int snd_cs46xx_egpio_select_get(snd_kcontrol_t *kcontrol, static int snd_cs46xx_egpio_select_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) 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; ucontrol->value.integer.value[0] = chip->current_gpio;
return 0; return 0;
} }
static int snd_cs46xx_egpio_select_put(snd_kcontrol_t *kcontrol, static int snd_cs46xx_egpio_select_put(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) 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]); int change = (chip->current_gpio != ucontrol->value.integer.value[0]);
chip->current_gpio = ucontrol->value.integer.value[0]; chip->current_gpio = ucontrol->value.integer.value[0];
...@@ -2121,10 +2121,10 @@ static int snd_cs46xx_egpio_select_put(snd_kcontrol_t *kcontrol, ...@@ -2121,10 +2121,10 @@ static int snd_cs46xx_egpio_select_put(snd_kcontrol_t *kcontrol,
} }
static int snd_cs46xx_egpio_get(snd_kcontrol_t *kcontrol, static int snd_cs46xx_egpio_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) 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 reg = kcontrol->private_value;
snd_printdd ("put: reg = %04x, gpio %02x\n",reg,chip->current_gpio); snd_printdd ("put: reg = %04x, gpio %02x\n",reg,chip->current_gpio);
...@@ -2134,10 +2134,10 @@ static int snd_cs46xx_egpio_get(snd_kcontrol_t *kcontrol, ...@@ -2134,10 +2134,10 @@ static int snd_cs46xx_egpio_get(snd_kcontrol_t *kcontrol,
return 0; return 0;
} }
static int snd_cs46xx_egpio_put(snd_kcontrol_t *kcontrol, static int snd_cs46xx_egpio_put(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) 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 reg = kcontrol->private_value;
int val = snd_cs46xx_peekBA0(chip, reg); int val = snd_cs46xx_peekBA0(chip, reg);
int oldval = val; int oldval = val;
...@@ -2155,7 +2155,7 @@ static int snd_cs46xx_egpio_put(snd_kcontrol_t *kcontrol, ...@@ -2155,7 +2155,7 @@ static int snd_cs46xx_egpio_put(snd_kcontrol_t *kcontrol,
} }
#endif /* CONFIG_SND_CS46XX_DEBUG_GPIO */ #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, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "DAC Volume", .name = "DAC Volume",
...@@ -2285,26 +2285,26 @@ static snd_kcontrol_new_t snd_cs46xx_controls[] __devinitdata = { ...@@ -2285,26 +2285,26 @@ static snd_kcontrol_new_t snd_cs46xx_controls[] __devinitdata = {
#ifdef CONFIG_SND_CS46XX_NEW_DSP #ifdef CONFIG_SND_CS46XX_NEW_DSP
/* set primary cs4294 codec into Extended Audio Mode */ /* set primary cs4294 codec into Extended Audio Mode */
static int snd_cs46xx_front_dup_get(snd_kcontrol_t *kcontrol, static int snd_cs46xx_front_dup_get(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
cs46xx_t *chip = snd_kcontrol_chip(kcontrol); struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
unsigned short val; unsigned short val;
val = snd_ac97_read(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX], AC97_CSR_ACMODE); val = snd_ac97_read(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX], AC97_CSR_ACMODE);
ucontrol->value.integer.value[0] = (val & 0x200) ? 0 : 1; ucontrol->value.integer.value[0] = (val & 0x200) ? 0 : 1;
return 0; return 0;
} }
static int snd_cs46xx_front_dup_put(snd_kcontrol_t *kcontrol, static int snd_cs46xx_front_dup_put(struct snd_kcontrol *kcontrol,
snd_ctl_elem_value_t *ucontrol) 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], return snd_ac97_update_bits(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX],
AC97_CSR_ACMODE, 0x200, AC97_CSR_ACMODE, 0x200,
ucontrol->value.integer.value[0] ? 0 : 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, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Duplicate Front", .name = "Duplicate Front",
.info = snd_mixer_boolean_info, .info = snd_mixer_boolean_info,
...@@ -2315,7 +2315,7 @@ static snd_kcontrol_new_t snd_cs46xx_front_dup_ctl = { ...@@ -2315,7 +2315,7 @@ static snd_kcontrol_new_t snd_cs46xx_front_dup_ctl = {
#ifdef CONFIG_SND_CS46XX_NEW_DSP #ifdef CONFIG_SND_CS46XX_NEW_DSP
/* Only available on the Hercules Game Theater XP soundcard */ /* 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, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Optical/Coaxial SPDIF Input Switch", .name = "Optical/Coaxial SPDIF Input Switch",
...@@ -2326,7 +2326,7 @@ static snd_kcontrol_new_t snd_hercules_controls[] __devinitdata = { ...@@ -2326,7 +2326,7 @@ static snd_kcontrol_new_t snd_hercules_controls[] __devinitdata = {
}; };
static void snd_cs46xx_codec_reset (ac97_t * ac97) static void snd_cs46xx_codec_reset (struct snd_ac97 * ac97)
{ {
unsigned long end_time; unsigned long end_time;
int err; int err;
...@@ -2375,10 +2375,10 @@ static void snd_cs46xx_codec_reset (ac97_t * ac97) ...@@ -2375,10 +2375,10 @@ static void snd_cs46xx_codec_reset (ac97_t * ac97)
} }
#endif #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; int idx, err;
ac97_template_t ac97; struct snd_ac97_template ac97;
memset(&ac97, 0, sizeof(ac97)); memset(&ac97, 0, sizeof(ac97));
ac97.private_data = chip; ac97.private_data = chip;
...@@ -2408,13 +2408,13 @@ static int __devinit cs46xx_detect_codec(cs46xx_t *chip, int codec) ...@@ -2408,13 +2408,13 @@ static int __devinit cs46xx_detect_codec(cs46xx_t *chip, int codec)
return -ENXIO; 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; struct snd_card *card = chip->card;
snd_ctl_elem_id_t id; struct snd_ctl_elem_id id;
int err; int err;
unsigned int idx; unsigned int idx;
static ac97_bus_ops_t ops = { static struct snd_ac97_bus_ops ops = {
#ifdef CONFIG_SND_CS46XX_NEW_DSP #ifdef CONFIG_SND_CS46XX_NEW_DSP
.reset = snd_cs46xx_codec_reset, .reset = snd_cs46xx_codec_reset,
#endif #endif
...@@ -2442,7 +2442,7 @@ int __devinit snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device) ...@@ -2442,7 +2442,7 @@ int __devinit snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device)
/* add cs4630 mixer controls */ /* add cs4630 mixer controls */
for (idx = 0; idx < ARRAY_SIZE(snd_cs46xx_controls); idx++) { 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); kctl = snd_ctl_new1(&snd_cs46xx_controls[idx], chip);
if (kctl && kctl->id.iface == SNDRV_CTL_ELEM_IFACE_PCM) if (kctl && kctl->id.iface == SNDRV_CTL_ELEM_IFACE_PCM)
kctl->id.device = spdif_device; kctl->id.device = spdif_device;
...@@ -2484,16 +2484,16 @@ int __devinit snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device) ...@@ -2484,16 +2484,16 @@ int __devinit snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device)
* RawMIDI interface * 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); snd_cs46xx_pokeBA0(chip, BA0_MIDCR, MIDCR_MRST);
udelay(100); udelay(100);
snd_cs46xx_pokeBA0(chip, BA0_MIDCR, chip->midcr); 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); chip->active_ctrl(chip, 1);
spin_lock_irq(&chip->reg_lock); spin_lock_irq(&chip->reg_lock);
...@@ -2509,9 +2509,9 @@ static int snd_cs46xx_midi_input_open(snd_rawmidi_substream_t * substream) ...@@ -2509,9 +2509,9 @@ static int snd_cs46xx_midi_input_open(snd_rawmidi_substream_t * substream)
return 0; 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); spin_lock_irq(&chip->reg_lock);
chip->midcr &= ~(MIDCR_RXE | MIDCR_RIE); chip->midcr &= ~(MIDCR_RXE | MIDCR_RIE);
...@@ -2527,9 +2527,9 @@ static int snd_cs46xx_midi_input_close(snd_rawmidi_substream_t * substream) ...@@ -2527,9 +2527,9 @@ static int snd_cs46xx_midi_input_close(snd_rawmidi_substream_t * substream)
return 0; 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); chip->active_ctrl(chip, 1);
...@@ -2546,9 +2546,9 @@ static int snd_cs46xx_midi_output_open(snd_rawmidi_substream_t * substream) ...@@ -2546,9 +2546,9 @@ static int snd_cs46xx_midi_output_open(snd_rawmidi_substream_t * substream)
return 0; 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); spin_lock_irq(&chip->reg_lock);
chip->midcr &= ~(MIDCR_TXE | MIDCR_TIE); chip->midcr &= ~(MIDCR_TXE | MIDCR_TIE);
...@@ -2564,10 +2564,10 @@ static int snd_cs46xx_midi_output_close(snd_rawmidi_substream_t * substream) ...@@ -2564,10 +2564,10 @@ static int snd_cs46xx_midi_output_close(snd_rawmidi_substream_t * substream)
return 0; 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; 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); spin_lock_irqsave(&chip->reg_lock, flags);
if (up) { if (up) {
...@@ -2584,10 +2584,10 @@ static void snd_cs46xx_midi_input_trigger(snd_rawmidi_substream_t * substream, i ...@@ -2584,10 +2584,10 @@ static void snd_cs46xx_midi_input_trigger(snd_rawmidi_substream_t * substream, i
spin_unlock_irqrestore(&chip->reg_lock, flags); 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; unsigned long flags;
cs46xx_t *chip = substream->rmidi->private_data; struct snd_cs46xx *chip = substream->rmidi->private_data;
unsigned char byte; unsigned char byte;
spin_lock_irqsave(&chip->reg_lock, flags); spin_lock_irqsave(&chip->reg_lock, flags);
...@@ -2614,23 +2614,23 @@ static void snd_cs46xx_midi_output_trigger(snd_rawmidi_substream_t * substream, ...@@ -2614,23 +2614,23 @@ static void snd_cs46xx_midi_output_trigger(snd_rawmidi_substream_t * substream,
spin_unlock_irqrestore(&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, .open = snd_cs46xx_midi_output_open,
.close = snd_cs46xx_midi_output_close, .close = snd_cs46xx_midi_output_close,
.trigger = snd_cs46xx_midi_output_trigger, .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, .open = snd_cs46xx_midi_input_open,
.close = snd_cs46xx_midi_input_close, .close = snd_cs46xx_midi_input_close,
.trigger = snd_cs46xx_midi_input_trigger, .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; int err;
if (rrawmidi) if (rrawmidi)
...@@ -2657,7 +2657,7 @@ int __devinit snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rrawmi ...@@ -2657,7 +2657,7 @@ int __devinit snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rrawmi
static void snd_cs46xx_gameport_trigger(struct gameport *gameport) 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_assert(chip, return);
snd_cs46xx_pokeBA0(chip, BA0_JSPT, 0xFF); //outb(gameport->io, 0xFF); snd_cs46xx_pokeBA0(chip, BA0_JSPT, 0xFF); //outb(gameport->io, 0xFF);
...@@ -2665,7 +2665,7 @@ static void snd_cs46xx_gameport_trigger(struct gameport *gameport) ...@@ -2665,7 +2665,7 @@ static void snd_cs46xx_gameport_trigger(struct gameport *gameport)
static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport) 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); snd_assert(chip, return 0);
return snd_cs46xx_peekBA0(chip, BA0_JSPT); //inb(gameport->io); return snd_cs46xx_peekBA0(chip, BA0_JSPT); //inb(gameport->io);
...@@ -2673,7 +2673,7 @@ static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport) ...@@ -2673,7 +2673,7 @@ static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport)
static int snd_cs46xx_gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons) 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; unsigned js1, js2, jst;
snd_assert(chip, return 0); snd_assert(chip, return 0);
...@@ -2707,7 +2707,7 @@ static int snd_cs46xx_gameport_open(struct gameport *gameport, int mode) ...@@ -2707,7 +2707,7 @@ static int snd_cs46xx_gameport_open(struct gameport *gameport, int mode)
return 0; return 0;
} }
int __devinit snd_cs46xx_gameport(cs46xx_t *chip) int __devinit snd_cs46xx_gameport(struct snd_cs46xx *chip)
{ {
struct gameport *gp; struct gameport *gp;
...@@ -2735,7 +2735,7 @@ int __devinit snd_cs46xx_gameport(cs46xx_t *chip) ...@@ -2735,7 +2735,7 @@ int __devinit snd_cs46xx_gameport(cs46xx_t *chip)
return 0; 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) { if (chip->gameport) {
gameport_unregister_port(chip->gameport); gameport_unregister_port(chip->gameport);
...@@ -2743,20 +2743,20 @@ static inline void snd_cs46xx_remove_gameport(cs46xx_t *chip) ...@@ -2743,20 +2743,20 @@ static inline void snd_cs46xx_remove_gameport(cs46xx_t *chip)
} }
} }
#else #else
int __devinit snd_cs46xx_gameport(cs46xx_t *chip) { return -ENOSYS; } int __devinit snd_cs46xx_gameport(struct snd_cs46xx *chip) { return -ENOSYS; }
static inline void snd_cs46xx_remove_gameport(cs46xx_t *chip) { } static inline void snd_cs46xx_remove_gameport(struct snd_cs46xx *chip) { }
#endif /* CONFIG_GAMEPORT */ #endif /* CONFIG_GAMEPORT */
/* /*
* proc interface * 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, struct file *file, char __user *buf,
unsigned long count, unsigned long pos) unsigned long count, unsigned long pos)
{ {
long size; long size;
snd_cs46xx_region_t *region = (snd_cs46xx_region_t *)entry->private_data; struct snd_cs46xx_region *region = entry->private_data;
size = count; size = count;
if (pos + (size_t)size > region->size) if (pos + (size_t)size > region->size)
...@@ -2772,13 +2772,13 @@ static struct snd_info_entry_ops snd_cs46xx_proc_io_ops = { ...@@ -2772,13 +2772,13 @@ static struct snd_info_entry_ops snd_cs46xx_proc_io_ops = {
.read = snd_cs46xx_io_read, .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; int idx;
for (idx = 0; idx < 5; 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)) { if (! snd_card_proc_new(card, region->name, &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA; entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = chip; entry->private_data = chip;
...@@ -2793,7 +2793,7 @@ static int __devinit snd_cs46xx_proc_init(snd_card_t * card, cs46xx_t *chip) ...@@ -2793,7 +2793,7 @@ static int __devinit snd_cs46xx_proc_init(snd_card_t * card, cs46xx_t *chip)
return 0; 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 #ifdef CONFIG_SND_CS46XX_NEW_DSP
cs46xx_dsp_proc_done(chip); cs46xx_dsp_proc_done(chip);
...@@ -2804,7 +2804,7 @@ static int snd_cs46xx_proc_done(cs46xx_t *chip) ...@@ -2804,7 +2804,7 @@ static int snd_cs46xx_proc_done(cs46xx_t *chip)
/* /*
* stop the h/w * 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; unsigned int tmp;
...@@ -2851,7 +2851,7 @@ static void snd_cs46xx_hw_stop(cs46xx_t *chip) ...@@ -2851,7 +2851,7 @@ static void snd_cs46xx_hw_stop(cs46xx_t *chip)
} }
static int snd_cs46xx_free(cs46xx_t *chip) static int snd_cs46xx_free(struct snd_cs46xx *chip)
{ {
int idx; int idx;
...@@ -2871,13 +2871,13 @@ static int snd_cs46xx_free(cs46xx_t *chip) ...@@ -2871,13 +2871,13 @@ static int snd_cs46xx_free(cs46xx_t *chip)
snd_cs46xx_hw_stop(chip); snd_cs46xx_hw_stop(chip);
for (idx = 0; idx < 5; 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 (region->remap_addr) if (region->remap_addr)
iounmap(region->remap_addr); iounmap(region->remap_addr);
release_and_free_resource(region->resource); release_and_free_resource(region->resource);
} }
if (chip->irq >= 0) if (chip->irq >= 0)
free_irq(chip->irq, (void *)chip); free_irq(chip->irq, chip);
if (chip->active_ctrl) if (chip->active_ctrl)
chip->active_ctrl(chip, -chip->amplifier); chip->active_ctrl(chip, -chip->amplifier);
...@@ -2894,16 +2894,16 @@ static int snd_cs46xx_free(cs46xx_t *chip) ...@@ -2894,16 +2894,16 @@ static int snd_cs46xx_free(cs46xx_t *chip)
return 0; 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); return snd_cs46xx_free(chip);
} }
/* /*
* initialize chip * initialize chip
*/ */
static int snd_cs46xx_chip_init(cs46xx_t *chip) static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
{ {
int timeout; int timeout;
...@@ -3132,7 +3132,7 @@ static int snd_cs46xx_chip_init(cs46xx_t *chip) ...@@ -3132,7 +3132,7 @@ static int snd_cs46xx_chip_init(cs46xx_t *chip)
/* /*
* start and load DSP * 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; unsigned int tmp;
/* /*
...@@ -3234,12 +3234,12 @@ int __devinit snd_cs46xx_start_dsp(cs46xx_t *chip) ...@@ -3234,12 +3234,12 @@ int __devinit snd_cs46xx_start_dsp(cs46xx_t *chip)
* AMP control - null AMP * 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 #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; u32 idx, valid_slots,tmp,powerdown = 0;
...@@ -3359,7 +3359,7 @@ static int voyetra_setup_eapd_slot(cs46xx_t *chip) ...@@ -3359,7 +3359,7 @@ static int voyetra_setup_eapd_slot(cs46xx_t *chip)
* Crystal EAPD mode * 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 /* Manage the EAPD bit on the Crystal 4297
and the Analog AD1885 */ and the Analog AD1885 */
...@@ -3395,7 +3395,7 @@ static void amp_voyetra(cs46xx_t *chip, int change) ...@@ -3395,7 +3395,7 @@ static void amp_voyetra(cs46xx_t *chip, int change)
#endif #endif
} }
static void hercules_init(cs46xx_t *chip) static void hercules_init(struct snd_cs46xx *chip)
{ {
/* default: AMP off, and SPDIF input optical */ /* default: AMP off, and SPDIF input optical */
snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, EGPIODR_GPOE0); snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, EGPIODR_GPOE0);
...@@ -3406,7 +3406,7 @@ static void hercules_init(cs46xx_t *chip) ...@@ -3406,7 +3406,7 @@ static void hercules_init(cs46xx_t *chip)
/* /*
* Game Theatre XP card - EGPIO[2] is used to enable the external amp. * 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 old = chip->amplifier;
int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR); int val1 = snd_cs46xx_peekBA0(chip, BA0_EGPIODR);
...@@ -3427,7 +3427,7 @@ static void amp_hercules(cs46xx_t *chip, int change) ...@@ -3427,7 +3427,7 @@ static void amp_hercules(cs46xx_t *chip, int change)
} }
} }
static void voyetra_mixer_init (cs46xx_t *chip) static void voyetra_mixer_init (struct snd_cs46xx *chip)
{ {
snd_printdd ("initializing Voyetra mixer\n"); snd_printdd ("initializing Voyetra mixer\n");
...@@ -3436,12 +3436,12 @@ static void voyetra_mixer_init (cs46xx_t *chip) ...@@ -3436,12 +3436,12 @@ static void voyetra_mixer_init (cs46xx_t *chip)
snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, EGPIODR_GPOE0); 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 #ifdef CONFIG_SND_CS46XX_NEW_DSP
unsigned int idx; unsigned int idx;
int err; int err;
snd_card_t *card = chip->card; struct snd_card *card = chip->card;
#endif #endif
/* set EGPIO to default */ /* set EGPIO to default */
...@@ -3451,7 +3451,7 @@ static void hercules_mixer_init (cs46xx_t *chip) ...@@ -3451,7 +3451,7 @@ static void hercules_mixer_init (cs46xx_t *chip)
#ifdef CONFIG_SND_CS46XX_NEW_DSP #ifdef CONFIG_SND_CS46XX_NEW_DSP
for (idx = 0 ; idx < ARRAY_SIZE(snd_hercules_controls); idx++) { 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); kctl = snd_ctl_new1(&snd_hercules_controls[idx], chip);
if ((err = snd_ctl_add(card, kctl)) < 0) { if ((err = snd_ctl_add(card, kctl)) < 0) {
...@@ -3468,7 +3468,7 @@ static void hercules_mixer_init (cs46xx_t *chip) ...@@ -3468,7 +3468,7 @@ static void hercules_mixer_init (cs46xx_t *chip)
* Untested * 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; chip->amplifier += change;
...@@ -3498,7 +3498,7 @@ static void amp_voyetra_4294(cs46xx_t *chip, int change) ...@@ -3498,7 +3498,7 @@ static void amp_voyetra_4294(cs46xx_t *chip, int change)
* enough to make them useful. * 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; u16 control, nval;
...@@ -3523,7 +3523,7 @@ static void clkrun_hack(cs46xx_t *chip, int change) ...@@ -3523,7 +3523,7 @@ static void clkrun_hack(cs46xx_t *chip, int change)
/* /*
* detect intel piix4 * detect intel piix4
*/ */
static void clkrun_init(cs46xx_t *chip) static void clkrun_init(struct snd_cs46xx *chip)
{ {
struct pci_dev *pdev; struct pci_dev *pdev;
u8 pp; u8 pp;
...@@ -3551,10 +3551,10 @@ struct cs_card_type ...@@ -3551,10 +3551,10 @@ struct cs_card_type
u16 vendor; u16 vendor;
u16 id; u16 id;
char *name; char *name;
void (*init)(cs46xx_t *); void (*init)(struct snd_cs46xx *);
void (*amp)(cs46xx_t *, int); void (*amp)(struct snd_cs46xx *, int);
void (*active)(cs46xx_t *, int); void (*active)(struct snd_cs46xx *, int);
void (*mixer_init)(cs46xx_t *); void (*mixer_init)(struct snd_cs46xx *);
}; };
static struct cs_card_type __devinitdata cards[] = { static struct cs_card_type __devinitdata cards[] = {
...@@ -3654,9 +3654,9 @@ static struct cs_card_type __devinitdata cards[] = { ...@@ -3654,9 +3654,9 @@ static struct cs_card_type __devinitdata cards[] = {
* APM support * APM support
*/ */
#ifdef CONFIG_PM #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; int amp_saved;
snd_pcm_suspend_all(chip->pcm); snd_pcm_suspend_all(chip->pcm);
...@@ -3678,9 +3678,9 @@ static int snd_cs46xx_suspend(snd_card_t *card, pm_message_t state) ...@@ -3678,9 +3678,9 @@ static int snd_cs46xx_suspend(snd_card_t *card, pm_message_t state)
return 0; 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; int amp_saved;
pci_enable_device(chip->pci); pci_enable_device(chip->pci);
...@@ -3719,17 +3719,17 @@ static int snd_cs46xx_resume(snd_card_t *card) ...@@ -3719,17 +3719,17 @@ static int snd_cs46xx_resume(snd_card_t *card)
/* /*
*/ */
int __devinit snd_cs46xx_create(snd_card_t * card, int __devinit snd_cs46xx_create(struct snd_card *card,
struct pci_dev * pci, struct pci_dev * pci,
int external_amp, int thinkpad, int external_amp, int thinkpad,
cs46xx_t ** rchip) struct snd_cs46xx ** rchip)
{ {
cs46xx_t *chip; struct snd_cs46xx *chip;
int err, idx; int err, idx;
snd_cs46xx_region_t *region; struct snd_cs46xx_region *region;
struct cs_card_type *cp; struct cs_card_type *cp;
u16 ss_card, ss_vendor; u16 ss_card, ss_vendor;
static snd_device_ops_t ops = { static struct snd_device_ops ops = {
.dev_free = snd_cs46xx_dev_free, .dev_free = snd_cs46xx_dev_free,
}; };
...@@ -3755,7 +3755,8 @@ int __devinit snd_cs46xx_create(snd_card_t * card, ...@@ -3755,7 +3755,8 @@ int __devinit snd_cs46xx_create(snd_card_t * card,
chip->ba1_addr = pci_resource_start(pci, 1); chip->ba1_addr = pci_resource_start(pci, 1);
if (chip->ba0_addr == 0 || chip->ba0_addr == (unsigned long)~0 || if (chip->ba0_addr == 0 || chip->ba0_addr == (unsigned long)~0 ||
chip->ba1_addr == 0 || chip->ba1_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); snd_cs46xx_free(chip);
return -ENOMEM; return -ENOMEM;
} }
...@@ -3825,8 +3826,10 @@ int __devinit snd_cs46xx_create(snd_card_t * card, ...@@ -3825,8 +3826,10 @@ int __devinit snd_cs46xx_create(snd_card_t * card,
for (idx = 0; idx < 5; idx++) { for (idx = 0; idx < 5; idx++) {
region = &chip->region.idx[idx]; region = &chip->region.idx[idx];
if ((region->resource = request_mem_region(region->base, region->size, region->name)) == NULL) { if ((region->resource = request_mem_region(region->base, region->size,
snd_printk(KERN_ERR "unable to request memory region 0x%lx-0x%lx\n", region->base, region->base + region->size - 1); 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); snd_cs46xx_free(chip);
return -EBUSY; return -EBUSY;
} }
...@@ -3838,7 +3841,8 @@ int __devinit snd_cs46xx_create(snd_card_t * card, ...@@ -3838,7 +3841,8 @@ int __devinit snd_cs46xx_create(snd_card_t * card,
} }
} }
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_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
snd_cs46xx_free(chip); snd_cs46xx_free(chip);
return -EBUSY; return -EBUSY;
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
* common I/O routines * 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 bank = reg >> 16;
unsigned int offset = reg & 0xffff; unsigned int offset = reg & 0xffff;
...@@ -66,117 +66,128 @@ static inline void snd_cs46xx_poke(cs46xx_t *chip, unsigned long reg, unsigned i ...@@ -66,117 +66,128 @@ static inline void snd_cs46xx_poke(cs46xx_t *chip, unsigned long reg, unsigned i
writel(val, chip->region.idx[bank+1].remap_addr + offset); 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 bank = reg >> 16;
unsigned int offset = reg & 0xffff; unsigned int offset = reg & 0xffff;
return readl(chip->region.idx[bank+1].remap_addr + offset); 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); 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); return readl(chip->region.name.ba0.remap_addr + offset);
} }
dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip); struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip);
void cs46xx_dsp_spos_destroy (cs46xx_t * chip); void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip);
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);
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 cs46xx_dsp_proc_init (snd_card_t * card, cs46xx_t *chip); int symbol_type);
int cs46xx_dsp_proc_done (cs46xx_t *chip); int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip);
int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip); int cs46xx_dsp_proc_done (struct snd_cs46xx *chip);
int snd_cs46xx_download (cs46xx_t *chip,u32 *src,unsigned long offset, int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip);
unsigned long len); int snd_cs46xx_download (struct snd_cs46xx *chip, u32 *src, unsigned long offset,
int snd_cs46xx_clear_BA1(cs46xx_t *chip,unsigned long offset,unsigned long len); unsigned long len);
int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip); int snd_cs46xx_clear_BA1(struct snd_cs46xx *chip, unsigned long offset, unsigned long len);
int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip); int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip);
int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip); int cs46xx_dsp_enable_spdif_hw (struct snd_cs46xx *chip);
int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip); int cs46xx_dsp_disable_spdif_out (struct snd_cs46xx *chip);
int cs46xx_dsp_disable_spdif_in (cs46xx_t *chip); int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip);
int cs46xx_dsp_enable_pcm_capture (cs46xx_t *chip); int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip);
int cs46xx_dsp_disable_pcm_capture (cs46xx_t *chip); int cs46xx_dsp_enable_pcm_capture (struct snd_cs46xx *chip);
int cs46xx_dsp_enable_adc_capture (cs46xx_t *chip); int cs46xx_dsp_disable_pcm_capture (struct snd_cs46xx *chip);
int cs46xx_dsp_disable_adc_capture (cs46xx_t *chip); int cs46xx_dsp_enable_adc_capture (struct snd_cs46xx *chip);
int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data); int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip);
dsp_scb_descriptor_t * cs46xx_dsp_create_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest); int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data);
void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb); struct dsp_scb_descriptor * cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name,
void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * scb); u32 * scb_data, u32 dest);
dsp_scb_descriptor_t * cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip); void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb);
dsp_scb_descriptor_t * cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name, void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
u16 channel_disp,u16 fifo_addr, struct dsp_scb_descriptor * scb);
u16 child_scb_addr, struct dsp_scb_descriptor * cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip);
u32 dest, struct dsp_scb_descriptor *
dsp_scb_descriptor_t * parent_scb, cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip,
int scb_child_type); char * codec_name, u16 channel_disp, u16 fifo_addr,
dsp_scb_descriptor_t * cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name, u16 child_scb_addr, u32 dest,
u16 channel_disp,u16 fifo_addr, struct dsp_scb_descriptor * parent_scb,
u16 sample_buffer_addr, int scb_child_type);
u32 dest, struct dsp_scb_descriptor *
dsp_scb_descriptor_t * parent_scb, cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
int scb_child_type); u16 channel_disp, u16 fifo_addr,
void cs46xx_dsp_remove_scb (cs46xx_t *chip,dsp_scb_descriptor_t * scb); u16 sample_buffer_addr, u32 dest,
dsp_scb_descriptor_t * cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name, struct dsp_scb_descriptor * parent_scb,
u16 channel_disp,u16 fifo_addr, int scb_child_type);
u16 sample_buffer_addr, void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip,
u32 dest,dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * scb);
int scb_child_type); struct dsp_scb_descriptor *
dsp_scb_descriptor_t * cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name, cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
int sample_rate, u16 channel_disp, u16 fifo_addr,
u16 src_buffer_addr, u16 sample_buffer_addr, u32 dest,
u16 src_delay_buffer_addr,u32 dest, struct dsp_scb_descriptor * parent_scb,
dsp_scb_descriptor_t * parent_scb, int scb_child_type);
int scb_child_type, struct dsp_scb_descriptor *
int pass_through); cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name,
dsp_scb_descriptor_t * cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name, int sample_rate, u16 src_buffer_addr,
u16 mix_buffer_addr,u32 dest, u16 src_delay_buffer_addr, u32 dest,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type); int scb_child_type, int pass_through);
struct dsp_scb_descriptor *
dsp_scb_descriptor_t * cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name, cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name,
u16 vari_buffer_addr0, u16 mix_buffer_addr, u32 dest,
u16 vari_buffer_addr1, struct dsp_scb_descriptor * parent_scb,
u32 dest, int scb_child_type);
dsp_scb_descriptor_t * parent_scb,
int scb_child_type); struct dsp_scb_descriptor *
dsp_scb_descriptor_t * cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest, cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx * chip, char * scb_name,
u16 hfg_scb_address, u16 vari_buffer_addr0, u16 vari_buffer_addr1, u32 dest,
u16 asynch_buffer_address, struct dsp_scb_descriptor * parent_scb,
dsp_scb_descriptor_t * parent_scb, int scb_child_type);
int scb_child_type); struct dsp_scb_descriptor *
dsp_scb_descriptor_t * cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest, cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name,
dsp_scb_descriptor_t * parent_scb, u32 dest, u16 hfg_scb_address, u16 asynch_buffer_address,
int scb_child_type); struct dsp_scb_descriptor * parent_scb,
dsp_scb_descriptor_t * cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name, int scb_child_type);
u16 mix_buffer_addr,u16 writeback_spb,u32 dest, struct dsp_scb_descriptor *
dsp_scb_descriptor_t * parent_scb, cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
int scb_child_type); struct dsp_scb_descriptor * parent_scb,
dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest, int scb_child_type);
u16 snoop_buffer_address, struct dsp_scb_descriptor *
dsp_scb_descriptor_t * snoop_scb, cs46xx_dsp_create_mix_to_ostream_scb(struct snd_cs46xx * chip, char * scb_name,
dsp_scb_descriptor_t * parent_scb, u16 mix_buffer_addr, u16 writeback_spb, u32 dest,
int scb_child_type); struct dsp_scb_descriptor * parent_scb,
pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,u32 sample_rate, void * private_data, u32 hw_dma_addr, int scb_child_type);
int pcm_channel_id); struct dsp_scb_descriptor *
void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip, cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx * chip, char * scb_name,
pcm_channel_descriptor_t * pcm_channel); u32 dest, u16 snoop_buffer_address,
int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel); struct dsp_scb_descriptor * snoop_scb,
int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel); struct dsp_scb_descriptor * parent_scb,
dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descriptor_t * source, int scb_child_type);
u16 addr,char * scb_name); struct dsp_pcm_channel_descriptor *
int cs46xx_src_unlink(cs46xx_t *chip,dsp_scb_descriptor_t * src); cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip, u32 sample_rate,
int cs46xx_src_link(cs46xx_t *chip,dsp_scb_descriptor_t * src); void * private_data, u32 hw_dma_addr,
int cs46xx_iec958_pre_open (cs46xx_t *chip); int pcm_channel_id);
int cs46xx_iec958_post_close (cs46xx_t *chip); void cs46xx_dsp_destroy_pcm_channel (struct snd_cs46xx * chip,
int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip, struct dsp_pcm_channel_descriptor * pcm_channel);
pcm_channel_descriptor_t * pcm_channel, int cs46xx_dsp_pcm_unlink (struct snd_cs46xx * chip,
int period_size); struct dsp_pcm_channel_descriptor * pcm_channel);
int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip, int cs46xx_dsp_pcm_link (struct snd_cs46xx * chip,
int period_size); struct dsp_pcm_channel_descriptor * pcm_channel);
int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right); struct dsp_scb_descriptor *
int cs46xx_dsp_set_iec958_volume (cs46xx_t * chip,u16 left,u16 right); 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__ */ #endif /* __CS46XX_LIB_H__ */
...@@ -37,9 +37,10 @@ ...@@ -37,9 +37,10 @@
#include "cs46xx_lib.h" #include "cs46xx_lib.h"
#include "dsp_spos.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_LOOP,
WIDE_FOR_BEGIN_LOOP2, WIDE_FOR_BEGIN_LOOP2,
WIDE_COND_GOTO_ADDR, WIDE_COND_GOTO_ADDR,
...@@ -54,12 +55,13 @@ static wide_opcode_t wide_opcodes[] = { ...@@ -54,12 +55,13 @@ static wide_opcode_t wide_opcodes[] = {
WIDE_TBEQ_NCOND_CALL1_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; unsigned int i = 0, j, nreallocated = 0;
u32 hival,loval,address; u32 hival,loval,address;
u32 mop_operands,mop_type,wide_op; 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); snd_assert( ((size % 2) == 0), return -EINVAL);
...@@ -114,7 +116,7 @@ static int shadow_and_reallocate_code (cs46xx_t * chip,u32 * data,u32 size, u32 ...@@ -114,7 +116,7 @@ static int shadow_and_reallocate_code (cs46xx_t * chip,u32 * data,u32 size, u32
return nreallocated; 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; int i;
for (i = 0;i < module->nsegments; ++i) { for (i = 0;i < module->nsegments; ++i) {
...@@ -126,7 +128,7 @@ static segment_desc_t * get_segment_desc (dsp_module_desc_t * module, int seg_ty ...@@ -126,7 +128,7 @@ static segment_desc_t * get_segment_desc (dsp_module_desc_t * module, int seg_ty
return NULL; 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; int index = ins->symbol_table.nsymbols,i;
...@@ -140,10 +142,10 @@ static int find_free_symbol_index (dsp_spos_instance_t * ins) ...@@ -140,10 +142,10 @@ static int find_free_symbol_index (dsp_spos_instance_t * ins)
return index; 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; 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 (module->symbol_table.nsymbols > 0) {
if (!strcmp(module->symbol_table.symbols[0].symbol_name, "OVERLAYBEGINADDRESS") && if (!strcmp(module->symbol_table.symbols[0].symbol_name, "OVERLAYBEGINADDRESS") &&
...@@ -181,10 +183,11 @@ static int add_symbols (cs46xx_t * chip, dsp_module_desc_t * module) ...@@ -181,10 +183,11 @@ static int add_symbols (cs46xx_t * chip, dsp_module_desc_t * module)
return 0; 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; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
symbol_entry_t * symbol = NULL; struct dsp_symbol_entry * symbol = NULL;
int index; int index;
if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) { if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) {
...@@ -217,17 +220,17 @@ static symbol_entry_t * add_symbol (cs46xx_t * chip, char * symbol_name, u32 add ...@@ -217,17 +220,17 @@ static symbol_entry_t * add_symbol (cs46xx_t * chip, char * symbol_name, u32 add
return symbol; 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) if (ins == NULL)
return NULL; return NULL;
memset(ins, 0, sizeof(*ins));
/* better to use vmalloc for this big table */ /* better to use vmalloc for this big table */
ins->symbol_table.nsymbols = 0; 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; ins->symbol_table.highest_frag_index = 0;
if (ins->symbol_table.symbols == NULL) { if (ins->symbol_table.symbols == NULL) {
...@@ -248,7 +251,7 @@ dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip) ...@@ -248,7 +251,7 @@ dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip)
ins->ntask = 0; ins->ntask = 0;
ins->nmodules = 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) { if (ins->modules == NULL) {
cs46xx_dsp_spos_destroy(chip); cs46xx_dsp_spos_destroy(chip);
...@@ -277,10 +280,10 @@ dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip) ...@@ -277,10 +280,10 @@ dsp_spos_instance_t * cs46xx_dsp_spos_create (cs46xx_t * chip)
return ins; return ins;
} }
void cs46xx_dsp_spos_destroy (cs46xx_t * chip) void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip)
{ {
int i; 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); snd_assert(ins != NULL, return);
...@@ -298,12 +301,12 @@ void cs46xx_dsp_spos_destroy (cs46xx_t * chip) ...@@ -298,12 +301,12 @@ void cs46xx_dsp_spos_destroy (cs46xx_t * chip)
up(&chip->spos_mutex); 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; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
segment_desc_t * code = get_segment_desc (module,SEGTYPE_SP_PROGRAM); struct dsp_segment_desc * code = get_segment_desc (module,SEGTYPE_SP_PROGRAM);
segment_desc_t * parameter = get_segment_desc (module,SEGTYPE_SP_PARAMETER); struct dsp_segment_desc * parameter = get_segment_desc (module,SEGTYPE_SP_PARAMETER);
segment_desc_t * sample = get_segment_desc (module,SEGTYPE_SP_SAMPLE); struct dsp_segment_desc * sample = get_segment_desc (module,SEGTYPE_SP_SAMPLE);
u32 doffset, dsize; u32 doffset, dsize;
if (ins->nmodules == DSP_MAX_MODULES - 1) { if (ins->nmodules == DSP_MAX_MODULES - 1) {
...@@ -410,10 +413,11 @@ int cs46xx_dsp_load_module (cs46xx_t * chip, dsp_module_desc_t * module) ...@@ -410,10 +413,11 @@ int cs46xx_dsp_load_module (cs46xx_t * chip, dsp_module_desc_t * module)
return 0; 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; 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 ) { for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) {
...@@ -435,10 +439,11 @@ symbol_entry_t * cs46xx_dsp_lookup_symbol (cs46xx_t * chip, char * symbol_name, ...@@ -435,10 +439,11 @@ symbol_entry_t * cs46xx_dsp_lookup_symbol (cs46xx_t * chip, char * symbol_name,
} }
static symbol_entry_t * cs46xx_dsp_lookup_symbol_addr (cs46xx_t * chip, u32 address, int symbol_type) static struct dsp_symbol_entry *
cs46xx_dsp_lookup_symbol_addr (struct snd_cs46xx * chip, u32 address, int symbol_type)
{ {
int i; 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 ) { for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) {
...@@ -456,10 +461,11 @@ static symbol_entry_t * cs46xx_dsp_lookup_symbol_addr (cs46xx_t * chip, u32 addr ...@@ -456,10 +461,11 @@ static symbol_entry_t * cs46xx_dsp_lookup_symbol_addr (cs46xx_t * chip, u32 addr
} }
static void cs46xx_dsp_proc_symbol_table_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) static void cs46xx_dsp_proc_symbol_table_read (struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{ {
cs46xx_t *chip = entry->private_data; struct snd_cs46xx *chip = entry->private_data;
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int i; int i;
snd_iprintf(buffer, "SYMBOLS:\n"); snd_iprintf(buffer, "SYMBOLS:\n");
...@@ -483,10 +489,11 @@ static void cs46xx_dsp_proc_symbol_table_read (snd_info_entry_t *entry, snd_info ...@@ -483,10 +489,11 @@ static void cs46xx_dsp_proc_symbol_table_read (snd_info_entry_t *entry, snd_info
} }
static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) static void cs46xx_dsp_proc_modules_read (struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{ {
cs46xx_t *chip = entry->private_data; struct snd_cs46xx *chip = entry->private_data;
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int i,j; int i,j;
down(&chip->spos_mutex); down(&chip->spos_mutex);
...@@ -497,7 +504,7 @@ static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buff ...@@ -497,7 +504,7 @@ static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buff
snd_iprintf(buffer, " %d fixups\n", ins->modules[i].nfixups); snd_iprintf(buffer, " %d fixups\n", ins->modules[i].nfixups);
for (j = 0; j < ins->modules[i].nsegments; ++ j) { 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", snd_iprintf(buffer, " segment %02x offset %08x size %08x\n",
desc->segment_type,desc->offset, desc->size); desc->segment_type,desc->offset, desc->size);
} }
...@@ -505,11 +512,12 @@ static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buff ...@@ -505,11 +512,12 @@ static void cs46xx_dsp_proc_modules_read (snd_info_entry_t *entry, snd_info_buff
up(&chip->spos_mutex); 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; struct snd_cs46xx *chip = entry->private_data;
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int i,j,col; int i, j, col;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET; void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
down(&chip->spos_mutex); down(&chip->spos_mutex);
...@@ -532,10 +540,11 @@ static void cs46xx_dsp_proc_task_tree_read (snd_info_entry_t *entry, snd_info_bu ...@@ -532,10 +540,11 @@ static void cs46xx_dsp_proc_task_tree_read (snd_info_entry_t *entry, snd_info_bu
up(&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; struct snd_cs46xx *chip = entry->private_data;
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int i; int i;
down(&chip->spos_mutex); down(&chip->spos_mutex);
...@@ -564,13 +573,14 @@ static void cs46xx_dsp_proc_scb_read (snd_info_entry_t *entry, snd_info_buffer_t ...@@ -564,13 +573,14 @@ static void cs46xx_dsp_proc_scb_read (snd_info_entry_t *entry, snd_info_buffer_t
up(&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; struct snd_cs46xx *chip = entry->private_data;
/*dsp_spos_instance_t * ins = chip->dsp_spos_instance; */ /*struct dsp_spos_instance * ins = chip->dsp_spos_instance; */
unsigned int i,col = 0; unsigned int i, col = 0;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET; 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 ++) { for (i = 0;i < DSP_PARAMETER_BYTE_SIZE; i += sizeof(u32),col ++) {
if (col == 4) { if (col == 4) {
...@@ -591,9 +601,10 @@ static void cs46xx_dsp_proc_parameter_dump_read (snd_info_entry_t *entry, snd_in ...@@ -591,9 +601,10 @@ static void cs46xx_dsp_proc_parameter_dump_read (snd_info_entry_t *entry, snd_in
} }
} }
static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{ {
cs46xx_t *chip = entry->private_data; struct snd_cs46xx *chip = entry->private_data;
int i,col = 0; int i,col = 0;
void __iomem *dst = chip->region.idx[2].remap_addr; void __iomem *dst = chip->region.idx[2].remap_addr;
...@@ -738,10 +749,10 @@ static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_ ...@@ -738,10 +749,10 @@ static void cs46xx_dsp_proc_sample_dump_read (snd_info_entry_t *entry, snd_info_
snd_iprintf(buffer,"\n"); 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; struct snd_info_entry *entry;
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int i; int i;
ins->snd_card = card; ins->snd_card = card;
...@@ -852,9 +863,9 @@ int cs46xx_dsp_proc_init (snd_card_t * card, cs46xx_t *chip) ...@@ -852,9 +863,9 @@ int cs46xx_dsp_proc_init (snd_card_t * card, cs46xx_t *chip)
return 0; 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; int i;
if (ins->proc_sym_info_entry) { if (ins->proc_sym_info_entry) {
...@@ -903,7 +914,8 @@ int cs46xx_dsp_proc_done (cs46xx_t *chip) ...@@ -903,7 +914,8 @@ int cs46xx_dsp_proc_done (cs46xx_t *chip)
} }
static int debug_tree; 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 + void __iomem *spdst = chip->region.idx[1].remap_addr +
DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32); DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32);
...@@ -917,7 +929,7 @@ static void _dsp_create_task_tree (cs46xx_t *chip,u32 * task_data, u32 dest, in ...@@ -917,7 +929,7 @@ static void _dsp_create_task_tree (cs46xx_t *chip,u32 * task_data, u32 dest, in
} }
static int debug_scb; 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 + void __iomem *spdst = chip->region.idx[1].remap_addr +
DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32); DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32);
...@@ -930,7 +942,7 @@ static void _dsp_create_scb (cs46xx_t *chip,u32 * scb_data, u32 dest) ...@@ -930,7 +942,7 @@ static void _dsp_create_scb (cs46xx_t *chip,u32 * scb_data, u32 dest)
} }
} }
static int find_free_scb_index (dsp_spos_instance_t * ins) static int find_free_scb_index (struct dsp_spos_instance * ins)
{ {
int index = ins->nscb, i; int index = ins->nscb, i;
...@@ -944,10 +956,10 @@ static int find_free_scb_index (dsp_spos_instance_t * ins) ...@@ -944,10 +956,10 @@ static int find_free_scb_index (dsp_spos_instance_t * ins)
return index; 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; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * desc = NULL; struct dsp_scb_descriptor * desc = NULL;
int index; int index;
if (ins->nscb == DSP_MAX_SCB_DESC - 1) { if (ins->nscb == DSP_MAX_SCB_DESC - 1) {
...@@ -977,10 +989,11 @@ static dsp_scb_descriptor_t * _map_scb (cs46xx_t *chip,char * name,u32 dest) ...@@ -977,10 +989,11 @@ static dsp_scb_descriptor_t * _map_scb (cs46xx_t *chip,char * name,u32 dest)
return desc; 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; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
dsp_task_descriptor_t * desc = NULL; struct dsp_task_descriptor * desc = NULL;
if (ins->ntask == DSP_MAX_TASK_DESC - 1) { if (ins->ntask == DSP_MAX_TASK_DESC - 1) {
snd_printk(KERN_ERR "dsp_spos: got no place for other TASK\n"); snd_printk(KERN_ERR "dsp_spos: got no place for other TASK\n");
...@@ -1000,9 +1013,10 @@ static dsp_task_descriptor_t * _map_task_tree (cs46xx_t *chip,char * name,u32 de ...@@ -1000,9 +1013,10 @@ static dsp_task_descriptor_t * _map_task_tree (cs46xx_t *chip,char * name,u32 de
return desc; 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); desc = _map_scb (chip,name,dest);
if (desc) { if (desc) {
...@@ -1015,9 +1029,11 @@ dsp_scb_descriptor_t * cs46xx_dsp_create_scb (cs46xx_t *chip,char * name, u32 * ...@@ -1015,9 +1029,11 @@ dsp_scb_descriptor_t * cs46xx_dsp_create_scb (cs46xx_t *chip,char * name, u32 *
} }
static dsp_task_descriptor_t * cs46xx_dsp_create_task_tree (cs46xx_t *chip,char * name, u32 * task_data,u32 dest,int size) static struct dsp_task_descriptor *
cs46xx_dsp_create_task_tree (struct snd_cs46xx *chip, char * name, u32 * task_data,
u32 dest, int size)
{ {
dsp_task_descriptor_t * desc; struct dsp_task_descriptor * desc;
desc = _map_task_tree (chip,name,dest,size); desc = _map_task_tree (chip,name,dest,size);
if (desc) { if (desc) {
...@@ -1029,31 +1045,31 @@ static dsp_task_descriptor_t * cs46xx_dsp_create_task_tree (cs46xx_t *chip,char ...@@ -1029,31 +1045,31 @@ static dsp_task_descriptor_t * cs46xx_dsp_create_task_tree (cs46xx_t *chip,char
return 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; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
symbol_entry_t * fg_task_tree_header_code; struct dsp_symbol_entry * fg_task_tree_header_code;
symbol_entry_t * task_tree_header_code; struct dsp_symbol_entry * task_tree_header_code;
symbol_entry_t * task_tree_thread; struct dsp_symbol_entry * task_tree_thread;
symbol_entry_t * null_algorithm; struct dsp_symbol_entry * null_algorithm;
symbol_entry_t * magic_snoop_task; struct dsp_symbol_entry * magic_snoop_task;
dsp_scb_descriptor_t * timing_master_scb; struct dsp_scb_descriptor * timing_master_scb;
dsp_scb_descriptor_t * codec_out_scb; struct dsp_scb_descriptor * codec_out_scb;
dsp_scb_descriptor_t * codec_in_scb; struct dsp_scb_descriptor * codec_in_scb;
dsp_scb_descriptor_t * src_task_scb; struct dsp_scb_descriptor * src_task_scb;
dsp_scb_descriptor_t * master_mix_scb; struct dsp_scb_descriptor * master_mix_scb;
dsp_scb_descriptor_t * rear_mix_scb; struct dsp_scb_descriptor * rear_mix_scb;
dsp_scb_descriptor_t * record_mix_scb; struct dsp_scb_descriptor * record_mix_scb;
dsp_scb_descriptor_t * write_back_scb; struct dsp_scb_descriptor * write_back_scb;
dsp_scb_descriptor_t * vari_decimate_scb; struct dsp_scb_descriptor * vari_decimate_scb;
dsp_scb_descriptor_t * rear_codec_out_scb; struct dsp_scb_descriptor * rear_codec_out_scb;
dsp_scb_descriptor_t * clfe_codec_out_scb; struct dsp_scb_descriptor * clfe_codec_out_scb;
dsp_scb_descriptor_t * magic_snoop_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, /* 0 */ HFG_TREE_SCB,HFG_STACK,
/* 1 */ SPOSCB_ADDR,BG_TREE_SCB_ADDR, /* 1 */ SPOSCB_ADDR,BG_TREE_SCB_ADDR,
/* 2 */ DSP_SPOS_DC,0, /* 2 */ DSP_SPOS_DC,0,
...@@ -1106,7 +1122,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip) ...@@ -1106,7 +1122,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
{ {
/* create the null SCB */ /* 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, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 },
NULL_SCB_ADDR, NULL_SCB_ADDR, NULL_SCB_ADDR, NULL_SCB_ADDR,
...@@ -1128,7 +1144,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip) ...@@ -1128,7 +1144,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
{ {
/* setup foreground task tree */ /* 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), { FG_TASK_HEADER_ADDR | (DSP_SPOS_DC << 0x10),
DSP_SPOS_DC_DC, DSP_SPOS_DC_DC,
DSP_SPOS_DC_DC, DSP_SPOS_DC_DC,
...@@ -1204,7 +1220,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip) ...@@ -1204,7 +1220,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
{ {
/* setup foreground task tree */ /* 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, DSP_SPOS_DC_DC,
DSP_SPOS_DC_DC, DSP_SPOS_DC_DC,
...@@ -1313,7 +1329,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip) ...@@ -1313,7 +1329,7 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
if (!write_back_scb) goto _fail_end; 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, 0x00020000,
0x0000ffff 0x0000ffff
}; };
...@@ -1448,13 +1464,14 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip) ...@@ -1448,13 +1464,14 @@ int cs46xx_dsp_scb_and_task_init (cs46xx_t *chip)
return -EINVAL; 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; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
symbol_entry_t * s16_async_codec_input_task; struct dsp_symbol_entry * s16_async_codec_input_task;
symbol_entry_t * spdifo_task; struct dsp_symbol_entry * spdifo_task;
symbol_entry_t * spdifi_task; struct dsp_symbol_entry * spdifi_task;
dsp_scb_descriptor_t * spdifi_scb_desc,* spdifo_scb_desc,* async_codec_scb_desc; 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); s16_async_codec_input_task = cs46xx_dsp_lookup_symbol(chip, "S16_ASYNCCODECINPUTTASK", SYMBOL_CODE);
if (s16_async_codec_input_task == NULL) { if (s16_async_codec_input_task == NULL) {
...@@ -1475,7 +1492,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr ...@@ -1475,7 +1492,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr
{ {
/* 0xBC0 */ /* 0xBC0 */
spdifoscb_t spdifo_scb = { struct dsp_spdifoscb spdifo_scb = {
/* 0 */ DSP_SPOS_UUUU, /* 0 */ DSP_SPOS_UUUU,
{ {
/* 1 */ 0xb0, /* 1 */ 0xb0,
...@@ -1504,7 +1521,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr ...@@ -1504,7 +1521,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr
}; };
/* 0xBB0 */ /* 0xBB0 */
spdifiscb_t spdifi_scb = { struct dsp_spdifiscb spdifi_scb = {
/* 0 */ DSP_SPOS_UULO,DSP_SPOS_UUHI, /* 0 */ DSP_SPOS_UULO,DSP_SPOS_UUHI,
/* 1 */ 0, /* 1 */ 0,
/* 2 */ 0, /* 2 */ 0,
...@@ -1529,7 +1546,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr ...@@ -1529,7 +1546,7 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr
}; };
/* 0xBA0 */ /* 0xBA0 */
async_codec_input_scb_t async_codec_input_scb = { struct dsp_async_codec_input_scb async_codec_input_scb = {
/* 0 */ DSP_SPOS_UUUU, /* 0 */ DSP_SPOS_UUUU,
/* 1 */ 0, /* 1 */ 0,
/* 2 */ 0, /* 2 */ 0,
...@@ -1620,9 +1637,9 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr ...@@ -1620,9 +1637,9 @@ static int cs46xx_dsp_async_init (cs46xx_t *chip, dsp_scb_descriptor_t * fg_entr
} }
static void cs46xx_dsp_disable_spdif_hw (cs46xx_t *chip) static void cs46xx_dsp_disable_spdif_hw (struct snd_cs46xx *chip)
{ {
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
/* set SPDIF output FIFO slot */ /* set SPDIF output FIFO slot */
snd_cs46xx_pokeBA0(chip, BA0_ASER_FADDR, 0); snd_cs46xx_pokeBA0(chip, BA0_ASER_FADDR, 0);
...@@ -1641,9 +1658,9 @@ static void cs46xx_dsp_disable_spdif_hw (cs46xx_t *chip) ...@@ -1641,9 +1658,9 @@ static void cs46xx_dsp_disable_spdif_hw (cs46xx_t *chip)
ins->spdif_status_out &= ~DSP_SPDIF_STATUS_HW_ENABLED; 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 ... */ /* if hw-ctrl already enabled, turn off to reset logic ... */
cs46xx_dsp_disable_spdif_hw (chip); cs46xx_dsp_disable_spdif_hw (chip);
...@@ -1664,9 +1681,9 @@ int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip) ...@@ -1664,9 +1681,9 @@ int cs46xx_dsp_enable_spdif_hw (cs46xx_t *chip)
return 0; 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 */ /* turn on amplifier */
chip->active_ctrl(chip, 1); chip->active_ctrl(chip, 1);
...@@ -1724,9 +1741,9 @@ int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip) ...@@ -1724,9 +1741,9 @@ int cs46xx_dsp_enable_spdif_in (cs46xx_t *chip)
return 0; 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->asynch_rx_scb != NULL, return -EINVAL);
snd_assert (ins->spdif_in_src != NULL,return -EINVAL); snd_assert (ins->spdif_in_src != NULL,return -EINVAL);
...@@ -1750,9 +1767,9 @@ int cs46xx_dsp_disable_spdif_in (cs46xx_t *chip) ...@@ -1750,9 +1767,9 @@ int cs46xx_dsp_disable_spdif_in (cs46xx_t *chip)
return 0; 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->pcm_input == NULL,return -EINVAL);
snd_assert (ins->ref_snoop_scb != NULL,return -EINVAL); snd_assert (ins->ref_snoop_scb != NULL,return -EINVAL);
...@@ -1765,9 +1782,9 @@ int cs46xx_dsp_enable_pcm_capture (cs46xx_t *chip) ...@@ -1765,9 +1782,9 @@ int cs46xx_dsp_enable_pcm_capture (cs46xx_t *chip)
return 0; 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); snd_assert (ins->pcm_input != NULL,return -EINVAL);
...@@ -1779,9 +1796,9 @@ int cs46xx_dsp_disable_pcm_capture (cs46xx_t *chip) ...@@ -1779,9 +1796,9 @@ int cs46xx_dsp_disable_pcm_capture (cs46xx_t *chip)
return 0; 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->adc_input == NULL,return -EINVAL);
snd_assert (ins->codec_in_scb != NULL,return -EINVAL); snd_assert (ins->codec_in_scb != NULL,return -EINVAL);
...@@ -1794,9 +1811,9 @@ int cs46xx_dsp_enable_adc_capture (cs46xx_t *chip) ...@@ -1794,9 +1811,9 @@ int cs46xx_dsp_enable_adc_capture (cs46xx_t *chip)
return 0; 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); snd_assert (ins->adc_input != NULL,return -EINVAL);
...@@ -1808,7 +1825,7 @@ int cs46xx_dsp_disable_adc_capture (cs46xx_t *chip) ...@@ -1808,7 +1825,7 @@ int cs46xx_dsp_disable_adc_capture (cs46xx_t *chip)
return 0; 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; u32 temp;
int i; int i;
...@@ -1845,10 +1862,10 @@ int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data) ...@@ -1845,10 +1862,10 @@ int cs46xx_poke_via_dsp (cs46xx_t *chip,u32 address,u32 data)
return 0; 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; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb; struct dsp_scb_descriptor * scb;
down(&chip->spos_mutex); down(&chip->spos_mutex);
...@@ -1874,8 +1891,9 @@ int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right) ...@@ -1874,8 +1891,9 @@ int cs46xx_dsp_set_dac_volume (cs46xx_t * chip,u16 left,u16 right)
return 0; return 0;
} }
int cs46xx_dsp_set_iec958_volume (cs46xx_t * chip,u16 left,u16 right) { int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right)
dsp_spos_instance_t * ins = chip->dsp_spos_instance; {
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
down(&chip->spos_mutex); down(&chip->spos_mutex);
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
/* this instruction types /* this instruction types
needs to be reallocated when load needs to be reallocated when load
code into DSP */ code into DSP */
typedef enum { enum wide_opcode {
WIDE_FOR_BEGIN_LOOP = 0x20, WIDE_FOR_BEGIN_LOOP = 0x20,
WIDE_FOR_BEGIN_LOOP2, WIDE_FOR_BEGIN_LOOP2,
...@@ -58,7 +58,7 @@ typedef enum { ...@@ -58,7 +58,7 @@ typedef enum {
WIDE_TBEQ_COND_CALL1_ADDR, WIDE_TBEQ_COND_CALL1_ADDR,
WIDE_TBEQ_NCOND_GOTOI_ADDR, WIDE_TBEQ_NCOND_GOTOI_ADDR,
WIDE_TBEQ_NCOND_CALL1_ADDR, WIDE_TBEQ_NCOND_CALL1_ADDR,
} wide_opcode_t; };
/* SAMPLE segment */ /* SAMPLE segment */
#define VARI_DECIMATE_BUF1 0x0000 #define VARI_DECIMATE_BUF1 0x0000
...@@ -186,7 +186,8 @@ typedef enum { ...@@ -186,7 +186,8 @@ typedef enum {
#define SP_SPDOUT_CONTROL 0x804D #define SP_SPDOUT_CONTROL 0x804D
#define SP_SPDOUT_CSUV 0x808E #define SP_SPDOUT_CSUV 0x808E
static inline u8 _wrap_all_bits (u8 val) { static inline u8 _wrap_all_bits (u8 val)
{
u8 wrapped; u8 wrapped;
/* wrap all 8 bits */ /* wrap all 8 bits */
...@@ -201,11 +202,10 @@ static inline u8 _wrap_all_bits (u8 val) { ...@@ -201,11 +202,10 @@ static inline u8 _wrap_all_bits (u8 val) {
((val & 0x80) >> 7); ((val & 0x80) >> 7);
return wrapped; return wrapped;
} }
static inline void cs46xx_dsp_spos_update_scb (struct snd_cs46xx * chip,
static inline void cs46xx_dsp_spos_update_scb (cs46xx_t * chip,dsp_scb_descriptor_t * scb) struct dsp_scb_descriptor * scb)
{ {
/* update nextSCB and subListPtr in SCB */ /* update nextSCB and subListPtr in SCB */
snd_cs46xx_poke(chip, snd_cs46xx_poke(chip,
...@@ -214,8 +214,10 @@ static inline void cs46xx_dsp_spos_update_scb (cs46xx_t * chip,dsp_scb_descripto ...@@ -214,8 +214,10 @@ static inline void cs46xx_dsp_spos_update_scb (cs46xx_t * chip,dsp_scb_descripto
(scb->next_scb_ptr->address)); (scb->next_scb_ptr->address));
} }
static inline void cs46xx_dsp_scb_set_volume (cs46xx_t * chip,dsp_scb_descriptor_t * scb, static inline void cs46xx_dsp_scb_set_volume (struct snd_cs46xx * chip,
u16 left,u16 right) { struct dsp_scb_descriptor * scb,
u16 left, u16 right)
{
unsigned int val = ((0xffff - left) << 16 | (0xffff - right)); unsigned int val = ((0xffff - left) << 16 | (0xffff - right));
snd_cs46xx_poke(chip, (scb->address + SCBVolumeCtrl) << 2, val); snd_cs46xx_poke(chip, (scb->address + SCBVolumeCtrl) << 2, val);
......
...@@ -36,14 +36,14 @@ ...@@ -36,14 +36,14 @@
#include "cs46xx_lib.h" #include "cs46xx_lib.h"
#include "dsp_spos.h" #include "dsp_spos.h"
typedef struct _proc_scb_info_t { struct proc_scb_info {
dsp_scb_descriptor_t * scb_desc; struct dsp_scb_descriptor * scb_desc;
cs46xx_t *chip; struct snd_cs46xx *chip;
} proc_scb_info_t; };
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); int symbol_index = (int)(symbol - ins->symbol_table.symbols);
snd_assert(ins->symbol_table.nsymbols > 0,return); snd_assert(ins->symbol_table.nsymbols > 0,return);
...@@ -64,12 +64,13 @@ static void remove_symbol (cs46xx_t * chip,symbol_entry_t * symbol) ...@@ -64,12 +64,13 @@ static void remove_symbol (cs46xx_t * chip,symbol_entry_t * symbol)
} }
static void cs46xx_dsp_proc_scb_info_read (snd_info_entry_t *entry, snd_info_buffer_t * buffer) static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{ {
proc_scb_info_t * scb_info = (proc_scb_info_t *)entry->private_data; struct proc_scb_info * scb_info = entry->private_data;
dsp_scb_descriptor_t * scb = scb_info->scb_desc; struct dsp_scb_descriptor * scb = scb_info->scb_desc;
dsp_spos_instance_t * ins; struct dsp_spos_instance * ins;
cs46xx_t *chip = scb_info->chip; struct snd_cs46xx *chip = scb_info->chip;
int j,col; int j,col;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET; void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
...@@ -106,9 +107,9 @@ static void cs46xx_dsp_proc_scb_info_read (snd_info_entry_t *entry, snd_info_buf ...@@ -106,9 +107,9 @@ static void cs46xx_dsp_proc_scb_info_read (snd_info_entry_t *entry, snd_info_buf
up(&chip->spos_mutex); 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; unsigned long flags;
if ( scb->parent_scb_ptr ) { if ( scb->parent_scb_ptr ) {
...@@ -160,7 +161,8 @@ static void _dsp_unlink_scb (cs46xx_t *chip,dsp_scb_descriptor_t * scb) ...@@ -160,7 +161,8 @@ static void _dsp_unlink_scb (cs46xx_t *chip,dsp_scb_descriptor_t * scb)
} }
} }
static void _dsp_clear_sample_buffer (cs46xx_t *chip, u32 sample_buffer_addr, int dword_count) static void _dsp_clear_sample_buffer (struct snd_cs46xx *chip, u32 sample_buffer_addr,
int dword_count)
{ {
void __iomem *dst = chip->region.idx[2].remap_addr + sample_buffer_addr; void __iomem *dst = chip->region.idx[2].remap_addr + sample_buffer_addr;
int i; int i;
...@@ -171,9 +173,9 @@ static void _dsp_clear_sample_buffer (cs46xx_t *chip, u32 sample_buffer_addr, in ...@@ -171,9 +173,9 @@ static void _dsp_clear_sample_buffer (cs46xx_t *chip, u32 sample_buffer_addr, in
} }
} }
void cs46xx_dsp_remove_scb (cs46xx_t *chip, dsp_scb_descriptor_t * scb) void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb)
{ {
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
/* check integrety */ /* check integrety */
snd_assert ( (scb->index >= 0 && snd_assert ( (scb->index >= 0 &&
...@@ -218,10 +220,10 @@ void cs46xx_dsp_remove_scb (cs46xx_t *chip, dsp_scb_descriptor_t * scb) ...@@ -218,10 +220,10 @@ void cs46xx_dsp_remove_scb (cs46xx_t *chip, dsp_scb_descriptor_t * scb)
} }
void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb) void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb)
{ {
if (scb->proc_info) { 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); snd_printdd("cs46xx_dsp_proc_free_scb_desc: freeing %s\n",scb->scb_name);
...@@ -233,11 +235,12 @@ void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb) ...@@ -233,11 +235,12 @@ void cs46xx_dsp_proc_free_scb_desc (dsp_scb_descriptor_t * scb)
} }
} }
void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * scb) void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
struct dsp_scb_descriptor * scb)
{ {
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
snd_info_entry_t * entry; struct snd_info_entry * entry;
proc_scb_info_t * scb_info; struct proc_scb_info * scb_info;
/* register to proc */ /* register to proc */
if (ins->snd_card != NULL && ins->proc_dsp_dir != NULL && if (ins->snd_card != NULL && ins->proc_dsp_dir != NULL &&
...@@ -245,7 +248,7 @@ void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * sc ...@@ -245,7 +248,7 @@ void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * sc
if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name, if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name,
ins->proc_dsp_dir)) != NULL) { 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) { if (!scb_info) {
snd_info_free_entry(entry); snd_info_free_entry(entry);
entry = NULL; entry = NULL;
...@@ -273,14 +276,14 @@ void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * sc ...@@ -273,14 +276,14 @@ void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * sc
} }
} }
static dsp_scb_descriptor_t * static struct dsp_scb_descriptor *
_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest, _dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest,
symbol_entry_t * task_entry, struct dsp_symbol_entry * task_entry,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type) int scb_child_type)
{ {
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb; struct dsp_scb_descriptor * scb;
unsigned long flags; unsigned long flags;
...@@ -342,13 +345,13 @@ _dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest, ...@@ -342,13 +345,13 @@ _dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest,
return scb; return scb;
} }
static dsp_scb_descriptor_t * static struct dsp_scb_descriptor *
cs46xx_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 dest, cs46xx_dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data,
char * task_entry_name, u32 dest, char * task_entry_name,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type) 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, task_entry = cs46xx_dsp_lookup_symbol (chip,task_entry_name,
SYMBOL_CODE); SYMBOL_CODE);
...@@ -362,12 +365,12 @@ cs46xx_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 de ...@@ -362,12 +365,12 @@ cs46xx_dsp_create_generic_scb (cs46xx_t *chip,char * name, u32 * scb_data,u32 de
parent_scb,scb_child_type); parent_scb,scb_child_type);
} }
dsp_scb_descriptor_t * struct dsp_scb_descriptor *
cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip) 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, 0,
0, 0,
...@@ -396,16 +399,15 @@ cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip) ...@@ -396,16 +399,15 @@ cs46xx_dsp_create_timing_master_scb (cs46xx_t *chip)
} }
dsp_scb_descriptor_t * struct dsp_scb_descriptor *
cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name, cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip, char * codec_name,
u16 channel_disp,u16 fifo_addr, u16 channel_disp, u16 fifo_addr, u16 child_scb_addr,
u16 child_scb_addr, u32 dest, struct dsp_scb_descriptor * parent_scb,
u32 dest,dsp_scb_descriptor_t * parent_scb,
int scb_child_type) 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, 0,
0, 0,
...@@ -435,16 +437,15 @@ cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name, ...@@ -435,16 +437,15 @@ cs46xx_dsp_create_codec_out_scb(cs46xx_t * chip,char * codec_name,
return scb; return scb;
} }
dsp_scb_descriptor_t * struct dsp_scb_descriptor *
cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name, cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
u16 channel_disp,u16 fifo_addr, u16 channel_disp, u16 fifo_addr, u16 sample_buffer_addr,
u16 sample_buffer_addr, u32 dest, struct dsp_scb_descriptor * parent_scb,
u32 dest,dsp_scb_descriptor_t * parent_scb, int scb_child_type)
int scb_child_type)
{ {
dsp_scb_descriptor_t * scb; struct dsp_scb_descriptor * scb;
codec_input_scb_t codec_input_scb = { struct dsp_codec_input_scb codec_input_scb = {
{ 0, { 0,
0, 0,
0, 0,
...@@ -481,17 +482,17 @@ cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name, ...@@ -481,17 +482,17 @@ cs46xx_dsp_create_codec_in_scb(cs46xx_t * chip,char * codec_name,
} }
static dsp_scb_descriptor_t * static struct dsp_scb_descriptor *
cs46xx_dsp_create_pcm_reader_scb(cs46xx_t * chip,char * scb_name, cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
u16 sample_buffer_addr,u32 dest, u16 sample_buffer_addr, u32 dest,
int virtual_channel, u32 playback_hw_addr, int virtual_channel, u32 playback_hw_addr,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type) int scb_child_type)
{ {
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb; 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 Play DMA Task xfers data from host buffer to SP buffer
...@@ -584,18 +585,18 @@ cs46xx_dsp_create_pcm_reader_scb(cs46xx_t * chip,char * scb_name, ...@@ -584,18 +585,18 @@ cs46xx_dsp_create_pcm_reader_scb(cs46xx_t * chip,char * scb_name,
#define GOF_PER_SEC 200 #define GOF_PER_SEC 200
dsp_scb_descriptor_t * struct dsp_scb_descriptor *
cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name, cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name,
int rate, int rate,
u16 src_buffer_addr, u16 src_buffer_addr,
u16 src_delay_buffer_addr,u32 dest, u16 src_delay_buffer_addr, u32 dest,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type, int scb_child_type,
int pass_through) int pass_through)
{ {
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb; struct dsp_scb_descriptor * scb;
unsigned int tmp1, tmp2; unsigned int tmp1, tmp2;
unsigned int phiIncr; unsigned int phiIncr;
unsigned int correctionPerGOF, correctionPerSec; unsigned int correctionPerGOF, correctionPerSec;
...@@ -632,7 +633,7 @@ cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name, ...@@ -632,7 +633,7 @@ cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name,
correctionPerSec = tmp1; correctionPerSec = tmp1;
{ {
src_task_scb_t src_task_scb = { struct dsp_src_task_scb src_task_scb = {
0x0028,0x00c8, 0x0028,0x00c8,
0x5555,0x0000, 0x5555,0x0000,
0x0000,0x0000, 0x0000,0x0000,
...@@ -688,14 +689,14 @@ cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name, ...@@ -688,14 +689,14 @@ cs46xx_dsp_create_src_task_scb(cs46xx_t * chip,char * scb_name,
} }
#if 0 /* not used */ #if 0 /* not used */
dsp_scb_descriptor_t * struct dsp_scb_descriptor *
cs46xx_dsp_create_filter_scb(cs46xx_t * chip,char * scb_name, cs46xx_dsp_create_filter_scb(struct snd_cs46xx * chip, char * scb_name,
u16 buffer_addr,u32 dest, u16 buffer_addr, u32 dest,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type) { 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_right = 0x41a9,
.a0_left = 0x41a9, .a0_left = 0x41a9,
.a1_right = 0xb8e4, .a1_right = 0xb8e4,
...@@ -738,15 +739,15 @@ cs46xx_dsp_create_filter_scb(cs46xx_t * chip,char * scb_name, ...@@ -738,15 +739,15 @@ cs46xx_dsp_create_filter_scb(cs46xx_t * chip,char * scb_name,
} }
#endif /* not used */ #endif /* not used */
dsp_scb_descriptor_t * struct dsp_scb_descriptor *
cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name, cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name,
u16 mix_buffer_addr,u32 dest, u16 mix_buffer_addr, u32 dest,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type) 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, /* 0 */ { 0,
/* 1 */ 0, /* 1 */ 0,
/* 2 */ mix_buffer_addr, /* 2 */ mix_buffer_addr,
...@@ -778,15 +779,15 @@ cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name, ...@@ -778,15 +779,15 @@ cs46xx_dsp_create_mix_only_scb(cs46xx_t * chip,char * scb_name,
} }
dsp_scb_descriptor_t * struct dsp_scb_descriptor *
cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name, cs46xx_dsp_create_mix_to_ostream_scb(struct snd_cs46xx * chip, char * scb_name,
u16 mix_buffer_addr,u16 writeback_spb,u32 dest, u16 mix_buffer_addr, u16 writeback_spb, u32 dest,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type) 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) */ /* Basic (non scatter/gather) DMA requestor (4 ints) */
{ {
DMA_RQ_C1_SOURCE_MOD64 + DMA_RQ_C1_SOURCE_MOD64 +
...@@ -832,18 +833,18 @@ cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name, ...@@ -832,18 +833,18 @@ cs46xx_dsp_create_mix_to_ostream_scb(cs46xx_t * chip,char * scb_name,
} }
dsp_scb_descriptor_t * struct dsp_scb_descriptor *
cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name, cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx * chip,char * scb_name,
u16 vari_buffer_addr0, u16 vari_buffer_addr0,
u16 vari_buffer_addr1, u16 vari_buffer_addr1,
u32 dest, u32 dest,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type) 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, 0x0028,0x00c8,
0x5555,0x0000, 0x5555,0x0000,
0x0000,0x0000, 0x0000,0x0000,
...@@ -876,17 +877,17 @@ cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name, ...@@ -876,17 +877,17 @@ cs46xx_dsp_create_vari_decimate_scb(cs46xx_t * chip,char * scb_name,
} }
static dsp_scb_descriptor_t * static struct dsp_scb_descriptor *
cs46xx_dsp_create_pcm_serial_input_scb(cs46xx_t * chip,char * scb_name,u32 dest, cs46xx_dsp_create_pcm_serial_input_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
dsp_scb_descriptor_t * input_scb, struct dsp_scb_descriptor * input_scb,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type) 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, 0,
0, 0,
...@@ -919,17 +920,17 @@ cs46xx_dsp_create_pcm_serial_input_scb(cs46xx_t * chip,char * scb_name,u32 dest, ...@@ -919,17 +920,17 @@ cs46xx_dsp_create_pcm_serial_input_scb(cs46xx_t * chip,char * scb_name,u32 dest,
} }
static dsp_scb_descriptor_t * static struct dsp_scb_descriptor *
cs46xx_dsp_create_asynch_fg_tx_scb(cs46xx_t * chip,char * scb_name,u32 dest, cs46xx_dsp_create_asynch_fg_tx_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
u16 hfg_scb_address, u16 hfg_scb_address,
u16 asynch_buffer_address, u16 asynch_buffer_address,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type) 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 */ 0xfc00,0x03ff, /* Prototype sample buffer size of 256 dwords */
0x0058,0x0028, /* Min Delta 7 dwords == 28 bytes */ 0x0058,0x0028, /* Min Delta 7 dwords == 28 bytes */
/* : Max delta 25 dwords == 100 bytes */ /* : Max delta 25 dwords == 100 bytes */
...@@ -966,17 +967,17 @@ cs46xx_dsp_create_asynch_fg_tx_scb(cs46xx_t * chip,char * scb_name,u32 dest, ...@@ -966,17 +967,17 @@ cs46xx_dsp_create_asynch_fg_tx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
} }
dsp_scb_descriptor_t * struct dsp_scb_descriptor *
cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest, cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
u16 hfg_scb_address, u16 hfg_scb_address,
u16 asynch_buffer_address, u16 asynch_buffer_address,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type) int scb_child_type)
{ {
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb; 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 */ 0xfe00,0x01ff, /* Prototype sample buffer size of 128 dwords */
0x0064,0x001c, /* Min Delta 7 dwords == 28 bytes */ 0x0064,0x001c, /* Min Delta 7 dwords == 28 bytes */
/* : Max delta 25 dwords == 100 bytes */ /* : Max delta 25 dwords == 100 bytes */
...@@ -1016,17 +1017,17 @@ cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest, ...@@ -1016,17 +1017,17 @@ cs46xx_dsp_create_asynch_fg_rx_scb(cs46xx_t * chip,char * scb_name,u32 dest,
#if 0 /* not used */ #if 0 /* not used */
dsp_scb_descriptor_t * struct dsp_scb_descriptor *
cs46xx_dsp_create_output_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest, cs46xx_dsp_create_output_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
u16 snoop_buffer_address, u16 snoop_buffer_address,
dsp_scb_descriptor_t * snoop_scb, struct dsp_scb_descriptor * snoop_scb,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type) 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, /* not used. Zero */
0, 0,
0, 0,
...@@ -1058,14 +1059,14 @@ cs46xx_dsp_create_output_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest, ...@@ -1058,14 +1059,14 @@ cs46xx_dsp_create_output_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest,
#endif /* not used */ #endif /* not used */
dsp_scb_descriptor_t * struct dsp_scb_descriptor *
cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest, cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * parent_scb,
int scb_child_type) 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,0, /* SPIOWAddress2:SPIOWAddress1; */
0, /* SPIOWData1; */ 0, /* SPIOWData1; */
0, /* SPIOWData2; */ 0, /* SPIOWData2; */
...@@ -1094,15 +1095,16 @@ cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest, ...@@ -1094,15 +1095,16 @@ cs46xx_dsp_create_spio_write_scb(cs46xx_t * chip,char * scb_name,u32 dest,
return scb; return scb;
} }
dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char * scb_name,u32 dest, struct dsp_scb_descriptor *
u16 snoop_buffer_address, cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
dsp_scb_descriptor_t * snoop_scb, u16 snoop_buffer_address,
dsp_scb_descriptor_t * parent_scb, struct dsp_scb_descriptor * snoop_scb,
int scb_child_type) 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 */ /* 0 */ 0, /* i0 */
/* 1 */ 0, /* i1 */ /* 1 */ 0, /* i1 */
/* 2 */ snoop_buffer_address << 0x10, /* 2 */ snoop_buffer_address << 0x10,
...@@ -1129,10 +1131,11 @@ dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char * ...@@ -1129,10 +1131,11 @@ dsp_scb_descriptor_t * cs46xx_dsp_create_magic_snoop_scb(cs46xx_t * chip,char *
return scb; 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; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * scb = from; struct dsp_scb_descriptor * scb = from;
while (scb->next_scb_ptr != ins->the_null_scb) { while (scb->next_scb_ptr != ins->the_null_scb) {
snd_assert (scb->next_scb_ptr != NULL, return NULL); snd_assert (scb->next_scb_ptr != NULL, return NULL);
...@@ -1212,18 +1215,19 @@ static u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = { ...@@ -1212,18 +1215,19 @@ static u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = {
0x2B00 0x2B00
}; };
pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip, struct dsp_pcm_channel_descriptor *
u32 sample_rate, void * private_data, cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
u32 hw_dma_addr, u32 sample_rate, void * private_data,
int pcm_channel_id) u32 hw_dma_addr,
int pcm_channel_id)
{ {
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * src_scb = NULL,* pcm_scb, * mixer_scb = NULL; struct dsp_scb_descriptor * src_scb = NULL, * pcm_scb, * mixer_scb = NULL;
dsp_scb_descriptor_t * src_parent_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]; 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; unsigned long flags;
switch (pcm_channel_id) { switch (pcm_channel_id) {
...@@ -1371,8 +1375,8 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip, ...@@ -1371,8 +1375,8 @@ pcm_channel_descriptor_t * cs46xx_dsp_create_pcm_channel (cs46xx_t * chip,
return (ins->pcm_channels + pcm_index); return (ins->pcm_channels + pcm_index);
} }
int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip, int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip,
pcm_channel_descriptor_t * pcm_channel, struct dsp_pcm_channel_descriptor * pcm_channel,
int period_size) int period_size)
{ {
u32 temp = snd_cs46xx_peek (chip,pcm_channel->pcm_reader_scb->address << 2); u32 temp = snd_cs46xx_peek (chip,pcm_channel->pcm_reader_scb->address << 2);
...@@ -1410,7 +1414,7 @@ int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip, ...@@ -1410,7 +1414,7 @@ int cs46xx_dsp_pcm_channel_set_period (cs46xx_t * chip,
return 0; 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) int period_size)
{ {
u32 temp = snd_cs46xx_peek (chip,WRITEBACK_SCB_ADDR << 2); u32 temp = snd_cs46xx_peek (chip,WRITEBACK_SCB_ADDR << 2);
...@@ -1448,9 +1452,10 @@ int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip, ...@@ -1448,9 +1452,10 @@ int cs46xx_dsp_pcm_ostream_set_period (cs46xx_t * chip,
return 0; 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; unsigned long flags;
snd_assert(pcm_channel->active, return ); snd_assert(pcm_channel->active, return );
...@@ -1478,9 +1483,10 @@ void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip,pcm_channel_descriptor_t * ...@@ -1478,9 +1483,10 @@ void cs46xx_dsp_destroy_pcm_channel (cs46xx_t * chip,pcm_channel_descriptor_t *
} }
} }
int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel) int cs46xx_dsp_pcm_unlink (struct snd_cs46xx * chip,
struct dsp_pcm_channel_descriptor * pcm_channel)
{ {
dsp_spos_instance_t * ins = chip->dsp_spos_instance; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
unsigned long flags; unsigned long flags;
snd_assert(pcm_channel->active,return -EIO); snd_assert(pcm_channel->active,return -EIO);
...@@ -1503,11 +1509,12 @@ int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channe ...@@ -1503,11 +1509,12 @@ int cs46xx_dsp_pcm_unlink (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channe
return 0; 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; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * parent_scb; struct dsp_scb_descriptor * parent_scb;
dsp_scb_descriptor_t * src_scb = pcm_channel->src_scb; struct dsp_scb_descriptor * src_scb = pcm_channel->src_scb;
unsigned long flags; unsigned long flags;
spin_lock(&pcm_channel->src_scb->lock); spin_lock(&pcm_channel->src_scb->lock);
...@@ -1544,12 +1551,13 @@ int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel) ...@@ -1544,12 +1551,13 @@ int cs46xx_dsp_pcm_link (cs46xx_t * chip,pcm_channel_descriptor_t * pcm_channel)
return 0; return 0;
} }
dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descriptor_t * source, struct dsp_scb_descriptor *
u16 addr,char * scb_name) 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; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * parent; struct dsp_scb_descriptor * parent;
dsp_scb_descriptor_t * pcm_input; struct dsp_scb_descriptor * pcm_input;
int insert_point; int insert_point;
snd_assert (ins->record_mixer_scb != NULL,return NULL); snd_assert (ins->record_mixer_scb != NULL,return NULL);
...@@ -1569,7 +1577,7 @@ dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descript ...@@ -1569,7 +1577,7 @@ dsp_scb_descriptor_t * cs46xx_add_record_source (cs46xx_t *chip,dsp_scb_descript
return pcm_input; 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 ); snd_assert (src->parent_scb_ptr != NULL, return -EINVAL );
...@@ -1581,10 +1589,10 @@ int cs46xx_src_unlink(cs46xx_t *chip,dsp_scb_descriptor_t * src) ...@@ -1581,10 +1589,10 @@ int cs46xx_src_unlink(cs46xx_t *chip,dsp_scb_descriptor_t * src)
return 0; 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; struct dsp_spos_instance * ins = chip->dsp_spos_instance;
dsp_scb_descriptor_t * parent_scb; struct dsp_scb_descriptor * parent_scb;
snd_assert (src->parent_scb_ptr == NULL, return -EINVAL ); snd_assert (src->parent_scb_ptr == NULL, return -EINVAL );
snd_assert(ins->master_mix_scb !=NULL, return -EINVAL ); snd_assert(ins->master_mix_scb !=NULL, return -EINVAL );
...@@ -1605,9 +1613,9 @@ int cs46xx_src_link(cs46xx_t *chip,dsp_scb_descriptor_t * src) ...@@ -1605,9 +1613,9 @@ int cs46xx_src_link(cs46xx_t *chip,dsp_scb_descriptor_t * src)
return 0; 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) ) { if ( ! (ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED) ) {
cs46xx_dsp_enable_spdif_hw (chip); cs46xx_dsp_enable_spdif_hw (chip);
...@@ -1653,9 +1661,9 @@ int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip) ...@@ -1653,9 +1661,9 @@ int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip)
return 0; 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 */ /* dont touch anything if SPDIF is open */
if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) { if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) {
...@@ -1685,9 +1693,9 @@ int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip) ...@@ -1685,9 +1693,9 @@ int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip)
return 0; 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 ) { if ( ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED ) {
/* remove AsynchFGTxSCB and and PCMSerialInput_II */ /* remove AsynchFGTxSCB and and PCMSerialInput_II */
...@@ -1718,9 +1726,9 @@ int cs46xx_iec958_pre_open (cs46xx_t *chip) ...@@ -1718,9 +1726,9 @@ int cs46xx_iec958_pre_open (cs46xx_t *chip)
return 0; 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); snd_assert (ins->asynch_tx_scb != NULL, return -EINVAL);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#ifndef __HEADER_cwc4630_H__ #ifndef __HEADER_cwc4630_H__
#define __HEADER_cwc4630_H__ #define __HEADER_cwc4630_H__
static symbol_entry_t cwc4630_symbols[] = { static struct dsp_symbol_entry cwc4630_symbols[] = {
{ 0x0000, "BEGINADDRESS",0x00 }, { 0x0000, "BEGINADDRESS",0x00 },
{ 0x8000, "EXECCHILD",0x03 }, { 0x8000, "EXECCHILD",0x03 },
{ 0x8001, "EXECCHILD_98",0x03 }, { 0x8001, "EXECCHILD_98",0x03 },
...@@ -302,12 +302,12 @@ static u32 cwc4630_parameter[] = { ...@@ -302,12 +302,12 @@ static u32 cwc4630_parameter[] = {
}; /* #PARAMETER_END */ }; /* #PARAMETER_END */
static segment_desc_t cwc4630_segments[] = { static struct dsp_segment_desc cwc4630_segments[] = {
{ SEGTYPE_SP_PROGRAM, 0x00000000, 0x00000328, cwc4630_code }, { SEGTYPE_SP_PROGRAM, 0x00000000, 0x00000328, cwc4630_code },
{ SEGTYPE_SP_PARAMETER, 0x00000000, 0x00000080, cwc4630_parameter }, { SEGTYPE_SP_PARAMETER, 0x00000000, 0x00000080, cwc4630_parameter },
}; };
static dsp_module_desc_t cwc4630_module = { static struct dsp_module_desc cwc4630_module = {
"cwc4630", "cwc4630",
{ {
38, 38,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#ifndef __HEADER_cwcasync_H__ #ifndef __HEADER_cwcasync_H__
#define __HEADER_cwcasync_H__ #define __HEADER_cwcasync_H__
static symbol_entry_t cwcasync_symbols[] = { static struct dsp_symbol_entry cwcasync_symbols[] = {
{ 0x8000, "EXECCHILD",0x03 }, { 0x8000, "EXECCHILD",0x03 },
{ 0x8001, "EXECCHILD_98",0x03 }, { 0x8001, "EXECCHILD_98",0x03 },
{ 0x8003, "EXECCHILD_PUSH1IND",0x03 }, { 0x8003, "EXECCHILD_PUSH1IND",0x03 },
...@@ -159,11 +159,11 @@ static u32 cwcasync_code[] = { ...@@ -159,11 +159,11 @@ static u32 cwcasync_code[] = {
}; };
/* #CODE_END */ /* #CODE_END */
static segment_desc_t cwcasync_segments[] = { static struct dsp_segment_desc cwcasync_segments[] = {
{ SEGTYPE_SP_PROGRAM, 0x00000000, 0x000001b6, cwcasync_code }, { SEGTYPE_SP_PROGRAM, 0x00000000, 0x000001b6, cwcasync_code },
}; };
static dsp_module_desc_t cwcasync_module = { static struct dsp_module_desc cwcasync_module = {
"cwcasync", "cwcasync",
{ {
32, 32,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#ifndef __HEADER_cwcbinhack_H__ #ifndef __HEADER_cwcbinhack_H__
#define __HEADER_cwcbinhack_H__ #define __HEADER_cwcbinhack_H__
static symbol_entry_t cwcbinhack_symbols[] = { static struct dsp_symbol_entry cwcbinhack_symbols[] = {
{ 0x02c8, "OVERLAYBEGINADDRESS",0x00 }, { 0x02c8, "OVERLAYBEGINADDRESS",0x00 },
{ 0x02c8, "MAGICSNOOPTASK",0x03 }, { 0x02c8, "MAGICSNOOPTASK",0x03 },
{ 0x0308, "#CODE_END",0x00 }, { 0x0308, "#CODE_END",0x00 },
...@@ -31,11 +31,11 @@ static u32 cwcbinhack_code[] = { ...@@ -31,11 +31,11 @@ static u32 cwcbinhack_code[] = {
}; };
/* #CODE_END */ /* #CODE_END */
static segment_desc_t cwcbinhack_segments[] = { static struct dsp_segment_desc cwcbinhack_segments[] = {
{ SEGTYPE_SP_PROGRAM, 0x00000000, 64, cwcbinhack_code }, { SEGTYPE_SP_PROGRAM, 0x00000000, 64, cwcbinhack_code },
}; };
static dsp_module_desc_t cwcbinhack_module = { static struct dsp_module_desc cwcbinhack_module = {
"cwcbinhack", "cwcbinhack",
{ {
3, 3,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#ifndef __HEADER_cwcdma_H__ #ifndef __HEADER_cwcdma_H__
#define __HEADER_cwcdma_H__ #define __HEADER_cwcdma_H__
static symbol_entry_t cwcdma_symbols[] = { static struct dsp_symbol_entry cwcdma_symbols[] = {
{ 0x8000, "EXECCHILD",0x03 }, { 0x8000, "EXECCHILD",0x03 },
{ 0x8001, "EXECCHILD_98",0x03 }, { 0x8001, "EXECCHILD_98",0x03 },
{ 0x8003, "EXECCHILD_PUSH1IND",0x03 }, { 0x8003, "EXECCHILD_PUSH1IND",0x03 },
...@@ -51,11 +51,11 @@ static u32 cwcdma_code[] = { ...@@ -51,11 +51,11 @@ static u32 cwcdma_code[] = {
/* #CODE_END */ /* #CODE_END */
static segment_desc_t cwcdma_segments[] = { static struct dsp_segment_desc cwcdma_segments[] = {
{ SEGTYPE_SP_PROGRAM, 0x00000000, 0x00000030, cwcdma_code }, { SEGTYPE_SP_PROGRAM, 0x00000000, 0x00000030, cwcdma_code },
}; };
static dsp_module_desc_t cwcdma_module = { static struct dsp_module_desc cwcdma_module = {
"cwcdma", "cwcdma",
{ {
27, 27,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#ifndef __HEADER_cwcemb80_H__ #ifndef __HEADER_cwcemb80_H__
#define __HEADER_cwcemb80_H__ #define __HEADER_cwcemb80_H__
static symbol_entry_t cwcemb80_symbols[] = { static struct dsp_symbol_entry cwcemb80_symbols[] = {
{ 0x0000, "BEGINADDRESS",0x00 }, { 0x0000, "BEGINADDRESS",0x00 },
{ 0x8000, "EXECCHILD",0x03 }, { 0x8000, "EXECCHILD",0x03 },
{ 0x8001, "EXECCHILD_98",0x03 }, { 0x8001, "EXECCHILD_98",0x03 },
...@@ -1588,13 +1588,13 @@ static u32 cwcemb80_sample[] = { ...@@ -1588,13 +1588,13 @@ static u32 cwcemb80_sample[] = {
}; /* #SAMPLE_END */ }; /* #SAMPLE_END */
static segment_desc_t cwcemb80_segments[] = { static struct dsp_segment_desc cwcemb80_segments[] = {
{ SEGTYPE_SP_PROGRAM, 0x00000000, 0x0000031c, cwcemb80_code }, { SEGTYPE_SP_PROGRAM, 0x00000000, 0x0000031c, cwcemb80_code },
{ SEGTYPE_SP_PARAMETER, 0x00000000, 0x00000697, cwcemb80_parameter }, { SEGTYPE_SP_PARAMETER, 0x00000000, 0x00000697, cwcemb80_parameter },
{ SEGTYPE_SP_SAMPLE, 0x00000000, 0x00000e00, cwcemb80_sample }, { SEGTYPE_SP_SAMPLE, 0x00000000, 0x00000e00, cwcemb80_sample },
}; };
static dsp_module_desc_t cwcemb80_module = { static struct dsp_module_desc cwcemb80_module = {
"cwcemb80", "cwcemb80",
{ {
38, 38,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#ifndef __HEADER_cwcsnoop_H__ #ifndef __HEADER_cwcsnoop_H__
#define __HEADER_cwcsnoop_H__ #define __HEADER_cwcsnoop_H__
static symbol_entry_t cwcsnoop_symbols[] = { static struct dsp_symbol_entry cwcsnoop_symbols[] = {
{ 0x0500, "OVERLAYBEGINADDRESS",0x00 }, { 0x0500, "OVERLAYBEGINADDRESS",0x00 },
{ 0x0500, "OUTPUTSNOOP",0x03 }, { 0x0500, "OUTPUTSNOOP",0x03 },
{ 0x051f, "#CODE_END",0x00 }, { 0x051f, "#CODE_END",0x00 },
...@@ -29,11 +29,11 @@ static u32 cwcsnoop_code[] = { ...@@ -29,11 +29,11 @@ static u32 cwcsnoop_code[] = {
}; };
/* #CODE_END */ /* #CODE_END */
static segment_desc_t cwcsnoop_segments[] = { static struct dsp_segment_desc cwcsnoop_segments[] = {
{ SEGTYPE_SP_PROGRAM, 0x00000000, 0x0000003e, cwcsnoop_code }, { SEGTYPE_SP_PROGRAM, 0x00000000, 0x0000003e, cwcsnoop_code },
}; };
static dsp_module_desc_t cwcsnoop_module = { static struct dsp_module_desc cwcsnoop_module = {
"cwcsnoop", "cwcsnoop",
{ {
3, 3,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment