diff options
Diffstat (limited to 'sound/pci/ice1712/delta.c')
-rw-r--r-- | sound/pci/ice1712/delta.c | 82 |
1 files changed, 41 insertions, 41 deletions
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 */ |
47 | static void ap_cs8427_write_byte(ice1712_t *ice, unsigned char data, unsigned char tmp) | 47 | static 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 */ |
64 | static unsigned char ap_cs8427_read_byte(ice1712_t *ice, unsigned char tmp) | 64 | static 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 */ |
83 | static unsigned char ap_cs8427_codec_select(ice1712_t *ice) | 83 | static 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 */ |
108 | static void ap_cs8427_codec_deassert(ice1712_t *ice, unsigned char tmp) | 108 | static 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 */ |
127 | static int ap_cs8427_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, int count) | 127 | static 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 */ |
144 | static int ap_cs8427_readbytes(snd_i2c_device_t *device, unsigned char *bytes, int count) | 144 | static 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 | ||
160 | static int ap_cs8427_probeaddr(snd_i2c_bus_t *bus, unsigned short addr) | 160 | static 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 | ||
167 | static snd_i2c_ops_t ap_cs8427_i2c_ops = { | 167 | static 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 | ||
176 | static void snd_ice1712_delta_cs8403_spdif_write(ice1712_t *ice, unsigned char bits) | 176 | static 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 | ||
201 | static void delta_spdif_default_get(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) | 201 | static 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 | ||
206 | static int delta_spdif_default_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) | 206 | static 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 | ||
224 | static void delta_spdif_stream_get(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) | 224 | static 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 | ||
229 | static int delta_spdif_stream_put(ice1712_t *ice, snd_ctl_elem_value_t * ucontrol) | 229 | static 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 | */ |
251 | static void delta_ak4524_lock(akm4xxx_t *ak, int chip) | 251 | static 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 | */ |
265 | static void delta1010lt_ak4524_lock(akm4xxx_t *ak, int chip) | 265 | static 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 | */ |
278 | static void vx442_ak4524_lock(akm4xxx_t *ak, int chip) | 278 | static 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 | */ |
292 | static void delta_1010_set_rate_val(ice1712_t *ice, unsigned int rate) | 292 | static 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 | */ |
312 | static void delta_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate) | 312 | static 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 | */ |
344 | static void vx442_ak4524_set_rate_val(akm4xxx_t *ak, unsigned int rate) | 344 | static 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 */ |
364 | static void delta_open_spdif(ice1712_t *ice, snd_pcm_substream_t * substream) | 364 | static 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 */ |
370 | static void delta_setup_spdif(ice1712_t *ice, int rate) | 370 | static 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 | ||
399 | static akm4xxx_t akm_audiophile __devinitdata = { | 399 | static 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 | ||
420 | static akm4xxx_t akm_delta410 __devinitdata = { | 420 | static 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 | ||
441 | static akm4xxx_t akm_delta1010lt __devinitdata = { | 441 | static 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 | ||
463 | static akm4xxx_t akm_delta44 __devinitdata = { | 463 | static 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 | ||
485 | static akm4xxx_t akm_vx442 __devinitdata = { | 485 | static 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 | ||
507 | static int __devinit snd_ice1712_delta_init(ice1712_t *ice) | 507 | static 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 | ||
620 | static snd_kcontrol_new_t snd_ice1712_delta1010_wordclock_select __devinitdata = | 620 | static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select __devinitdata = |
621 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0); | 621 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0); |
622 | static snd_kcontrol_new_t snd_ice1712_delta1010lt_wordclock_select __devinitdata = | 622 | static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select __devinitdata = |
623 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 1, 0); | 623 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 1, 0); |
624 | static snd_kcontrol_new_t snd_ice1712_delta1010_wordclock_status __devinitdata = | 624 | static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status __devinitdata = |
625 | ICE1712_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); | 625 | ICE1712_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); |
626 | static snd_kcontrol_new_t snd_ice1712_deltadio2496_spdif_in_select __devinitdata = | 626 | static struct snd_kcontrol_new snd_ice1712_deltadio2496_spdif_in_select __devinitdata = |
627 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, ICE1712_DELTA_SPDIF_INPUT_SELECT, 0, 0); | 627 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, ICE1712_DELTA_SPDIF_INPUT_SELECT, 0, 0); |
628 | static snd_kcontrol_new_t snd_ice1712_delta_spdif_in_status __devinitdata = | 628 | static struct snd_kcontrol_new snd_ice1712_delta_spdif_in_status __devinitdata = |
629 | ICE1712_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); | 629 | ICE1712_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 | ||
632 | static int __devinit snd_ice1712_delta_add_controls(ice1712_t *ice) | 632 | static int __devinit snd_ice1712_delta_add_controls(struct snd_ice1712 *ice) |
633 | { | 633 | { |
634 | int err; | 634 | int err; |
635 | 635 | ||