aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 08:59:52 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:19:11 -0500
commit6ca308d4edd51c4f34ffff94ae0bbf193087d89f (patch)
tree6bc0cb2ccacc6a4fd08cc35ecda4819e01f87af5
parenta98f90fd826913519c3f704ea24fb9bea1e0e494 (diff)
[ALSA] Remove xxx_t typedefs: PCI ICE1712
Modules: ICE1712 driver Remove xxx_t typedefs from the PCI ICE1712 driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/ice1712/ak4xxx.c26
-rw-r--r--sound/pci/ice1712/delta.c82
-rw-r--r--sound/pci/ice1712/ews.c144
-rw-r--r--sound/pci/ice1712/hoontech.c30
-rw-r--r--sound/pci/ice1712/ice1712.c554
-rw-r--r--sound/pci/ice1712/ice1712.h118
6 files changed, 500 insertions, 454 deletions
diff --git a/sound/pci/ice1712/ak4xxx.c b/sound/pci/ice1712/ak4xxx.c
index ae9dc029ba0d..ab00cce2c39f 100644
--- a/sound/pci/ice1712/ak4xxx.c
+++ b/sound/pci/ice1712/ak4xxx.c
@@ -34,16 +34,16 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
34MODULE_DESCRIPTION("ICEnsemble ICE17xx <-> AK4xxx AD/DA chip interface"); 34MODULE_DESCRIPTION("ICEnsemble ICE17xx <-> AK4xxx AD/DA chip interface");
35MODULE_LICENSE("GPL"); 35MODULE_LICENSE("GPL");
36 36
37static void snd_ice1712_akm4xxx_lock(akm4xxx_t *ak, int chip) 37static void snd_ice1712_akm4xxx_lock(struct snd_akm4xxx *ak, int chip)
38{ 38{
39 ice1712_t *ice = ak->private_data[0]; 39 struct snd_ice1712 *ice = ak->private_data[0];
40 40
41 snd_ice1712_save_gpio_status(ice); 41 snd_ice1712_save_gpio_status(ice);
42} 42}
43 43
44static void snd_ice1712_akm4xxx_unlock(akm4xxx_t *ak, int chip) 44static void snd_ice1712_akm4xxx_unlock(struct snd_akm4xxx *ak, int chip)
45{ 45{
46 ice1712_t *ice = ak->private_data[0]; 46 struct snd_ice1712 *ice = ak->private_data[0];
47 47
48 snd_ice1712_restore_gpio_status(ice); 48 snd_ice1712_restore_gpio_status(ice);
49} 49}
@@ -51,14 +51,14 @@ static void snd_ice1712_akm4xxx_unlock(akm4xxx_t *ak, int chip)
51/* 51/*
52 * write AK4xxx register 52 * write AK4xxx register
53 */ 53 */
54static void snd_ice1712_akm4xxx_write(akm4xxx_t *ak, int chip, 54static void snd_ice1712_akm4xxx_write(struct snd_akm4xxx *ak, int chip,
55 unsigned char addr, unsigned char data) 55 unsigned char addr, unsigned char data)
56{ 56{
57 unsigned int tmp; 57 unsigned int tmp;
58 int idx; 58 int idx;
59 unsigned int addrdata; 59 unsigned int addrdata;
60 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; 60 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
61 ice1712_t *ice = ak->private_data[0]; 61 struct snd_ice1712 *ice = ak->private_data[0];
62 62
63 snd_assert(chip >= 0 && chip < 4, return); 63 snd_assert(chip >= 0 && chip < 4, return);
64 64
@@ -119,10 +119,10 @@ static void snd_ice1712_akm4xxx_write(akm4xxx_t *ak, int chip,
119} 119}
120 120
121/* 121/*
122 * initialize the akm4xxx_t record with the template 122 * initialize the struct snd_akm4xxx record with the template
123 */ 123 */
124int snd_ice1712_akm4xxx_init(akm4xxx_t *ak, const akm4xxx_t *temp, 124int snd_ice1712_akm4xxx_init(struct snd_akm4xxx *ak, const struct snd_akm4xxx *temp,
125 const struct snd_ak4xxx_private *_priv, ice1712_t *ice) 125 const struct snd_ak4xxx_private *_priv, struct snd_ice1712 *ice)
126{ 126{
127 struct snd_ak4xxx_private *priv; 127 struct snd_ak4xxx_private *priv;
128 128
@@ -148,13 +148,13 @@ int snd_ice1712_akm4xxx_init(akm4xxx_t *ak, const akm4xxx_t *temp,
148 return 0; 148 return 0;
149} 149}
150 150
151void snd_ice1712_akm4xxx_free(ice1712_t *ice) 151void snd_ice1712_akm4xxx_free(struct snd_ice1712 *ice)
152{ 152{
153 unsigned int akidx; 153 unsigned int akidx;
154 if (ice->akm == NULL) 154 if (ice->akm == NULL)
155 return; 155 return;
156 for (akidx = 0; akidx < ice->akm_codecs; akidx++) { 156 for (akidx = 0; akidx < ice->akm_codecs; akidx++) {
157 akm4xxx_t *ak = &ice->akm[akidx]; 157 struct snd_akm4xxx *ak = &ice->akm[akidx];
158 kfree((void*)ak->private_value[0]); 158 kfree((void*)ak->private_value[0]);
159 } 159 }
160 kfree(ice->akm); 160 kfree(ice->akm);
@@ -163,13 +163,13 @@ void snd_ice1712_akm4xxx_free(ice1712_t *ice)
163/* 163/*
164 * build AK4xxx controls 164 * build AK4xxx controls
165 */ 165 */
166int snd_ice1712_akm4xxx_build_controls(ice1712_t *ice) 166int snd_ice1712_akm4xxx_build_controls(struct snd_ice1712 *ice)
167{ 167{
168 unsigned int akidx; 168 unsigned int akidx;
169 int err; 169 int err;
170 170
171 for (akidx = 0; akidx < ice->akm_codecs; akidx++) { 171 for (akidx = 0; akidx < ice->akm_codecs; akidx++) {
172 akm4xxx_t *ak = &ice->akm[akidx]; 172 struct snd_akm4xxx *ak = &ice->akm[akidx];
173 err = snd_akm4xxx_build_controls(ak); 173 err = snd_akm4xxx_build_controls(ak);
174 if (err < 0) 174 if (err < 0)
175 return err; 175 return err;
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c
index 576f69d482c9..9a51d34e6817 100644
--- a/sound/pci/ice1712/delta.c
+++ b/sound/pci/ice1712/delta.c
@@ -44,7 +44,7 @@
44 */ 44 */
45 45
46/* send 8 bits */ 46/* send 8 bits */
47static void ap_cs8427_write_byte(ice1712_t *ice, unsigned char data, unsigned char tmp) 47static void ap_cs8427_write_byte(struct snd_ice1712 *ice, unsigned char data, unsigned char tmp)
48{ 48{
49 int idx; 49 int idx;
50 50
@@ -61,7 +61,7 @@ static void ap_cs8427_write_byte(ice1712_t *ice, unsigned char data, unsigned ch
61} 61}
62 62
63/* read 8 bits */ 63/* read 8 bits */
64static unsigned char ap_cs8427_read_byte(ice1712_t *ice, unsigned char tmp) 64static unsigned char ap_cs8427_read_byte(struct snd_ice1712 *ice, unsigned char tmp)
65{ 65{
66 unsigned char data = 0; 66 unsigned char data = 0;
67 int idx; 67 int idx;
@@ -80,7 +80,7 @@ static unsigned char ap_cs8427_read_byte(ice1712_t *ice, unsigned char tmp)
80} 80}
81 81
82/* assert chip select */ 82/* assert chip select */
83static unsigned char ap_cs8427_codec_select(ice1712_t *ice) 83static unsigned char ap_cs8427_codec_select(struct snd_ice1712 *ice)
84{ 84{
85 unsigned char tmp; 85 unsigned char tmp;
86 tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); 86 tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
@@ -105,7 +105,7 @@ static unsigned char ap_cs8427_codec_select(ice1712_t *ice)
105} 105}
106 106
107/* deassert chip select */ 107/* deassert chip select */
108static void ap_cs8427_codec_deassert(ice1712_t *ice, unsigned char tmp) 108static void ap_cs8427_codec_deassert(struct snd_ice1712 *ice, unsigned char tmp)
109{ 109{
110 switch (ice->eeprom.subvendor) { 110 switch (ice->eeprom.subvendor) {
111 case ICE1712_SUBDEVICE_DELTA1010LT: 111 case ICE1712_SUBDEVICE_DELTA1010LT:
@@ -124,9 +124,9 @@ static void ap_cs8427_codec_deassert(ice1712_t *ice, unsigned char tmp)
124} 124}
125 125
126/* sequential write */ 126/* sequential write */
127static int ap_cs8427_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, int count) 127static int ap_cs8427_sendbytes(struct snd_i2c_device *device, unsigned char *bytes, int count)
128{ 128{
129 ice1712_t *ice = device->bus->private_data; 129 struct snd_ice1712 *ice = device->bus->private_data;
130 int res = count; 130 int res = count;
131 unsigned char tmp; 131 unsigned char tmp;
132 132
@@ -141,9 +141,9 @@ static int ap_cs8427_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, i
141} 141}
142 142
143/* sequential read */ 143/* sequential read */
144static int ap_cs8427_readbytes(snd_i2c_device_t *device, unsigned char *bytes, int count) 144static int ap_cs8427_readbytes(struct snd_i2c_device *device, unsigned char *bytes, int count)
145{ 145{
146 ice1712_t *ice = device->bus->private_data; 146 struct snd_ice1712 *ice = device->bus->private_data;
147 int res = count; 147 int res = count;
148 unsigned char tmp; 148 unsigned char tmp;
149 149
@@ -157,14 +157,14 @@ static int ap_cs8427_readbytes(snd_i2c_device_t *device, unsigned char *bytes, i
157 return res; 157 return res;
158} 158}
159 159
160static int ap_cs8427_probeaddr(snd_i2c_bus_t *bus, unsigned short addr) 160static int ap_cs8427_probeaddr(struct snd_i2c_bus *bus, unsigned short addr)
161{ 161{
162 if (addr == 0x10) 162 if (addr == 0x10)
163 return 1; 163 return 1;
164 return -ENOENT; 164 return -ENOENT;
165} 165}
166 166
167static snd_i2c_ops_t ap_cs8427_i2c_ops = { 167static struct snd_i2c_ops ap_cs8427_i2c_ops = {
168 .sendbytes = ap_cs8427_sendbytes, 168 .sendbytes = ap_cs8427_sendbytes,
169 .readbytes = ap_cs8427_readbytes, 169 .readbytes = ap_cs8427_readbytes,
170 .probeaddr = ap_cs8427_probeaddr, 170 .probeaddr = ap_cs8427_probeaddr,
@@ -173,7 +173,7 @@ static snd_i2c_ops_t ap_cs8427_i2c_ops = {
173/* 173/*
174 */ 174 */
175 175
176static void snd_ice1712_delta_cs8403_spdif_write(ice1712_t *ice, unsigned char bits) 176static void snd_ice1712_delta_cs8403_spdif_write(struct snd_ice1712 *ice, unsigned char bits)
177{ 177{
178 unsigned char tmp, mask1, mask2; 178 unsigned char tmp, mask1, mask2;
179 int idx; 179 int idx;
@@ -198,12 +198,12 @@ static void snd_ice1712_delta_cs8403_spdif_write(ice1712_t *ice, unsigned char b
198} 198}
199 199
200 200
201static void delta_spdif_default_get(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) 201static void delta_spdif_default_get(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
202{ 202{
203 snd_cs8403_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_bits); 203 snd_cs8403_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_bits);
204} 204}
205 205
206static int delta_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) 206static int delta_spdif_default_put(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
207{ 207{
208 unsigned int val; 208 unsigned int val;
209 int change; 209 int change;
@@ -221,12 +221,12 @@ static int delta_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontr
221 return change; 221 return change;
222} 222}
223 223
224static void delta_spdif_stream_get(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) 224static void delta_spdif_stream_get(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
225{ 225{
226 snd_cs8403_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_stream_bits); 226 snd_cs8403_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_stream_bits);
227} 227}
228 228
229static int delta_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) 229static int delta_spdif_stream_put(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
230{ 230{
231 unsigned int val; 231 unsigned int val;
232 int change; 232 int change;
@@ -248,10 +248,10 @@ static int delta_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontro
248/* 248/*
249 * AK4524 on Delta 44 and 66 to choose the chip mask 249 * AK4524 on Delta 44 and 66 to choose the chip mask
250 */ 250 */
251static void delta_ak4524_lock(akm4xxx_t *ak, int chip) 251static void delta_ak4524_lock(struct snd_akm4xxx *ak, int chip)
252{ 252{
253 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; 253 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
254 ice1712_t *ice = ak->private_data[0]; 254 struct snd_ice1712 *ice = ak->private_data[0];
255 255
256 snd_ice1712_save_gpio_status(ice); 256 snd_ice1712_save_gpio_status(ice);
257 priv->cs_mask = 257 priv->cs_mask =
@@ -262,10 +262,10 @@ static void delta_ak4524_lock(akm4xxx_t *ak, int chip)
262/* 262/*
263 * AK4524 on Delta1010LT to choose the chip address 263 * AK4524 on Delta1010LT to choose the chip address
264 */ 264 */
265static void delta1010lt_ak4524_lock(akm4xxx_t *ak, int chip) 265static void delta1010lt_ak4524_lock(struct snd_akm4xxx *ak, int chip)
266{ 266{
267 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; 267 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
268 ice1712_t *ice = ak->private_data[0]; 268 struct snd_ice1712 *ice = ak->private_data[0];
269 269
270 snd_ice1712_save_gpio_status(ice); 270 snd_ice1712_save_gpio_status(ice);
271 priv->cs_mask = ICE1712_DELTA_1010LT_CS; 271 priv->cs_mask = ICE1712_DELTA_1010LT_CS;
@@ -275,10 +275,10 @@ static void delta1010lt_ak4524_lock(akm4xxx_t *ak, int chip)
275/* 275/*
276 * AK4528 on VX442 to choose the chip mask 276 * AK4528 on VX442 to choose the chip mask
277 */ 277 */
278static void vx442_ak4524_lock(akm4xxx_t *ak, int chip) 278static void vx442_ak4524_lock(struct snd_akm4xxx *ak, int chip)
279{ 279{
280 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; 280 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
281 ice1712_t *ice = ak->private_data[0]; 281 struct snd_ice1712 *ice = ak->private_data[0];
282 282
283 snd_ice1712_save_gpio_status(ice); 283 snd_ice1712_save_gpio_status(ice);
284 priv->cs_mask = 284 priv->cs_mask =
@@ -289,7 +289,7 @@ static void vx442_ak4524_lock(akm4xxx_t *ak, int chip)
289/* 289/*
290 * change the DFS bit according rate for Delta1010 290 * change the DFS bit according rate for Delta1010
291 */ 291 */
292static void delta_1010_set_rate_val(ice1712_t *ice, unsigned int rate) 292static void delta_1010_set_rate_val(struct snd_ice1712 *ice, unsigned int rate)
293{ 293{
294 unsigned char tmp, tmp2; 294 unsigned char tmp, tmp2;
295 295
@@ -309,10 +309,10 @@ static void delta_1010_set_rate_val(ice1712_t *ice, unsigned int rate)
309/* 309/*
310 * change the rate of AK4524 on Delta 44/66, AP, 1010LT 310 * change the rate of AK4524 on Delta 44/66, AP, 1010LT
311 */ 311 */
312static void delta_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate) 312static void delta_ak4524_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate)
313{ 313{
314 unsigned char tmp, tmp2; 314 unsigned char tmp, tmp2;
315 ice1712_t *ice = ak->private_data[0]; 315 struct snd_ice1712 *ice = ak->private_data[0];
316 316
317 if (rate == 0) /* no hint - S/PDIF input is master, simply return */ 317 if (rate == 0) /* no hint - S/PDIF input is master, simply return */
318 return; 318 return;
@@ -341,7 +341,7 @@ static void delta_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate)
341/* 341/*
342 * change the rate of AK4524 on VX442 342 * change the rate of AK4524 on VX442
343 */ 343 */
344static void vx442_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate) 344static void vx442_ak4524_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate)
345{ 345{
346 unsigned char val; 346 unsigned char val;
347 347
@@ -361,13 +361,13 @@ static void vx442_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate)
361 */ 361 */
362 362
363/* open callback */ 363/* open callback */
364static void delta_open_spdif(ice1712_t *ice, snd_pcm_substream_t * substream) 364static void delta_open_spdif(struct snd_ice1712 *ice, struct snd_pcm_substream *substream)
365{ 365{
366 ice->spdif.cs8403_stream_bits = ice->spdif.cs8403_bits; 366 ice->spdif.cs8403_stream_bits = ice->spdif.cs8403_bits;
367} 367}
368 368
369/* set up */ 369/* set up */
370static void delta_setup_spdif(ice1712_t *ice, int rate) 370static void delta_setup_spdif(struct snd_ice1712 *ice, int rate)
371{ 371{
372 unsigned long flags; 372 unsigned long flags;
373 unsigned int tmp; 373 unsigned int tmp;
@@ -396,7 +396,7 @@ static void delta_setup_spdif(ice1712_t *ice, int rate)
396 * initialize the chips on M-Audio cards 396 * initialize the chips on M-Audio cards
397 */ 397 */
398 398
399static akm4xxx_t akm_audiophile __devinitdata = { 399static struct snd_akm4xxx akm_audiophile __devinitdata = {
400 .type = SND_AK4528, 400 .type = SND_AK4528,
401 .num_adcs = 2, 401 .num_adcs = 2,
402 .num_dacs = 2, 402 .num_dacs = 2,
@@ -417,7 +417,7 @@ static struct snd_ak4xxx_private akm_audiophile_priv __devinitdata = {
417 .mask_flags = 0, 417 .mask_flags = 0,
418}; 418};
419 419
420static akm4xxx_t akm_delta410 __devinitdata = { 420static struct snd_akm4xxx akm_delta410 __devinitdata = {
421 .type = SND_AK4529, 421 .type = SND_AK4529,
422 .num_adcs = 2, 422 .num_adcs = 2,
423 .num_dacs = 8, 423 .num_dacs = 8,
@@ -438,7 +438,7 @@ static struct snd_ak4xxx_private akm_delta410_priv __devinitdata = {
438 .mask_flags = 0, 438 .mask_flags = 0,
439}; 439};
440 440
441static akm4xxx_t akm_delta1010lt __devinitdata = { 441static struct snd_akm4xxx akm_delta1010lt __devinitdata = {
442 .type = SND_AK4524, 442 .type = SND_AK4524,
443 .num_adcs = 8, 443 .num_adcs = 8,
444 .num_dacs = 8, 444 .num_dacs = 8,
@@ -460,7 +460,7 @@ static struct snd_ak4xxx_private akm_delta1010lt_priv __devinitdata = {
460 .mask_flags = 0, 460 .mask_flags = 0,
461}; 461};
462 462
463static akm4xxx_t akm_delta44 __devinitdata = { 463static struct snd_akm4xxx akm_delta44 __devinitdata = {
464 .type = SND_AK4524, 464 .type = SND_AK4524,
465 .num_adcs = 4, 465 .num_adcs = 4,
466 .num_dacs = 4, 466 .num_dacs = 4,
@@ -482,7 +482,7 @@ static struct snd_ak4xxx_private akm_delta44_priv __devinitdata = {
482 .mask_flags = 0, 482 .mask_flags = 0,
483}; 483};
484 484
485static akm4xxx_t akm_vx442 __devinitdata = { 485static struct snd_akm4xxx akm_vx442 __devinitdata = {
486 .type = SND_AK4524, 486 .type = SND_AK4524,
487 .num_adcs = 4, 487 .num_adcs = 4,
488 .num_dacs = 4, 488 .num_dacs = 4,
@@ -504,10 +504,10 @@ static struct snd_ak4xxx_private akm_vx442_priv __devinitdata = {
504 .mask_flags = 0, 504 .mask_flags = 0,
505}; 505};
506 506
507static int __devinit snd_ice1712_delta_init(ice1712_t *ice) 507static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
508{ 508{
509 int err; 509 int err;
510 akm4xxx_t *ak; 510 struct snd_akm4xxx *ak;
511 511
512 /* determine I2C, DACs and ADCs */ 512 /* determine I2C, DACs and ADCs */
513 switch (ice->eeprom.subvendor) { 513 switch (ice->eeprom.subvendor) {
@@ -582,7 +582,7 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice)
582 } 582 }
583 583
584 /* second stage of initialization, analog parts and others */ 584 /* second stage of initialization, analog parts and others */
585 ak = ice->akm = kmalloc(sizeof(akm4xxx_t), GFP_KERNEL); 585 ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
586 if (! ak) 586 if (! ak)
587 return -ENOMEM; 587 return -ENOMEM;
588 ice->akm_codecs = 1; 588 ice->akm_codecs = 1;
@@ -617,19 +617,19 @@ static int __devinit snd_ice1712_delta_init(ice1712_t *ice)
617 * additional controls for M-Audio cards 617 * additional controls for M-Audio cards
618 */ 618 */
619 619
620static snd_kcontrol_new_t snd_ice1712_delta1010_wordclock_select __devinitdata = 620static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select __devinitdata =
621ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0); 621ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0);
622static snd_kcontrol_new_t snd_ice1712_delta1010lt_wordclock_select __devinitdata = 622static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select __devinitdata =
623ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 1, 0); 623ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 1, 0);
624static snd_kcontrol_new_t snd_ice1712_delta1010_wordclock_status __devinitdata = 624static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status __devinitdata =
625ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Status", 0, ICE1712_DELTA_WORD_CLOCK_STATUS, 1, SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE); 625ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Status", 0, ICE1712_DELTA_WORD_CLOCK_STATUS, 1, SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE);
626static snd_kcontrol_new_t snd_ice1712_deltadio2496_spdif_in_select __devinitdata = 626static struct snd_kcontrol_new snd_ice1712_deltadio2496_spdif_in_select __devinitdata =
627ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, ICE1712_DELTA_SPDIF_INPUT_SELECT, 0, 0); 627ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, ICE1712_DELTA_SPDIF_INPUT_SELECT, 0, 0);
628static snd_kcontrol_new_t snd_ice1712_delta_spdif_in_status __devinitdata = 628static struct snd_kcontrol_new snd_ice1712_delta_spdif_in_status __devinitdata =
629ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Delta IEC958 Input Status", 0, ICE1712_DELTA_SPDIF_IN_STAT, 1, SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE); 629ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Delta IEC958 Input Status", 0, ICE1712_DELTA_SPDIF_IN_STAT, 1, SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE);
630 630
631 631
632static int __devinit snd_ice1712_delta_add_controls(ice1712_t *ice) 632static int __devinit snd_ice1712_delta_add_controls(struct snd_ice1712 *ice)
633{ 633{
634 int err; 634 int err;
635 635
diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c
index c8ec5cac3c17..2127d57da190 100644
--- a/sound/pci/ice1712/ews.c
+++ b/sound/pci/ice1712/ews.c
@@ -50,9 +50,9 @@ enum {
50 */ 50 */
51 51
52/* send SDA and SCL */ 52/* send SDA and SCL */
53static void ewx_i2c_setlines(snd_i2c_bus_t *bus, int clk, int data) 53static void ewx_i2c_setlines(struct snd_i2c_bus *bus, int clk, int data)
54{ 54{
55 ice1712_t *ice = bus->private_data; 55 struct snd_ice1712 *ice = bus->private_data;
56 unsigned char tmp = 0; 56 unsigned char tmp = 0;
57 if (clk) 57 if (clk)
58 tmp |= ICE1712_EWX2496_SERIAL_CLOCK; 58 tmp |= ICE1712_EWX2496_SERIAL_CLOCK;
@@ -62,15 +62,15 @@ static void ewx_i2c_setlines(snd_i2c_bus_t *bus, int clk, int data)
62 udelay(5); 62 udelay(5);
63} 63}
64 64
65static int ewx_i2c_getclock(snd_i2c_bus_t *bus) 65static int ewx_i2c_getclock(struct snd_i2c_bus *bus)
66{ 66{
67 ice1712_t *ice = bus->private_data; 67 struct snd_ice1712 *ice = bus->private_data;
68 return snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & ICE1712_EWX2496_SERIAL_CLOCK ? 1 : 0; 68 return snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & ICE1712_EWX2496_SERIAL_CLOCK ? 1 : 0;
69} 69}
70 70
71static int ewx_i2c_getdata(snd_i2c_bus_t *bus, int ack) 71static int ewx_i2c_getdata(struct snd_i2c_bus *bus, int ack)
72{ 72{
73 ice1712_t *ice = bus->private_data; 73 struct snd_ice1712 *ice = bus->private_data;
74 int bit; 74 int bit;
75 /* set RW pin to low */ 75 /* set RW pin to low */
76 snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~ICE1712_EWX2496_RW); 76 snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~ICE1712_EWX2496_RW);
@@ -85,9 +85,9 @@ static int ewx_i2c_getdata(snd_i2c_bus_t *bus, int ack)
85 return bit; 85 return bit;
86} 86}
87 87
88static void ewx_i2c_start(snd_i2c_bus_t *bus) 88static void ewx_i2c_start(struct snd_i2c_bus *bus)
89{ 89{
90 ice1712_t *ice = bus->private_data; 90 struct snd_ice1712 *ice = bus->private_data;
91 unsigned char mask; 91 unsigned char mask;
92 92
93 snd_ice1712_save_gpio_status(ice); 93 snd_ice1712_save_gpio_status(ice);
@@ -104,15 +104,15 @@ static void ewx_i2c_start(snd_i2c_bus_t *bus)
104 snd_ice1712_gpio_write_bits(ice, mask, mask); 104 snd_ice1712_gpio_write_bits(ice, mask, mask);
105} 105}
106 106
107static void ewx_i2c_stop(snd_i2c_bus_t *bus) 107static void ewx_i2c_stop(struct snd_i2c_bus *bus)
108{ 108{
109 ice1712_t *ice = bus->private_data; 109 struct snd_ice1712 *ice = bus->private_data;
110 snd_ice1712_restore_gpio_status(ice); 110 snd_ice1712_restore_gpio_status(ice);
111} 111}
112 112
113static void ewx_i2c_direction(snd_i2c_bus_t *bus, int clock, int data) 113static void ewx_i2c_direction(struct snd_i2c_bus *bus, int clock, int data)
114{ 114{
115 ice1712_t *ice = bus->private_data; 115 struct snd_ice1712 *ice = bus->private_data;
116 unsigned char mask = 0; 116 unsigned char mask = 0;
117 117
118 if (clock) 118 if (clock)
@@ -125,7 +125,7 @@ static void ewx_i2c_direction(snd_i2c_bus_t *bus, int clock, int data)
125 snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~mask); 125 snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~mask);
126} 126}
127 127
128static snd_i2c_bit_ops_t snd_ice1712_ewx_cs8427_bit_ops = { 128static struct snd_i2c_bit_ops snd_ice1712_ewx_cs8427_bit_ops = {
129 .start = ewx_i2c_start, 129 .start = ewx_i2c_start,
130 .stop = ewx_i2c_stop, 130 .stop = ewx_i2c_stop,
131 .direction = ewx_i2c_direction, 131 .direction = ewx_i2c_direction,
@@ -140,7 +140,7 @@ static snd_i2c_bit_ops_t snd_ice1712_ewx_cs8427_bit_ops = {
140 */ 140 */
141 141
142/* AK4524 chip select; address 0x48 bit 0-3 */ 142/* AK4524 chip select; address 0x48 bit 0-3 */
143static int snd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask) 143static int snd_ice1712_ews88mt_chip_select(struct snd_ice1712 *ice, int chip_mask)
144{ 144{
145 unsigned char data, ndata; 145 unsigned char data, ndata;
146 146
@@ -162,9 +162,9 @@ static int snd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask)
162} 162}
163 163
164/* start callback for EWS88MT, needs to select a certain chip mask */ 164/* start callback for EWS88MT, needs to select a certain chip mask */
165static void ews88mt_ak4524_lock(akm4xxx_t *ak, int chip) 165static void ews88mt_ak4524_lock(struct snd_akm4xxx *ak, int chip)
166{ 166{
167 ice1712_t *ice = ak->private_data[0]; 167 struct snd_ice1712 *ice = ak->private_data[0];
168 unsigned char tmp; 168 unsigned char tmp;
169 /* assert AK4524 CS */ 169 /* assert AK4524 CS */
170 if (snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f) < 0) 170 if (snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f) < 0)
@@ -179,18 +179,18 @@ static void ews88mt_ak4524_lock(akm4xxx_t *ak, int chip)
179} 179}
180 180
181/* stop callback for EWS88MT, needs to deselect chip mask */ 181/* stop callback for EWS88MT, needs to deselect chip mask */
182static void ews88mt_ak4524_unlock(akm4xxx_t *ak, int chip) 182static void ews88mt_ak4524_unlock(struct snd_akm4xxx *ak, int chip)
183{ 183{
184 ice1712_t *ice = ak->private_data[0]; 184 struct snd_ice1712 *ice = ak->private_data[0];
185 snd_ice1712_restore_gpio_status(ice); 185 snd_ice1712_restore_gpio_status(ice);
186 udelay(1); 186 udelay(1);
187 snd_ice1712_ews88mt_chip_select(ice, 0x0f); 187 snd_ice1712_ews88mt_chip_select(ice, 0x0f);
188} 188}
189 189
190/* start callback for EWX24/96 */ 190/* start callback for EWX24/96 */
191static void ewx2496_ak4524_lock(akm4xxx_t *ak, int chip) 191static void ewx2496_ak4524_lock(struct snd_akm4xxx *ak, int chip)
192{ 192{
193 ice1712_t *ice = ak->private_data[0]; 193 struct snd_ice1712 *ice = ak->private_data[0];
194 unsigned char tmp; 194 unsigned char tmp;
195 snd_ice1712_save_gpio_status(ice); 195 snd_ice1712_save_gpio_status(ice);
196 tmp = ICE1712_EWX2496_SERIAL_DATA | 196 tmp = ICE1712_EWX2496_SERIAL_DATA |
@@ -203,10 +203,10 @@ static void ewx2496_ak4524_lock(akm4xxx_t *ak, int chip)
203} 203}
204 204
205/* start callback for DMX 6fire */ 205/* start callback for DMX 6fire */
206static void dmx6fire_ak4524_lock(akm4xxx_t *ak, int chip) 206static void dmx6fire_ak4524_lock(struct snd_akm4xxx *ak, int chip)
207{ 207{
208 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; 208 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
209 ice1712_t *ice = ak->private_data[0]; 209 struct snd_ice1712 *ice = ak->private_data[0];
210 unsigned char tmp; 210 unsigned char tmp;
211 snd_ice1712_save_gpio_status(ice); 211 snd_ice1712_save_gpio_status(ice);
212 tmp = priv->cs_mask = priv->cs_addr = (1 << chip) & ICE1712_6FIRE_AK4524_CS_MASK; 212 tmp = priv->cs_mask = priv->cs_addr = (1 << chip) & ICE1712_6FIRE_AK4524_CS_MASK;
@@ -222,7 +222,7 @@ static void dmx6fire_ak4524_lock(akm4xxx_t *ak, int chip)
222 * CS8404 interface on EWS88MT/D 222 * CS8404 interface on EWS88MT/D
223 */ 223 */
224 224
225static void snd_ice1712_ews_cs8404_spdif_write(ice1712_t *ice, unsigned char bits) 225static void snd_ice1712_ews_cs8404_spdif_write(struct snd_ice1712 *ice, unsigned char bits)
226{ 226{
227 unsigned char bytes[2]; 227 unsigned char bytes[2];
228 228
@@ -251,12 +251,12 @@ static void snd_ice1712_ews_cs8404_spdif_write(ice1712_t *ice, unsigned char bit
251/* 251/*
252 */ 252 */
253 253
254static void ews88_spdif_default_get(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) 254static void ews88_spdif_default_get(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
255{ 255{
256 snd_cs8404_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_bits); 256 snd_cs8404_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_bits);
257} 257}
258 258
259static int ews88_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) 259static int ews88_spdif_default_put(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
260{ 260{
261 unsigned int val; 261 unsigned int val;
262 int change; 262 int change;
@@ -274,12 +274,12 @@ static int ews88_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontr
274 return change; 274 return change;
275} 275}
276 276
277static void ews88_spdif_stream_get(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) 277static void ews88_spdif_stream_get(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
278{ 278{
279 snd_cs8404_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_stream_bits); 279 snd_cs8404_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_stream_bits);
280} 280}
281 281
282static int ews88_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) 282static int ews88_spdif_stream_put(struct snd_ice1712 *ice, struct snd_ctl_elem_value *ucontrol)
283{ 283{
284 unsigned int val; 284 unsigned int val;
285 int change; 285 int change;
@@ -299,13 +299,13 @@ static int ews88_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontro
299 299
300 300
301/* open callback */ 301/* open callback */
302static void ews88_open_spdif(ice1712_t *ice, snd_pcm_substream_t * substream) 302static void ews88_open_spdif(struct snd_ice1712 *ice, struct snd_pcm_substream *substream)
303{ 303{
304 ice->spdif.cs8403_stream_bits = ice->spdif.cs8403_bits; 304 ice->spdif.cs8403_stream_bits = ice->spdif.cs8403_bits;
305} 305}
306 306
307/* set up SPDIF for EWS88MT / EWS88D */ 307/* set up SPDIF for EWS88MT / EWS88D */
308static void ews88_setup_spdif(ice1712_t *ice, int rate) 308static void ews88_setup_spdif(struct snd_ice1712 *ice, int rate)
309{ 309{
310 unsigned long flags; 310 unsigned long flags;
311 unsigned char tmp; 311 unsigned char tmp;
@@ -332,7 +332,7 @@ static void ews88_setup_spdif(ice1712_t *ice, int rate)
332 332
333/* 333/*
334 */ 334 */
335static akm4xxx_t akm_ews88mt __devinitdata = { 335static struct snd_akm4xxx akm_ews88mt __devinitdata = {
336 .num_adcs = 8, 336 .num_adcs = 8,
337 .num_dacs = 8, 337 .num_dacs = 8,
338 .type = SND_AK4524, 338 .type = SND_AK4524,
@@ -354,7 +354,7 @@ static struct snd_ak4xxx_private akm_ews88mt_priv __devinitdata = {
354 .mask_flags = 0, 354 .mask_flags = 0,
355}; 355};
356 356
357static akm4xxx_t akm_ewx2496 __devinitdata = { 357static struct snd_akm4xxx akm_ewx2496 __devinitdata = {
358 .num_adcs = 2, 358 .num_adcs = 2,
359 .num_dacs = 2, 359 .num_dacs = 2,
360 .type = SND_AK4524, 360 .type = SND_AK4524,
@@ -375,7 +375,7 @@ static struct snd_ak4xxx_private akm_ewx2496_priv __devinitdata = {
375 .mask_flags = 0, 375 .mask_flags = 0,
376}; 376};
377 377
378static akm4xxx_t akm_6fire __devinitdata = { 378static struct snd_akm4xxx akm_6fire __devinitdata = {
379 .num_adcs = 6, 379 .num_adcs = 6,
380 .num_dacs = 6, 380 .num_dacs = 6,
381 .type = SND_AK4524, 381 .type = SND_AK4524,
@@ -406,12 +406,12 @@ static struct snd_ak4xxx_private akm_6fire_priv __devinitdata = {
406#define PCF9554_REG_POLARITY 2 406#define PCF9554_REG_POLARITY 2
407#define PCF9554_REG_CONFIG 3 407#define PCF9554_REG_CONFIG 3
408 408
409static int snd_ice1712_6fire_write_pca(ice1712_t *ice, unsigned char reg, unsigned char data); 409static int snd_ice1712_6fire_write_pca(struct snd_ice1712 *ice, unsigned char reg, unsigned char data);
410 410
411static int __devinit snd_ice1712_ews_init(ice1712_t *ice) 411static int __devinit snd_ice1712_ews_init(struct snd_ice1712 *ice)
412{ 412{
413 int err; 413 int err;
414 akm4xxx_t *ak; 414 struct snd_akm4xxx *ak;
415 415
416 /* set the analog DACs */ 416 /* set the analog DACs */
417 switch (ice->eeprom.subvendor) { 417 switch (ice->eeprom.subvendor) {
@@ -507,7 +507,7 @@ static int __devinit snd_ice1712_ews_init(ice1712_t *ice)
507 } 507 }
508 508
509 /* analog section */ 509 /* analog section */
510 ak = ice->akm = kmalloc(sizeof(akm4xxx_t), GFP_KERNEL); 510 ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
511 if (! ak) 511 if (! ak)
512 return -ENOMEM; 512 return -ENOMEM;
513 ice->akm_codecs = 1; 513 ice->akm_codecs = 1;
@@ -536,7 +536,7 @@ static int __devinit snd_ice1712_ews_init(ice1712_t *ice)
536 */ 536 */
537 537
538/* i/o sensitivity - this callback is shared among other devices, too */ 538/* i/o sensitivity - this callback is shared among other devices, too */
539static int snd_ice1712_ewx_io_sense_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo){ 539static int snd_ice1712_ewx_io_sense_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo){
540 540
541 static char *texts[2] = { 541 static char *texts[2] = {
542 "+4dBu", "-10dBV", 542 "+4dBu", "-10dBV",
@@ -550,9 +550,9 @@ static int snd_ice1712_ewx_io_sense_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_
550 return 0; 550 return 0;
551} 551}
552 552
553static int snd_ice1712_ewx_io_sense_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 553static int snd_ice1712_ewx_io_sense_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
554{ 554{
555 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 555 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
556 unsigned char mask = kcontrol->private_value & 0xff; 556 unsigned char mask = kcontrol->private_value & 0xff;
557 557
558 snd_ice1712_save_gpio_status(ice); 558 snd_ice1712_save_gpio_status(ice);
@@ -561,9 +561,9 @@ static int snd_ice1712_ewx_io_sense_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_
561 return 0; 561 return 0;
562} 562}
563 563
564static int snd_ice1712_ewx_io_sense_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 564static int snd_ice1712_ewx_io_sense_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
565{ 565{
566 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 566 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
567 unsigned char mask = kcontrol->private_value & 0xff; 567 unsigned char mask = kcontrol->private_value & 0xff;
568 int val, nval; 568 int val, nval;
569 569
@@ -578,7 +578,7 @@ static int snd_ice1712_ewx_io_sense_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_
578 return val != nval; 578 return val != nval;
579} 579}
580 580
581static snd_kcontrol_new_t snd_ice1712_ewx2496_controls[] __devinitdata = { 581static struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] __devinitdata = {
582 { 582 {
583 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 583 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
584 .name = "Input Sensitivity Switch", 584 .name = "Input Sensitivity Switch",
@@ -602,9 +602,9 @@ static snd_kcontrol_new_t snd_ice1712_ewx2496_controls[] __devinitdata = {
602 * EWS88MT specific controls 602 * EWS88MT specific controls
603 */ 603 */
604/* analog output sensitivity;; address 0x48 bit 6 */ 604/* analog output sensitivity;; address 0x48 bit 6 */
605static int snd_ice1712_ews88mt_output_sense_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 605static int snd_ice1712_ews88mt_output_sense_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
606{ 606{
607 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 607 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
608 unsigned char data; 608 unsigned char data;
609 609
610 snd_i2c_lock(ice->i2c); 610 snd_i2c_lock(ice->i2c);
@@ -618,9 +618,9 @@ static int snd_ice1712_ews88mt_output_sense_get(snd_kcontrol_t *kcontrol, snd_ct
618} 618}
619 619
620/* analog output sensitivity;; address 0x48 bit 6 */ 620/* analog output sensitivity;; address 0x48 bit 6 */
621static int snd_ice1712_ews88mt_output_sense_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 621static int snd_ice1712_ews88mt_output_sense_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
622{ 622{
623 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 623 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
624 unsigned char data, ndata; 624 unsigned char data, ndata;
625 625
626 snd_i2c_lock(ice->i2c); 626 snd_i2c_lock(ice->i2c);
@@ -638,9 +638,9 @@ static int snd_ice1712_ews88mt_output_sense_put(snd_kcontrol_t *kcontrol, snd_ct
638} 638}
639 639
640/* analog input sensitivity; address 0x46 */ 640/* analog input sensitivity; address 0x46 */
641static int snd_ice1712_ews88mt_input_sense_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 641static int snd_ice1712_ews88mt_input_sense_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
642{ 642{
643 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 643 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
644 int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 644 int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
645 unsigned char data; 645 unsigned char data;
646 646
@@ -657,9 +657,9 @@ static int snd_ice1712_ews88mt_input_sense_get(snd_kcontrol_t *kcontrol, snd_ctl
657} 657}
658 658
659/* analog output sensitivity; address 0x46 */ 659/* analog output sensitivity; address 0x46 */
660static int snd_ice1712_ews88mt_input_sense_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 660static int snd_ice1712_ews88mt_input_sense_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
661{ 661{
662 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 662 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
663 int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 663 int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
664 unsigned char data, ndata; 664 unsigned char data, ndata;
665 665
@@ -678,7 +678,7 @@ static int snd_ice1712_ews88mt_input_sense_put(snd_kcontrol_t *kcontrol, snd_ctl
678 return ndata != data; 678 return ndata != data;
679} 679}
680 680
681static snd_kcontrol_new_t snd_ice1712_ews88mt_input_sense __devinitdata = { 681static struct snd_kcontrol_new snd_ice1712_ews88mt_input_sense __devinitdata = {
682 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 682 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
683 .name = "Input Sensitivity Switch", 683 .name = "Input Sensitivity Switch",
684 .info = snd_ice1712_ewx_io_sense_info, 684 .info = snd_ice1712_ewx_io_sense_info,
@@ -687,7 +687,7 @@ static snd_kcontrol_new_t snd_ice1712_ews88mt_input_sense __devinitdata = {
687 .count = 8, 687 .count = 8,
688}; 688};
689 689
690static snd_kcontrol_new_t snd_ice1712_ews88mt_output_sense __devinitdata = { 690static struct snd_kcontrol_new snd_ice1712_ews88mt_output_sense __devinitdata = {
691 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 691 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
692 .name = "Output Sensitivity Switch", 692 .name = "Output Sensitivity Switch",
693 .info = snd_ice1712_ewx_io_sense_info, 693 .info = snd_ice1712_ewx_io_sense_info,
@@ -700,7 +700,7 @@ static snd_kcontrol_new_t snd_ice1712_ews88mt_output_sense __devinitdata = {
700 * EWS88D specific controls 700 * EWS88D specific controls
701 */ 701 */
702 702
703static int snd_ice1712_ews88d_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 703static int snd_ice1712_ews88d_control_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
704{ 704{
705 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 705 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
706 uinfo->count = 1; 706 uinfo->count = 1;
@@ -709,9 +709,9 @@ static int snd_ice1712_ews88d_control_info(snd_kcontrol_t *kcontrol, snd_ctl_ele
709 return 0; 709 return 0;
710} 710}
711 711
712static int snd_ice1712_ews88d_control_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 712static int snd_ice1712_ews88d_control_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
713{ 713{
714 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 714 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
715 int shift = kcontrol->private_value & 0xff; 715 int shift = kcontrol->private_value & 0xff;
716 int invert = (kcontrol->private_value >> 8) & 1; 716 int invert = (kcontrol->private_value >> 8) & 1;
717 unsigned char data[2]; 717 unsigned char data[2];
@@ -729,9 +729,9 @@ static int snd_ice1712_ews88d_control_get(snd_kcontrol_t *kcontrol, snd_ctl_elem
729 return 0; 729 return 0;
730} 730}
731 731
732static int snd_ice1712_ews88d_control_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 732static int snd_ice1712_ews88d_control_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
733{ 733{
734 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 734 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
735 int shift = kcontrol->private_value & 0xff; 735 int shift = kcontrol->private_value & 0xff;
736 int invert = (kcontrol->private_value >> 8) & 1; 736 int invert = (kcontrol->private_value >> 8) & 1;
737 unsigned char data[2], ndata[2]; 737 unsigned char data[2], ndata[2];
@@ -769,7 +769,7 @@ static int snd_ice1712_ews88d_control_put(snd_kcontrol_t * kcontrol, snd_ctl_ele
769 .private_value = xshift | (xinvert << 8),\ 769 .private_value = xshift | (xinvert << 8),\
770} 770}
771 771
772static snd_kcontrol_new_t snd_ice1712_ews88d_controls[] __devinitdata = { 772static struct snd_kcontrol_new snd_ice1712_ews88d_controls[] __devinitdata = {
773 EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, 1, 0), /* inverted */ 773 EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, 1, 0), /* inverted */
774 EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT Output Optical", 1, 0, 0), 774 EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT Output Optical", 1, 0, 0),
775 EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT External Master Clock", 2, 0, 0), 775 EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT External Master Clock", 2, 0, 0),
@@ -782,7 +782,7 @@ static snd_kcontrol_new_t snd_ice1712_ews88d_controls[] __devinitdata = {
782 * DMX 6Fire specific controls 782 * DMX 6Fire specific controls
783 */ 783 */
784 784
785static int snd_ice1712_6fire_read_pca(ice1712_t *ice, unsigned char reg) 785static int snd_ice1712_6fire_read_pca(struct snd_ice1712 *ice, unsigned char reg)
786{ 786{
787 unsigned char byte; 787 unsigned char byte;
788 snd_i2c_lock(ice->i2c); 788 snd_i2c_lock(ice->i2c);
@@ -798,7 +798,7 @@ static int snd_ice1712_6fire_read_pca(ice1712_t *ice, unsigned char reg)
798 return byte; 798 return byte;
799} 799}
800 800
801static int snd_ice1712_6fire_write_pca(ice1712_t *ice, unsigned char reg, unsigned char data) 801static int snd_ice1712_6fire_write_pca(struct snd_ice1712 *ice, unsigned char reg, unsigned char data)
802{ 802{
803 unsigned char bytes[2]; 803 unsigned char bytes[2];
804 snd_i2c_lock(ice->i2c); 804 snd_i2c_lock(ice->i2c);
@@ -812,7 +812,7 @@ static int snd_ice1712_6fire_write_pca(ice1712_t *ice, unsigned char reg, unsign
812 return 0; 812 return 0;
813} 813}
814 814
815static int snd_ice1712_6fire_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 815static int snd_ice1712_6fire_control_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
816{ 816{
817 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 817 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
818 uinfo->count = 1; 818 uinfo->count = 1;
@@ -821,9 +821,9 @@ static int snd_ice1712_6fire_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem
821 return 0; 821 return 0;
822} 822}
823 823
824static int snd_ice1712_6fire_control_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 824static int snd_ice1712_6fire_control_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
825{ 825{
826 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 826 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
827 int shift = kcontrol->private_value & 0xff; 827 int shift = kcontrol->private_value & 0xff;
828 int invert = (kcontrol->private_value >> 8) & 1; 828 int invert = (kcontrol->private_value >> 8) & 1;
829 int data; 829 int data;
@@ -837,9 +837,9 @@ static int snd_ice1712_6fire_control_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_
837 return 0; 837 return 0;
838} 838}
839 839
840static int snd_ice1712_6fire_control_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 840static int snd_ice1712_6fire_control_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
841{ 841{
842 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 842 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
843 int shift = kcontrol->private_value & 0xff; 843 int shift = kcontrol->private_value & 0xff;
844 int invert = (kcontrol->private_value >> 8) & 1; 844 int invert = (kcontrol->private_value >> 8) & 1;
845 int data, ndata; 845 int data, ndata;
@@ -858,7 +858,7 @@ static int snd_ice1712_6fire_control_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_
858 return 0; 858 return 0;
859} 859}
860 860
861static int snd_ice1712_6fire_select_input_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 861static int snd_ice1712_6fire_select_input_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
862{ 862{
863 static char *texts[4] = { 863 static char *texts[4] = {
864 "Internal", "Front Input", "Rear Input", "Wave Table" 864 "Internal", "Front Input", "Rear Input", "Wave Table"
@@ -872,9 +872,9 @@ static int snd_ice1712_6fire_select_input_info(snd_kcontrol_t *kcontrol, snd_ctl
872 return 0; 872 return 0;
873} 873}
874 874
875static int snd_ice1712_6fire_select_input_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 875static int snd_ice1712_6fire_select_input_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
876{ 876{
877 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 877 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
878 int data; 878 int data;
879 879
880 if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0) 880 if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
@@ -883,9 +883,9 @@ static int snd_ice1712_6fire_select_input_get(snd_kcontrol_t *kcontrol, snd_ctl_
883 return 0; 883 return 0;
884} 884}
885 885
886static int snd_ice1712_6fire_select_input_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 886static int snd_ice1712_6fire_select_input_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
887{ 887{
888 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 888 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
889 int data, ndata; 889 int data, ndata;
890 890
891 if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0) 891 if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
@@ -909,7 +909,7 @@ static int snd_ice1712_6fire_select_input_put(snd_kcontrol_t *kcontrol, snd_ctl_
909 .private_value = xshift | (xinvert << 8),\ 909 .private_value = xshift | (xinvert << 8),\
910} 910}
911 911
912static snd_kcontrol_new_t snd_ice1712_6fire_controls[] __devinitdata = { 912static struct snd_kcontrol_new snd_ice1712_6fire_controls[] __devinitdata = {
913 { 913 {
914 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 914 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
915 .name = "Analog Input Select", 915 .name = "Analog Input Select",
@@ -925,7 +925,7 @@ static snd_kcontrol_new_t snd_ice1712_6fire_controls[] __devinitdata = {
925}; 925};
926 926
927 927
928static int __devinit snd_ice1712_ews_add_controls(ice1712_t *ice) 928static int __devinit snd_ice1712_ews_add_controls(struct snd_ice1712 *ice)
929{ 929{
930 unsigned int idx; 930 unsigned int idx;
931 int err; 931 int err;
diff --git a/sound/pci/ice1712/hoontech.c b/sound/pci/ice1712/hoontech.c
index ab5fbd0bdfad..3f2f918536f5 100644
--- a/sound/pci/ice1712/hoontech.c
+++ b/sound/pci/ice1712/hoontech.c
@@ -33,7 +33,7 @@
33#include "hoontech.h" 33#include "hoontech.h"
34 34
35 35
36static void __devinit snd_ice1712_stdsp24_gpio_write(ice1712_t *ice, unsigned char byte) 36static void __devinit snd_ice1712_stdsp24_gpio_write(struct snd_ice1712 *ice, unsigned char byte)
37{ 37{
38 byte |= ICE1712_STDSP24_CLOCK_BIT; 38 byte |= ICE1712_STDSP24_CLOCK_BIT;
39 udelay(100); 39 udelay(100);
@@ -46,7 +46,7 @@ static void __devinit snd_ice1712_stdsp24_gpio_write(ice1712_t *ice, unsigned ch
46 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, byte); 46 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, byte);
47} 47}
48 48
49static void __devinit snd_ice1712_stdsp24_darear(ice1712_t *ice, int activate) 49static void __devinit snd_ice1712_stdsp24_darear(struct snd_ice1712 *ice, int activate)
50{ 50{
51 down(&ice->gpio_mutex); 51 down(&ice->gpio_mutex);
52 ICE1712_STDSP24_0_DAREAR(ice->spec.hoontech.boxbits, activate); 52 ICE1712_STDSP24_0_DAREAR(ice->spec.hoontech.boxbits, activate);
@@ -54,7 +54,7 @@ static void __devinit snd_ice1712_stdsp24_darear(ice1712_t *ice, int activate)
54 up(&ice->gpio_mutex); 54 up(&ice->gpio_mutex);
55} 55}
56 56
57static void __devinit snd_ice1712_stdsp24_mute(ice1712_t *ice, int activate) 57static void __devinit snd_ice1712_stdsp24_mute(struct snd_ice1712 *ice, int activate)
58{ 58{
59 down(&ice->gpio_mutex); 59 down(&ice->gpio_mutex);
60 ICE1712_STDSP24_3_MUTE(ice->spec.hoontech.boxbits, activate); 60 ICE1712_STDSP24_3_MUTE(ice->spec.hoontech.boxbits, activate);
@@ -62,7 +62,7 @@ static void __devinit snd_ice1712_stdsp24_mute(ice1712_t *ice, int activate)
62 up(&ice->gpio_mutex); 62 up(&ice->gpio_mutex);
63} 63}
64 64
65static void __devinit snd_ice1712_stdsp24_insel(ice1712_t *ice, int activate) 65static void __devinit snd_ice1712_stdsp24_insel(struct snd_ice1712 *ice, int activate)
66{ 66{
67 down(&ice->gpio_mutex); 67 down(&ice->gpio_mutex);
68 ICE1712_STDSP24_3_INSEL(ice->spec.hoontech.boxbits, activate); 68 ICE1712_STDSP24_3_INSEL(ice->spec.hoontech.boxbits, activate);
@@ -70,7 +70,7 @@ static void __devinit snd_ice1712_stdsp24_insel(ice1712_t *ice, int activate)
70 up(&ice->gpio_mutex); 70 up(&ice->gpio_mutex);
71} 71}
72 72
73static void __devinit snd_ice1712_stdsp24_box_channel(ice1712_t *ice, int box, int chn, int activate) 73static void __devinit snd_ice1712_stdsp24_box_channel(struct snd_ice1712 *ice, int box, int chn, int activate)
74{ 74{
75 down(&ice->gpio_mutex); 75 down(&ice->gpio_mutex);
76 76
@@ -118,7 +118,7 @@ static void __devinit snd_ice1712_stdsp24_box_channel(ice1712_t *ice, int box, i
118 up(&ice->gpio_mutex); 118 up(&ice->gpio_mutex);
119} 119}
120 120
121static void __devinit snd_ice1712_stdsp24_box_midi(ice1712_t *ice, int box, int master) 121static void __devinit snd_ice1712_stdsp24_box_midi(struct snd_ice1712 *ice, int box, int master)
122{ 122{
123 down(&ice->gpio_mutex); 123 down(&ice->gpio_mutex);
124 124
@@ -144,7 +144,7 @@ static void __devinit snd_ice1712_stdsp24_box_midi(ice1712_t *ice, int box, int
144 up(&ice->gpio_mutex); 144 up(&ice->gpio_mutex);
145} 145}
146 146
147static void __devinit snd_ice1712_stdsp24_midi2(ice1712_t *ice, int activate) 147static void __devinit snd_ice1712_stdsp24_midi2(struct snd_ice1712 *ice, int activate)
148{ 148{
149 down(&ice->gpio_mutex); 149 down(&ice->gpio_mutex);
150 ICE1712_STDSP24_3_MIDI2(ice->spec.hoontech.boxbits, activate); 150 ICE1712_STDSP24_3_MIDI2(ice->spec.hoontech.boxbits, activate);
@@ -152,7 +152,7 @@ static void __devinit snd_ice1712_stdsp24_midi2(ice1712_t *ice, int activate)
152 up(&ice->gpio_mutex); 152 up(&ice->gpio_mutex);
153} 153}
154 154
155static int __devinit snd_ice1712_hoontech_init(ice1712_t *ice) 155static int __devinit snd_ice1712_hoontech_init(struct snd_ice1712 *ice)
156{ 156{
157 int box, chn; 157 int box, chn;
158 158
@@ -221,9 +221,9 @@ static int __devinit snd_ice1712_hoontech_init(ice1712_t *ice)
221 */ 221 */
222 222
223/* start callback for STDSP24 with modified hardware */ 223/* start callback for STDSP24 with modified hardware */
224static void stdsp24_ak4524_lock(akm4xxx_t *ak, int chip) 224static void stdsp24_ak4524_lock(struct snd_akm4xxx *ak, int chip)
225{ 225{
226 ice1712_t *ice = ak->private_data[0]; 226 struct snd_ice1712 *ice = ak->private_data[0];
227 unsigned char tmp; 227 unsigned char tmp;
228 snd_ice1712_save_gpio_status(ice); 228 snd_ice1712_save_gpio_status(ice);
229 tmp = ICE1712_STDSP24_SERIAL_DATA | 229 tmp = ICE1712_STDSP24_SERIAL_DATA |
@@ -234,10 +234,10 @@ static void stdsp24_ak4524_lock(akm4xxx_t *ak, int chip)
234 snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~tmp); 234 snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~tmp);
235} 235}
236 236
237static int __devinit snd_ice1712_value_init(ice1712_t *ice) 237static int __devinit snd_ice1712_value_init(struct snd_ice1712 *ice)
238{ 238{
239 /* Hoontech STDSP24 with modified hardware */ 239 /* Hoontech STDSP24 with modified hardware */
240 static akm4xxx_t akm_stdsp24_mv __devinitdata = { 240 static struct snd_akm4xxx akm_stdsp24_mv __devinitdata = {
241 .num_adcs = 2, 241 .num_adcs = 2,
242 .num_dacs = 2, 242 .num_dacs = 2,
243 .type = SND_AK4524, 243 .type = SND_AK4524,
@@ -258,7 +258,7 @@ static int __devinit snd_ice1712_value_init(ice1712_t *ice)
258 }; 258 };
259 259
260 int err; 260 int err;
261 akm4xxx_t *ak; 261 struct snd_akm4xxx *ak;
262 262
263 /* set the analog DACs */ 263 /* set the analog DACs */
264 ice->num_total_dacs = 2; 264 ice->num_total_dacs = 2;
@@ -267,7 +267,7 @@ static int __devinit snd_ice1712_value_init(ice1712_t *ice)
267 ice->num_total_adcs = 2; 267 ice->num_total_adcs = 2;
268 268
269 /* analog section */ 269 /* analog section */
270 ak = ice->akm = kmalloc(sizeof(akm4xxx_t), GFP_KERNEL); 270 ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
271 if (! ak) 271 if (! ak)
272 return -ENOMEM; 272 return -ENOMEM;
273 ice->akm_codecs = 1; 273 ice->akm_codecs = 1;
@@ -284,7 +284,7 @@ static int __devinit snd_ice1712_value_init(ice1712_t *ice)
284 return 0; 284 return 0;
285} 285}
286 286
287static int __devinit snd_ice1712_ez8_init(ice1712_t *ice) 287static int __devinit snd_ice1712_ez8_init(struct snd_ice1712 *ice)
288{ 288{
289 ice->gpio.write_mask = ice->eeprom.gpiomask; 289 ice->gpio.write_mask = ice->eeprom.gpiomask;
290 ice->gpio.direction = ice->eeprom.gpiodir; 290 ice->gpio.direction = ice->eeprom.gpiodir;
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index b16c9c1c92c6..ef6f18558c95 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -108,8 +108,8 @@ static struct pci_device_id snd_ice1712_ids[] = {
108 108
109MODULE_DEVICE_TABLE(pci, snd_ice1712_ids); 109MODULE_DEVICE_TABLE(pci, snd_ice1712_ids);
110 110
111static int snd_ice1712_build_pro_mixer(ice1712_t *ice); 111static int snd_ice1712_build_pro_mixer(struct snd_ice1712 *ice);
112static int snd_ice1712_build_controls(ice1712_t *ice); 112static int snd_ice1712_build_controls(struct snd_ice1712 *ice);
113 113
114static int PRO_RATE_LOCKED; 114static int PRO_RATE_LOCKED;
115static int PRO_RATE_RESET = 1; 115static int PRO_RATE_RESET = 1;
@@ -120,33 +120,33 @@ static unsigned int PRO_RATE_DEFAULT = 44100;
120 */ 120 */
121 121
122/* check whether the clock mode is spdif-in */ 122/* check whether the clock mode is spdif-in */
123static inline int is_spdif_master(ice1712_t *ice) 123static inline int is_spdif_master(struct snd_ice1712 *ice)
124{ 124{
125 return (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER) ? 1 : 0; 125 return (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER) ? 1 : 0;
126} 126}
127 127
128static inline int is_pro_rate_locked(ice1712_t *ice) 128static inline int is_pro_rate_locked(struct snd_ice1712 *ice)
129{ 129{
130 return is_spdif_master(ice) || PRO_RATE_LOCKED; 130 return is_spdif_master(ice) || PRO_RATE_LOCKED;
131} 131}
132 132
133static inline void snd_ice1712_ds_write(ice1712_t * ice, u8 channel, u8 addr, u32 data) 133static inline void snd_ice1712_ds_write(struct snd_ice1712 * ice, u8 channel, u8 addr, u32 data)
134{ 134{
135 outb((channel << 4) | addr, ICEDS(ice, INDEX)); 135 outb((channel << 4) | addr, ICEDS(ice, INDEX));
136 outl(data, ICEDS(ice, DATA)); 136 outl(data, ICEDS(ice, DATA));
137} 137}
138 138
139static inline u32 snd_ice1712_ds_read(ice1712_t * ice, u8 channel, u8 addr) 139static inline u32 snd_ice1712_ds_read(struct snd_ice1712 * ice, u8 channel, u8 addr)
140{ 140{
141 outb((channel << 4) | addr, ICEDS(ice, INDEX)); 141 outb((channel << 4) | addr, ICEDS(ice, INDEX));
142 return inl(ICEDS(ice, DATA)); 142 return inl(ICEDS(ice, DATA));
143} 143}
144 144
145static void snd_ice1712_ac97_write(ac97_t *ac97, 145static void snd_ice1712_ac97_write(struct snd_ac97 *ac97,
146 unsigned short reg, 146 unsigned short reg,
147 unsigned short val) 147 unsigned short val)
148{ 148{
149 ice1712_t *ice = (ice1712_t *)ac97->private_data; 149 struct snd_ice1712 *ice = ac97->private_data;
150 int tm; 150 int tm;
151 unsigned char old_cmd = 0; 151 unsigned char old_cmd = 0;
152 152
@@ -167,10 +167,10 @@ static void snd_ice1712_ac97_write(ac97_t *ac97,
167 break; 167 break;
168} 168}
169 169
170static unsigned short snd_ice1712_ac97_read(ac97_t *ac97, 170static unsigned short snd_ice1712_ac97_read(struct snd_ac97 *ac97,
171 unsigned short reg) 171 unsigned short reg)
172{ 172{
173 ice1712_t *ice = (ice1712_t *)ac97->private_data; 173 struct snd_ice1712 *ice = ac97->private_data;
174 int tm; 174 int tm;
175 unsigned char old_cmd = 0; 175 unsigned char old_cmd = 0;
176 176
@@ -196,11 +196,11 @@ static unsigned short snd_ice1712_ac97_read(ac97_t *ac97,
196 * pro ac97 section 196 * pro ac97 section
197 */ 197 */
198 198
199static void snd_ice1712_pro_ac97_write(ac97_t *ac97, 199static void snd_ice1712_pro_ac97_write(struct snd_ac97 *ac97,
200 unsigned short reg, 200 unsigned short reg,
201 unsigned short val) 201 unsigned short val)
202{ 202{
203 ice1712_t *ice = (ice1712_t *)ac97->private_data; 203 struct snd_ice1712 *ice = ac97->private_data;
204 int tm; 204 int tm;
205 unsigned char old_cmd = 0; 205 unsigned char old_cmd = 0;
206 206
@@ -222,10 +222,10 @@ static void snd_ice1712_pro_ac97_write(ac97_t *ac97,
222} 222}
223 223
224 224
225static unsigned short snd_ice1712_pro_ac97_read(ac97_t *ac97, 225static unsigned short snd_ice1712_pro_ac97_read(struct snd_ac97 *ac97,
226 unsigned short reg) 226 unsigned short reg)
227{ 227{
228 ice1712_t *ice = (ice1712_t *)ac97->private_data; 228 struct snd_ice1712 *ice = ac97->private_data;
229 int tm; 229 int tm;
230 unsigned char old_cmd = 0; 230 unsigned char old_cmd = 0;
231 231
@@ -250,7 +250,7 @@ static unsigned short snd_ice1712_pro_ac97_read(ac97_t *ac97,
250/* 250/*
251 * consumer ac97 digital mix 251 * consumer ac97 digital mix
252 */ 252 */
253static int snd_ice1712_digmix_route_ac97_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 253static int snd_ice1712_digmix_route_ac97_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
254{ 254{
255 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 255 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
256 uinfo->count = 1; 256 uinfo->count = 1;
@@ -259,17 +259,17 @@ static int snd_ice1712_digmix_route_ac97_info(snd_kcontrol_t *kcontrol, snd_ctl_
259 return 0; 259 return 0;
260} 260}
261 261
262static int snd_ice1712_digmix_route_ac97_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 262static int snd_ice1712_digmix_route_ac97_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
263{ 263{
264 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 264 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
265 265
266 ucontrol->value.integer.value[0] = inb(ICEMT(ice, MONITOR_ROUTECTRL)) & ICE1712_ROUTE_AC97 ? 1 : 0; 266 ucontrol->value.integer.value[0] = inb(ICEMT(ice, MONITOR_ROUTECTRL)) & ICE1712_ROUTE_AC97 ? 1 : 0;
267 return 0; 267 return 0;
268} 268}
269 269
270static int snd_ice1712_digmix_route_ac97_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 270static int snd_ice1712_digmix_route_ac97_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
271{ 271{
272 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 272 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
273 unsigned char val, nval; 273 unsigned char val, nval;
274 274
275 spin_lock_irq(&ice->reg_lock); 275 spin_lock_irq(&ice->reg_lock);
@@ -281,7 +281,7 @@ static int snd_ice1712_digmix_route_ac97_put(snd_kcontrol_t *kcontrol, snd_ctl_e
281 return val != nval; 281 return val != nval;
282} 282}
283 283
284static snd_kcontrol_new_t snd_ice1712_mixer_digmix_route_ac97 __devinitdata = { 284static struct snd_kcontrol_new snd_ice1712_mixer_digmix_route_ac97 __devinitdata = {
285 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 285 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
286 .name = "Digital Mixer To AC97", 286 .name = "Digital Mixer To AC97",
287 .info = snd_ice1712_digmix_route_ac97_info, 287 .info = snd_ice1712_digmix_route_ac97_info,
@@ -293,24 +293,24 @@ static snd_kcontrol_new_t snd_ice1712_mixer_digmix_route_ac97 __devinitdata = {
293/* 293/*
294 * gpio operations 294 * gpio operations
295 */ 295 */
296static void snd_ice1712_set_gpio_dir(ice1712_t *ice, unsigned int data) 296static void snd_ice1712_set_gpio_dir(struct snd_ice1712 *ice, unsigned int data)
297{ 297{
298 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, data); 298 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, data);
299 inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */ 299 inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */
300} 300}
301 301
302static void snd_ice1712_set_gpio_mask(ice1712_t *ice, unsigned int data) 302static void snd_ice1712_set_gpio_mask(struct snd_ice1712 *ice, unsigned int data)
303{ 303{
304 snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, data); 304 snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, data);
305 inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */ 305 inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */
306} 306}
307 307
308static unsigned int snd_ice1712_get_gpio_data(ice1712_t *ice) 308static unsigned int snd_ice1712_get_gpio_data(struct snd_ice1712 *ice)
309{ 309{
310 return snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); 310 return snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
311} 311}
312 312
313static void snd_ice1712_set_gpio_data(ice1712_t *ice, unsigned int val) 313static void snd_ice1712_set_gpio_data(struct snd_ice1712 *ice, unsigned int val)
314{ 314{
315 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, val); 315 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, val);
316 inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */ 316 inb(ICEREG(ice, DATA)); /* dummy read for pci-posting */
@@ -327,7 +327,7 @@ static void snd_ice1712_set_gpio_data(ice1712_t *ice, unsigned int val)
327 * change the input clock selection 327 * change the input clock selection
328 * spdif_clock = 1 - IEC958 input, 0 - Envy24 328 * spdif_clock = 1 - IEC958 input, 0 - Envy24
329 */ 329 */
330static int snd_ice1712_cs8427_set_input_clock(ice1712_t *ice, int spdif_clock) 330static int snd_ice1712_cs8427_set_input_clock(struct snd_ice1712 *ice, int spdif_clock)
331{ 331{
332 unsigned char reg[2] = { 0x80 | 4, 0 }; /* CS8427 auto increment | register number 4 + data */ 332 unsigned char reg[2] = { 0x80 | 4, 0 }; /* CS8427 auto increment | register number 4 + data */
333 unsigned char val, nval; 333 unsigned char val, nval;
@@ -362,17 +362,17 @@ static int snd_ice1712_cs8427_set_input_clock(ice1712_t *ice, int spdif_clock)
362/* 362/*
363 * spdif callbacks 363 * spdif callbacks
364 */ 364 */
365static void open_cs8427(ice1712_t *ice, snd_pcm_substream_t * substream) 365static void open_cs8427(struct snd_ice1712 *ice, struct snd_pcm_substream *substream)
366{ 366{
367 snd_cs8427_iec958_active(ice->cs8427, 1); 367 snd_cs8427_iec958_active(ice->cs8427, 1);
368} 368}
369 369
370static void close_cs8427(ice1712_t *ice, snd_pcm_substream_t * substream) 370static void close_cs8427(struct snd_ice1712 *ice, struct snd_pcm_substream *substream)
371{ 371{
372 snd_cs8427_iec958_active(ice->cs8427, 0); 372 snd_cs8427_iec958_active(ice->cs8427, 0);
373} 373}
374 374
375static void setup_cs8427(ice1712_t *ice, int rate) 375static void setup_cs8427(struct snd_ice1712 *ice, int rate)
376{ 376{
377 snd_cs8427_iec958_pcm(ice->cs8427, rate); 377 snd_cs8427_iec958_pcm(ice->cs8427, rate);
378} 378}
@@ -380,7 +380,7 @@ static void setup_cs8427(ice1712_t *ice, int rate)
380/* 380/*
381 * create and initialize callbacks for cs8427 interface 381 * create and initialize callbacks for cs8427 interface
382 */ 382 */
383int __devinit snd_ice1712_init_cs8427(ice1712_t *ice, int addr) 383int __devinit snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr)
384{ 384{
385 int err; 385 int err;
386 386
@@ -403,7 +403,7 @@ int __devinit snd_ice1712_init_cs8427(ice1712_t *ice, int addr)
403 403
404static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *regs) 404static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *regs)
405{ 405{
406 ice1712_t *ice = dev_id; 406 struct snd_ice1712 *ice = dev_id;
407 unsigned char status; 407 unsigned char status;
408 int handled = 0; 408 int handled = 0;
409 409
@@ -444,7 +444,7 @@ static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *
444 if (status & ICE1712_IRQ_PBKDS) { 444 if (status & ICE1712_IRQ_PBKDS) {
445 u32 idx; 445 u32 idx;
446 u16 pbkstatus; 446 u16 pbkstatus;
447 snd_pcm_substream_t *substream; 447 struct snd_pcm_substream *substream;
448 pbkstatus = inw(ICEDS(ice, INTSTAT)); 448 pbkstatus = inw(ICEDS(ice, INTSTAT));
449 //printk("pbkstatus = 0x%x\n", pbkstatus); 449 //printk("pbkstatus = 0x%x\n", pbkstatus);
450 for (idx = 0; idx < 6; idx++) { 450 for (idx = 0; idx < 6; idx++) {
@@ -475,13 +475,13 @@ static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *
475 * PCM part - misc 475 * PCM part - misc
476 */ 476 */
477 477
478static int snd_ice1712_hw_params(snd_pcm_substream_t * substream, 478static int snd_ice1712_hw_params(struct snd_pcm_substream *substream,
479 snd_pcm_hw_params_t * hw_params) 479 struct snd_pcm_hw_params *hw_params)
480{ 480{
481 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 481 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
482} 482}
483 483
484static int snd_ice1712_hw_free(snd_pcm_substream_t * substream) 484static int snd_ice1712_hw_free(struct snd_pcm_substream *substream)
485{ 485{
486 return snd_pcm_lib_free_pages(substream); 486 return snd_pcm_lib_free_pages(substream);
487} 487}
@@ -490,10 +490,10 @@ static int snd_ice1712_hw_free(snd_pcm_substream_t * substream)
490 * PCM part - consumer I/O 490 * PCM part - consumer I/O
491 */ 491 */
492 492
493static int snd_ice1712_playback_trigger(snd_pcm_substream_t * substream, 493static int snd_ice1712_playback_trigger(struct snd_pcm_substream *substream,
494 int cmd) 494 int cmd)
495{ 495{
496 ice1712_t *ice = snd_pcm_substream_chip(substream); 496 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
497 int result = 0; 497 int result = 0;
498 u32 tmp; 498 u32 tmp;
499 499
@@ -515,10 +515,10 @@ static int snd_ice1712_playback_trigger(snd_pcm_substream_t * substream,
515 return result; 515 return result;
516} 516}
517 517
518static int snd_ice1712_playback_ds_trigger(snd_pcm_substream_t * substream, 518static int snd_ice1712_playback_ds_trigger(struct snd_pcm_substream *substream,
519 int cmd) 519 int cmd)
520{ 520{
521 ice1712_t *ice = snd_pcm_substream_chip(substream); 521 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
522 int result = 0; 522 int result = 0;
523 u32 tmp; 523 u32 tmp;
524 524
@@ -540,10 +540,10 @@ static int snd_ice1712_playback_ds_trigger(snd_pcm_substream_t * substream,
540 return result; 540 return result;
541} 541}
542 542
543static int snd_ice1712_capture_trigger(snd_pcm_substream_t * substream, 543static int snd_ice1712_capture_trigger(struct snd_pcm_substream *substream,
544 int cmd) 544 int cmd)
545{ 545{
546 ice1712_t *ice = snd_pcm_substream_chip(substream); 546 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
547 int result = 0; 547 int result = 0;
548 u8 tmp; 548 u8 tmp;
549 549
@@ -561,10 +561,10 @@ static int snd_ice1712_capture_trigger(snd_pcm_substream_t * substream,
561 return result; 561 return result;
562} 562}
563 563
564static int snd_ice1712_playback_prepare(snd_pcm_substream_t * substream) 564static int snd_ice1712_playback_prepare(struct snd_pcm_substream *substream)
565{ 565{
566 ice1712_t *ice = snd_pcm_substream_chip(substream); 566 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
567 snd_pcm_runtime_t *runtime = substream->runtime; 567 struct snd_pcm_runtime *runtime = substream->runtime;
568 u32 period_size, buf_size, rate, tmp; 568 u32 period_size, buf_size, rate, tmp;
569 569
570 period_size = (snd_pcm_lib_period_bytes(substream) >> 2) - 1; 570 period_size = (snd_pcm_lib_period_bytes(substream) >> 2) - 1;
@@ -594,10 +594,10 @@ static int snd_ice1712_playback_prepare(snd_pcm_substream_t * substream)
594 return 0; 594 return 0;
595} 595}
596 596
597static int snd_ice1712_playback_ds_prepare(snd_pcm_substream_t * substream) 597static int snd_ice1712_playback_ds_prepare(struct snd_pcm_substream *substream)
598{ 598{
599 ice1712_t *ice = snd_pcm_substream_chip(substream); 599 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
600 snd_pcm_runtime_t *runtime = substream->runtime; 600 struct snd_pcm_runtime *runtime = substream->runtime;
601 u32 period_size, buf_size, rate, tmp, chn; 601 u32 period_size, buf_size, rate, tmp, chn;
602 602
603 period_size = snd_pcm_lib_period_bytes(substream) - 1; 603 period_size = snd_pcm_lib_period_bytes(substream) - 1;
@@ -629,10 +629,10 @@ static int snd_ice1712_playback_ds_prepare(snd_pcm_substream_t * substream)
629 return 0; 629 return 0;
630} 630}
631 631
632static int snd_ice1712_capture_prepare(snd_pcm_substream_t * substream) 632static int snd_ice1712_capture_prepare(struct snd_pcm_substream *substream)
633{ 633{
634 ice1712_t *ice = snd_pcm_substream_chip(substream); 634 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
635 snd_pcm_runtime_t *runtime = substream->runtime; 635 struct snd_pcm_runtime *runtime = substream->runtime;
636 u32 period_size, buf_size; 636 u32 period_size, buf_size;
637 u8 tmp; 637 u8 tmp;
638 638
@@ -654,10 +654,10 @@ static int snd_ice1712_capture_prepare(snd_pcm_substream_t * substream)
654 return 0; 654 return 0;
655} 655}
656 656
657static snd_pcm_uframes_t snd_ice1712_playback_pointer(snd_pcm_substream_t * substream) 657static snd_pcm_uframes_t snd_ice1712_playback_pointer(struct snd_pcm_substream *substream)
658{ 658{
659 ice1712_t *ice = snd_pcm_substream_chip(substream); 659 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
660 snd_pcm_runtime_t *runtime = substream->runtime; 660 struct snd_pcm_runtime *runtime = substream->runtime;
661 size_t ptr; 661 size_t ptr;
662 662
663 if (!(snd_ice1712_read(ice, ICE1712_IREG_PBK_CTRL) & 1)) 663 if (!(snd_ice1712_read(ice, ICE1712_IREG_PBK_CTRL) & 1))
@@ -668,9 +668,9 @@ static snd_pcm_uframes_t snd_ice1712_playback_pointer(snd_pcm_substream_t * subs
668 return bytes_to_frames(substream->runtime, ptr); 668 return bytes_to_frames(substream->runtime, ptr);
669} 669}
670 670
671static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(snd_pcm_substream_t * substream) 671static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(struct snd_pcm_substream *substream)
672{ 672{
673 ice1712_t *ice = snd_pcm_substream_chip(substream); 673 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
674 u8 addr; 674 u8 addr;
675 size_t ptr; 675 size_t ptr;
676 676
@@ -687,9 +687,9 @@ static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(snd_pcm_substream_t * s
687 return bytes_to_frames(substream->runtime, ptr); 687 return bytes_to_frames(substream->runtime, ptr);
688} 688}
689 689
690static snd_pcm_uframes_t snd_ice1712_capture_pointer(snd_pcm_substream_t * substream) 690static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *substream)
691{ 691{
692 ice1712_t *ice = snd_pcm_substream_chip(substream); 692 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
693 size_t ptr; 693 size_t ptr;
694 694
695 if (!(snd_ice1712_read(ice, ICE1712_IREG_CAP_CTRL) & 1)) 695 if (!(snd_ice1712_read(ice, ICE1712_IREG_CAP_CTRL) & 1))
@@ -700,7 +700,7 @@ static snd_pcm_uframes_t snd_ice1712_capture_pointer(snd_pcm_substream_t * subst
700 return bytes_to_frames(substream->runtime, ptr); 700 return bytes_to_frames(substream->runtime, ptr);
701} 701}
702 702
703static snd_pcm_hardware_t snd_ice1712_playback = 703static struct snd_pcm_hardware snd_ice1712_playback =
704{ 704{
705 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 705 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
706 SNDRV_PCM_INFO_BLOCK_TRANSFER | 706 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -720,7 +720,7 @@ static snd_pcm_hardware_t snd_ice1712_playback =
720 .fifo_size = 0, 720 .fifo_size = 0,
721}; 721};
722 722
723static snd_pcm_hardware_t snd_ice1712_playback_ds = 723static struct snd_pcm_hardware snd_ice1712_playback_ds =
724{ 724{
725 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 725 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
726 SNDRV_PCM_INFO_BLOCK_TRANSFER | 726 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -740,7 +740,7 @@ static snd_pcm_hardware_t snd_ice1712_playback_ds =
740 .fifo_size = 0, 740 .fifo_size = 0,
741}; 741};
742 742
743static snd_pcm_hardware_t snd_ice1712_capture = 743static struct snd_pcm_hardware snd_ice1712_capture =
744{ 744{
745 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 745 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
746 SNDRV_PCM_INFO_BLOCK_TRANSFER | 746 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -759,20 +759,20 @@ static snd_pcm_hardware_t snd_ice1712_capture =
759 .fifo_size = 0, 759 .fifo_size = 0,
760}; 760};
761 761
762static int snd_ice1712_playback_open(snd_pcm_substream_t * substream) 762static int snd_ice1712_playback_open(struct snd_pcm_substream *substream)
763{ 763{
764 snd_pcm_runtime_t *runtime = substream->runtime; 764 struct snd_pcm_runtime *runtime = substream->runtime;
765 ice1712_t *ice = snd_pcm_substream_chip(substream); 765 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
766 766
767 ice->playback_con_substream = substream; 767 ice->playback_con_substream = substream;
768 runtime->hw = snd_ice1712_playback; 768 runtime->hw = snd_ice1712_playback;
769 return 0; 769 return 0;
770} 770}
771 771
772static int snd_ice1712_playback_ds_open(snd_pcm_substream_t * substream) 772static int snd_ice1712_playback_ds_open(struct snd_pcm_substream *substream)
773{ 773{
774 snd_pcm_runtime_t *runtime = substream->runtime; 774 struct snd_pcm_runtime *runtime = substream->runtime;
775 ice1712_t *ice = snd_pcm_substream_chip(substream); 775 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
776 u32 tmp; 776 u32 tmp;
777 777
778 ice->playback_con_substream_ds[substream->number] = substream; 778 ice->playback_con_substream_ds[substream->number] = substream;
@@ -784,10 +784,10 @@ static int snd_ice1712_playback_ds_open(snd_pcm_substream_t * substream)
784 return 0; 784 return 0;
785} 785}
786 786
787static int snd_ice1712_capture_open(snd_pcm_substream_t * substream) 787static int snd_ice1712_capture_open(struct snd_pcm_substream *substream)
788{ 788{
789 snd_pcm_runtime_t *runtime = substream->runtime; 789 struct snd_pcm_runtime *runtime = substream->runtime;
790 ice1712_t *ice = snd_pcm_substream_chip(substream); 790 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
791 791
792 ice->capture_con_substream = substream; 792 ice->capture_con_substream = substream;
793 runtime->hw = snd_ice1712_capture; 793 runtime->hw = snd_ice1712_capture;
@@ -797,17 +797,17 @@ static int snd_ice1712_capture_open(snd_pcm_substream_t * substream)
797 return 0; 797 return 0;
798} 798}
799 799
800static int snd_ice1712_playback_close(snd_pcm_substream_t * substream) 800static int snd_ice1712_playback_close(struct snd_pcm_substream *substream)
801{ 801{
802 ice1712_t *ice = snd_pcm_substream_chip(substream); 802 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
803 803
804 ice->playback_con_substream = NULL; 804 ice->playback_con_substream = NULL;
805 return 0; 805 return 0;
806} 806}
807 807
808static int snd_ice1712_playback_ds_close(snd_pcm_substream_t * substream) 808static int snd_ice1712_playback_ds_close(struct snd_pcm_substream *substream)
809{ 809{
810 ice1712_t *ice = snd_pcm_substream_chip(substream); 810 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
811 u32 tmp; 811 u32 tmp;
812 812
813 spin_lock_irq(&ice->reg_lock); 813 spin_lock_irq(&ice->reg_lock);
@@ -818,15 +818,15 @@ static int snd_ice1712_playback_ds_close(snd_pcm_substream_t * substream)
818 return 0; 818 return 0;
819} 819}
820 820
821static int snd_ice1712_capture_close(snd_pcm_substream_t * substream) 821static int snd_ice1712_capture_close(struct snd_pcm_substream *substream)
822{ 822{
823 ice1712_t *ice = snd_pcm_substream_chip(substream); 823 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
824 824
825 ice->capture_con_substream = NULL; 825 ice->capture_con_substream = NULL;
826 return 0; 826 return 0;
827} 827}
828 828
829static snd_pcm_ops_t snd_ice1712_playback_ops = { 829static struct snd_pcm_ops snd_ice1712_playback_ops = {
830 .open = snd_ice1712_playback_open, 830 .open = snd_ice1712_playback_open,
831 .close = snd_ice1712_playback_close, 831 .close = snd_ice1712_playback_close,
832 .ioctl = snd_pcm_lib_ioctl, 832 .ioctl = snd_pcm_lib_ioctl,
@@ -837,7 +837,7 @@ static snd_pcm_ops_t snd_ice1712_playback_ops = {
837 .pointer = snd_ice1712_playback_pointer, 837 .pointer = snd_ice1712_playback_pointer,
838}; 838};
839 839
840static snd_pcm_ops_t snd_ice1712_playback_ds_ops = { 840static struct snd_pcm_ops snd_ice1712_playback_ds_ops = {
841 .open = snd_ice1712_playback_ds_open, 841 .open = snd_ice1712_playback_ds_open,
842 .close = snd_ice1712_playback_ds_close, 842 .close = snd_ice1712_playback_ds_close,
843 .ioctl = snd_pcm_lib_ioctl, 843 .ioctl = snd_pcm_lib_ioctl,
@@ -848,7 +848,7 @@ static snd_pcm_ops_t snd_ice1712_playback_ds_ops = {
848 .pointer = snd_ice1712_playback_ds_pointer, 848 .pointer = snd_ice1712_playback_ds_pointer,
849}; 849};
850 850
851static snd_pcm_ops_t snd_ice1712_capture_ops = { 851static struct snd_pcm_ops snd_ice1712_capture_ops = {
852 .open = snd_ice1712_capture_open, 852 .open = snd_ice1712_capture_open,
853 .close = snd_ice1712_capture_close, 853 .close = snd_ice1712_capture_close,
854 .ioctl = snd_pcm_lib_ioctl, 854 .ioctl = snd_pcm_lib_ioctl,
@@ -859,9 +859,9 @@ static snd_pcm_ops_t snd_ice1712_capture_ops = {
859 .pointer = snd_ice1712_capture_pointer, 859 .pointer = snd_ice1712_capture_pointer,
860}; 860};
861 861
862static int __devinit snd_ice1712_pcm(ice1712_t * ice, int device, snd_pcm_t ** rpcm) 862static int __devinit snd_ice1712_pcm(struct snd_ice1712 * ice, int device, struct snd_pcm ** rpcm)
863{ 863{
864 snd_pcm_t *pcm; 864 struct snd_pcm *pcm;
865 int err; 865 int err;
866 866
867 if (rpcm) 867 if (rpcm)
@@ -889,9 +889,9 @@ static int __devinit snd_ice1712_pcm(ice1712_t * ice, int device, snd_pcm_t ** r
889 return 0; 889 return 0;
890} 890}
891 891
892static int __devinit snd_ice1712_pcm_ds(ice1712_t * ice, int device, snd_pcm_t ** rpcm) 892static int __devinit snd_ice1712_pcm_ds(struct snd_ice1712 * ice, int device, struct snd_pcm ** rpcm)
893{ 893{
894 snd_pcm_t *pcm; 894 struct snd_pcm *pcm;
895 int err; 895 int err;
896 896
897 if (rpcm) 897 if (rpcm)
@@ -923,16 +923,16 @@ static int __devinit snd_ice1712_pcm_ds(ice1712_t * ice, int device, snd_pcm_t *
923static unsigned int rates[] = { 8000, 9600, 11025, 12000, 16000, 22050, 24000, 923static unsigned int rates[] = { 8000, 9600, 11025, 12000, 16000, 22050, 24000,
924 32000, 44100, 48000, 64000, 88200, 96000 }; 924 32000, 44100, 48000, 64000, 88200, 96000 };
925 925
926static snd_pcm_hw_constraint_list_t hw_constraints_rates = { 926static struct snd_pcm_hw_constraint_list hw_constraints_rates = {
927 .count = ARRAY_SIZE(rates), 927 .count = ARRAY_SIZE(rates),
928 .list = rates, 928 .list = rates,
929 .mask = 0, 929 .mask = 0,
930}; 930};
931 931
932static int snd_ice1712_pro_trigger(snd_pcm_substream_t *substream, 932static int snd_ice1712_pro_trigger(struct snd_pcm_substream *substream,
933 int cmd) 933 int cmd)
934{ 934{
935 ice1712_t *ice = snd_pcm_substream_chip(substream); 935 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
936 switch (cmd) { 936 switch (cmd) {
937 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 937 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
938 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 938 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
@@ -959,7 +959,7 @@ static int snd_ice1712_pro_trigger(snd_pcm_substream_t *substream,
959 unsigned int what = 0; 959 unsigned int what = 0;
960 unsigned int old; 960 unsigned int old;
961 struct list_head *pos; 961 struct list_head *pos;
962 snd_pcm_substream_t *s; 962 struct snd_pcm_substream *s;
963 963
964 snd_pcm_group_for_each(pos, substream) { 964 snd_pcm_group_for_each(pos, substream) {
965 s = snd_pcm_group_substream_entry(pos); 965 s = snd_pcm_group_substream_entry(pos);
@@ -989,7 +989,7 @@ static int snd_ice1712_pro_trigger(snd_pcm_substream_t *substream,
989 989
990/* 990/*
991 */ 991 */
992static void snd_ice1712_set_pro_rate(ice1712_t *ice, unsigned int rate, int force) 992static void snd_ice1712_set_pro_rate(struct snd_ice1712 *ice, unsigned int rate, int force)
993{ 993{
994 unsigned long flags; 994 unsigned long flags;
995 unsigned char val, old; 995 unsigned char val, old;
@@ -1043,9 +1043,9 @@ static void snd_ice1712_set_pro_rate(ice1712_t *ice, unsigned int rate, int forc
1043 ice->spdif.ops.setup_rate(ice, rate); 1043 ice->spdif.ops.setup_rate(ice, rate);
1044} 1044}
1045 1045
1046static int snd_ice1712_playback_pro_prepare(snd_pcm_substream_t * substream) 1046static int snd_ice1712_playback_pro_prepare(struct snd_pcm_substream *substream)
1047{ 1047{
1048 ice1712_t *ice = snd_pcm_substream_chip(substream); 1048 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1049 1049
1050 ice->playback_pro_size = snd_pcm_lib_buffer_bytes(substream); 1050 ice->playback_pro_size = snd_pcm_lib_buffer_bytes(substream);
1051 spin_lock_irq(&ice->reg_lock); 1051 spin_lock_irq(&ice->reg_lock);
@@ -1057,18 +1057,18 @@ static int snd_ice1712_playback_pro_prepare(snd_pcm_substream_t * substream)
1057 return 0; 1057 return 0;
1058} 1058}
1059 1059
1060static int snd_ice1712_playback_pro_hw_params(snd_pcm_substream_t * substream, 1060static int snd_ice1712_playback_pro_hw_params(struct snd_pcm_substream *substream,
1061 snd_pcm_hw_params_t * hw_params) 1061 struct snd_pcm_hw_params *hw_params)
1062{ 1062{
1063 ice1712_t *ice = snd_pcm_substream_chip(substream); 1063 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1064 1064
1065 snd_ice1712_set_pro_rate(ice, params_rate(hw_params), 0); 1065 snd_ice1712_set_pro_rate(ice, params_rate(hw_params), 0);
1066 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 1066 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
1067} 1067}
1068 1068
1069static int snd_ice1712_capture_pro_prepare(snd_pcm_substream_t * substream) 1069static int snd_ice1712_capture_pro_prepare(struct snd_pcm_substream *substream)
1070{ 1070{
1071 ice1712_t *ice = snd_pcm_substream_chip(substream); 1071 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1072 1072
1073 ice->capture_pro_size = snd_pcm_lib_buffer_bytes(substream); 1073 ice->capture_pro_size = snd_pcm_lib_buffer_bytes(substream);
1074 spin_lock_irq(&ice->reg_lock); 1074 spin_lock_irq(&ice->reg_lock);
@@ -1079,18 +1079,18 @@ static int snd_ice1712_capture_pro_prepare(snd_pcm_substream_t * substream)
1079 return 0; 1079 return 0;
1080} 1080}
1081 1081
1082static int snd_ice1712_capture_pro_hw_params(snd_pcm_substream_t * substream, 1082static int snd_ice1712_capture_pro_hw_params(struct snd_pcm_substream *substream,
1083 snd_pcm_hw_params_t * hw_params) 1083 struct snd_pcm_hw_params *hw_params)
1084{ 1084{
1085 ice1712_t *ice = snd_pcm_substream_chip(substream); 1085 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1086 1086
1087 snd_ice1712_set_pro_rate(ice, params_rate(hw_params), 0); 1087 snd_ice1712_set_pro_rate(ice, params_rate(hw_params), 0);
1088 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 1088 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
1089} 1089}
1090 1090
1091static snd_pcm_uframes_t snd_ice1712_playback_pro_pointer(snd_pcm_substream_t * substream) 1091static snd_pcm_uframes_t snd_ice1712_playback_pro_pointer(struct snd_pcm_substream *substream)
1092{ 1092{
1093 ice1712_t *ice = snd_pcm_substream_chip(substream); 1093 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1094 size_t ptr; 1094 size_t ptr;
1095 1095
1096 if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_PLAYBACK_START)) 1096 if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_PLAYBACK_START))
@@ -1101,9 +1101,9 @@ static snd_pcm_uframes_t snd_ice1712_playback_pro_pointer(snd_pcm_substream_t *
1101 return bytes_to_frames(substream->runtime, ptr); 1101 return bytes_to_frames(substream->runtime, ptr);
1102} 1102}
1103 1103
1104static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(snd_pcm_substream_t * substream) 1104static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substream *substream)
1105{ 1105{
1106 ice1712_t *ice = snd_pcm_substream_chip(substream); 1106 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1107 size_t ptr; 1107 size_t ptr;
1108 1108
1109 if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_CAPTURE_START_SHADOW)) 1109 if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_CAPTURE_START_SHADOW))
@@ -1114,7 +1114,7 @@ static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(snd_pcm_substream_t * s
1114 return bytes_to_frames(substream->runtime, ptr); 1114 return bytes_to_frames(substream->runtime, ptr);
1115} 1115}
1116 1116
1117static snd_pcm_hardware_t snd_ice1712_playback_pro = 1117static struct snd_pcm_hardware snd_ice1712_playback_pro =
1118{ 1118{
1119 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1119 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1120 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1120 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1134,7 +1134,7 @@ static snd_pcm_hardware_t snd_ice1712_playback_pro =
1134 .fifo_size = 0, 1134 .fifo_size = 0,
1135}; 1135};
1136 1136
1137static snd_pcm_hardware_t snd_ice1712_capture_pro = 1137static struct snd_pcm_hardware snd_ice1712_capture_pro =
1138{ 1138{
1139 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1139 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1140 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1140 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1154,10 +1154,10 @@ static snd_pcm_hardware_t snd_ice1712_capture_pro =
1154 .fifo_size = 0, 1154 .fifo_size = 0,
1155}; 1155};
1156 1156
1157static int snd_ice1712_playback_pro_open(snd_pcm_substream_t * substream) 1157static int snd_ice1712_playback_pro_open(struct snd_pcm_substream *substream)
1158{ 1158{
1159 snd_pcm_runtime_t *runtime = substream->runtime; 1159 struct snd_pcm_runtime *runtime = substream->runtime;
1160 ice1712_t *ice = snd_pcm_substream_chip(substream); 1160 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1161 1161
1162 ice->playback_pro_substream = substream; 1162 ice->playback_pro_substream = substream;
1163 runtime->hw = snd_ice1712_playback_pro; 1163 runtime->hw = snd_ice1712_playback_pro;
@@ -1171,10 +1171,10 @@ static int snd_ice1712_playback_pro_open(snd_pcm_substream_t * substream)
1171 return 0; 1171 return 0;
1172} 1172}
1173 1173
1174static int snd_ice1712_capture_pro_open(snd_pcm_substream_t * substream) 1174static int snd_ice1712_capture_pro_open(struct snd_pcm_substream *substream)
1175{ 1175{
1176 ice1712_t *ice = snd_pcm_substream_chip(substream); 1176 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1177 snd_pcm_runtime_t *runtime = substream->runtime; 1177 struct snd_pcm_runtime *runtime = substream->runtime;
1178 1178
1179 ice->capture_pro_substream = substream; 1179 ice->capture_pro_substream = substream;
1180 runtime->hw = snd_ice1712_capture_pro; 1180 runtime->hw = snd_ice1712_capture_pro;
@@ -1184,9 +1184,9 @@ static int snd_ice1712_capture_pro_open(snd_pcm_substream_t * substream)
1184 return 0; 1184 return 0;
1185} 1185}
1186 1186
1187static int snd_ice1712_playback_pro_close(snd_pcm_substream_t * substream) 1187static int snd_ice1712_playback_pro_close(struct snd_pcm_substream *substream)
1188{ 1188{
1189 ice1712_t *ice = snd_pcm_substream_chip(substream); 1189 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1190 1190
1191 if (PRO_RATE_RESET) 1191 if (PRO_RATE_RESET)
1192 snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 0); 1192 snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 0);
@@ -1197,9 +1197,9 @@ static int snd_ice1712_playback_pro_close(snd_pcm_substream_t * substream)
1197 return 0; 1197 return 0;
1198} 1198}
1199 1199
1200static int snd_ice1712_capture_pro_close(snd_pcm_substream_t * substream) 1200static int snd_ice1712_capture_pro_close(struct snd_pcm_substream *substream)
1201{ 1201{
1202 ice1712_t *ice = snd_pcm_substream_chip(substream); 1202 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1203 1203
1204 if (PRO_RATE_RESET) 1204 if (PRO_RATE_RESET)
1205 snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 0); 1205 snd_ice1712_set_pro_rate(ice, PRO_RATE_DEFAULT, 0);
@@ -1207,7 +1207,7 @@ static int snd_ice1712_capture_pro_close(snd_pcm_substream_t * substream)
1207 return 0; 1207 return 0;
1208} 1208}
1209 1209
1210static snd_pcm_ops_t snd_ice1712_playback_pro_ops = { 1210static struct snd_pcm_ops snd_ice1712_playback_pro_ops = {
1211 .open = snd_ice1712_playback_pro_open, 1211 .open = snd_ice1712_playback_pro_open,
1212 .close = snd_ice1712_playback_pro_close, 1212 .close = snd_ice1712_playback_pro_close,
1213 .ioctl = snd_pcm_lib_ioctl, 1213 .ioctl = snd_pcm_lib_ioctl,
@@ -1218,7 +1218,7 @@ static snd_pcm_ops_t snd_ice1712_playback_pro_ops = {
1218 .pointer = snd_ice1712_playback_pro_pointer, 1218 .pointer = snd_ice1712_playback_pro_pointer,
1219}; 1219};
1220 1220
1221static snd_pcm_ops_t snd_ice1712_capture_pro_ops = { 1221static struct snd_pcm_ops snd_ice1712_capture_pro_ops = {
1222 .open = snd_ice1712_capture_pro_open, 1222 .open = snd_ice1712_capture_pro_open,
1223 .close = snd_ice1712_capture_pro_close, 1223 .close = snd_ice1712_capture_pro_close,
1224 .ioctl = snd_pcm_lib_ioctl, 1224 .ioctl = snd_pcm_lib_ioctl,
@@ -1229,9 +1229,9 @@ static snd_pcm_ops_t snd_ice1712_capture_pro_ops = {
1229 .pointer = snd_ice1712_capture_pro_pointer, 1229 .pointer = snd_ice1712_capture_pro_pointer,
1230}; 1230};
1231 1231
1232static int __devinit snd_ice1712_pcm_profi(ice1712_t * ice, int device, snd_pcm_t ** rpcm) 1232static int __devinit snd_ice1712_pcm_profi(struct snd_ice1712 * ice, int device, struct snd_pcm ** rpcm)
1233{ 1233{
1234 snd_pcm_t *pcm; 1234 struct snd_pcm *pcm;
1235 int err; 1235 int err;
1236 1236
1237 if (rpcm) 1237 if (rpcm)
@@ -1272,7 +1272,7 @@ static int __devinit snd_ice1712_pcm_profi(ice1712_t * ice, int device, snd_pcm_
1272 * Mixer section 1272 * Mixer section
1273 */ 1273 */
1274 1274
1275static void snd_ice1712_update_volume(ice1712_t *ice, int index) 1275static void snd_ice1712_update_volume(struct snd_ice1712 *ice, int index)
1276{ 1276{
1277 unsigned int vol = ice->pro_volumes[index]; 1277 unsigned int vol = ice->pro_volumes[index];
1278 unsigned short val = 0; 1278 unsigned short val = 0;
@@ -1283,7 +1283,7 @@ static void snd_ice1712_update_volume(ice1712_t *ice, int index)
1283 outw(val, ICEMT(ice, MONITOR_VOLUME)); 1283 outw(val, ICEMT(ice, MONITOR_VOLUME));
1284} 1284}
1285 1285
1286static int snd_ice1712_pro_mixer_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1286static int snd_ice1712_pro_mixer_switch_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1287{ 1287{
1288 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1288 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1289 uinfo->count = 2; 1289 uinfo->count = 2;
@@ -1292,9 +1292,9 @@ static int snd_ice1712_pro_mixer_switch_info(snd_kcontrol_t *kcontrol, snd_ctl_e
1292 return 0; 1292 return 0;
1293} 1293}
1294 1294
1295static int snd_ice1712_pro_mixer_switch_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1295static int snd_ice1712_pro_mixer_switch_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1296{ 1296{
1297 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1297 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1298 int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value; 1298 int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value;
1299 1299
1300 spin_lock_irq(&ice->reg_lock); 1300 spin_lock_irq(&ice->reg_lock);
@@ -1304,9 +1304,9 @@ static int snd_ice1712_pro_mixer_switch_get(snd_kcontrol_t * kcontrol, snd_ctl_e
1304 return 0; 1304 return 0;
1305} 1305}
1306 1306
1307static int snd_ice1712_pro_mixer_switch_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1307static int snd_ice1712_pro_mixer_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1308{ 1308{
1309 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1309 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1310 int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value; 1310 int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value;
1311 unsigned int nval, change; 1311 unsigned int nval, change;
1312 1312
@@ -1321,7 +1321,7 @@ static int snd_ice1712_pro_mixer_switch_put(snd_kcontrol_t * kcontrol, snd_ctl_e
1321 return change; 1321 return change;
1322} 1322}
1323 1323
1324static int snd_ice1712_pro_mixer_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1324static int snd_ice1712_pro_mixer_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1325{ 1325{
1326 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 1326 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
1327 uinfo->count = 2; 1327 uinfo->count = 2;
@@ -1330,9 +1330,9 @@ static int snd_ice1712_pro_mixer_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_e
1330 return 0; 1330 return 0;
1331} 1331}
1332 1332
1333static int snd_ice1712_pro_mixer_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1333static int snd_ice1712_pro_mixer_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1334{ 1334{
1335 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1335 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1336 int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value; 1336 int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value;
1337 1337
1338 spin_lock_irq(&ice->reg_lock); 1338 spin_lock_irq(&ice->reg_lock);
@@ -1342,9 +1342,9 @@ static int snd_ice1712_pro_mixer_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_e
1342 return 0; 1342 return 0;
1343} 1343}
1344 1344
1345static int snd_ice1712_pro_mixer_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1345static int snd_ice1712_pro_mixer_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1346{ 1346{
1347 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1347 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1348 int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value; 1348 int index = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + kcontrol->private_value;
1349 unsigned int nval, change; 1349 unsigned int nval, change;
1350 1350
@@ -1360,7 +1360,7 @@ static int snd_ice1712_pro_mixer_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_e
1360} 1360}
1361 1361
1362 1362
1363static snd_kcontrol_new_t snd_ice1712_multi_playback_ctrls[] __devinitdata = { 1363static struct snd_kcontrol_new snd_ice1712_multi_playback_ctrls[] __devinitdata = {
1364 { 1364 {
1365 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1365 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1366 .name = "Multi Playback Switch", 1366 .name = "Multi Playback Switch",
@@ -1381,7 +1381,7 @@ static snd_kcontrol_new_t snd_ice1712_multi_playback_ctrls[] __devinitdata = {
1381 }, 1381 },
1382}; 1382};
1383 1383
1384static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_switch __devinitdata = { 1384static struct snd_kcontrol_new snd_ice1712_multi_capture_analog_switch __devinitdata = {
1385 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1385 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1386 .name = "H/W Multi Capture Switch", 1386 .name = "H/W Multi Capture Switch",
1387 .info = snd_ice1712_pro_mixer_switch_info, 1387 .info = snd_ice1712_pro_mixer_switch_info,
@@ -1390,7 +1390,7 @@ static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_switch __devinitdata
1390 .private_value = 10, 1390 .private_value = 10,
1391}; 1391};
1392 1392
1393static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_switch __devinitdata = { 1393static struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_switch __devinitdata = {
1394 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1394 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1395 .name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,SWITCH), 1395 .name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,SWITCH),
1396 .info = snd_ice1712_pro_mixer_switch_info, 1396 .info = snd_ice1712_pro_mixer_switch_info,
@@ -1400,7 +1400,7 @@ static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_switch __devinitdata =
1400 .count = 2, 1400 .count = 2,
1401}; 1401};
1402 1402
1403static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_volume __devinitdata = { 1403static struct snd_kcontrol_new snd_ice1712_multi_capture_analog_volume __devinitdata = {
1404 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1404 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1405 .name = "H/W Multi Capture Volume", 1405 .name = "H/W Multi Capture Volume",
1406 .info = snd_ice1712_pro_mixer_volume_info, 1406 .info = snd_ice1712_pro_mixer_volume_info,
@@ -1409,7 +1409,7 @@ static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_volume __devinitdata
1409 .private_value = 10, 1409 .private_value = 10,
1410}; 1410};
1411 1411
1412static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_volume __devinitdata = { 1412static struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_volume __devinitdata = {
1413 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1413 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1414 .name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,VOLUME), 1414 .name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,VOLUME),
1415 .info = snd_ice1712_pro_mixer_volume_info, 1415 .info = snd_ice1712_pro_mixer_volume_info,
@@ -1419,9 +1419,9 @@ static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_volume __devinitdata =
1419 .count = 2, 1419 .count = 2,
1420}; 1420};
1421 1421
1422static int __devinit snd_ice1712_build_pro_mixer(ice1712_t *ice) 1422static int __devinit snd_ice1712_build_pro_mixer(struct snd_ice1712 *ice)
1423{ 1423{
1424 snd_card_t * card = ice->card; 1424 struct snd_card *card = ice->card;
1425 unsigned int idx; 1425 unsigned int idx;
1426 int err; 1426 int err;
1427 1427
@@ -1433,7 +1433,7 @@ static int __devinit snd_ice1712_build_pro_mixer(ice1712_t *ice)
1433 } 1433 }
1434 1434
1435 if (ice->num_total_adcs > 0) { 1435 if (ice->num_total_adcs > 0) {
1436 snd_kcontrol_new_t tmp = snd_ice1712_multi_capture_analog_switch; 1436 struct snd_kcontrol_new tmp = snd_ice1712_multi_capture_analog_switch;
1437 tmp.count = ice->num_total_adcs; 1437 tmp.count = ice->num_total_adcs;
1438 err = snd_ctl_add(card, snd_ctl_new1(&tmp, ice)); 1438 err = snd_ctl_add(card, snd_ctl_new1(&tmp, ice));
1439 if (err < 0) 1439 if (err < 0)
@@ -1445,7 +1445,7 @@ static int __devinit snd_ice1712_build_pro_mixer(ice1712_t *ice)
1445 return err; 1445 return err;
1446 1446
1447 if (ice->num_total_adcs > 0) { 1447 if (ice->num_total_adcs > 0) {
1448 snd_kcontrol_new_t tmp = snd_ice1712_multi_capture_analog_volume; 1448 struct snd_kcontrol_new tmp = snd_ice1712_multi_capture_analog_volume;
1449 tmp.count = ice->num_total_adcs; 1449 tmp.count = ice->num_total_adcs;
1450 err = snd_ctl_add(card, snd_ctl_new1(&tmp, ice)); 1450 err = snd_ctl_add(card, snd_ctl_new1(&tmp, ice));
1451 if (err < 0) 1451 if (err < 0)
@@ -1472,22 +1472,22 @@ static int __devinit snd_ice1712_build_pro_mixer(ice1712_t *ice)
1472 return 0; 1472 return 0;
1473} 1473}
1474 1474
1475static void snd_ice1712_mixer_free_ac97(ac97_t *ac97) 1475static void snd_ice1712_mixer_free_ac97(struct snd_ac97 *ac97)
1476{ 1476{
1477 ice1712_t *ice = ac97->private_data; 1477 struct snd_ice1712 *ice = ac97->private_data;
1478 ice->ac97 = NULL; 1478 ice->ac97 = NULL;
1479} 1479}
1480 1480
1481static int __devinit snd_ice1712_ac97_mixer(ice1712_t * ice) 1481static int __devinit snd_ice1712_ac97_mixer(struct snd_ice1712 * ice)
1482{ 1482{
1483 int err, bus_num = 0; 1483 int err, bus_num = 0;
1484 ac97_template_t ac97; 1484 struct snd_ac97_template ac97;
1485 ac97_bus_t *pbus; 1485 struct snd_ac97_bus *pbus;
1486 static ac97_bus_ops_t con_ops = { 1486 static struct snd_ac97_bus_ops con_ops = {
1487 .write = snd_ice1712_ac97_write, 1487 .write = snd_ice1712_ac97_write,
1488 .read = snd_ice1712_ac97_read, 1488 .read = snd_ice1712_ac97_read,
1489 }; 1489 };
1490 static ac97_bus_ops_t pro_ops = { 1490 static struct snd_ac97_bus_ops pro_ops = {
1491 .write = snd_ice1712_pro_ac97_write, 1491 .write = snd_ice1712_pro_ac97_write,
1492 .read = snd_ice1712_pro_ac97_read, 1492 .read = snd_ice1712_pro_ac97_read,
1493 }; 1493 };
@@ -1527,15 +1527,15 @@ static int __devinit snd_ice1712_ac97_mixer(ice1712_t * ice)
1527 * 1527 *
1528 */ 1528 */
1529 1529
1530static inline unsigned int eeprom_double(ice1712_t *ice, int idx) 1530static inline unsigned int eeprom_double(struct snd_ice1712 *ice, int idx)
1531{ 1531{
1532 return (unsigned int)ice->eeprom.data[idx] | ((unsigned int)ice->eeprom.data[idx + 1] << 8); 1532 return (unsigned int)ice->eeprom.data[idx] | ((unsigned int)ice->eeprom.data[idx + 1] << 8);
1533} 1533}
1534 1534
1535static void snd_ice1712_proc_read(snd_info_entry_t *entry, 1535static void snd_ice1712_proc_read(struct snd_info_entry *entry,
1536 snd_info_buffer_t * buffer) 1536 struct snd_info_buffer *buffer)
1537{ 1537{
1538 ice1712_t *ice = entry->private_data; 1538 struct snd_ice1712 *ice = entry->private_data;
1539 unsigned int idx; 1539 unsigned int idx;
1540 1540
1541 snd_iprintf(buffer, "%s\n\n", ice->card->longname); 1541 snd_iprintf(buffer, "%s\n\n", ice->card->longname);
@@ -1569,9 +1569,9 @@ static void snd_ice1712_proc_read(snd_info_entry_t *entry,
1569 snd_iprintf(buffer, " RATE : 0x%02x\n", (unsigned)inb(ICEMT(ice, RATE))); 1569 snd_iprintf(buffer, " RATE : 0x%02x\n", (unsigned)inb(ICEMT(ice, RATE)));
1570} 1570}
1571 1571
1572static void __devinit snd_ice1712_proc_init(ice1712_t * ice) 1572static void __devinit snd_ice1712_proc_init(struct snd_ice1712 * ice)
1573{ 1573{
1574 snd_info_entry_t *entry; 1574 struct snd_info_entry *entry;
1575 1575
1576 if (! snd_card_proc_new(ice->card, "ice1712", &entry)) 1576 if (! snd_card_proc_new(ice->card, "ice1712", &entry))
1577 snd_info_set_text_ops(entry, ice, 1024, snd_ice1712_proc_read); 1577 snd_info_set_text_ops(entry, ice, 1024, snd_ice1712_proc_read);
@@ -1581,22 +1581,24 @@ static void __devinit snd_ice1712_proc_init(ice1712_t * ice)
1581 * 1581 *
1582 */ 1582 */
1583 1583
1584static int snd_ice1712_eeprom_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1584static int snd_ice1712_eeprom_info(struct snd_kcontrol *kcontrol,
1585 struct snd_ctl_elem_info *uinfo)
1585{ 1586{
1586 uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; 1587 uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES;
1587 uinfo->count = sizeof(ice1712_eeprom_t); 1588 uinfo->count = sizeof(struct snd_ice1712_eeprom);
1588 return 0; 1589 return 0;
1589} 1590}
1590 1591
1591static int snd_ice1712_eeprom_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1592static int snd_ice1712_eeprom_get(struct snd_kcontrol *kcontrol,
1593 struct snd_ctl_elem_value *ucontrol)
1592{ 1594{
1593 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1595 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1594 1596
1595 memcpy(ucontrol->value.bytes.data, &ice->eeprom, sizeof(ice->eeprom)); 1597 memcpy(ucontrol->value.bytes.data, &ice->eeprom, sizeof(ice->eeprom));
1596 return 0; 1598 return 0;
1597} 1599}
1598 1600
1599static snd_kcontrol_new_t snd_ice1712_eeprom __devinitdata = { 1601static struct snd_kcontrol_new snd_ice1712_eeprom __devinitdata = {
1600 .iface = SNDRV_CTL_ELEM_IFACE_CARD, 1602 .iface = SNDRV_CTL_ELEM_IFACE_CARD,
1601 .name = "ICE1712 EEPROM", 1603 .name = "ICE1712 EEPROM",
1602 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1604 .access = SNDRV_CTL_ELEM_ACCESS_READ,
@@ -1606,32 +1608,33 @@ static snd_kcontrol_new_t snd_ice1712_eeprom __devinitdata = {
1606 1608
1607/* 1609/*
1608 */ 1610 */
1609static int snd_ice1712_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1611static int snd_ice1712_spdif_info(struct snd_kcontrol *kcontrol,
1612 struct snd_ctl_elem_info *uinfo)
1610{ 1613{
1611 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 1614 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
1612 uinfo->count = 1; 1615 uinfo->count = 1;
1613 return 0; 1616 return 0;
1614} 1617}
1615 1618
1616static int snd_ice1712_spdif_default_get(snd_kcontrol_t * kcontrol, 1619static int snd_ice1712_spdif_default_get(struct snd_kcontrol *kcontrol,
1617 snd_ctl_elem_value_t * ucontrol) 1620 struct snd_ctl_elem_value *ucontrol)
1618{ 1621{
1619 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1622 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1620 if (ice->spdif.ops.default_get) 1623 if (ice->spdif.ops.default_get)
1621 ice->spdif.ops.default_get(ice, ucontrol); 1624 ice->spdif.ops.default_get(ice, ucontrol);
1622 return 0; 1625 return 0;
1623} 1626}
1624 1627
1625static int snd_ice1712_spdif_default_put(snd_kcontrol_t * kcontrol, 1628static int snd_ice1712_spdif_default_put(struct snd_kcontrol *kcontrol,
1626 snd_ctl_elem_value_t * ucontrol) 1629 struct snd_ctl_elem_value *ucontrol)
1627{ 1630{
1628 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1631 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1629 if (ice->spdif.ops.default_put) 1632 if (ice->spdif.ops.default_put)
1630 return ice->spdif.ops.default_put(ice, ucontrol); 1633 return ice->spdif.ops.default_put(ice, ucontrol);
1631 return 0; 1634 return 0;
1632} 1635}
1633 1636
1634static snd_kcontrol_new_t snd_ice1712_spdif_default __devinitdata = 1637static struct snd_kcontrol_new snd_ice1712_spdif_default __devinitdata =
1635{ 1638{
1636 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1639 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
1637 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 1640 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
@@ -1640,10 +1643,10 @@ static snd_kcontrol_new_t snd_ice1712_spdif_default __devinitdata =
1640 .put = snd_ice1712_spdif_default_put 1643 .put = snd_ice1712_spdif_default_put
1641}; 1644};
1642 1645
1643static int snd_ice1712_spdif_maskc_get(snd_kcontrol_t * kcontrol, 1646static int snd_ice1712_spdif_maskc_get(struct snd_kcontrol *kcontrol,
1644 snd_ctl_elem_value_t * ucontrol) 1647 struct snd_ctl_elem_value *ucontrol)
1645{ 1648{
1646 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1649 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1647 if (ice->spdif.ops.default_get) { 1650 if (ice->spdif.ops.default_get) {
1648 ucontrol->value.iec958.status[0] = IEC958_AES0_NONAUDIO | 1651 ucontrol->value.iec958.status[0] = IEC958_AES0_NONAUDIO |
1649 IEC958_AES0_PROFESSIONAL | 1652 IEC958_AES0_PROFESSIONAL |
@@ -1662,10 +1665,10 @@ static int snd_ice1712_spdif_maskc_get(snd_kcontrol_t * kcontrol,
1662 return 0; 1665 return 0;
1663} 1666}
1664 1667
1665static int snd_ice1712_spdif_maskp_get(snd_kcontrol_t * kcontrol, 1668static int snd_ice1712_spdif_maskp_get(struct snd_kcontrol *kcontrol,
1666 snd_ctl_elem_value_t * ucontrol) 1669 struct snd_ctl_elem_value *ucontrol)
1667{ 1670{
1668 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1671 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1669 if (ice->spdif.ops.default_get) { 1672 if (ice->spdif.ops.default_get) {
1670 ucontrol->value.iec958.status[0] = IEC958_AES0_NONAUDIO | 1673 ucontrol->value.iec958.status[0] = IEC958_AES0_NONAUDIO |
1671 IEC958_AES0_PROFESSIONAL | 1674 IEC958_AES0_PROFESSIONAL |
@@ -1682,7 +1685,7 @@ static int snd_ice1712_spdif_maskp_get(snd_kcontrol_t * kcontrol,
1682 return 0; 1685 return 0;
1683} 1686}
1684 1687
1685static snd_kcontrol_new_t snd_ice1712_spdif_maskc __devinitdata = 1688static struct snd_kcontrol_new snd_ice1712_spdif_maskc __devinitdata =
1686{ 1689{
1687 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1690 .access = SNDRV_CTL_ELEM_ACCESS_READ,
1688 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1691 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -1691,7 +1694,7 @@ static snd_kcontrol_new_t snd_ice1712_spdif_maskc __devinitdata =
1691 .get = snd_ice1712_spdif_maskc_get, 1694 .get = snd_ice1712_spdif_maskc_get,
1692}; 1695};
1693 1696
1694static snd_kcontrol_new_t snd_ice1712_spdif_maskp __devinitdata = 1697static struct snd_kcontrol_new snd_ice1712_spdif_maskp __devinitdata =
1695{ 1698{
1696 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1699 .access = SNDRV_CTL_ELEM_ACCESS_READ,
1697 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1700 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -1700,27 +1703,28 @@ static snd_kcontrol_new_t snd_ice1712_spdif_maskp __devinitdata =
1700 .get = snd_ice1712_spdif_maskp_get, 1703 .get = snd_ice1712_spdif_maskp_get,
1701}; 1704};
1702 1705
1703static int snd_ice1712_spdif_stream_get(snd_kcontrol_t * kcontrol, 1706static int snd_ice1712_spdif_stream_get(struct snd_kcontrol *kcontrol,
1704 snd_ctl_elem_value_t * ucontrol) 1707 struct snd_ctl_elem_value *ucontrol)
1705{ 1708{
1706 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1709 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1707 if (ice->spdif.ops.stream_get) 1710 if (ice->spdif.ops.stream_get)
1708 ice->spdif.ops.stream_get(ice, ucontrol); 1711 ice->spdif.ops.stream_get(ice, ucontrol);
1709 return 0; 1712 return 0;
1710} 1713}
1711 1714
1712static int snd_ice1712_spdif_stream_put(snd_kcontrol_t * kcontrol, 1715static int snd_ice1712_spdif_stream_put(struct snd_kcontrol *kcontrol,
1713 snd_ctl_elem_value_t * ucontrol) 1716 struct snd_ctl_elem_value *ucontrol)
1714{ 1717{
1715 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1718 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1716 if (ice->spdif.ops.stream_put) 1719 if (ice->spdif.ops.stream_put)
1717 return ice->spdif.ops.stream_put(ice, ucontrol); 1720 return ice->spdif.ops.stream_put(ice, ucontrol);
1718 return 0; 1721 return 0;
1719} 1722}
1720 1723
1721static snd_kcontrol_new_t snd_ice1712_spdif_stream __devinitdata = 1724static struct snd_kcontrol_new snd_ice1712_spdif_stream __devinitdata =
1722{ 1725{
1723 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 1726 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1727 SNDRV_CTL_ELEM_ACCESS_INACTIVE),
1724 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1728 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
1725 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 1729 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),
1726 .info = snd_ice1712_spdif_info, 1730 .info = snd_ice1712_spdif_info,
@@ -1728,7 +1732,8 @@ static snd_kcontrol_new_t snd_ice1712_spdif_stream __devinitdata =
1728 .put = snd_ice1712_spdif_stream_put 1732 .put = snd_ice1712_spdif_stream_put
1729}; 1733};
1730 1734
1731int snd_ice1712_gpio_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1735int snd_ice1712_gpio_info(struct snd_kcontrol *kcontrol,
1736 struct snd_ctl_elem_info *uinfo)
1732{ 1737{
1733 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1738 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1734 uinfo->count = 1; 1739 uinfo->count = 1;
@@ -1737,21 +1742,24 @@ int snd_ice1712_gpio_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
1737 return 0; 1742 return 0;
1738} 1743}
1739 1744
1740int snd_ice1712_gpio_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1745int snd_ice1712_gpio_get(struct snd_kcontrol *kcontrol,
1746 struct snd_ctl_elem_value *ucontrol)
1741{ 1747{
1742 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1748 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1743 unsigned char mask = kcontrol->private_value & 0xff; 1749 unsigned char mask = kcontrol->private_value & 0xff;
1744 int invert = (kcontrol->private_value & (1<<24)) ? 1 : 0; 1750 int invert = (kcontrol->private_value & (1<<24)) ? 1 : 0;
1745 1751
1746 snd_ice1712_save_gpio_status(ice); 1752 snd_ice1712_save_gpio_status(ice);
1747 ucontrol->value.integer.value[0] = (snd_ice1712_gpio_read(ice) & mask ? 1 : 0) ^ invert; 1753 ucontrol->value.integer.value[0] =
1754 (snd_ice1712_gpio_read(ice) & mask ? 1 : 0) ^ invert;
1748 snd_ice1712_restore_gpio_status(ice); 1755 snd_ice1712_restore_gpio_status(ice);
1749 return 0; 1756 return 0;
1750} 1757}
1751 1758
1752int snd_ice1712_gpio_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1759int snd_ice1712_gpio_put(struct snd_kcontrol *kcontrol,
1760 struct snd_ctl_elem_value *ucontrol)
1753{ 1761{
1754 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1762 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1755 unsigned char mask = kcontrol->private_value & 0xff; 1763 unsigned char mask = kcontrol->private_value & 0xff;
1756 int invert = (kcontrol->private_value & (1<<24)) ? mask : 0; 1764 int invert = (kcontrol->private_value & (1<<24)) ? mask : 0;
1757 unsigned int val, nval; 1765 unsigned int val, nval;
@@ -1771,7 +1779,8 @@ int snd_ice1712_gpio_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucont
1771/* 1779/*
1772 * rate 1780 * rate
1773 */ 1781 */
1774static int snd_ice1712_pro_internal_clock_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1782static int snd_ice1712_pro_internal_clock_info(struct snd_kcontrol *kcontrol,
1783 struct snd_ctl_elem_info *uinfo)
1775{ 1784{
1776 static char *texts[] = { 1785 static char *texts[] = {
1777 "8000", /* 0: 6 */ 1786 "8000", /* 0: 6 */
@@ -1798,9 +1807,10 @@ static int snd_ice1712_pro_internal_clock_info(snd_kcontrol_t *kcontrol, snd_ctl
1798 return 0; 1807 return 0;
1799} 1808}
1800 1809
1801static int snd_ice1712_pro_internal_clock_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1810static int snd_ice1712_pro_internal_clock_get(struct snd_kcontrol *kcontrol,
1811 struct snd_ctl_elem_value *ucontrol)
1802{ 1812{
1803 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1813 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1804 static unsigned char xlate[16] = { 1814 static unsigned char xlate[16] = {
1805 9, 6, 3, 1, 7, 4, 0, 12, 8, 5, 2, 11, 255, 255, 255, 10 1815 9, 6, 3, 1, 7, 4, 0, 12, 8, 5, 2, 11, 255, 255, 255, 10
1806 }; 1816 };
@@ -1821,9 +1831,10 @@ static int snd_ice1712_pro_internal_clock_get(snd_kcontrol_t * kcontrol, snd_ctl
1821 return 0; 1831 return 0;
1822} 1832}
1823 1833
1824static int snd_ice1712_pro_internal_clock_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1834static int snd_ice1712_pro_internal_clock_put(struct snd_kcontrol *kcontrol,
1835 struct snd_ctl_elem_value *ucontrol)
1825{ 1836{
1826 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1837 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1827 static unsigned int xrate[13] = { 1838 static unsigned int xrate[13] = {
1828 8000, 9600, 11025, 12000, 1600, 22050, 24000, 1839 8000, 9600, 11025, 12000, 1600, 22050, 24000,
1829 32000, 44100, 48000, 64000, 88200, 96000 1840 32000, 44100, 48000, 64000, 88200, 96000
@@ -1844,7 +1855,8 @@ static int snd_ice1712_pro_internal_clock_put(snd_kcontrol_t * kcontrol, snd_ctl
1844 change = inb(ICEMT(ice, RATE)) != oval; 1855 change = inb(ICEMT(ice, RATE)) != oval;
1845 spin_unlock_irq(&ice->reg_lock); 1856 spin_unlock_irq(&ice->reg_lock);
1846 1857
1847 if ((oval & ICE1712_SPDIF_MASTER) != (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER)) { 1858 if ((oval & ICE1712_SPDIF_MASTER) !=
1859 (inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER)) {
1848 /* change CS8427 clock source too */ 1860 /* change CS8427 clock source too */
1849 if (ice->cs8427) { 1861 if (ice->cs8427) {
1850 snd_ice1712_cs8427_set_input_clock(ice, is_spdif_master(ice)); 1862 snd_ice1712_cs8427_set_input_clock(ice, is_spdif_master(ice));
@@ -1862,7 +1874,7 @@ static int snd_ice1712_pro_internal_clock_put(snd_kcontrol_t * kcontrol, snd_ctl
1862 return change; 1874 return change;
1863} 1875}
1864 1876
1865static snd_kcontrol_new_t snd_ice1712_pro_internal_clock __devinitdata = { 1877static struct snd_kcontrol_new snd_ice1712_pro_internal_clock __devinitdata = {
1866 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1878 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1867 .name = "Multi Track Internal Clock", 1879 .name = "Multi Track Internal Clock",
1868 .info = snd_ice1712_pro_internal_clock_info, 1880 .info = snd_ice1712_pro_internal_clock_info,
@@ -1870,7 +1882,8 @@ static snd_kcontrol_new_t snd_ice1712_pro_internal_clock __devinitdata = {
1870 .put = snd_ice1712_pro_internal_clock_put 1882 .put = snd_ice1712_pro_internal_clock_put
1871}; 1883};
1872 1884
1873static int snd_ice1712_pro_internal_clock_default_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1885static int snd_ice1712_pro_internal_clock_default_info(struct snd_kcontrol *kcontrol,
1886 struct snd_ctl_elem_info *uinfo)
1874{ 1887{
1875 static char *texts[] = { 1888 static char *texts[] = {
1876 "8000", /* 0: 6 */ 1889 "8000", /* 0: 6 */
@@ -1897,7 +1910,8 @@ static int snd_ice1712_pro_internal_clock_default_info(snd_kcontrol_t *kcontrol,
1897 return 0; 1910 return 0;
1898} 1911}
1899 1912
1900static int snd_ice1712_pro_internal_clock_default_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1913static int snd_ice1712_pro_internal_clock_default_get(struct snd_kcontrol *kcontrol,
1914 struct snd_ctl_elem_value *ucontrol)
1901{ 1915{
1902 int val; 1916 int val;
1903 static unsigned int xrate[13] = { 1917 static unsigned int xrate[13] = {
@@ -1914,7 +1928,8 @@ static int snd_ice1712_pro_internal_clock_default_get(snd_kcontrol_t * kcontrol,
1914 return 0; 1928 return 0;
1915} 1929}
1916 1930
1917static int snd_ice1712_pro_internal_clock_default_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1931static int snd_ice1712_pro_internal_clock_default_put(struct snd_kcontrol *kcontrol,
1932 struct snd_ctl_elem_value *ucontrol)
1918{ 1933{
1919 static unsigned int xrate[13] = { 1934 static unsigned int xrate[13] = {
1920 8000, 9600, 11025, 12000, 1600, 22050, 24000, 1935 8000, 9600, 11025, 12000, 1600, 22050, 24000,
@@ -1930,7 +1945,7 @@ static int snd_ice1712_pro_internal_clock_default_put(snd_kcontrol_t * kcontrol,
1930 return change; 1945 return change;
1931} 1946}
1932 1947
1933static snd_kcontrol_new_t snd_ice1712_pro_internal_clock_default __devinitdata = { 1948static struct snd_kcontrol_new snd_ice1712_pro_internal_clock_default __devinitdata = {
1934 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1949 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1935 .name = "Multi Track Internal Clock Default", 1950 .name = "Multi Track Internal Clock Default",
1936 .info = snd_ice1712_pro_internal_clock_default_info, 1951 .info = snd_ice1712_pro_internal_clock_default_info,
@@ -1938,7 +1953,8 @@ static snd_kcontrol_new_t snd_ice1712_pro_internal_clock_default __devinitdata =
1938 .put = snd_ice1712_pro_internal_clock_default_put 1953 .put = snd_ice1712_pro_internal_clock_default_put
1939}; 1954};
1940 1955
1941static int snd_ice1712_pro_rate_locking_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1956static int snd_ice1712_pro_rate_locking_info(struct snd_kcontrol *kcontrol,
1957 struct snd_ctl_elem_info *uinfo)
1942{ 1958{
1943 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1959 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1944 uinfo->count = 1; 1960 uinfo->count = 1;
@@ -1947,15 +1963,17 @@ static int snd_ice1712_pro_rate_locking_info(snd_kcontrol_t *kcontrol, snd_ctl_e
1947 return 0; 1963 return 0;
1948} 1964}
1949 1965
1950static int snd_ice1712_pro_rate_locking_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1966static int snd_ice1712_pro_rate_locking_get(struct snd_kcontrol *kcontrol,
1967 struct snd_ctl_elem_value *ucontrol)
1951{ 1968{
1952 ucontrol->value.integer.value[0] = PRO_RATE_LOCKED; 1969 ucontrol->value.integer.value[0] = PRO_RATE_LOCKED;
1953 return 0; 1970 return 0;
1954} 1971}
1955 1972
1956static int snd_ice1712_pro_rate_locking_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1973static int snd_ice1712_pro_rate_locking_put(struct snd_kcontrol *kcontrol,
1974 struct snd_ctl_elem_value *ucontrol)
1957{ 1975{
1958 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 1976 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1959 int change = 0, nval; 1977 int change = 0, nval;
1960 1978
1961 nval = ucontrol->value.integer.value[0] ? 1 : 0; 1979 nval = ucontrol->value.integer.value[0] ? 1 : 0;
@@ -1966,7 +1984,7 @@ static int snd_ice1712_pro_rate_locking_put(snd_kcontrol_t * kcontrol, snd_ctl_e
1966 return change; 1984 return change;
1967} 1985}
1968 1986
1969static snd_kcontrol_new_t snd_ice1712_pro_rate_locking __devinitdata = { 1987static struct snd_kcontrol_new snd_ice1712_pro_rate_locking __devinitdata = {
1970 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1988 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1971 .name = "Multi Track Rate Locking", 1989 .name = "Multi Track Rate Locking",
1972 .info = snd_ice1712_pro_rate_locking_info, 1990 .info = snd_ice1712_pro_rate_locking_info,
@@ -1974,7 +1992,8 @@ static snd_kcontrol_new_t snd_ice1712_pro_rate_locking __devinitdata = {
1974 .put = snd_ice1712_pro_rate_locking_put 1992 .put = snd_ice1712_pro_rate_locking_put
1975}; 1993};
1976 1994
1977static int snd_ice1712_pro_rate_reset_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1995static int snd_ice1712_pro_rate_reset_info(struct snd_kcontrol *kcontrol,
1996 struct snd_ctl_elem_info *uinfo)
1978{ 1997{
1979 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1998 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1980 uinfo->count = 1; 1999 uinfo->count = 1;
@@ -1983,15 +2002,17 @@ static int snd_ice1712_pro_rate_reset_info(snd_kcontrol_t *kcontrol, snd_ctl_ele
1983 return 0; 2002 return 0;
1984} 2003}
1985 2004
1986static int snd_ice1712_pro_rate_reset_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2005static int snd_ice1712_pro_rate_reset_get(struct snd_kcontrol *kcontrol,
2006 struct snd_ctl_elem_value *ucontrol)
1987{ 2007{
1988 ucontrol->value.integer.value[0] = PRO_RATE_RESET; 2008 ucontrol->value.integer.value[0] = PRO_RATE_RESET;
1989 return 0; 2009 return 0;
1990} 2010}
1991 2011
1992static int snd_ice1712_pro_rate_reset_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2012static int snd_ice1712_pro_rate_reset_put(struct snd_kcontrol *kcontrol,
2013 struct snd_ctl_elem_value *ucontrol)
1993{ 2014{
1994 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 2015 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
1995 int change = 0, nval; 2016 int change = 0, nval;
1996 2017
1997 nval = ucontrol->value.integer.value[0] ? 1 : 0; 2018 nval = ucontrol->value.integer.value[0] ? 1 : 0;
@@ -2002,7 +2023,7 @@ static int snd_ice1712_pro_rate_reset_put(snd_kcontrol_t * kcontrol, snd_ctl_ele
2002 return change; 2023 return change;
2003} 2024}
2004 2025
2005static snd_kcontrol_new_t snd_ice1712_pro_rate_reset __devinitdata = { 2026static struct snd_kcontrol_new snd_ice1712_pro_rate_reset __devinitdata = {
2006 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2027 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2007 .name = "Multi Track Rate Reset", 2028 .name = "Multi Track Rate Reset",
2008 .info = snd_ice1712_pro_rate_reset_info, 2029 .info = snd_ice1712_pro_rate_reset_info,
@@ -2013,7 +2034,8 @@ static snd_kcontrol_new_t snd_ice1712_pro_rate_reset __devinitdata = {
2013/* 2034/*
2014 * routing 2035 * routing
2015 */ 2036 */
2016static int snd_ice1712_pro_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2037static int snd_ice1712_pro_route_info(struct snd_kcontrol *kcontrol,
2038 struct snd_ctl_elem_info *uinfo)
2017{ 2039{
2018 static char *texts[] = { 2040 static char *texts[] = {
2019 "PCM Out", /* 0 */ 2041 "PCM Out", /* 0 */
@@ -2025,16 +2047,18 @@ static int snd_ice1712_pro_route_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf
2025 2047
2026 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 2048 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
2027 uinfo->count = 1; 2049 uinfo->count = 1;
2028 uinfo->value.enumerated.items = snd_ctl_get_ioffidx(kcontrol, &uinfo->id) < 2 ? 12 : 11; 2050 uinfo->value.enumerated.items =
2051 snd_ctl_get_ioffidx(kcontrol, &uinfo->id) < 2 ? 12 : 11;
2029 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) 2052 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
2030 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; 2053 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
2031 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); 2054 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
2032 return 0; 2055 return 0;
2033} 2056}
2034 2057
2035static int snd_ice1712_pro_route_analog_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol) 2058static int snd_ice1712_pro_route_analog_get(struct snd_kcontrol *kcontrol,
2059 struct snd_ctl_elem_value *ucontrol)
2036{ 2060{
2037 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 2061 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
2038 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 2062 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
2039 unsigned int val, cval; 2063 unsigned int val, cval;
2040 2064
@@ -2057,9 +2081,10 @@ static int snd_ice1712_pro_route_analog_get(snd_kcontrol_t * kcontrol, snd_ctl_e
2057 return 0; 2081 return 0;
2058} 2082}
2059 2083
2060static int snd_ice1712_pro_route_analog_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol) 2084static int snd_ice1712_pro_route_analog_put(struct snd_kcontrol *kcontrol,
2085 struct snd_ctl_elem_value *ucontrol)
2061{ 2086{
2062 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 2087 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
2063 int change, shift; 2088 int change, shift;
2064 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 2089 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
2065 unsigned int val, old_val, nval; 2090 unsigned int val, old_val, nval;
@@ -2106,9 +2131,10 @@ static int snd_ice1712_pro_route_analog_put(snd_kcontrol_t * kcontrol, snd_ctl_e
2106 return change; 2131 return change;
2107} 2132}
2108 2133
2109static int snd_ice1712_pro_route_spdif_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol) 2134static int snd_ice1712_pro_route_spdif_get(struct snd_kcontrol *kcontrol,
2135 struct snd_ctl_elem_value *ucontrol)
2110{ 2136{
2111 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 2137 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
2112 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 2138 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
2113 unsigned int val, cval; 2139 unsigned int val, cval;
2114 val = inw(ICEMT(ice, ROUTE_SPDOUT)); 2140 val = inw(ICEMT(ice, ROUTE_SPDOUT));
@@ -2125,9 +2151,10 @@ static int snd_ice1712_pro_route_spdif_get(snd_kcontrol_t * kcontrol, snd_ctl_el
2125 return 0; 2151 return 0;
2126} 2152}
2127 2153
2128static int snd_ice1712_pro_route_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol) 2154static int snd_ice1712_pro_route_spdif_put(struct snd_kcontrol *kcontrol,
2155 struct snd_ctl_elem_value *ucontrol)
2129{ 2156{
2130 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 2157 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
2131 int change, shift; 2158 int change, shift;
2132 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 2159 int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
2133 unsigned int val, old_val, nval; 2160 unsigned int val, old_val, nval;
@@ -2163,7 +2190,7 @@ static int snd_ice1712_pro_route_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_el
2163 return change; 2190 return change;
2164} 2191}
2165 2192
2166static snd_kcontrol_new_t snd_ice1712_mixer_pro_analog_route __devinitdata = { 2193static struct snd_kcontrol_new snd_ice1712_mixer_pro_analog_route __devinitdata = {
2167 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2194 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2168 .name = "H/W Playback Route", 2195 .name = "H/W Playback Route",
2169 .info = snd_ice1712_pro_route_info, 2196 .info = snd_ice1712_pro_route_info,
@@ -2171,7 +2198,7 @@ static snd_kcontrol_new_t snd_ice1712_mixer_pro_analog_route __devinitdata = {
2171 .put = snd_ice1712_pro_route_analog_put, 2198 .put = snd_ice1712_pro_route_analog_put,
2172}; 2199};
2173 2200
2174static snd_kcontrol_new_t snd_ice1712_mixer_pro_spdif_route __devinitdata = { 2201static struct snd_kcontrol_new snd_ice1712_mixer_pro_spdif_route __devinitdata = {
2175 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2202 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2176 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route", 2203 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route",
2177 .info = snd_ice1712_pro_route_info, 2204 .info = snd_ice1712_pro_route_info,
@@ -2181,7 +2208,8 @@ static snd_kcontrol_new_t snd_ice1712_mixer_pro_spdif_route __devinitdata = {
2181}; 2208};
2182 2209
2183 2210
2184static int snd_ice1712_pro_volume_rate_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2211static int snd_ice1712_pro_volume_rate_info(struct snd_kcontrol *kcontrol,
2212 struct snd_ctl_elem_info *uinfo)
2185{ 2213{
2186 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 2214 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
2187 uinfo->count = 1; 2215 uinfo->count = 1;
@@ -2190,17 +2218,19 @@ static int snd_ice1712_pro_volume_rate_info(snd_kcontrol_t *kcontrol, snd_ctl_el
2190 return 0; 2218 return 0;
2191} 2219}
2192 2220
2193static int snd_ice1712_pro_volume_rate_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2221static int snd_ice1712_pro_volume_rate_get(struct snd_kcontrol *kcontrol,
2222 struct snd_ctl_elem_value *ucontrol)
2194{ 2223{
2195 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 2224 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
2196 2225
2197 ucontrol->value.integer.value[0] = inb(ICEMT(ice, MONITOR_RATE)); 2226 ucontrol->value.integer.value[0] = inb(ICEMT(ice, MONITOR_RATE));
2198 return 0; 2227 return 0;
2199} 2228}
2200 2229
2201static int snd_ice1712_pro_volume_rate_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2230static int snd_ice1712_pro_volume_rate_put(struct snd_kcontrol *kcontrol,
2231 struct snd_ctl_elem_value *ucontrol)
2202{ 2232{
2203 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 2233 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
2204 int change; 2234 int change;
2205 2235
2206 spin_lock_irq(&ice->reg_lock); 2236 spin_lock_irq(&ice->reg_lock);
@@ -2210,7 +2240,7 @@ static int snd_ice1712_pro_volume_rate_put(snd_kcontrol_t * kcontrol, snd_ctl_el
2210 return change; 2240 return change;
2211} 2241}
2212 2242
2213static snd_kcontrol_new_t snd_ice1712_mixer_pro_volume_rate __devinitdata = { 2243static struct snd_kcontrol_new snd_ice1712_mixer_pro_volume_rate __devinitdata = {
2214 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2244 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2215 .name = "Multi Track Volume Rate", 2245 .name = "Multi Track Volume Rate",
2216 .info = snd_ice1712_pro_volume_rate_info, 2246 .info = snd_ice1712_pro_volume_rate_info,
@@ -2218,7 +2248,8 @@ static snd_kcontrol_new_t snd_ice1712_mixer_pro_volume_rate __devinitdata = {
2218 .put = snd_ice1712_pro_volume_rate_put 2248 .put = snd_ice1712_pro_volume_rate_put
2219}; 2249};
2220 2250
2221static int snd_ice1712_pro_peak_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2251static int snd_ice1712_pro_peak_info(struct snd_kcontrol *kcontrol,
2252 struct snd_ctl_elem_info *uinfo)
2222{ 2253{
2223 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 2254 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
2224 uinfo->count = 22; 2255 uinfo->count = 22;
@@ -2227,9 +2258,10 @@ static int snd_ice1712_pro_peak_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info
2227 return 0; 2258 return 0;
2228} 2259}
2229 2260
2230static int snd_ice1712_pro_peak_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2261static int snd_ice1712_pro_peak_get(struct snd_kcontrol *kcontrol,
2262 struct snd_ctl_elem_value *ucontrol)
2231{ 2263{
2232 ice1712_t *ice = snd_kcontrol_chip(kcontrol); 2264 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
2233 int idx; 2265 int idx;
2234 2266
2235 spin_lock_irq(&ice->reg_lock); 2267 spin_lock_irq(&ice->reg_lock);
@@ -2241,7 +2273,7 @@ static int snd_ice1712_pro_peak_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_valu
2241 return 0; 2273 return 0;
2242} 2274}
2243 2275
2244static snd_kcontrol_new_t snd_ice1712_mixer_pro_peak __devinitdata = { 2276static struct snd_kcontrol_new snd_ice1712_mixer_pro_peak __devinitdata = {
2245 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2277 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2246 .name = "Multi Track Peak", 2278 .name = "Multi Track Peak",
2247 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 2279 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
@@ -2263,7 +2295,7 @@ static struct snd_ice1712_card_info *card_tables[] __devinitdata = {
2263 NULL, 2295 NULL,
2264}; 2296};
2265 2297
2266static unsigned char __devinit snd_ice1712_read_i2c(ice1712_t *ice, 2298static unsigned char __devinit snd_ice1712_read_i2c(struct snd_ice1712 *ice,
2267 unsigned char dev, 2299 unsigned char dev,
2268 unsigned char addr) 2300 unsigned char addr)
2269{ 2301{
@@ -2275,7 +2307,8 @@ static unsigned char __devinit snd_ice1712_read_i2c(ice1712_t *ice,
2275 return inb(ICEREG(ice, I2C_DATA)); 2307 return inb(ICEREG(ice, I2C_DATA));
2276} 2308}
2277 2309
2278static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelname) 2310static int __devinit snd_ice1712_read_eeprom(struct snd_ice1712 *ice,
2311 const char *modelname)
2279{ 2312{
2280 int dev = 0xa0; /* EEPROM device address */ 2313 int dev = 0xa0; /* EEPROM device address */
2281 unsigned int i, size; 2314 unsigned int i, size;
@@ -2288,7 +2321,8 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelna
2288 (snd_ice1712_read_i2c(ice, dev, 0x01) << 8) | 2321 (snd_ice1712_read_i2c(ice, dev, 0x01) << 8) |
2289 (snd_ice1712_read_i2c(ice, dev, 0x02) << 16) | 2322 (snd_ice1712_read_i2c(ice, dev, 0x02) << 16) |
2290 (snd_ice1712_read_i2c(ice, dev, 0x03) << 24); 2323 (snd_ice1712_read_i2c(ice, dev, 0x03) << 24);
2291 if (ice->eeprom.subvendor == 0 || ice->eeprom.subvendor == (unsigned int)-1) { 2324 if (ice->eeprom.subvendor == 0 ||
2325 ice->eeprom.subvendor == (unsigned int)-1) {
2292 /* invalid subvendor from EEPROM, try the PCI subststem ID instead */ 2326 /* invalid subvendor from EEPROM, try the PCI subststem ID instead */
2293 u16 vendor, device; 2327 u16 vendor, device;
2294 pci_read_config_word(ice->pci, PCI_SUBSYSTEM_VENDOR_ID, &vendor); 2328 pci_read_config_word(ice->pci, PCI_SUBSYSTEM_VENDOR_ID, &vendor);
@@ -2317,7 +2351,8 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelna
2317 goto read_skipped; 2351 goto read_skipped;
2318 } 2352 }
2319 } 2353 }
2320 printk(KERN_WARNING "ice1712: No matching model found for ID 0x%x\n", ice->eeprom.subvendor); 2354 printk(KERN_WARNING "ice1712: No matching model found for ID 0x%x\n",
2355 ice->eeprom.subvendor);
2321 2356
2322 found: 2357 found:
2323 ice->eeprom.size = snd_ice1712_read_i2c(ice, dev, 0x04); 2358 ice->eeprom.size = snd_ice1712_read_i2c(ice, dev, 0x04);
@@ -2329,7 +2364,8 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelna
2329 } 2364 }
2330 ice->eeprom.version = snd_ice1712_read_i2c(ice, dev, 0x05); 2365 ice->eeprom.version = snd_ice1712_read_i2c(ice, dev, 0x05);
2331 if (ice->eeprom.version != 1) { 2366 if (ice->eeprom.version != 1) {
2332 snd_printk(KERN_ERR "invalid EEPROM version %i\n", ice->eeprom.version); 2367 snd_printk(KERN_ERR "invalid EEPROM version %i\n",
2368 ice->eeprom.version);
2333 /* return -EIO; */ 2369 /* return -EIO; */
2334 } 2370 }
2335 size = ice->eeprom.size - 6; 2371 size = ice->eeprom.size - 6;
@@ -2346,7 +2382,7 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelna
2346 2382
2347 2383
2348 2384
2349static int __devinit snd_ice1712_chip_init(ice1712_t *ice) 2385static int __devinit snd_ice1712_chip_init(struct snd_ice1712 *ice)
2350{ 2386{
2351 outb(ICE1712_RESET | ICE1712_NATIVE, ICEREG(ice, CONTROL)); 2387 outb(ICE1712_RESET | ICE1712_NATIVE, ICEREG(ice, CONTROL));
2352 udelay(200); 2388 udelay(200);
@@ -2359,15 +2395,19 @@ static int __devinit snd_ice1712_chip_init(ice1712_t *ice)
2359 if (ice->eeprom.subvendor != ICE1712_SUBDEVICE_STDSP24) { 2395 if (ice->eeprom.subvendor != ICE1712_SUBDEVICE_STDSP24) {
2360 ice->gpio.write_mask = ice->eeprom.gpiomask; 2396 ice->gpio.write_mask = ice->eeprom.gpiomask;
2361 ice->gpio.direction = ice->eeprom.gpiodir; 2397 ice->gpio.direction = ice->eeprom.gpiodir;
2362 snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ice->eeprom.gpiomask); 2398 snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK,
2363 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, ice->eeprom.gpiodir); 2399 ice->eeprom.gpiomask);
2364 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, ice->eeprom.gpiostate); 2400 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION,
2401 ice->eeprom.gpiodir);
2402 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA,
2403 ice->eeprom.gpiostate);
2365 } else { 2404 } else {
2366 ice->gpio.write_mask = 0xc0; 2405 ice->gpio.write_mask = 0xc0;
2367 ice->gpio.direction = 0xff; 2406 ice->gpio.direction = 0xff;
2368 snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, 0xc0); 2407 snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, 0xc0);
2369 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, 0xff); 2408 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, 0xff);
2370 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, ICE1712_STDSP24_CLOCK_BIT); 2409 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA,
2410 ICE1712_STDSP24_CLOCK_BIT);
2371 } 2411 }
2372 snd_ice1712_write(ice, ICE1712_IREG_PRO_POWERDOWN, 0); 2412 snd_ice1712_write(ice, ICE1712_IREG_PRO_POWERDOWN, 0);
2373 if (!(ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_NO_CON_AC97)) { 2413 if (!(ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_NO_CON_AC97)) {
@@ -2382,10 +2422,10 @@ static int __devinit snd_ice1712_chip_init(ice1712_t *ice)
2382 return 0; 2422 return 0;
2383} 2423}
2384 2424
2385int __devinit snd_ice1712_spdif_build_controls(ice1712_t *ice) 2425int __devinit snd_ice1712_spdif_build_controls(struct snd_ice1712 *ice)
2386{ 2426{
2387 int err; 2427 int err;
2388 snd_kcontrol_t *kctl; 2428 struct snd_kcontrol *kctl;
2389 2429
2390 snd_assert(ice->pcm_pro != NULL, return -EIO); 2430 snd_assert(ice->pcm_pro != NULL, return -EIO);
2391 err = snd_ctl_add(ice->card, kctl = snd_ctl_new1(&snd_ice1712_spdif_default, ice)); 2431 err = snd_ctl_add(ice->card, kctl = snd_ctl_new1(&snd_ice1712_spdif_default, ice));
@@ -2409,7 +2449,7 @@ int __devinit snd_ice1712_spdif_build_controls(ice1712_t *ice)
2409} 2449}
2410 2450
2411 2451
2412static int __devinit snd_ice1712_build_controls(ice1712_t *ice) 2452static int __devinit snd_ice1712_build_controls(struct snd_ice1712 *ice)
2413{ 2453{
2414 int err; 2454 int err;
2415 2455
@@ -2431,7 +2471,7 @@ static int __devinit snd_ice1712_build_controls(ice1712_t *ice)
2431 return err; 2471 return err;
2432 2472
2433 if (ice->num_total_dacs > 0) { 2473 if (ice->num_total_dacs > 0) {
2434 snd_kcontrol_new_t tmp = snd_ice1712_mixer_pro_analog_route; 2474 struct snd_kcontrol_new tmp = snd_ice1712_mixer_pro_analog_route;
2435 tmp.count = ice->num_total_dacs; 2475 tmp.count = ice->num_total_dacs;
2436 err = snd_ctl_add(ice->card, snd_ctl_new1(&tmp, ice)); 2476 err = snd_ctl_add(ice->card, snd_ctl_new1(&tmp, ice));
2437 if (err < 0) 2477 if (err < 0)
@@ -2452,7 +2492,7 @@ static int __devinit snd_ice1712_build_controls(ice1712_t *ice)
2452 return 0; 2492 return 0;
2453} 2493}
2454 2494
2455static int snd_ice1712_free(ice1712_t *ice) 2495static int snd_ice1712_free(struct snd_ice1712 *ice)
2456{ 2496{
2457 if (! ice->port) 2497 if (! ice->port)
2458 goto __hw_end; 2498 goto __hw_end;
@@ -2463,7 +2503,7 @@ static int snd_ice1712_free(ice1712_t *ice)
2463 __hw_end: 2503 __hw_end:
2464 if (ice->irq >= 0) { 2504 if (ice->irq >= 0) {
2465 synchronize_irq(ice->irq); 2505 synchronize_irq(ice->irq);
2466 free_irq(ice->irq, (void *) ice); 2506 free_irq(ice->irq, ice);
2467 } 2507 }
2468 if (ice->port) 2508 if (ice->port)
2469 pci_release_regions(ice->pci); 2509 pci_release_regions(ice->pci);
@@ -2473,22 +2513,22 @@ static int snd_ice1712_free(ice1712_t *ice)
2473 return 0; 2513 return 0;
2474} 2514}
2475 2515
2476static int snd_ice1712_dev_free(snd_device_t *device) 2516static int snd_ice1712_dev_free(struct snd_device *device)
2477{ 2517{
2478 ice1712_t *ice = device->device_data; 2518 struct snd_ice1712 *ice = device->device_data;
2479 return snd_ice1712_free(ice); 2519 return snd_ice1712_free(ice);
2480} 2520}
2481 2521
2482static int __devinit snd_ice1712_create(snd_card_t * card, 2522static int __devinit snd_ice1712_create(struct snd_card *card,
2483 struct pci_dev *pci, 2523 struct pci_dev *pci,
2484 const char *modelname, 2524 const char *modelname,
2485 int omni, 2525 int omni,
2486 int cs8427_timeout, 2526 int cs8427_timeout,
2487 ice1712_t ** r_ice1712) 2527 struct snd_ice1712 ** r_ice1712)
2488{ 2528{
2489 ice1712_t *ice; 2529 struct snd_ice1712 *ice;
2490 int err; 2530 int err;
2491 static snd_device_ops_t ops = { 2531 static struct snd_device_ops ops = {
2492 .dev_free = snd_ice1712_dev_free, 2532 .dev_free = snd_ice1712_dev_free,
2493 }; 2533 };
2494 2534
@@ -2548,7 +2588,8 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
2548 ice->dmapath_port = pci_resource_start(pci, 2); 2588 ice->dmapath_port = pci_resource_start(pci, 2);
2549 ice->profi_port = pci_resource_start(pci, 3); 2589 ice->profi_port = pci_resource_start(pci, 3);
2550 2590
2551 if (request_irq(pci->irq, snd_ice1712_interrupt, SA_INTERRUPT|SA_SHIRQ, "ICE1712", (void *) ice)) { 2591 if (request_irq(pci->irq, snd_ice1712_interrupt, SA_INTERRUPT|SA_SHIRQ,
2592 "ICE1712", ice)) {
2552 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 2593 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
2553 snd_ice1712_free(ice); 2594 snd_ice1712_free(ice);
2554 return -EIO; 2595 return -EIO;
@@ -2566,8 +2607,10 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
2566 } 2607 }
2567 2608
2568 /* unmask used interrupts */ 2609 /* unmask used interrupts */
2569 outb((ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_2xMPU401) == 0 ? ICE1712_IRQ_MPU2 : 0 | 2610 outb(((ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_2xMPU401) == 0 ?
2570 (ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_NO_CON_AC97) ? ICE1712_IRQ_PBKDS | ICE1712_IRQ_CONCAP | ICE1712_IRQ_CONPBK : 0, 2611 ICE1712_IRQ_MPU2 : 0) |
2612 ((ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_NO_CON_AC97) ?
2613 ICE1712_IRQ_PBKDS | ICE1712_IRQ_CONCAP | ICE1712_IRQ_CONPBK : 0),
2571 ICEREG(ice, IRQMASK)); 2614 ICEREG(ice, IRQMASK));
2572 outb(0x00, ICEMT(ice, IRQ)); 2615 outb(0x00, ICEMT(ice, IRQ));
2573 2616
@@ -2595,8 +2638,8 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
2595 const struct pci_device_id *pci_id) 2638 const struct pci_device_id *pci_id)
2596{ 2639{
2597 static int dev; 2640 static int dev;
2598 snd_card_t *card; 2641 struct snd_card *card;
2599 ice1712_t *ice; 2642 struct snd_ice1712 *ice;
2600 int pcm_dev = 0, err; 2643 int pcm_dev = 0, err;
2601 struct snd_ice1712_card_info **tbl, *c; 2644 struct snd_ice1712_card_info **tbl, *c;
2602 2645
@@ -2614,7 +2657,8 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
2614 strcpy(card->driver, "ICE1712"); 2657 strcpy(card->driver, "ICE1712");
2615 strcpy(card->shortname, "ICEnsemble ICE1712"); 2658 strcpy(card->shortname, "ICEnsemble ICE1712");
2616 2659
2617 if ((err = snd_ice1712_create(card, pci, model[dev], omni[dev], cs8427_timeout[dev], &ice)) < 0) { 2660 if ((err = snd_ice1712_create(card, pci, model[dev], omni[dev],
2661 cs8427_timeout[dev], &ice)) < 0) {
2618 snd_card_free(card); 2662 snd_card_free(card);
2619 return err; 2663 return err;
2620 } 2664 }
diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h
index 5ad4728daa7b..ce96b3bb6531 100644
--- a/sound/pci/ice1712/ice1712.h
+++ b/sound/pci/ice1712/ice1712.h
@@ -215,9 +215,9 @@
215 * 215 *
216 */ 216 */
217 217
218typedef struct _snd_ice1712 ice1712_t; 218struct snd_ice1712;
219 219
220typedef struct { 220struct snd_ice1712_eeprom {
221 unsigned int subvendor; /* PCI[2c-2f] */ 221 unsigned int subvendor; /* PCI[2c-2f] */
222 unsigned char size; /* size of EEPROM image in bytes */ 222 unsigned char size; /* size of EEPROM image in bytes */
223 unsigned char version; /* must be 1 (or 2 for vt1724) */ 223 unsigned char version; /* must be 1 (or 2 for vt1724) */
@@ -225,7 +225,7 @@ typedef struct {
225 unsigned int gpiomask; 225 unsigned int gpiomask;
226 unsigned int gpiostate; 226 unsigned int gpiostate;
227 unsigned int gpiodir; 227 unsigned int gpiodir;
228} ice1712_eeprom_t; 228};
229 229
230enum { 230enum {
231 ICE_EEP1_CODEC = 0, /* 06 */ 231 ICE_EEP1_CODEC = 0, /* 06 */
@@ -266,28 +266,28 @@ struct snd_ak4xxx_private {
266 unsigned int add_flags; /* additional bits at init */ 266 unsigned int add_flags; /* additional bits at init */
267 unsigned int mask_flags; /* total mask bits */ 267 unsigned int mask_flags; /* total mask bits */
268 struct snd_akm4xxx_ops { 268 struct snd_akm4xxx_ops {
269 void (*set_rate_val)(akm4xxx_t *ak, unsigned int rate); 269 void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate);
270 } ops; 270 } ops;
271}; 271};
272 272
273struct snd_ice1712_spdif { 273struct snd_ice1712_spdif {
274 unsigned char cs8403_bits; 274 unsigned char cs8403_bits;
275 unsigned char cs8403_stream_bits; 275 unsigned char cs8403_stream_bits;
276 snd_kcontrol_t *stream_ctl; 276 struct snd_kcontrol *stream_ctl;
277 277
278 struct snd_ice1712_spdif_ops { 278 struct snd_ice1712_spdif_ops {
279 void (*open)(ice1712_t *, snd_pcm_substream_t *); 279 void (*open)(struct snd_ice1712 *, struct snd_pcm_substream *);
280 void (*setup_rate)(ice1712_t *, int rate); 280 void (*setup_rate)(struct snd_ice1712 *, int rate);
281 void (*close)(ice1712_t *, snd_pcm_substream_t *); 281 void (*close)(struct snd_ice1712 *, struct snd_pcm_substream *);
282 void (*default_get)(ice1712_t *, snd_ctl_elem_value_t * ucontrol); 282 void (*default_get)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol);
283 int (*default_put)(ice1712_t *, snd_ctl_elem_value_t * ucontrol); 283 int (*default_put)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol);
284 void (*stream_get)(ice1712_t *, snd_ctl_elem_value_t * ucontrol); 284 void (*stream_get)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol);
285 int (*stream_put)(ice1712_t *, snd_ctl_elem_value_t * ucontrol); 285 int (*stream_put)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol);
286 } ops; 286 } ops;
287}; 287};
288 288
289 289
290struct _snd_ice1712 { 290struct snd_ice1712 {
291 unsigned long conp_dma_size; 291 unsigned long conp_dma_size;
292 unsigned long conc_dma_size; 292 unsigned long conc_dma_size;
293 unsigned long prop_dma_size; 293 unsigned long prop_dma_size;
@@ -300,28 +300,28 @@ struct _snd_ice1712 {
300 unsigned long profi_port; 300 unsigned long profi_port;
301 301
302 struct pci_dev *pci; 302 struct pci_dev *pci;
303 snd_card_t *card; 303 struct snd_card *card;
304 snd_pcm_t *pcm; 304 struct snd_pcm *pcm;
305 snd_pcm_t *pcm_ds; 305 struct snd_pcm *pcm_ds;
306 snd_pcm_t *pcm_pro; 306 struct snd_pcm *pcm_pro;
307 snd_pcm_substream_t *playback_con_substream; 307 struct snd_pcm_substream *playback_con_substream;
308 snd_pcm_substream_t *playback_con_substream_ds[6]; 308 struct snd_pcm_substream *playback_con_substream_ds[6];
309 snd_pcm_substream_t *capture_con_substream; 309 struct snd_pcm_substream *capture_con_substream;
310 snd_pcm_substream_t *playback_pro_substream; 310 struct snd_pcm_substream *playback_pro_substream;
311 snd_pcm_substream_t *capture_pro_substream; 311 struct snd_pcm_substream *capture_pro_substream;
312 unsigned int playback_pro_size; 312 unsigned int playback_pro_size;
313 unsigned int capture_pro_size; 313 unsigned int capture_pro_size;
314 unsigned int playback_con_virt_addr[6]; 314 unsigned int playback_con_virt_addr[6];
315 unsigned int playback_con_active_buf[6]; 315 unsigned int playback_con_active_buf[6];
316 unsigned int capture_con_virt_addr; 316 unsigned int capture_con_virt_addr;
317 unsigned int ac97_ext_id; 317 unsigned int ac97_ext_id;
318 ac97_t *ac97; 318 struct snd_ac97 *ac97;
319 snd_rawmidi_t *rmidi[2]; 319 struct snd_rawmidi *rmidi[2];
320 320
321 spinlock_t reg_lock; 321 spinlock_t reg_lock;
322 snd_info_entry_t *proc_entry; 322 struct snd_info_entry *proc_entry;
323 323
324 ice1712_eeprom_t eeprom; 324 struct snd_ice1712_eeprom eeprom;
325 325
326 unsigned int pro_volumes[20]; 326 unsigned int pro_volumes[20];
327 unsigned int omni: 1; /* Delta Omni I/O */ 327 unsigned int omni: 1; /* Delta Omni I/O */
@@ -335,16 +335,16 @@ struct _snd_ice1712 {
335 unsigned int cur_rate; /* current rate */ 335 unsigned int cur_rate; /* current rate */
336 336
337 struct semaphore open_mutex; 337 struct semaphore open_mutex;
338 snd_pcm_substream_t *pcm_reserved[4]; 338 struct snd_pcm_substream *pcm_reserved[4];
339 snd_pcm_hw_constraint_list_t *hw_rates; /* card-specific rate constraints */ 339 struct snd_pcm_hw_constraint_list *hw_rates; /* card-specific rate constraints */
340 340
341 unsigned int akm_codecs; 341 unsigned int akm_codecs;
342 akm4xxx_t *akm; 342 struct snd_akm4xxx *akm;
343 struct snd_ice1712_spdif spdif; 343 struct snd_ice1712_spdif spdif;
344 344
345 struct semaphore i2c_mutex; /* I2C mutex for ICE1724 registers */ 345 struct semaphore i2c_mutex; /* I2C mutex for ICE1724 registers */
346 snd_i2c_bus_t *i2c; /* I2C bus */ 346 struct snd_i2c_bus *i2c; /* I2C bus */
347 snd_i2c_device_t *cs8427; /* CS8427 I2C device */ 347 struct snd_i2c_device *cs8427; /* CS8427 I2C device */
348 unsigned int cs8427_timeout; /* CS8427 reset timeout in HZ/100 */ 348 unsigned int cs8427_timeout; /* CS8427 reset timeout in HZ/100 */
349 349
350 struct ice1712_gpio { 350 struct ice1712_gpio {
@@ -352,20 +352,20 @@ struct _snd_ice1712 {
352 unsigned int write_mask; /* current mask bits */ 352 unsigned int write_mask; /* current mask bits */
353 unsigned int saved[2]; /* for ewx_i2c */ 353 unsigned int saved[2]; /* for ewx_i2c */
354 /* operators */ 354 /* operators */
355 void (*set_mask)(ice1712_t *ice, unsigned int data); 355 void (*set_mask)(struct snd_ice1712 *ice, unsigned int data);
356 void (*set_dir)(ice1712_t *ice, unsigned int data); 356 void (*set_dir)(struct snd_ice1712 *ice, unsigned int data);
357 void (*set_data)(ice1712_t *ice, unsigned int data); 357 void (*set_data)(struct snd_ice1712 *ice, unsigned int data);
358 unsigned int (*get_data)(ice1712_t *ice); 358 unsigned int (*get_data)(struct snd_ice1712 *ice);
359 /* misc operators - move to another place? */ 359 /* misc operators - move to another place? */
360 void (*set_pro_rate)(ice1712_t *ice, unsigned int rate); 360 void (*set_pro_rate)(struct snd_ice1712 *ice, unsigned int rate);
361 void (*i2s_mclk_changed)(ice1712_t *ice); 361 void (*i2s_mclk_changed)(struct snd_ice1712 *ice);
362 } gpio; 362 } gpio;
363 struct semaphore gpio_mutex; 363 struct semaphore gpio_mutex;
364 364
365 /* other board-specific data */ 365 /* other board-specific data */
366 union { 366 union {
367 /* additional i2c devices for EWS boards */ 367 /* additional i2c devices for EWS boards */
368 snd_i2c_device_t *i2cdevs[3]; 368 struct snd_i2c_device *i2cdevs[3];
369 /* AC97 register cache for Aureon */ 369 /* AC97 register cache for Aureon */
370 struct aureon_spec { 370 struct aureon_spec {
371 unsigned short stac9744[64]; 371 unsigned short stac9744[64];
@@ -385,7 +385,7 @@ struct _snd_ice1712 {
385 unsigned short boxconfig[4]; 385 unsigned short boxconfig[4];
386 } hoontech; 386 } hoontech;
387 struct { 387 struct {
388 ak4114_t *ak4114; 388 struct ak4114 *ak4114;
389 unsigned int analog: 1; 389 unsigned int analog: 1;
390 } juli; 390 } juli;
391 } spec; 391 } spec;
@@ -396,22 +396,22 @@ struct _snd_ice1712 {
396/* 396/*
397 * gpio access functions 397 * gpio access functions
398 */ 398 */
399static inline void snd_ice1712_gpio_set_dir(ice1712_t *ice, unsigned int bits) 399static inline void snd_ice1712_gpio_set_dir(struct snd_ice1712 *ice, unsigned int bits)
400{ 400{
401 ice->gpio.set_dir(ice, bits); 401 ice->gpio.set_dir(ice, bits);
402} 402}
403 403
404static inline void snd_ice1712_gpio_set_mask(ice1712_t *ice, unsigned int bits) 404static inline void snd_ice1712_gpio_set_mask(struct snd_ice1712 *ice, unsigned int bits)
405{ 405{
406 ice->gpio.set_mask(ice, bits); 406 ice->gpio.set_mask(ice, bits);
407} 407}
408 408
409static inline void snd_ice1712_gpio_write(ice1712_t *ice, unsigned int val) 409static inline void snd_ice1712_gpio_write(struct snd_ice1712 *ice, unsigned int val)
410{ 410{
411 ice->gpio.set_data(ice, val); 411 ice->gpio.set_data(ice, val);
412} 412}
413 413
414static inline unsigned int snd_ice1712_gpio_read(ice1712_t *ice) 414static inline unsigned int snd_ice1712_gpio_read(struct snd_ice1712 *ice)
415{ 415{
416 return ice->gpio.get_data(ice); 416 return ice->gpio.get_data(ice);
417} 417}
@@ -421,14 +421,14 @@ static inline unsigned int snd_ice1712_gpio_read(ice1712_t *ice)
421 * The access to gpio will be protected by mutex, so don't forget to 421 * The access to gpio will be protected by mutex, so don't forget to
422 * restore! 422 * restore!
423 */ 423 */
424static inline void snd_ice1712_save_gpio_status(ice1712_t *ice) 424static inline void snd_ice1712_save_gpio_status(struct snd_ice1712 *ice)
425{ 425{
426 down(&ice->gpio_mutex); 426 down(&ice->gpio_mutex);
427 ice->gpio.saved[0] = ice->gpio.direction; 427 ice->gpio.saved[0] = ice->gpio.direction;
428 ice->gpio.saved[1] = ice->gpio.write_mask; 428 ice->gpio.saved[1] = ice->gpio.write_mask;
429} 429}
430 430
431static inline void snd_ice1712_restore_gpio_status(ice1712_t *ice) 431static inline void snd_ice1712_restore_gpio_status(struct snd_ice1712 *ice)
432{ 432{
433 ice->gpio.set_dir(ice, ice->gpio.saved[0]); 433 ice->gpio.set_dir(ice, ice->gpio.saved[0]);
434 ice->gpio.set_mask(ice, ice->gpio.saved[1]); 434 ice->gpio.set_mask(ice, ice->gpio.saved[1]);
@@ -443,14 +443,15 @@ static inline void snd_ice1712_restore_gpio_status(ice1712_t *ice)
443 .get = snd_ice1712_gpio_get, .put = snd_ice1712_gpio_put, \ 443 .get = snd_ice1712_gpio_get, .put = snd_ice1712_gpio_put, \
444 .private_value = mask | (invert << 24) } 444 .private_value = mask | (invert << 24) }
445 445
446int snd_ice1712_gpio_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); 446int snd_ice1712_gpio_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
447int snd_ice1712_gpio_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 447int snd_ice1712_gpio_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
448int snd_ice1712_gpio_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 448int snd_ice1712_gpio_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
449 449
450/* 450/*
451 * set gpio direction, write mask and data 451 * set gpio direction, write mask and data
452 */ 452 */
453static inline void snd_ice1712_gpio_write_bits(ice1712_t *ice, unsigned int mask, unsigned int bits) 453static inline void snd_ice1712_gpio_write_bits(struct snd_ice1712 *ice,
454 unsigned int mask, unsigned int bits)
454{ 455{
455 ice->gpio.direction |= mask; 456 ice->gpio.direction |= mask;
456 snd_ice1712_gpio_set_dir(ice, ice->gpio.direction); 457 snd_ice1712_gpio_set_dir(ice, ice->gpio.direction);
@@ -458,21 +459,22 @@ static inline void snd_ice1712_gpio_write_bits(ice1712_t *ice, unsigned int mask
458 snd_ice1712_gpio_write(ice, mask & bits); 459 snd_ice1712_gpio_write(ice, mask & bits);
459} 460}
460 461
461int snd_ice1712_spdif_build_controls(ice1712_t *ice); 462int snd_ice1712_spdif_build_controls(struct snd_ice1712 *ice);
462 463
463int snd_ice1712_akm4xxx_init(akm4xxx_t *ak, const akm4xxx_t *template, const struct snd_ak4xxx_private *priv, ice1712_t *ice); 464int snd_ice1712_akm4xxx_init(struct snd_akm4xxx *ak, const struct snd_akm4xxx *template,
464void snd_ice1712_akm4xxx_free(ice1712_t *ice); 465 const struct snd_ak4xxx_private *priv, struct snd_ice1712 *ice);
465int snd_ice1712_akm4xxx_build_controls(ice1712_t *ice); 466void snd_ice1712_akm4xxx_free(struct snd_ice1712 *ice);
467int snd_ice1712_akm4xxx_build_controls(struct snd_ice1712 *ice);
466 468
467int snd_ice1712_init_cs8427(ice1712_t *ice, int addr); 469int snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr);
468 470
469static inline void snd_ice1712_write(ice1712_t * ice, u8 addr, u8 data) 471static inline void snd_ice1712_write(struct snd_ice1712 * ice, u8 addr, u8 data)
470{ 472{
471 outb(addr, ICEREG(ice, INDEX)); 473 outb(addr, ICEREG(ice, INDEX));
472 outb(data, ICEREG(ice, DATA)); 474 outb(data, ICEREG(ice, DATA));
473} 475}
474 476
475static inline u8 snd_ice1712_read(ice1712_t * ice, u8 addr) 477static inline u8 snd_ice1712_read(struct snd_ice1712 * ice, u8 addr)
476{ 478{
477 outb(addr, ICEREG(ice, INDEX)); 479 outb(addr, ICEREG(ice, INDEX));
478 return inb(ICEREG(ice, DATA)); 480 return inb(ICEREG(ice, DATA));
@@ -488,8 +490,8 @@ struct snd_ice1712_card_info {
488 char *name; 490 char *name;
489 char *model; 491 char *model;
490 char *driver; 492 char *driver;
491 int (*chip_init)(ice1712_t *); 493 int (*chip_init)(struct snd_ice1712 *);
492 int (*build_controls)(ice1712_t *); 494 int (*build_controls)(struct snd_ice1712 *);
493 unsigned int no_mpu401: 1; 495 unsigned int no_mpu401: 1;
494 unsigned int eeprom_size; 496 unsigned int eeprom_size;
495 unsigned char *eeprom_data; 497 unsigned char *eeprom_data;