aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/rme96.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/rme96.c')
-rw-r--r--sound/pci/rme96.c320
1 files changed, 160 insertions, 160 deletions
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 6d422ef64999..0e694b011dcc 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -201,7 +201,7 @@ MODULE_PARM_DESC(enable, "Enable RME Digi96 soundcard.");
201#define RME96_AD1855_VOL_BITS 10 201#define RME96_AD1855_VOL_BITS 10
202 202
203 203
204typedef struct snd_rme96 { 204struct rme96 {
205 spinlock_t lock; 205 spinlock_t lock;
206 int irq; 206 int irq;
207 unsigned long port; 207 unsigned long port;
@@ -216,8 +216,8 @@ typedef struct snd_rme96 {
216 216
217 u8 rev; /* card revision number */ 217 u8 rev; /* card revision number */
218 218
219 snd_pcm_substream_t *playback_substream; 219 struct snd_pcm_substream *playback_substream;
220 snd_pcm_substream_t *capture_substream; 220 struct snd_pcm_substream *capture_substream;
221 221
222 int playback_frlog; /* log2 of framesize */ 222 int playback_frlog; /* log2 of framesize */
223 int capture_frlog; 223 int capture_frlog;
@@ -225,12 +225,12 @@ typedef struct snd_rme96 {
225 size_t playback_periodsize; /* in bytes, zero if not used */ 225 size_t playback_periodsize; /* in bytes, zero if not used */
226 size_t capture_periodsize; /* in bytes, zero if not used */ 226 size_t capture_periodsize; /* in bytes, zero if not used */
227 227
228 snd_card_t *card; 228 struct snd_card *card;
229 snd_pcm_t *spdif_pcm; 229 struct snd_pcm *spdif_pcm;
230 snd_pcm_t *adat_pcm; 230 struct snd_pcm *adat_pcm;
231 struct pci_dev *pci; 231 struct pci_dev *pci;
232 snd_kcontrol_t *spdif_ctl; 232 struct snd_kcontrol *spdif_ctl;
233} rme96_t; 233};
234 234
235static struct pci_device_id snd_rme96_ids[] = { 235static struct pci_device_id snd_rme96_ids[] = {
236 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96, 236 { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96,
@@ -257,44 +257,44 @@ MODULE_DEVICE_TABLE(pci, snd_rme96_ids);
257#define RME96_185X_MAX_OUT(rme96) ((1 << (RME96_DAC_IS_1852(rme96) ? RME96_AD1852_VOL_BITS : RME96_AD1855_VOL_BITS)) - 1) 257#define RME96_185X_MAX_OUT(rme96) ((1 << (RME96_DAC_IS_1852(rme96) ? RME96_AD1852_VOL_BITS : RME96_AD1855_VOL_BITS)) - 1)
258 258
259static int 259static int
260snd_rme96_playback_prepare(snd_pcm_substream_t *substream); 260snd_rme96_playback_prepare(struct snd_pcm_substream *substream);
261 261
262static int 262static int
263snd_rme96_capture_prepare(snd_pcm_substream_t *substream); 263snd_rme96_capture_prepare(struct snd_pcm_substream *substream);
264 264
265static int 265static int
266snd_rme96_playback_trigger(snd_pcm_substream_t *substream, 266snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
267 int cmd); 267 int cmd);
268 268
269static int 269static int
270snd_rme96_capture_trigger(snd_pcm_substream_t *substream, 270snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
271 int cmd); 271 int cmd);
272 272
273static snd_pcm_uframes_t 273static snd_pcm_uframes_t
274snd_rme96_playback_pointer(snd_pcm_substream_t *substream); 274snd_rme96_playback_pointer(struct snd_pcm_substream *substream);
275 275
276static snd_pcm_uframes_t 276static snd_pcm_uframes_t
277snd_rme96_capture_pointer(snd_pcm_substream_t *substream); 277snd_rme96_capture_pointer(struct snd_pcm_substream *substream);
278 278
279static void __devinit 279static void __devinit
280snd_rme96_proc_init(rme96_t *rme96); 280snd_rme96_proc_init(struct rme96 *rme96);
281 281
282static int 282static int
283snd_rme96_create_switches(snd_card_t *card, 283snd_rme96_create_switches(struct snd_card *card,
284 rme96_t *rme96); 284 struct rme96 *rme96);
285 285
286static int 286static int
287snd_rme96_getinputtype(rme96_t *rme96); 287snd_rme96_getinputtype(struct rme96 *rme96);
288 288
289static inline unsigned int 289static inline unsigned int
290snd_rme96_playback_ptr(rme96_t *rme96) 290snd_rme96_playback_ptr(struct rme96 *rme96)
291{ 291{
292 return (readl(rme96->iobase + RME96_IO_GET_PLAY_POS) 292 return (readl(rme96->iobase + RME96_IO_GET_PLAY_POS)
293 & RME96_RCR_AUDIO_ADDR_MASK) >> rme96->playback_frlog; 293 & RME96_RCR_AUDIO_ADDR_MASK) >> rme96->playback_frlog;
294} 294}
295 295
296static inline unsigned int 296static inline unsigned int
297snd_rme96_capture_ptr(rme96_t *rme96) 297snd_rme96_capture_ptr(struct rme96 *rme96)
298{ 298{
299 return (readl(rme96->iobase + RME96_IO_GET_REC_POS) 299 return (readl(rme96->iobase + RME96_IO_GET_REC_POS)
300 & RME96_RCR_AUDIO_ADDR_MASK) >> rme96->capture_frlog; 300 & RME96_RCR_AUDIO_ADDR_MASK) >> rme96->capture_frlog;
@@ -315,12 +315,12 @@ snd_rme96_ratecode(int rate)
315} 315}
316 316
317static int 317static int
318snd_rme96_playback_silence(snd_pcm_substream_t *substream, 318snd_rme96_playback_silence(struct snd_pcm_substream *substream,
319 int channel, /* not used (interleaved data) */ 319 int channel, /* not used (interleaved data) */
320 snd_pcm_uframes_t pos, 320 snd_pcm_uframes_t pos,
321 snd_pcm_uframes_t count) 321 snd_pcm_uframes_t count)
322{ 322{
323 rme96_t *rme96 = snd_pcm_substream_chip(substream); 323 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
324 count <<= rme96->playback_frlog; 324 count <<= rme96->playback_frlog;
325 pos <<= rme96->playback_frlog; 325 pos <<= rme96->playback_frlog;
326 memset_io(rme96->iobase + RME96_IO_PLAY_BUFFER + pos, 326 memset_io(rme96->iobase + RME96_IO_PLAY_BUFFER + pos,
@@ -329,13 +329,13 @@ snd_rme96_playback_silence(snd_pcm_substream_t *substream,
329} 329}
330 330
331static int 331static int
332snd_rme96_playback_copy(snd_pcm_substream_t *substream, 332snd_rme96_playback_copy(struct snd_pcm_substream *substream,
333 int channel, /* not used (interleaved data) */ 333 int channel, /* not used (interleaved data) */
334 snd_pcm_uframes_t pos, 334 snd_pcm_uframes_t pos,
335 void __user *src, 335 void __user *src,
336 snd_pcm_uframes_t count) 336 snd_pcm_uframes_t count)
337{ 337{
338 rme96_t *rme96 = snd_pcm_substream_chip(substream); 338 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
339 count <<= rme96->playback_frlog; 339 count <<= rme96->playback_frlog;
340 pos <<= rme96->playback_frlog; 340 pos <<= rme96->playback_frlog;
341 copy_from_user_toio(rme96->iobase + RME96_IO_PLAY_BUFFER + pos, src, 341 copy_from_user_toio(rme96->iobase + RME96_IO_PLAY_BUFFER + pos, src,
@@ -344,13 +344,13 @@ snd_rme96_playback_copy(snd_pcm_substream_t *substream,
344} 344}
345 345
346static int 346static int
347snd_rme96_capture_copy(snd_pcm_substream_t *substream, 347snd_rme96_capture_copy(struct snd_pcm_substream *substream,
348 int channel, /* not used (interleaved data) */ 348 int channel, /* not used (interleaved data) */
349 snd_pcm_uframes_t pos, 349 snd_pcm_uframes_t pos,
350 void __user *dst, 350 void __user *dst,
351 snd_pcm_uframes_t count) 351 snd_pcm_uframes_t count)
352{ 352{
353 rme96_t *rme96 = snd_pcm_substream_chip(substream); 353 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
354 count <<= rme96->capture_frlog; 354 count <<= rme96->capture_frlog;
355 pos <<= rme96->capture_frlog; 355 pos <<= rme96->capture_frlog;
356 copy_to_user_fromio(dst, rme96->iobase + RME96_IO_REC_BUFFER + pos, 356 copy_to_user_fromio(dst, rme96->iobase + RME96_IO_REC_BUFFER + pos,
@@ -361,7 +361,7 @@ snd_rme96_capture_copy(snd_pcm_substream_t *substream,
361/* 361/*
362 * Digital output capabilites (S/PDIF) 362 * Digital output capabilites (S/PDIF)
363 */ 363 */
364static snd_pcm_hardware_t snd_rme96_playback_spdif_info = 364static struct snd_pcm_hardware snd_rme96_playback_spdif_info =
365{ 365{
366 .info = (SNDRV_PCM_INFO_MMAP_IOMEM | 366 .info = (SNDRV_PCM_INFO_MMAP_IOMEM |
367 SNDRV_PCM_INFO_MMAP_VALID | 367 SNDRV_PCM_INFO_MMAP_VALID |
@@ -390,7 +390,7 @@ static snd_pcm_hardware_t snd_rme96_playback_spdif_info =
390/* 390/*
391 * Digital input capabilites (S/PDIF) 391 * Digital input capabilites (S/PDIF)
392 */ 392 */
393static snd_pcm_hardware_t snd_rme96_capture_spdif_info = 393static struct snd_pcm_hardware snd_rme96_capture_spdif_info =
394{ 394{
395 .info = (SNDRV_PCM_INFO_MMAP_IOMEM | 395 .info = (SNDRV_PCM_INFO_MMAP_IOMEM |
396 SNDRV_PCM_INFO_MMAP_VALID | 396 SNDRV_PCM_INFO_MMAP_VALID |
@@ -419,7 +419,7 @@ static snd_pcm_hardware_t snd_rme96_capture_spdif_info =
419/* 419/*
420 * Digital output capabilites (ADAT) 420 * Digital output capabilites (ADAT)
421 */ 421 */
422static snd_pcm_hardware_t snd_rme96_playback_adat_info = 422static struct snd_pcm_hardware snd_rme96_playback_adat_info =
423{ 423{
424 .info = (SNDRV_PCM_INFO_MMAP_IOMEM | 424 .info = (SNDRV_PCM_INFO_MMAP_IOMEM |
425 SNDRV_PCM_INFO_MMAP_VALID | 425 SNDRV_PCM_INFO_MMAP_VALID |
@@ -444,7 +444,7 @@ static snd_pcm_hardware_t snd_rme96_playback_adat_info =
444/* 444/*
445 * Digital input capabilites (ADAT) 445 * Digital input capabilites (ADAT)
446 */ 446 */
447static snd_pcm_hardware_t snd_rme96_capture_adat_info = 447static struct snd_pcm_hardware snd_rme96_capture_adat_info =
448{ 448{
449 .info = (SNDRV_PCM_INFO_MMAP_IOMEM | 449 .info = (SNDRV_PCM_INFO_MMAP_IOMEM |
450 SNDRV_PCM_INFO_MMAP_VALID | 450 SNDRV_PCM_INFO_MMAP_VALID |
@@ -479,7 +479,7 @@ static snd_pcm_hardware_t snd_rme96_capture_adat_info =
479 * the volume. 479 * the volume.
480 */ 480 */
481static void 481static void
482snd_rme96_write_SPI(rme96_t *rme96, u16 val) 482snd_rme96_write_SPI(struct rme96 *rme96, u16 val)
483{ 483{
484 int i; 484 int i;
485 485
@@ -506,7 +506,7 @@ snd_rme96_write_SPI(rme96_t *rme96, u16 val)
506} 506}
507 507
508static void 508static void
509snd_rme96_apply_dac_volume(rme96_t *rme96) 509snd_rme96_apply_dac_volume(struct rme96 *rme96)
510{ 510{
511 if (RME96_DAC_IS_1852(rme96)) { 511 if (RME96_DAC_IS_1852(rme96)) {
512 snd_rme96_write_SPI(rme96, (rme96->vol[0] << 2) | 0x0); 512 snd_rme96_write_SPI(rme96, (rme96->vol[0] << 2) | 0x0);
@@ -518,7 +518,7 @@ snd_rme96_apply_dac_volume(rme96_t *rme96)
518} 518}
519 519
520static void 520static void
521snd_rme96_reset_dac(rme96_t *rme96) 521snd_rme96_reset_dac(struct rme96 *rme96)
522{ 522{
523 writel(rme96->wcreg | RME96_WCR_PD, 523 writel(rme96->wcreg | RME96_WCR_PD,
524 rme96->iobase + RME96_IO_CONTROL_REGISTER); 524 rme96->iobase + RME96_IO_CONTROL_REGISTER);
@@ -526,14 +526,14 @@ snd_rme96_reset_dac(rme96_t *rme96)
526} 526}
527 527
528static int 528static int
529snd_rme96_getmontracks(rme96_t *rme96) 529snd_rme96_getmontracks(struct rme96 *rme96)
530{ 530{
531 return ((rme96->wcreg >> RME96_WCR_BITPOS_MONITOR_0) & 1) + 531 return ((rme96->wcreg >> RME96_WCR_BITPOS_MONITOR_0) & 1) +
532 (((rme96->wcreg >> RME96_WCR_BITPOS_MONITOR_1) & 1) << 1); 532 (((rme96->wcreg >> RME96_WCR_BITPOS_MONITOR_1) & 1) << 1);
533} 533}
534 534
535static int 535static int
536snd_rme96_setmontracks(rme96_t *rme96, 536snd_rme96_setmontracks(struct rme96 *rme96,
537 int montracks) 537 int montracks)
538{ 538{
539 if (montracks & 1) { 539 if (montracks & 1) {
@@ -551,14 +551,14 @@ snd_rme96_setmontracks(rme96_t *rme96,
551} 551}
552 552
553static int 553static int
554snd_rme96_getattenuation(rme96_t *rme96) 554snd_rme96_getattenuation(struct rme96 *rme96)
555{ 555{
556 return ((rme96->wcreg >> RME96_WCR_BITPOS_GAIN_0) & 1) + 556 return ((rme96->wcreg >> RME96_WCR_BITPOS_GAIN_0) & 1) +
557 (((rme96->wcreg >> RME96_WCR_BITPOS_GAIN_1) & 1) << 1); 557 (((rme96->wcreg >> RME96_WCR_BITPOS_GAIN_1) & 1) << 1);
558} 558}
559 559
560static int 560static int
561snd_rme96_setattenuation(rme96_t *rme96, 561snd_rme96_setattenuation(struct rme96 *rme96,
562 int attenuation) 562 int attenuation)
563{ 563{
564 switch (attenuation) { 564 switch (attenuation) {
@@ -586,7 +586,7 @@ snd_rme96_setattenuation(rme96_t *rme96,
586} 586}
587 587
588static int 588static int
589snd_rme96_capture_getrate(rme96_t *rme96, 589snd_rme96_capture_getrate(struct rme96 *rme96,
590 int *is_adat) 590 int *is_adat)
591{ 591{
592 int n, rate; 592 int n, rate;
@@ -649,7 +649,7 @@ snd_rme96_capture_getrate(rme96_t *rme96,
649} 649}
650 650
651static int 651static int
652snd_rme96_playback_getrate(rme96_t *rme96) 652snd_rme96_playback_getrate(struct rme96 *rme96)
653{ 653{
654 int rate, dummy; 654 int rate, dummy;
655 655
@@ -679,7 +679,7 @@ snd_rme96_playback_getrate(rme96_t *rme96)
679} 679}
680 680
681static int 681static int
682snd_rme96_playback_setrate(rme96_t *rme96, 682snd_rme96_playback_setrate(struct rme96 *rme96,
683 int rate) 683 int rate)
684{ 684{
685 int ds; 685 int ds;
@@ -731,7 +731,7 @@ snd_rme96_playback_setrate(rme96_t *rme96,
731} 731}
732 732
733static int 733static int
734snd_rme96_capture_analog_setrate(rme96_t *rme96, 734snd_rme96_capture_analog_setrate(struct rme96 *rme96,
735 int rate) 735 int rate)
736{ 736{
737 switch (rate) { 737 switch (rate) {
@@ -773,7 +773,7 @@ snd_rme96_capture_analog_setrate(rme96_t *rme96,
773} 773}
774 774
775static int 775static int
776snd_rme96_setclockmode(rme96_t *rme96, 776snd_rme96_setclockmode(struct rme96 *rme96,
777 int mode) 777 int mode)
778{ 778{
779 switch (mode) { 779 switch (mode) {
@@ -801,7 +801,7 @@ snd_rme96_setclockmode(rme96_t *rme96,
801} 801}
802 802
803static int 803static int
804snd_rme96_getclockmode(rme96_t *rme96) 804snd_rme96_getclockmode(struct rme96 *rme96)
805{ 805{
806 if (rme96->areg & RME96_AR_WSEL) { 806 if (rme96->areg & RME96_AR_WSEL) {
807 return RME96_CLOCKMODE_WORDCLOCK; 807 return RME96_CLOCKMODE_WORDCLOCK;
@@ -811,7 +811,7 @@ snd_rme96_getclockmode(rme96_t *rme96)
811} 811}
812 812
813static int 813static int
814snd_rme96_setinputtype(rme96_t *rme96, 814snd_rme96_setinputtype(struct rme96 *rme96,
815 int type) 815 int type)
816{ 816{
817 int n; 817 int n;
@@ -872,7 +872,7 @@ snd_rme96_setinputtype(rme96_t *rme96,
872} 872}
873 873
874static int 874static int
875snd_rme96_getinputtype(rme96_t *rme96) 875snd_rme96_getinputtype(struct rme96 *rme96)
876{ 876{
877 if (rme96->areg & RME96_AR_ANALOG) { 877 if (rme96->areg & RME96_AR_ANALOG) {
878 return RME96_INPUT_ANALOG; 878 return RME96_INPUT_ANALOG;
@@ -882,7 +882,7 @@ snd_rme96_getinputtype(rme96_t *rme96)
882} 882}
883 883
884static void 884static void
885snd_rme96_setframelog(rme96_t *rme96, 885snd_rme96_setframelog(struct rme96 *rme96,
886 int n_channels, 886 int n_channels,
887 int is_playback) 887 int is_playback)
888{ 888{
@@ -904,7 +904,7 @@ snd_rme96_setframelog(rme96_t *rme96,
904} 904}
905 905
906static int 906static int
907snd_rme96_playback_setformat(rme96_t *rme96, 907snd_rme96_playback_setformat(struct rme96 *rme96,
908 int format) 908 int format)
909{ 909{
910 switch (format) { 910 switch (format) {
@@ -922,7 +922,7 @@ snd_rme96_playback_setformat(rme96_t *rme96,
922} 922}
923 923
924static int 924static int
925snd_rme96_capture_setformat(rme96_t *rme96, 925snd_rme96_capture_setformat(struct rme96 *rme96,
926 int format) 926 int format)
927{ 927{
928 switch (format) { 928 switch (format) {
@@ -940,7 +940,7 @@ snd_rme96_capture_setformat(rme96_t *rme96,
940} 940}
941 941
942static void 942static void
943snd_rme96_set_period_properties(rme96_t *rme96, 943snd_rme96_set_period_properties(struct rme96 *rme96,
944 size_t period_bytes) 944 size_t period_bytes)
945{ 945{
946 switch (period_bytes) { 946 switch (period_bytes) {
@@ -959,11 +959,11 @@ snd_rme96_set_period_properties(rme96_t *rme96,
959} 959}
960 960
961static int 961static int
962snd_rme96_playback_hw_params(snd_pcm_substream_t *substream, 962snd_rme96_playback_hw_params(struct snd_pcm_substream *substream,
963 snd_pcm_hw_params_t *params) 963 struct snd_pcm_hw_params *params)
964{ 964{
965 rme96_t *rme96 = snd_pcm_substream_chip(substream); 965 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
966 snd_pcm_runtime_t *runtime = substream->runtime; 966 struct snd_pcm_runtime *runtime = substream->runtime;
967 int err, rate, dummy; 967 int err, rate, dummy;
968 968
969 runtime->dma_area = (void __force *)(rme96->iobase + 969 runtime->dma_area = (void __force *)(rme96->iobase +
@@ -1012,11 +1012,11 @@ snd_rme96_playback_hw_params(snd_pcm_substream_t *substream,
1012} 1012}
1013 1013
1014static int 1014static int
1015snd_rme96_capture_hw_params(snd_pcm_substream_t *substream, 1015snd_rme96_capture_hw_params(struct snd_pcm_substream *substream,
1016 snd_pcm_hw_params_t *params) 1016 struct snd_pcm_hw_params *params)
1017{ 1017{
1018 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1018 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1019 snd_pcm_runtime_t *runtime = substream->runtime; 1019 struct snd_pcm_runtime *runtime = substream->runtime;
1020 int err, isadat, rate; 1020 int err, isadat, rate;
1021 1021
1022 runtime->dma_area = (void __force *)(rme96->iobase + 1022 runtime->dma_area = (void __force *)(rme96->iobase +
@@ -1066,7 +1066,7 @@ snd_rme96_capture_hw_params(snd_pcm_substream_t *substream,
1066} 1066}
1067 1067
1068static void 1068static void
1069snd_rme96_playback_start(rme96_t *rme96, 1069snd_rme96_playback_start(struct rme96 *rme96,
1070 int from_pause) 1070 int from_pause)
1071{ 1071{
1072 if (!from_pause) { 1072 if (!from_pause) {
@@ -1078,7 +1078,7 @@ snd_rme96_playback_start(rme96_t *rme96,
1078} 1078}
1079 1079
1080static void 1080static void
1081snd_rme96_capture_start(rme96_t *rme96, 1081snd_rme96_capture_start(struct rme96 *rme96,
1082 int from_pause) 1082 int from_pause)
1083{ 1083{
1084 if (!from_pause) { 1084 if (!from_pause) {
@@ -1090,7 +1090,7 @@ snd_rme96_capture_start(rme96_t *rme96,
1090} 1090}
1091 1091
1092static void 1092static void
1093snd_rme96_playback_stop(rme96_t *rme96) 1093snd_rme96_playback_stop(struct rme96 *rme96)
1094{ 1094{
1095 /* 1095 /*
1096 * Check if there is an unconfirmed IRQ, if so confirm it, or else 1096 * Check if there is an unconfirmed IRQ, if so confirm it, or else
@@ -1105,7 +1105,7 @@ snd_rme96_playback_stop(rme96_t *rme96)
1105} 1105}
1106 1106
1107static void 1107static void
1108snd_rme96_capture_stop(rme96_t *rme96) 1108snd_rme96_capture_stop(struct rme96 *rme96)
1109{ 1109{
1110 rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER); 1110 rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
1111 if (rme96->rcreg & RME96_RCR_IRQ_2) { 1111 if (rme96->rcreg & RME96_RCR_IRQ_2) {
@@ -1120,7 +1120,7 @@ snd_rme96_interrupt(int irq,
1120 void *dev_id, 1120 void *dev_id,
1121 struct pt_regs *regs) 1121 struct pt_regs *regs)
1122{ 1122{
1123 rme96_t *rme96 = (rme96_t *)dev_id; 1123 struct rme96 *rme96 = (struct rme96 *)dev_id;
1124 1124
1125 rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER); 1125 rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
1126 /* fastpath out, to ease interrupt sharing */ 1126 /* fastpath out, to ease interrupt sharing */
@@ -1145,18 +1145,18 @@ snd_rme96_interrupt(int irq,
1145 1145
1146static unsigned int period_bytes[] = { RME96_SMALL_BLOCK_SIZE, RME96_LARGE_BLOCK_SIZE }; 1146static unsigned int period_bytes[] = { RME96_SMALL_BLOCK_SIZE, RME96_LARGE_BLOCK_SIZE };
1147 1147
1148static snd_pcm_hw_constraint_list_t hw_constraints_period_bytes = { 1148static struct snd_pcm_hw_constraint_list hw_constraints_period_bytes = {
1149 .count = ARRAY_SIZE(period_bytes), 1149 .count = ARRAY_SIZE(period_bytes),
1150 .list = period_bytes, 1150 .list = period_bytes,
1151 .mask = 0 1151 .mask = 0
1152}; 1152};
1153 1153
1154static int 1154static int
1155snd_rme96_playback_spdif_open(snd_pcm_substream_t *substream) 1155snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
1156{ 1156{
1157 int rate, dummy; 1157 int rate, dummy;
1158 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1158 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1159 snd_pcm_runtime_t *runtime = substream->runtime; 1159 struct snd_pcm_runtime *runtime = substream->runtime;
1160 1160
1161 snd_pcm_set_sync(substream); 1161 snd_pcm_set_sync(substream);
1162 1162
@@ -1191,11 +1191,11 @@ snd_rme96_playback_spdif_open(snd_pcm_substream_t *substream)
1191} 1191}
1192 1192
1193static int 1193static int
1194snd_rme96_capture_spdif_open(snd_pcm_substream_t *substream) 1194snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream)
1195{ 1195{
1196 int isadat, rate; 1196 int isadat, rate;
1197 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1197 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1198 snd_pcm_runtime_t *runtime = substream->runtime; 1198 struct snd_pcm_runtime *runtime = substream->runtime;
1199 1199
1200 snd_pcm_set_sync(substream); 1200 snd_pcm_set_sync(substream);
1201 1201
@@ -1226,11 +1226,11 @@ snd_rme96_capture_spdif_open(snd_pcm_substream_t *substream)
1226} 1226}
1227 1227
1228static int 1228static int
1229snd_rme96_playback_adat_open(snd_pcm_substream_t *substream) 1229snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
1230{ 1230{
1231 int rate, dummy; 1231 int rate, dummy;
1232 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1232 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1233 snd_pcm_runtime_t *runtime = substream->runtime; 1233 struct snd_pcm_runtime *runtime = substream->runtime;
1234 1234
1235 snd_pcm_set_sync(substream); 1235 snd_pcm_set_sync(substream);
1236 1236
@@ -1260,11 +1260,11 @@ snd_rme96_playback_adat_open(snd_pcm_substream_t *substream)
1260} 1260}
1261 1261
1262static int 1262static int
1263snd_rme96_capture_adat_open(snd_pcm_substream_t *substream) 1263snd_rme96_capture_adat_open(struct snd_pcm_substream *substream)
1264{ 1264{
1265 int isadat, rate; 1265 int isadat, rate;
1266 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1266 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1267 snd_pcm_runtime_t *runtime = substream->runtime; 1267 struct snd_pcm_runtime *runtime = substream->runtime;
1268 1268
1269 snd_pcm_set_sync(substream); 1269 snd_pcm_set_sync(substream);
1270 1270
@@ -1297,9 +1297,9 @@ snd_rme96_capture_adat_open(snd_pcm_substream_t *substream)
1297} 1297}
1298 1298
1299static int 1299static int
1300snd_rme96_playback_close(snd_pcm_substream_t *substream) 1300snd_rme96_playback_close(struct snd_pcm_substream *substream)
1301{ 1301{
1302 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1302 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1303 int spdif = 0; 1303 int spdif = 0;
1304 1304
1305 spin_lock_irq(&rme96->lock); 1305 spin_lock_irq(&rme96->lock);
@@ -1319,9 +1319,9 @@ snd_rme96_playback_close(snd_pcm_substream_t *substream)
1319} 1319}
1320 1320
1321static int 1321static int
1322snd_rme96_capture_close(snd_pcm_substream_t *substream) 1322snd_rme96_capture_close(struct snd_pcm_substream *substream)
1323{ 1323{
1324 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1324 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1325 1325
1326 spin_lock_irq(&rme96->lock); 1326 spin_lock_irq(&rme96->lock);
1327 if (RME96_ISRECORDING(rme96)) { 1327 if (RME96_ISRECORDING(rme96)) {
@@ -1334,9 +1334,9 @@ snd_rme96_capture_close(snd_pcm_substream_t *substream)
1334} 1334}
1335 1335
1336static int 1336static int
1337snd_rme96_playback_prepare(snd_pcm_substream_t *substream) 1337snd_rme96_playback_prepare(struct snd_pcm_substream *substream)
1338{ 1338{
1339 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1339 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1340 1340
1341 spin_lock_irq(&rme96->lock); 1341 spin_lock_irq(&rme96->lock);
1342 if (RME96_ISPLAYING(rme96)) { 1342 if (RME96_ISPLAYING(rme96)) {
@@ -1348,9 +1348,9 @@ snd_rme96_playback_prepare(snd_pcm_substream_t *substream)
1348} 1348}
1349 1349
1350static int 1350static int
1351snd_rme96_capture_prepare(snd_pcm_substream_t *substream) 1351snd_rme96_capture_prepare(struct snd_pcm_substream *substream)
1352{ 1352{
1353 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1353 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1354 1354
1355 spin_lock_irq(&rme96->lock); 1355 spin_lock_irq(&rme96->lock);
1356 if (RME96_ISRECORDING(rme96)) { 1356 if (RME96_ISRECORDING(rme96)) {
@@ -1362,10 +1362,10 @@ snd_rme96_capture_prepare(snd_pcm_substream_t *substream)
1362} 1362}
1363 1363
1364static int 1364static int
1365snd_rme96_playback_trigger(snd_pcm_substream_t *substream, 1365snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
1366 int cmd) 1366 int cmd)
1367{ 1367{
1368 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1368 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1369 1369
1370 switch (cmd) { 1370 switch (cmd) {
1371 case SNDRV_PCM_TRIGGER_START: 1371 case SNDRV_PCM_TRIGGER_START:
@@ -1405,10 +1405,10 @@ snd_rme96_playback_trigger(snd_pcm_substream_t *substream,
1405} 1405}
1406 1406
1407static int 1407static int
1408snd_rme96_capture_trigger(snd_pcm_substream_t *substream, 1408snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
1409 int cmd) 1409 int cmd)
1410{ 1410{
1411 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1411 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1412 1412
1413 switch (cmd) { 1413 switch (cmd) {
1414 case SNDRV_PCM_TRIGGER_START: 1414 case SNDRV_PCM_TRIGGER_START:
@@ -1449,20 +1449,20 @@ snd_rme96_capture_trigger(snd_pcm_substream_t *substream,
1449} 1449}
1450 1450
1451static snd_pcm_uframes_t 1451static snd_pcm_uframes_t
1452snd_rme96_playback_pointer(snd_pcm_substream_t *substream) 1452snd_rme96_playback_pointer(struct snd_pcm_substream *substream)
1453{ 1453{
1454 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1454 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1455 return snd_rme96_playback_ptr(rme96); 1455 return snd_rme96_playback_ptr(rme96);
1456} 1456}
1457 1457
1458static snd_pcm_uframes_t 1458static snd_pcm_uframes_t
1459snd_rme96_capture_pointer(snd_pcm_substream_t *substream) 1459snd_rme96_capture_pointer(struct snd_pcm_substream *substream)
1460{ 1460{
1461 rme96_t *rme96 = snd_pcm_substream_chip(substream); 1461 struct rme96 *rme96 = snd_pcm_substream_chip(substream);
1462 return snd_rme96_capture_ptr(rme96); 1462 return snd_rme96_capture_ptr(rme96);
1463} 1463}
1464 1464
1465static snd_pcm_ops_t snd_rme96_playback_spdif_ops = { 1465static struct snd_pcm_ops snd_rme96_playback_spdif_ops = {
1466 .open = snd_rme96_playback_spdif_open, 1466 .open = snd_rme96_playback_spdif_open,
1467 .close = snd_rme96_playback_close, 1467 .close = snd_rme96_playback_close,
1468 .ioctl = snd_pcm_lib_ioctl, 1468 .ioctl = snd_pcm_lib_ioctl,
@@ -1475,7 +1475,7 @@ static snd_pcm_ops_t snd_rme96_playback_spdif_ops = {
1475 .mmap = snd_pcm_lib_mmap_iomem, 1475 .mmap = snd_pcm_lib_mmap_iomem,
1476}; 1476};
1477 1477
1478static snd_pcm_ops_t snd_rme96_capture_spdif_ops = { 1478static struct snd_pcm_ops snd_rme96_capture_spdif_ops = {
1479 .open = snd_rme96_capture_spdif_open, 1479 .open = snd_rme96_capture_spdif_open,
1480 .close = snd_rme96_capture_close, 1480 .close = snd_rme96_capture_close,
1481 .ioctl = snd_pcm_lib_ioctl, 1481 .ioctl = snd_pcm_lib_ioctl,
@@ -1487,7 +1487,7 @@ static snd_pcm_ops_t snd_rme96_capture_spdif_ops = {
1487 .mmap = snd_pcm_lib_mmap_iomem, 1487 .mmap = snd_pcm_lib_mmap_iomem,
1488}; 1488};
1489 1489
1490static snd_pcm_ops_t snd_rme96_playback_adat_ops = { 1490static struct snd_pcm_ops snd_rme96_playback_adat_ops = {
1491 .open = snd_rme96_playback_adat_open, 1491 .open = snd_rme96_playback_adat_open,
1492 .close = snd_rme96_playback_close, 1492 .close = snd_rme96_playback_close,
1493 .ioctl = snd_pcm_lib_ioctl, 1493 .ioctl = snd_pcm_lib_ioctl,
@@ -1500,7 +1500,7 @@ static snd_pcm_ops_t snd_rme96_playback_adat_ops = {
1500 .mmap = snd_pcm_lib_mmap_iomem, 1500 .mmap = snd_pcm_lib_mmap_iomem,
1501}; 1501};
1502 1502
1503static snd_pcm_ops_t snd_rme96_capture_adat_ops = { 1503static struct snd_pcm_ops snd_rme96_capture_adat_ops = {
1504 .open = snd_rme96_capture_adat_open, 1504 .open = snd_rme96_capture_adat_open,
1505 .close = snd_rme96_capture_close, 1505 .close = snd_rme96_capture_close,
1506 .ioctl = snd_pcm_lib_ioctl, 1506 .ioctl = snd_pcm_lib_ioctl,
@@ -1515,7 +1515,7 @@ static snd_pcm_ops_t snd_rme96_capture_adat_ops = {
1515static void 1515static void
1516snd_rme96_free(void *private_data) 1516snd_rme96_free(void *private_data)
1517{ 1517{
1518 rme96_t *rme96 = (rme96_t *)private_data; 1518 struct rme96 *rme96 = (struct rme96 *)private_data;
1519 1519
1520 if (rme96 == NULL) { 1520 if (rme96 == NULL) {
1521 return; 1521 return;
@@ -1540,21 +1540,21 @@ snd_rme96_free(void *private_data)
1540} 1540}
1541 1541
1542static void 1542static void
1543snd_rme96_free_spdif_pcm(snd_pcm_t *pcm) 1543snd_rme96_free_spdif_pcm(struct snd_pcm *pcm)
1544{ 1544{
1545 rme96_t *rme96 = (rme96_t *) pcm->private_data; 1545 struct rme96 *rme96 = (struct rme96 *) pcm->private_data;
1546 rme96->spdif_pcm = NULL; 1546 rme96->spdif_pcm = NULL;
1547} 1547}
1548 1548
1549static void 1549static void
1550snd_rme96_free_adat_pcm(snd_pcm_t *pcm) 1550snd_rme96_free_adat_pcm(struct snd_pcm *pcm)
1551{ 1551{
1552 rme96_t *rme96 = (rme96_t *) pcm->private_data; 1552 struct rme96 *rme96 = (struct rme96 *) pcm->private_data;
1553 rme96->adat_pcm = NULL; 1553 rme96->adat_pcm = NULL;
1554} 1554}
1555 1555
1556static int __devinit 1556static int __devinit
1557snd_rme96_create(rme96_t *rme96) 1557snd_rme96_create(struct rme96 *rme96)
1558{ 1558{
1559 struct pci_dev *pci = rme96->pci; 1559 struct pci_dev *pci = rme96->pci;
1560 int err; 1560 int err;
@@ -1671,10 +1671,10 @@ snd_rme96_create(rme96_t *rme96)
1671 */ 1671 */
1672 1672
1673static void 1673static void
1674snd_rme96_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) 1674snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
1675{ 1675{
1676 int n; 1676 int n;
1677 rme96_t *rme96 = (rme96_t *)entry->private_data; 1677 struct rme96 *rme96 = (struct rme96 *)entry->private_data;
1678 1678
1679 rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER); 1679 rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
1680 1680
@@ -1800,9 +1800,9 @@ snd_rme96_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
1800} 1800}
1801 1801
1802static void __devinit 1802static void __devinit
1803snd_rme96_proc_init(rme96_t *rme96) 1803snd_rme96_proc_init(struct rme96 *rme96)
1804{ 1804{
1805 snd_info_entry_t *entry; 1805 struct snd_info_entry *entry;
1806 1806
1807 if (! snd_card_proc_new(rme96->card, "rme96", &entry)) 1807 if (! snd_card_proc_new(rme96->card, "rme96", &entry))
1808 snd_info_set_text_ops(entry, rme96, 1024, snd_rme96_proc_read); 1808 snd_info_set_text_ops(entry, rme96, 1024, snd_rme96_proc_read);
@@ -1813,7 +1813,7 @@ snd_rme96_proc_init(rme96_t *rme96)
1813 */ 1813 */
1814 1814
1815static int 1815static int
1816snd_rme96_info_loopback_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1816snd_rme96_info_loopback_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1817{ 1817{
1818 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1818 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1819 uinfo->count = 1; 1819 uinfo->count = 1;
@@ -1822,9 +1822,9 @@ snd_rme96_info_loopback_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *
1822 return 0; 1822 return 0;
1823} 1823}
1824static int 1824static int
1825snd_rme96_get_loopback_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1825snd_rme96_get_loopback_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1826{ 1826{
1827 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 1827 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
1828 1828
1829 spin_lock_irq(&rme96->lock); 1829 spin_lock_irq(&rme96->lock);
1830 ucontrol->value.integer.value[0] = rme96->wcreg & RME96_WCR_SEL ? 0 : 1; 1830 ucontrol->value.integer.value[0] = rme96->wcreg & RME96_WCR_SEL ? 0 : 1;
@@ -1832,9 +1832,9 @@ snd_rme96_get_loopback_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *
1832 return 0; 1832 return 0;
1833} 1833}
1834static int 1834static int
1835snd_rme96_put_loopback_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1835snd_rme96_put_loopback_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1836{ 1836{
1837 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 1837 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
1838 unsigned int val; 1838 unsigned int val;
1839 int change; 1839 int change;
1840 1840
@@ -1849,10 +1849,10 @@ snd_rme96_put_loopback_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *
1849} 1849}
1850 1850
1851static int 1851static int
1852snd_rme96_info_inputtype_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1852snd_rme96_info_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1853{ 1853{
1854 static char *_texts[5] = { "Optical", "Coaxial", "Internal", "XLR", "Analog" }; 1854 static char *_texts[5] = { "Optical", "Coaxial", "Internal", "XLR", "Analog" };
1855 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 1855 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
1856 char *texts[5] = { _texts[0], _texts[1], _texts[2], _texts[3], _texts[4] }; 1856 char *texts[5] = { _texts[0], _texts[1], _texts[2], _texts[3], _texts[4] };
1857 1857
1858 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 1858 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
@@ -1886,9 +1886,9 @@ snd_rme96_info_inputtype_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *
1886 return 0; 1886 return 0;
1887} 1887}
1888static int 1888static int
1889snd_rme96_get_inputtype_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1889snd_rme96_get_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1890{ 1890{
1891 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 1891 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
1892 unsigned int items = 3; 1892 unsigned int items = 3;
1893 1893
1894 spin_lock_irq(&rme96->lock); 1894 spin_lock_irq(&rme96->lock);
@@ -1925,9 +1925,9 @@ snd_rme96_get_inputtype_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
1925 return 0; 1925 return 0;
1926} 1926}
1927static int 1927static int
1928snd_rme96_put_inputtype_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1928snd_rme96_put_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1929{ 1929{
1930 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 1930 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
1931 unsigned int val; 1931 unsigned int val;
1932 int change, items = 3; 1932 int change, items = 3;
1933 1933
@@ -1967,7 +1967,7 @@ snd_rme96_put_inputtype_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
1967} 1967}
1968 1968
1969static int 1969static int
1970snd_rme96_info_clockmode_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1970snd_rme96_info_clockmode_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1971{ 1971{
1972 static char *texts[3] = { "AutoSync", "Internal", "Word" }; 1972 static char *texts[3] = { "AutoSync", "Internal", "Word" };
1973 1973
@@ -1981,9 +1981,9 @@ snd_rme96_info_clockmode_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *
1981 return 0; 1981 return 0;
1982} 1982}
1983static int 1983static int
1984snd_rme96_get_clockmode_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1984snd_rme96_get_clockmode_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1985{ 1985{
1986 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 1986 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
1987 1987
1988 spin_lock_irq(&rme96->lock); 1988 spin_lock_irq(&rme96->lock);
1989 ucontrol->value.enumerated.item[0] = snd_rme96_getclockmode(rme96); 1989 ucontrol->value.enumerated.item[0] = snd_rme96_getclockmode(rme96);
@@ -1991,9 +1991,9 @@ snd_rme96_get_clockmode_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
1991 return 0; 1991 return 0;
1992} 1992}
1993static int 1993static int
1994snd_rme96_put_clockmode_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1994snd_rme96_put_clockmode_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1995{ 1995{
1996 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 1996 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
1997 unsigned int val; 1997 unsigned int val;
1998 int change; 1998 int change;
1999 1999
@@ -2006,7 +2006,7 @@ snd_rme96_put_clockmode_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
2006} 2006}
2007 2007
2008static int 2008static int
2009snd_rme96_info_attenuation_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2009snd_rme96_info_attenuation_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
2010{ 2010{
2011 static char *texts[4] = { "0 dB", "-6 dB", "-12 dB", "-18 dB" }; 2011 static char *texts[4] = { "0 dB", "-6 dB", "-12 dB", "-18 dB" };
2012 2012
@@ -2020,9 +2020,9 @@ snd_rme96_info_attenuation_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t
2020 return 0; 2020 return 0;
2021} 2021}
2022static int 2022static int
2023snd_rme96_get_attenuation_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2023snd_rme96_get_attenuation_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2024{ 2024{
2025 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 2025 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
2026 2026
2027 spin_lock_irq(&rme96->lock); 2027 spin_lock_irq(&rme96->lock);
2028 ucontrol->value.enumerated.item[0] = snd_rme96_getattenuation(rme96); 2028 ucontrol->value.enumerated.item[0] = snd_rme96_getattenuation(rme96);
@@ -2030,9 +2030,9 @@ snd_rme96_get_attenuation_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
2030 return 0; 2030 return 0;
2031} 2031}
2032static int 2032static int
2033snd_rme96_put_attenuation_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2033snd_rme96_put_attenuation_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2034{ 2034{
2035 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 2035 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
2036 unsigned int val; 2036 unsigned int val;
2037 int change; 2037 int change;
2038 2038
@@ -2046,7 +2046,7 @@ snd_rme96_put_attenuation_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
2046} 2046}
2047 2047
2048static int 2048static int
2049snd_rme96_info_montracks_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2049snd_rme96_info_montracks_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
2050{ 2050{
2051 static char *texts[4] = { "1+2", "3+4", "5+6", "7+8" }; 2051 static char *texts[4] = { "1+2", "3+4", "5+6", "7+8" };
2052 2052
@@ -2060,9 +2060,9 @@ snd_rme96_info_montracks_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *
2060 return 0; 2060 return 0;
2061} 2061}
2062static int 2062static int
2063snd_rme96_get_montracks_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2063snd_rme96_get_montracks_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2064{ 2064{
2065 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 2065 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
2066 2066
2067 spin_lock_irq(&rme96->lock); 2067 spin_lock_irq(&rme96->lock);
2068 ucontrol->value.enumerated.item[0] = snd_rme96_getmontracks(rme96); 2068 ucontrol->value.enumerated.item[0] = snd_rme96_getmontracks(rme96);
@@ -2070,9 +2070,9 @@ snd_rme96_get_montracks_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
2070 return 0; 2070 return 0;
2071} 2071}
2072static int 2072static int
2073snd_rme96_put_montracks_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2073snd_rme96_put_montracks_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2074{ 2074{
2075 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 2075 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
2076 unsigned int val; 2076 unsigned int val;
2077 int change; 2077 int change;
2078 2078
@@ -2084,7 +2084,7 @@ snd_rme96_put_montracks_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
2084 return change; 2084 return change;
2085} 2085}
2086 2086
2087static u32 snd_rme96_convert_from_aes(snd_aes_iec958_t *aes) 2087static u32 snd_rme96_convert_from_aes(struct snd_aes_iec958 *aes)
2088{ 2088{
2089 u32 val = 0; 2089 u32 val = 0;
2090 val |= (aes->status[0] & IEC958_AES0_PROFESSIONAL) ? RME96_WCR_PRO : 0; 2090 val |= (aes->status[0] & IEC958_AES0_PROFESSIONAL) ? RME96_WCR_PRO : 0;
@@ -2096,7 +2096,7 @@ static u32 snd_rme96_convert_from_aes(snd_aes_iec958_t *aes)
2096 return val; 2096 return val;
2097} 2097}
2098 2098
2099static void snd_rme96_convert_to_aes(snd_aes_iec958_t *aes, u32 val) 2099static void snd_rme96_convert_to_aes(struct snd_aes_iec958 *aes, u32 val)
2100{ 2100{
2101 aes->status[0] = ((val & RME96_WCR_PRO) ? IEC958_AES0_PROFESSIONAL : 0) | 2101 aes->status[0] = ((val & RME96_WCR_PRO) ? IEC958_AES0_PROFESSIONAL : 0) |
2102 ((val & RME96_WCR_DOLBY) ? IEC958_AES0_NONAUDIO : 0); 2102 ((val & RME96_WCR_DOLBY) ? IEC958_AES0_NONAUDIO : 0);
@@ -2106,24 +2106,24 @@ static void snd_rme96_convert_to_aes(snd_aes_iec958_t *aes, u32 val)
2106 aes->status[0] |= (val & RME96_WCR_EMP) ? IEC958_AES0_CON_EMPHASIS_5015 : 0; 2106 aes->status[0] |= (val & RME96_WCR_EMP) ? IEC958_AES0_CON_EMPHASIS_5015 : 0;
2107} 2107}
2108 2108
2109static int snd_rme96_control_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2109static int snd_rme96_control_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
2110{ 2110{
2111 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 2111 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
2112 uinfo->count = 1; 2112 uinfo->count = 1;
2113 return 0; 2113 return 0;
2114} 2114}
2115 2115
2116static int snd_rme96_control_spdif_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2116static int snd_rme96_control_spdif_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2117{ 2117{
2118 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 2118 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
2119 2119
2120 snd_rme96_convert_to_aes(&ucontrol->value.iec958, rme96->wcreg_spdif); 2120 snd_rme96_convert_to_aes(&ucontrol->value.iec958, rme96->wcreg_spdif);
2121 return 0; 2121 return 0;
2122} 2122}
2123 2123
2124static int snd_rme96_control_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2124static int snd_rme96_control_spdif_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2125{ 2125{
2126 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 2126 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
2127 int change; 2127 int change;
2128 u32 val; 2128 u32 val;
2129 2129
@@ -2135,24 +2135,24 @@ static int snd_rme96_control_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_v
2135 return change; 2135 return change;
2136} 2136}
2137 2137
2138static int snd_rme96_control_spdif_stream_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2138static int snd_rme96_control_spdif_stream_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
2139{ 2139{
2140 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 2140 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
2141 uinfo->count = 1; 2141 uinfo->count = 1;
2142 return 0; 2142 return 0;
2143} 2143}
2144 2144
2145static int snd_rme96_control_spdif_stream_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2145static int snd_rme96_control_spdif_stream_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2146{ 2146{
2147 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 2147 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
2148 2148
2149 snd_rme96_convert_to_aes(&ucontrol->value.iec958, rme96->wcreg_spdif_stream); 2149 snd_rme96_convert_to_aes(&ucontrol->value.iec958, rme96->wcreg_spdif_stream);
2150 return 0; 2150 return 0;
2151} 2151}
2152 2152
2153static int snd_rme96_control_spdif_stream_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2153static int snd_rme96_control_spdif_stream_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2154{ 2154{
2155 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 2155 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
2156 int change; 2156 int change;
2157 u32 val; 2157 u32 val;
2158 2158
@@ -2167,23 +2167,23 @@ static int snd_rme96_control_spdif_stream_put(snd_kcontrol_t * kcontrol, snd_ctl
2167 return change; 2167 return change;
2168} 2168}
2169 2169
2170static int snd_rme96_control_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2170static int snd_rme96_control_spdif_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
2171{ 2171{
2172 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 2172 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
2173 uinfo->count = 1; 2173 uinfo->count = 1;
2174 return 0; 2174 return 0;
2175} 2175}
2176 2176
2177static int snd_rme96_control_spdif_mask_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 2177static int snd_rme96_control_spdif_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
2178{ 2178{
2179 ucontrol->value.iec958.status[0] = kcontrol->private_value; 2179 ucontrol->value.iec958.status[0] = kcontrol->private_value;
2180 return 0; 2180 return 0;
2181} 2181}
2182 2182
2183static int 2183static int
2184snd_rme96_dac_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2184snd_rme96_dac_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
2185{ 2185{
2186 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 2186 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
2187 2187
2188 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 2188 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
2189 uinfo->count = 2; 2189 uinfo->count = 2;
@@ -2193,9 +2193,9 @@ snd_rme96_dac_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
2193} 2193}
2194 2194
2195static int 2195static int
2196snd_rme96_dac_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u) 2196snd_rme96_dac_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *u)
2197{ 2197{
2198 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 2198 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
2199 2199
2200 spin_lock_irq(&rme96->lock); 2200 spin_lock_irq(&rme96->lock);
2201 u->value.integer.value[0] = rme96->vol[0]; 2201 u->value.integer.value[0] = rme96->vol[0];
@@ -2206,9 +2206,9 @@ snd_rme96_dac_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u)
2206} 2206}
2207 2207
2208static int 2208static int
2209snd_rme96_dac_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u) 2209snd_rme96_dac_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *u)
2210{ 2210{
2211 rme96_t *rme96 = snd_kcontrol_chip(kcontrol); 2211 struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
2212 int change = 0; 2212 int change = 0;
2213 2213
2214 if (!RME96_HAS_ANALOG_OUT(rme96)) { 2214 if (!RME96_HAS_ANALOG_OUT(rme96)) {
@@ -2231,7 +2231,7 @@ snd_rme96_dac_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u)
2231 return change; 2231 return change;
2232} 2232}
2233 2233
2234static snd_kcontrol_new_t snd_rme96_controls[] = { 2234static struct snd_kcontrol_new snd_rme96_controls[] = {
2235{ 2235{
2236 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2236 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
2237 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 2237 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
@@ -2312,11 +2312,11 @@ static snd_kcontrol_new_t snd_rme96_controls[] = {
2312}; 2312};
2313 2313
2314static int 2314static int
2315snd_rme96_create_switches(snd_card_t *card, 2315snd_rme96_create_switches(struct snd_card *card,
2316 rme96_t *rme96) 2316 struct rme96 *rme96)
2317{ 2317{
2318 int idx, err; 2318 int idx, err;
2319 snd_kcontrol_t *kctl; 2319 struct snd_kcontrol *kctl;
2320 2320
2321 for (idx = 0; idx < 7; idx++) { 2321 for (idx = 0; idx < 7; idx++) {
2322 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_rme96_controls[idx], rme96))) < 0) 2322 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_rme96_controls[idx], rme96))) < 0)
@@ -2338,7 +2338,7 @@ snd_rme96_create_switches(snd_card_t *card,
2338 * Card initialisation 2338 * Card initialisation
2339 */ 2339 */
2340 2340
2341static void snd_rme96_card_free(snd_card_t *card) 2341static void snd_rme96_card_free(struct snd_card *card)
2342{ 2342{
2343 snd_rme96_free(card->private_data); 2343 snd_rme96_free(card->private_data);
2344} 2344}
@@ -2348,8 +2348,8 @@ snd_rme96_probe(struct pci_dev *pci,
2348 const struct pci_device_id *pci_id) 2348 const struct pci_device_id *pci_id)
2349{ 2349{
2350 static int dev; 2350 static int dev;
2351 rme96_t *rme96; 2351 struct rme96 *rme96;
2352 snd_card_t *card; 2352 struct snd_card *card;
2353 int err; 2353 int err;
2354 u8 val; 2354 u8 val;
2355 2355
@@ -2361,10 +2361,10 @@ snd_rme96_probe(struct pci_dev *pci,
2361 return -ENOENT; 2361 return -ENOENT;
2362 } 2362 }
2363 if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, 2363 if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
2364 sizeof(rme96_t))) == NULL) 2364 sizeof(struct rme96))) == NULL)
2365 return -ENOMEM; 2365 return -ENOMEM;
2366 card->private_free = snd_rme96_card_free; 2366 card->private_free = snd_rme96_card_free;
2367 rme96 = (rme96_t *)card->private_data; 2367 rme96 = (struct rme96 *)card->private_data;
2368 rme96->card = card; 2368 rme96->card = card;
2369 rme96->pci = pci; 2369 rme96->pci = pci;
2370 snd_card_set_dev(card, &pci->dev); 2370 snd_card_set_dev(card, &pci->dev);