aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/sb/sb16_csp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/sb/sb16_csp.c')
-rw-r--r--sound/isa/sb/sb16_csp.c174
1 files changed, 88 insertions, 86 deletions
diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
index 7192d4c758e6..9c2b5efbacbf 100644
--- a/sound/isa/sb/sb16_csp.c
+++ b/sound/isa/sb/sb16_csp.c
@@ -72,46 +72,47 @@ struct desc_header {
72/* 72/*
73 * prototypes 73 * prototypes
74 */ 74 */
75static void snd_sb_csp_free(snd_hwdep_t *hw); 75static void snd_sb_csp_free(struct snd_hwdep *hw);
76static int snd_sb_csp_open(snd_hwdep_t * hw, struct file *file); 76static int snd_sb_csp_open(struct snd_hwdep * hw, struct file *file);
77static int snd_sb_csp_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsigned long arg); 77static int snd_sb_csp_ioctl(struct snd_hwdep * hw, struct file *file, unsigned int cmd, unsigned long arg);
78static int snd_sb_csp_release(snd_hwdep_t * hw, struct file *file); 78static int snd_sb_csp_release(struct snd_hwdep * hw, struct file *file);
79 79
80static int csp_detect(sb_t *chip, int *version); 80static int csp_detect(struct snd_sb *chip, int *version);
81static int set_codec_parameter(sb_t *chip, unsigned char par, unsigned char val); 81static int set_codec_parameter(struct snd_sb *chip, unsigned char par, unsigned char val);
82static int set_register(sb_t *chip, unsigned char reg, unsigned char val); 82static int set_register(struct snd_sb *chip, unsigned char reg, unsigned char val);
83static int read_register(sb_t *chip, unsigned char reg); 83static int read_register(struct snd_sb *chip, unsigned char reg);
84static int set_mode_register(sb_t *chip, unsigned char mode); 84static int set_mode_register(struct snd_sb *chip, unsigned char mode);
85static int get_version(sb_t *chip); 85static int get_version(struct snd_sb *chip);
86 86
87static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t __user * code); 87static int snd_sb_csp_riff_load(struct snd_sb_csp * p,
88static int snd_sb_csp_unload(snd_sb_csp_t * p); 88 struct snd_sb_csp_microcode __user * code);
89static int snd_sb_csp_load_user(snd_sb_csp_t * p, const unsigned char __user *buf, int size, int load_flags); 89static int snd_sb_csp_unload(struct snd_sb_csp * p);
90static int snd_sb_csp_autoload(snd_sb_csp_t * p, int pcm_sfmt, int play_rec_mode); 90static int snd_sb_csp_load_user(struct snd_sb_csp * p, const unsigned char __user *buf, int size, int load_flags);
91static int snd_sb_csp_check_version(snd_sb_csp_t * p); 91static int snd_sb_csp_autoload(struct snd_sb_csp * p, int pcm_sfmt, int play_rec_mode);
92 92static int snd_sb_csp_check_version(struct snd_sb_csp * p);
93static int snd_sb_csp_use(snd_sb_csp_t * p); 93
94static int snd_sb_csp_unuse(snd_sb_csp_t * p); 94static int snd_sb_csp_use(struct snd_sb_csp * p);
95static int snd_sb_csp_start(snd_sb_csp_t * p, int sample_width, int channels); 95static int snd_sb_csp_unuse(struct snd_sb_csp * p);
96static int snd_sb_csp_stop(snd_sb_csp_t * p); 96static int snd_sb_csp_start(struct snd_sb_csp * p, int sample_width, int channels);
97static int snd_sb_csp_pause(snd_sb_csp_t * p); 97static int snd_sb_csp_stop(struct snd_sb_csp * p);
98static int snd_sb_csp_restart(snd_sb_csp_t * p); 98static int snd_sb_csp_pause(struct snd_sb_csp * p);
99 99static int snd_sb_csp_restart(struct snd_sb_csp * p);
100static int snd_sb_qsound_build(snd_sb_csp_t * p); 100
101static void snd_sb_qsound_destroy(snd_sb_csp_t * p); 101static int snd_sb_qsound_build(struct snd_sb_csp * p);
102static int snd_sb_csp_qsound_transfer(snd_sb_csp_t * p); 102static void snd_sb_qsound_destroy(struct snd_sb_csp * p);
103 103static int snd_sb_csp_qsound_transfer(struct snd_sb_csp * p);
104static int init_proc_entry(snd_sb_csp_t * p, int device); 104
105static void info_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer); 105static int init_proc_entry(struct snd_sb_csp * p, int device);
106static void info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer);
106 107
107/* 108/*
108 * Detect CSP chip and create a new instance 109 * Detect CSP chip and create a new instance
109 */ 110 */
110int snd_sb_csp_new(sb_t *chip, int device, snd_hwdep_t ** rhwdep) 111int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep)
111{ 112{
112 snd_sb_csp_t *p; 113 struct snd_sb_csp *p;
113 int version, err; 114 int version, err;
114 snd_hwdep_t *hw; 115 struct snd_hwdep *hw;
115 116
116 if (rhwdep) 117 if (rhwdep)
117 *rhwdep = NULL; 118 *rhwdep = NULL;
@@ -158,9 +159,9 @@ int snd_sb_csp_new(sb_t *chip, int device, snd_hwdep_t ** rhwdep)
158/* 159/*
159 * free_private for hwdep instance 160 * free_private for hwdep instance
160 */ 161 */
161static void snd_sb_csp_free(snd_hwdep_t *hwdep) 162static void snd_sb_csp_free(struct snd_hwdep *hwdep)
162{ 163{
163 snd_sb_csp_t *p = hwdep->private_data; 164 struct snd_sb_csp *p = hwdep->private_data;
164 if (p) { 165 if (p) {
165 if (p->running & SNDRV_SB_CSP_ST_RUNNING) 166 if (p->running & SNDRV_SB_CSP_ST_RUNNING)
166 snd_sb_csp_stop(p); 167 snd_sb_csp_stop(p);
@@ -173,20 +174,20 @@ static void snd_sb_csp_free(snd_hwdep_t *hwdep)
173/* 174/*
174 * open the device exclusively 175 * open the device exclusively
175 */ 176 */
176static int snd_sb_csp_open(snd_hwdep_t * hw, struct file *file) 177static int snd_sb_csp_open(struct snd_hwdep * hw, struct file *file)
177{ 178{
178 snd_sb_csp_t *p = hw->private_data; 179 struct snd_sb_csp *p = hw->private_data;
179 return (snd_sb_csp_use(p)); 180 return (snd_sb_csp_use(p));
180} 181}
181 182
182/* 183/*
183 * ioctl for hwdep device: 184 * ioctl for hwdep device:
184 */ 185 */
185static int snd_sb_csp_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsigned long arg) 186static int snd_sb_csp_ioctl(struct snd_hwdep * hw, struct file *file, unsigned int cmd, unsigned long arg)
186{ 187{
187 snd_sb_csp_t *p = hw->private_data; 188 struct snd_sb_csp *p = hw->private_data;
188 snd_sb_csp_info_t info; 189 struct snd_sb_csp_info info;
189 snd_sb_csp_start_t start_info; 190 struct snd_sb_csp_start start_info;
190 int err; 191 int err;
191 192
192 snd_assert(p != NULL, return -EINVAL); 193 snd_assert(p != NULL, return -EINVAL);
@@ -217,7 +218,7 @@ static int snd_sb_csp_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cm
217 /* load CSP microcode */ 218 /* load CSP microcode */
218 case SNDRV_SB_CSP_IOCTL_LOAD_CODE: 219 case SNDRV_SB_CSP_IOCTL_LOAD_CODE:
219 err = (p->running & SNDRV_SB_CSP_ST_RUNNING ? 220 err = (p->running & SNDRV_SB_CSP_ST_RUNNING ?
220 -EBUSY : snd_sb_csp_riff_load(p, (snd_sb_csp_microcode_t __user *) arg)); 221 -EBUSY : snd_sb_csp_riff_load(p, (struct snd_sb_csp_microcode __user *) arg));
221 break; 222 break;
222 case SNDRV_SB_CSP_IOCTL_UNLOAD_CODE: 223 case SNDRV_SB_CSP_IOCTL_UNLOAD_CODE:
223 err = (p->running & SNDRV_SB_CSP_ST_RUNNING ? 224 err = (p->running & SNDRV_SB_CSP_ST_RUNNING ?
@@ -251,9 +252,9 @@ static int snd_sb_csp_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cm
251/* 252/*
252 * close the device 253 * close the device
253 */ 254 */
254static int snd_sb_csp_release(snd_hwdep_t * hw, struct file *file) 255static int snd_sb_csp_release(struct snd_hwdep * hw, struct file *file)
255{ 256{
256 snd_sb_csp_t *p = hw->private_data; 257 struct snd_sb_csp *p = hw->private_data;
257 return (snd_sb_csp_unuse(p)); 258 return (snd_sb_csp_unuse(p));
258} 259}
259 260
@@ -262,7 +263,7 @@ static int snd_sb_csp_release(snd_hwdep_t * hw, struct file *file)
262/* 263/*
263 * acquire device 264 * acquire device
264 */ 265 */
265static int snd_sb_csp_use(snd_sb_csp_t * p) 266static int snd_sb_csp_use(struct snd_sb_csp * p)
266{ 267{
267 down(&p->access_mutex); 268 down(&p->access_mutex);
268 if (p->used) { 269 if (p->used) {
@@ -279,7 +280,7 @@ static int snd_sb_csp_use(snd_sb_csp_t * p)
279/* 280/*
280 * release device 281 * release device
281 */ 282 */
282static int snd_sb_csp_unuse(snd_sb_csp_t * p) 283static int snd_sb_csp_unuse(struct snd_sb_csp * p)
283{ 284{
284 down(&p->access_mutex); 285 down(&p->access_mutex);
285 p->used--; 286 p->used--;
@@ -292,9 +293,10 @@ static int snd_sb_csp_unuse(snd_sb_csp_t * p)
292 * load microcode via ioctl: 293 * load microcode via ioctl:
293 * code is user-space pointer 294 * code is user-space pointer
294 */ 295 */
295static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t __user * mcode) 296static int snd_sb_csp_riff_load(struct snd_sb_csp * p,
297 struct snd_sb_csp_microcode __user * mcode)
296{ 298{
297 snd_sb_csp_mc_header_t info; 299 struct snd_sb_csp_mc_header info;
298 300
299 unsigned char __user *data_ptr; 301 unsigned char __user *data_ptr;
300 unsigned char __user *data_end; 302 unsigned char __user *data_end;
@@ -449,7 +451,7 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t __user
449/* 451/*
450 * unload CSP microcode 452 * unload CSP microcode
451 */ 453 */
452static int snd_sb_csp_unload(snd_sb_csp_t * p) 454static int snd_sb_csp_unload(struct snd_sb_csp * p)
453{ 455{
454 if (p->running & SNDRV_SB_CSP_ST_RUNNING) 456 if (p->running & SNDRV_SB_CSP_ST_RUNNING)
455 return -EBUSY; 457 return -EBUSY;
@@ -472,7 +474,7 @@ static int snd_sb_csp_unload(snd_sb_csp_t * p)
472/* 474/*
473 * send command sequence to DSP 475 * send command sequence to DSP
474 */ 476 */
475static inline int command_seq(sb_t *chip, const unsigned char *seq, int size) 477static inline int command_seq(struct snd_sb *chip, const unsigned char *seq, int size)
476{ 478{
477 int i; 479 int i;
478 for (i = 0; i < size; i++) { 480 for (i = 0; i < size; i++) {
@@ -485,7 +487,7 @@ static inline int command_seq(sb_t *chip, const unsigned char *seq, int size)
485/* 487/*
486 * set CSP codec parameter 488 * set CSP codec parameter
487 */ 489 */
488static int set_codec_parameter(sb_t *chip, unsigned char par, unsigned char val) 490static int set_codec_parameter(struct snd_sb *chip, unsigned char par, unsigned char val)
489{ 491{
490 unsigned char dsp_cmd[3]; 492 unsigned char dsp_cmd[3];
491 493
@@ -502,7 +504,7 @@ static int set_codec_parameter(sb_t *chip, unsigned char par, unsigned char val)
502/* 504/*
503 * set CSP register 505 * set CSP register
504 */ 506 */
505static int set_register(sb_t *chip, unsigned char reg, unsigned char val) 507static int set_register(struct snd_sb *chip, unsigned char reg, unsigned char val)
506{ 508{
507 unsigned char dsp_cmd[3]; 509 unsigned char dsp_cmd[3];
508 510
@@ -516,7 +518,7 @@ static int set_register(sb_t *chip, unsigned char reg, unsigned char val)
516 * read CSP register 518 * read CSP register
517 * return < 0 -> error 519 * return < 0 -> error
518 */ 520 */
519static int read_register(sb_t *chip, unsigned char reg) 521static int read_register(struct snd_sb *chip, unsigned char reg)
520{ 522{
521 unsigned char dsp_cmd[2]; 523 unsigned char dsp_cmd[2];
522 524
@@ -529,7 +531,7 @@ static int read_register(sb_t *chip, unsigned char reg)
529/* 531/*
530 * set CSP mode register 532 * set CSP mode register
531 */ 533 */
532static int set_mode_register(sb_t *chip, unsigned char mode) 534static int set_mode_register(struct snd_sb *chip, unsigned char mode)
533{ 535{
534 unsigned char dsp_cmd[2]; 536 unsigned char dsp_cmd[2];
535 537
@@ -542,7 +544,7 @@ static int set_mode_register(sb_t *chip, unsigned char mode)
542 * Detect CSP 544 * Detect CSP
543 * return 0 if CSP exists. 545 * return 0 if CSP exists.
544 */ 546 */
545static int csp_detect(sb_t *chip, int *version) 547static int csp_detect(struct snd_sb *chip, int *version)
546{ 548{
547 unsigned char csp_test1, csp_test2; 549 unsigned char csp_test1, csp_test2;
548 unsigned long flags; 550 unsigned long flags;
@@ -579,7 +581,7 @@ static int csp_detect(sb_t *chip, int *version)
579/* 581/*
580 * get CSP version number 582 * get CSP version number
581 */ 583 */
582static int get_version(sb_t *chip) 584static int get_version(struct snd_sb *chip)
583{ 585{
584 unsigned char dsp_cmd[2]; 586 unsigned char dsp_cmd[2];
585 587
@@ -593,7 +595,7 @@ static int get_version(sb_t *chip)
593/* 595/*
594 * check if the CSP version is valid 596 * check if the CSP version is valid
595 */ 597 */
596static int snd_sb_csp_check_version(snd_sb_csp_t * p) 598static int snd_sb_csp_check_version(struct snd_sb_csp * p)
597{ 599{
598 if (p->version < 0x10 || p->version > 0x1f) { 600 if (p->version < 0x10 || p->version > 0x1f) {
599 snd_printd("%s: Invalid CSP version: 0x%x\n", __FUNCTION__, p->version); 601 snd_printd("%s: Invalid CSP version: 0x%x\n", __FUNCTION__, p->version);
@@ -605,7 +607,7 @@ static int snd_sb_csp_check_version(snd_sb_csp_t * p)
605/* 607/*
606 * download microcode to CSP (microcode should have one "main" block). 608 * download microcode to CSP (microcode should have one "main" block).
607 */ 609 */
608static int snd_sb_csp_load(snd_sb_csp_t * p, const unsigned char *buf, int size, int load_flags) 610static int snd_sb_csp_load(struct snd_sb_csp * p, const unsigned char *buf, int size, int load_flags)
609{ 611{
610 int status, i; 612 int status, i;
611 int err; 613 int err;
@@ -671,7 +673,7 @@ static int snd_sb_csp_load(snd_sb_csp_t * p, const unsigned char *buf, int size,
671 return result; 673 return result;
672} 674}
673 675
674static int snd_sb_csp_load_user(snd_sb_csp_t * p, const unsigned char __user *buf, int size, int load_flags) 676static int snd_sb_csp_load_user(struct snd_sb_csp * p, const unsigned char __user *buf, int size, int load_flags)
675{ 677{
676 int err = -ENOMEM; 678 int err = -ENOMEM;
677 unsigned char *kbuf = kmalloc(size, GFP_KERNEL); 679 unsigned char *kbuf = kmalloc(size, GFP_KERNEL);
@@ -691,7 +693,7 @@ static int snd_sb_csp_load_user(snd_sb_csp_t * p, const unsigned char __user *bu
691 * autoload hardware codec if necessary 693 * autoload hardware codec if necessary
692 * return 0 if CSP is loaded and ready to run (p->running != 0) 694 * return 0 if CSP is loaded and ready to run (p->running != 0)
693 */ 695 */
694static int snd_sb_csp_autoload(snd_sb_csp_t * p, int pcm_sfmt, int play_rec_mode) 696static int snd_sb_csp_autoload(struct snd_sb_csp * p, int pcm_sfmt, int play_rec_mode)
695{ 697{
696 unsigned long flags; 698 unsigned long flags;
697 int err = 0; 699 int err = 0;
@@ -763,7 +765,7 @@ static int snd_sb_csp_autoload(snd_sb_csp_t * p, int pcm_sfmt, int play_rec_mode
763/* 765/*
764 * start CSP 766 * start CSP
765 */ 767 */
766static int snd_sb_csp_start(snd_sb_csp_t * p, int sample_width, int channels) 768static int snd_sb_csp_start(struct snd_sb_csp * p, int sample_width, int channels)
767{ 769{
768 unsigned char s_type; /* sample type */ 770 unsigned char s_type; /* sample type */
769 unsigned char mixL, mixR; 771 unsigned char mixL, mixR;
@@ -842,7 +844,7 @@ static int snd_sb_csp_start(snd_sb_csp_t * p, int sample_width, int channels)
842/* 844/*
843 * stop CSP 845 * stop CSP
844 */ 846 */
845static int snd_sb_csp_stop(snd_sb_csp_t * p) 847static int snd_sb_csp_stop(struct snd_sb_csp * p)
846{ 848{
847 int result; 849 int result;
848 unsigned char mixL, mixR; 850 unsigned char mixL, mixR;
@@ -883,7 +885,7 @@ static int snd_sb_csp_stop(snd_sb_csp_t * p)
883/* 885/*
884 * pause CSP codec and hold DMA transfer 886 * pause CSP codec and hold DMA transfer
885 */ 887 */
886static int snd_sb_csp_pause(snd_sb_csp_t * p) 888static int snd_sb_csp_pause(struct snd_sb_csp * p)
887{ 889{
888 int result; 890 int result;
889 unsigned long flags; 891 unsigned long flags;
@@ -903,7 +905,7 @@ static int snd_sb_csp_pause(snd_sb_csp_t * p)
903/* 905/*
904 * restart CSP codec and resume DMA transfer 906 * restart CSP codec and resume DMA transfer
905 */ 907 */
906static int snd_sb_csp_restart(snd_sb_csp_t * p) 908static int snd_sb_csp_restart(struct snd_sb_csp * p)
907{ 909{
908 int result; 910 int result;
909 unsigned long flags; 911 unsigned long flags;
@@ -926,7 +928,7 @@ static int snd_sb_csp_restart(snd_sb_csp_t * p)
926 * QSound mixer control for PCM 928 * QSound mixer control for PCM
927 */ 929 */
928 930
929static int snd_sb_qsound_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 931static int snd_sb_qsound_switch_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
930{ 932{
931 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 933 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
932 uinfo->count = 1; 934 uinfo->count = 1;
@@ -935,17 +937,17 @@ static int snd_sb_qsound_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info
935 return 0; 937 return 0;
936} 938}
937 939
938static int snd_sb_qsound_switch_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 940static int snd_sb_qsound_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
939{ 941{
940 snd_sb_csp_t *p = snd_kcontrol_chip(kcontrol); 942 struct snd_sb_csp *p = snd_kcontrol_chip(kcontrol);
941 943
942 ucontrol->value.integer.value[0] = p->q_enabled ? 1 : 0; 944 ucontrol->value.integer.value[0] = p->q_enabled ? 1 : 0;
943 return 0; 945 return 0;
944} 946}
945 947
946static int snd_sb_qsound_switch_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 948static int snd_sb_qsound_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
947{ 949{
948 snd_sb_csp_t *p = snd_kcontrol_chip(kcontrol); 950 struct snd_sb_csp *p = snd_kcontrol_chip(kcontrol);
949 unsigned long flags; 951 unsigned long flags;
950 int change; 952 int change;
951 unsigned char nval; 953 unsigned char nval;
@@ -958,7 +960,7 @@ static int snd_sb_qsound_switch_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_valu
958 return change; 960 return change;
959} 961}
960 962
961static int snd_sb_qsound_space_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 963static int snd_sb_qsound_space_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
962{ 964{
963 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 965 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
964 uinfo->count = 2; 966 uinfo->count = 2;
@@ -967,9 +969,9 @@ static int snd_sb_qsound_space_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_
967 return 0; 969 return 0;
968} 970}
969 971
970static int snd_sb_qsound_space_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 972static int snd_sb_qsound_space_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
971{ 973{
972 snd_sb_csp_t *p = snd_kcontrol_chip(kcontrol); 974 struct snd_sb_csp *p = snd_kcontrol_chip(kcontrol);
973 unsigned long flags; 975 unsigned long flags;
974 976
975 spin_lock_irqsave(&p->q_lock, flags); 977 spin_lock_irqsave(&p->q_lock, flags);
@@ -979,9 +981,9 @@ static int snd_sb_qsound_space_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value
979 return 0; 981 return 0;
980} 982}
981 983
982static int snd_sb_qsound_space_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 984static int snd_sb_qsound_space_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
983{ 985{
984 snd_sb_csp_t *p = snd_kcontrol_chip(kcontrol); 986 struct snd_sb_csp *p = snd_kcontrol_chip(kcontrol);
985 unsigned long flags; 987 unsigned long flags;
986 int change; 988 int change;
987 unsigned char nval1, nval2; 989 unsigned char nval1, nval2;
@@ -1001,7 +1003,7 @@ static int snd_sb_qsound_space_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value
1001 return change; 1003 return change;
1002} 1004}
1003 1005
1004static snd_kcontrol_new_t snd_sb_qsound_switch = { 1006static struct snd_kcontrol_new snd_sb_qsound_switch = {
1005 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1007 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1006 .name = "3D Control - Switch", 1008 .name = "3D Control - Switch",
1007 .info = snd_sb_qsound_switch_info, 1009 .info = snd_sb_qsound_switch_info,
@@ -1009,7 +1011,7 @@ static snd_kcontrol_new_t snd_sb_qsound_switch = {
1009 .put = snd_sb_qsound_switch_put 1011 .put = snd_sb_qsound_switch_put
1010}; 1012};
1011 1013
1012static snd_kcontrol_new_t snd_sb_qsound_space = { 1014static struct snd_kcontrol_new snd_sb_qsound_space = {
1013 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1015 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1014 .name = "3D Control - Space", 1016 .name = "3D Control - Space",
1015 .info = snd_sb_qsound_space_info, 1017 .info = snd_sb_qsound_space_info,
@@ -1017,9 +1019,9 @@ static snd_kcontrol_new_t snd_sb_qsound_space = {
1017 .put = snd_sb_qsound_space_put 1019 .put = snd_sb_qsound_space_put
1018}; 1020};
1019 1021
1020static int snd_sb_qsound_build(snd_sb_csp_t * p) 1022static int snd_sb_qsound_build(struct snd_sb_csp * p)
1021{ 1023{
1022 snd_card_t * card; 1024 struct snd_card *card;
1023 int err; 1025 int err;
1024 1026
1025 snd_assert(p != NULL, return -EINVAL); 1027 snd_assert(p != NULL, return -EINVAL);
@@ -1042,9 +1044,9 @@ static int snd_sb_qsound_build(snd_sb_csp_t * p)
1042 return err; 1044 return err;
1043} 1045}
1044 1046
1045static void snd_sb_qsound_destroy(snd_sb_csp_t * p) 1047static void snd_sb_qsound_destroy(struct snd_sb_csp * p)
1046{ 1048{
1047 snd_card_t * card; 1049 struct snd_card *card;
1048 unsigned long flags; 1050 unsigned long flags;
1049 1051
1050 snd_assert(p != NULL, return); 1052 snd_assert(p != NULL, return);
@@ -1068,7 +1070,7 @@ static void snd_sb_qsound_destroy(snd_sb_csp_t * p)
1068 * Transfer qsound parameters to CSP, 1070 * Transfer qsound parameters to CSP,
1069 * function should be called from interrupt routine 1071 * function should be called from interrupt routine
1070 */ 1072 */
1071static int snd_sb_csp_qsound_transfer(snd_sb_csp_t * p) 1073static int snd_sb_csp_qsound_transfer(struct snd_sb_csp * p)
1072{ 1074{
1073 int err = -ENXIO; 1075 int err = -ENXIO;
1074 1076
@@ -1093,19 +1095,19 @@ static int snd_sb_csp_qsound_transfer(snd_sb_csp_t * p)
1093/* 1095/*
1094 * proc interface 1096 * proc interface
1095 */ 1097 */
1096static int init_proc_entry(snd_sb_csp_t * p, int device) 1098static int init_proc_entry(struct snd_sb_csp * p, int device)
1097{ 1099{
1098 char name[16]; 1100 char name[16];
1099 snd_info_entry_t *entry; 1101 struct snd_info_entry *entry;
1100 sprintf(name, "cspD%d", device); 1102 sprintf(name, "cspD%d", device);
1101 if (! snd_card_proc_new(p->chip->card, name, &entry)) 1103 if (! snd_card_proc_new(p->chip->card, name, &entry))
1102 snd_info_set_text_ops(entry, p, 1024, info_read); 1104 snd_info_set_text_ops(entry, p, 1024, info_read);
1103 return 0; 1105 return 0;
1104} 1106}
1105 1107
1106static void info_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) 1108static void info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
1107{ 1109{
1108 snd_sb_csp_t *p = entry->private_data; 1110 struct snd_sb_csp *p = entry->private_data;
1109 1111
1110 snd_iprintf(buffer, "Creative Signal Processor [v%d.%d]\n", (p->version >> 4), (p->version & 0x0f)); 1112 snd_iprintf(buffer, "Creative Signal Processor [v%d.%d]\n", (p->version >> 4), (p->version & 0x0f));
1111 snd_iprintf(buffer, "State: %cx%c%c%c\n", ((p->running & SNDRV_SB_CSP_ST_QSOUND) ? 'Q' : '-'), 1113 snd_iprintf(buffer, "State: %cx%c%c%c\n", ((p->running & SNDRV_SB_CSP_ST_QSOUND) ? 'Q' : '-'),