diff options
Diffstat (limited to 'sound/pci/rme9652/hdsp.c')
-rw-r--r-- | sound/pci/rme9652/hdsp.c | 744 |
1 files changed, 370 insertions, 374 deletions
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index d15ffb3e9b0a..ebf7a2b86c23 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
@@ -394,11 +394,7 @@ MODULE_SUPPORTED_DEVICE("{{RME Hammerfall-DSP}," | |||
394 | #endif | 394 | #endif |
395 | #endif | 395 | #endif |
396 | 396 | ||
397 | typedef struct _hdsp hdsp_t; | 397 | struct hdsp_9632_meters { |
398 | typedef struct _hdsp_midi hdsp_midi_t; | ||
399 | typedef struct _hdsp_9632_meters hdsp_9632_meters_t; | ||
400 | |||
401 | struct _hdsp_9632_meters { | ||
402 | u32 input_peak[16]; | 398 | u32 input_peak[16]; |
403 | u32 playback_peak[16]; | 399 | u32 playback_peak[16]; |
404 | u32 output_peak[16]; | 400 | u32 output_peak[16]; |
@@ -414,23 +410,23 @@ struct _hdsp_9632_meters { | |||
414 | u32 xxx_rms_high[16]; | 410 | u32 xxx_rms_high[16]; |
415 | }; | 411 | }; |
416 | 412 | ||
417 | struct _hdsp_midi { | 413 | struct hdsp_midi { |
418 | hdsp_t *hdsp; | 414 | struct hdsp *hdsp; |
419 | int id; | 415 | int id; |
420 | snd_rawmidi_t *rmidi; | 416 | struct snd_rawmidi *rmidi; |
421 | snd_rawmidi_substream_t *input; | 417 | struct snd_rawmidi_substream *input; |
422 | snd_rawmidi_substream_t *output; | 418 | struct snd_rawmidi_substream *output; |
423 | char istimer; /* timer in use */ | 419 | char istimer; /* timer in use */ |
424 | struct timer_list timer; | 420 | struct timer_list timer; |
425 | spinlock_t lock; | 421 | spinlock_t lock; |
426 | int pending; | 422 | int pending; |
427 | }; | 423 | }; |
428 | 424 | ||
429 | struct _hdsp { | 425 | struct hdsp { |
430 | spinlock_t lock; | 426 | spinlock_t lock; |
431 | snd_pcm_substream_t *capture_substream; | 427 | struct snd_pcm_substream *capture_substream; |
432 | snd_pcm_substream_t *playback_substream; | 428 | struct snd_pcm_substream *playback_substream; |
433 | hdsp_midi_t midi[2]; | 429 | struct hdsp_midi midi[2]; |
434 | struct tasklet_struct midi_tasklet; | 430 | struct tasklet_struct midi_tasklet; |
435 | int use_midi_tasklet; | 431 | int use_midi_tasklet; |
436 | int precise_ptr; | 432 | int precise_ptr; |
@@ -440,7 +436,7 @@ struct _hdsp { | |||
440 | u32 creg_spdif_stream; | 436 | u32 creg_spdif_stream; |
441 | int clock_source_locked; | 437 | int clock_source_locked; |
442 | char *card_name; /* digiface/multiface */ | 438 | char *card_name; /* digiface/multiface */ |
443 | HDSP_IO_Type io_type; /* ditto, but for code use */ | 439 | enum HDSP_IO_Type io_type; /* ditto, but for code use */ |
444 | unsigned short firmware_rev; | 440 | unsigned short firmware_rev; |
445 | unsigned short state; /* stores state bits */ | 441 | unsigned short state; /* stores state bits */ |
446 | u32 firmware_cache[24413]; /* this helps recover from accidental iobox power failure */ | 442 | u32 firmware_cache[24413]; /* this helps recover from accidental iobox power failure */ |
@@ -467,11 +463,11 @@ struct _hdsp { | |||
467 | int irq; | 463 | int irq; |
468 | unsigned long port; | 464 | unsigned long port; |
469 | void __iomem *iobase; | 465 | void __iomem *iobase; |
470 | snd_card_t *card; | 466 | struct snd_card *card; |
471 | snd_pcm_t *pcm; | 467 | struct snd_pcm *pcm; |
472 | snd_hwdep_t *hwdep; | 468 | struct snd_hwdep *hwdep; |
473 | struct pci_dev *pci; | 469 | struct pci_dev *pci; |
474 | snd_kcontrol_t *spdif_ctl; | 470 | struct snd_kcontrol *spdif_ctl; |
475 | unsigned short mixer_matrix[HDSP_MATRIX_MIXER_SIZE]; | 471 | unsigned short mixer_matrix[HDSP_MATRIX_MIXER_SIZE]; |
476 | }; | 472 | }; |
477 | 473 | ||
@@ -585,17 +581,17 @@ static struct pci_device_id snd_hdsp_ids[] = { | |||
585 | MODULE_DEVICE_TABLE(pci, snd_hdsp_ids); | 581 | MODULE_DEVICE_TABLE(pci, snd_hdsp_ids); |
586 | 582 | ||
587 | /* prototypes */ | 583 | /* prototypes */ |
588 | static int snd_hdsp_create_alsa_devices(snd_card_t *card, hdsp_t *hdsp); | 584 | static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp); |
589 | static int snd_hdsp_create_pcm(snd_card_t *card, hdsp_t *hdsp); | 585 | static int snd_hdsp_create_pcm(struct snd_card *card, struct hdsp *hdsp); |
590 | static int snd_hdsp_enable_io (hdsp_t *hdsp); | 586 | static int snd_hdsp_enable_io (struct hdsp *hdsp); |
591 | static void snd_hdsp_initialize_midi_flush (hdsp_t *hdsp); | 587 | static void snd_hdsp_initialize_midi_flush (struct hdsp *hdsp); |
592 | static void snd_hdsp_initialize_channels (hdsp_t *hdsp); | 588 | static void snd_hdsp_initialize_channels (struct hdsp *hdsp); |
593 | static int hdsp_fifo_wait(hdsp_t *hdsp, int count, int timeout); | 589 | static int hdsp_fifo_wait(struct hdsp *hdsp, int count, int timeout); |
594 | static int hdsp_autosync_ref(hdsp_t *hdsp); | 590 | static int hdsp_autosync_ref(struct hdsp *hdsp); |
595 | static int snd_hdsp_set_defaults(hdsp_t *hdsp); | 591 | static int snd_hdsp_set_defaults(struct hdsp *hdsp); |
596 | static void snd_hdsp_9652_enable_mixer (hdsp_t *hdsp); | 592 | static void snd_hdsp_9652_enable_mixer (struct hdsp *hdsp); |
597 | 593 | ||
598 | static int hdsp_playback_to_output_key (hdsp_t *hdsp, int in, int out) | 594 | static int hdsp_playback_to_output_key (struct hdsp *hdsp, int in, int out) |
599 | { | 595 | { |
600 | switch (hdsp->firmware_rev) { | 596 | switch (hdsp->firmware_rev) { |
601 | case 0xa: | 597 | case 0xa: |
@@ -608,7 +604,7 @@ static int hdsp_playback_to_output_key (hdsp_t *hdsp, int in, int out) | |||
608 | } | 604 | } |
609 | } | 605 | } |
610 | 606 | ||
611 | static int hdsp_input_to_output_key (hdsp_t *hdsp, int in, int out) | 607 | static int hdsp_input_to_output_key (struct hdsp *hdsp, int in, int out) |
612 | { | 608 | { |
613 | switch (hdsp->firmware_rev) { | 609 | switch (hdsp->firmware_rev) { |
614 | case 0xa: | 610 | case 0xa: |
@@ -621,17 +617,17 @@ static int hdsp_input_to_output_key (hdsp_t *hdsp, int in, int out) | |||
621 | } | 617 | } |
622 | } | 618 | } |
623 | 619 | ||
624 | static void hdsp_write(hdsp_t *hdsp, int reg, int val) | 620 | static void hdsp_write(struct hdsp *hdsp, int reg, int val) |
625 | { | 621 | { |
626 | writel(val, hdsp->iobase + reg); | 622 | writel(val, hdsp->iobase + reg); |
627 | } | 623 | } |
628 | 624 | ||
629 | static unsigned int hdsp_read(hdsp_t *hdsp, int reg) | 625 | static unsigned int hdsp_read(struct hdsp *hdsp, int reg) |
630 | { | 626 | { |
631 | return readl (hdsp->iobase + reg); | 627 | return readl (hdsp->iobase + reg); |
632 | } | 628 | } |
633 | 629 | ||
634 | static int hdsp_check_for_iobox (hdsp_t *hdsp) | 630 | static int hdsp_check_for_iobox (struct hdsp *hdsp) |
635 | { | 631 | { |
636 | 632 | ||
637 | if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0; | 633 | if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0; |
@@ -644,7 +640,7 @@ static int hdsp_check_for_iobox (hdsp_t *hdsp) | |||
644 | 640 | ||
645 | } | 641 | } |
646 | 642 | ||
647 | static int snd_hdsp_load_firmware_from_cache(hdsp_t *hdsp) { | 643 | static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) { |
648 | 644 | ||
649 | int i; | 645 | int i; |
650 | unsigned long flags; | 646 | unsigned long flags; |
@@ -699,7 +695,7 @@ static int snd_hdsp_load_firmware_from_cache(hdsp_t *hdsp) { | |||
699 | return 0; | 695 | return 0; |
700 | } | 696 | } |
701 | 697 | ||
702 | static int hdsp_get_iobox_version (hdsp_t *hdsp) | 698 | static int hdsp_get_iobox_version (struct hdsp *hdsp) |
703 | { | 699 | { |
704 | if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) { | 700 | if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) { |
705 | 701 | ||
@@ -730,7 +726,7 @@ static int hdsp_get_iobox_version (hdsp_t *hdsp) | |||
730 | } | 726 | } |
731 | 727 | ||
732 | 728 | ||
733 | static int hdsp_check_for_firmware (hdsp_t *hdsp, int show_err) | 729 | static int hdsp_check_for_firmware (struct hdsp *hdsp, int show_err) |
734 | { | 730 | { |
735 | if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0; | 731 | if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0; |
736 | if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) { | 732 | if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) { |
@@ -751,7 +747,7 @@ static int hdsp_check_for_firmware (hdsp_t *hdsp, int show_err) | |||
751 | } | 747 | } |
752 | 748 | ||
753 | 749 | ||
754 | static int hdsp_fifo_wait(hdsp_t *hdsp, int count, int timeout) | 750 | static int hdsp_fifo_wait(struct hdsp *hdsp, int count, int timeout) |
755 | { | 751 | { |
756 | int i; | 752 | int i; |
757 | 753 | ||
@@ -776,7 +772,7 @@ static int hdsp_fifo_wait(hdsp_t *hdsp, int count, int timeout) | |||
776 | return -1; | 772 | return -1; |
777 | } | 773 | } |
778 | 774 | ||
779 | static int hdsp_read_gain (hdsp_t *hdsp, unsigned int addr) | 775 | static int hdsp_read_gain (struct hdsp *hdsp, unsigned int addr) |
780 | { | 776 | { |
781 | if (addr >= HDSP_MATRIX_MIXER_SIZE) | 777 | if (addr >= HDSP_MATRIX_MIXER_SIZE) |
782 | return 0; | 778 | return 0; |
@@ -784,7 +780,7 @@ static int hdsp_read_gain (hdsp_t *hdsp, unsigned int addr) | |||
784 | return hdsp->mixer_matrix[addr]; | 780 | return hdsp->mixer_matrix[addr]; |
785 | } | 781 | } |
786 | 782 | ||
787 | static int hdsp_write_gain(hdsp_t *hdsp, unsigned int addr, unsigned short data) | 783 | static int hdsp_write_gain(struct hdsp *hdsp, unsigned int addr, unsigned short data) |
788 | { | 784 | { |
789 | unsigned int ad; | 785 | unsigned int ad; |
790 | 786 | ||
@@ -844,7 +840,7 @@ static int hdsp_write_gain(hdsp_t *hdsp, unsigned int addr, unsigned short data) | |||
844 | return 0; | 840 | return 0; |
845 | } | 841 | } |
846 | 842 | ||
847 | static int snd_hdsp_use_is_exclusive(hdsp_t *hdsp) | 843 | static int snd_hdsp_use_is_exclusive(struct hdsp *hdsp) |
848 | { | 844 | { |
849 | unsigned long flags; | 845 | unsigned long flags; |
850 | int ret = 1; | 846 | int ret = 1; |
@@ -857,7 +853,7 @@ static int snd_hdsp_use_is_exclusive(hdsp_t *hdsp) | |||
857 | return ret; | 853 | return ret; |
858 | } | 854 | } |
859 | 855 | ||
860 | static int hdsp_external_sample_rate (hdsp_t *hdsp) | 856 | static int hdsp_external_sample_rate (struct hdsp *hdsp) |
861 | { | 857 | { |
862 | unsigned int status2 = hdsp_read(hdsp, HDSP_status2Register); | 858 | unsigned int status2 = hdsp_read(hdsp, HDSP_status2Register); |
863 | unsigned int rate_bits = status2 & HDSP_systemFrequencyMask; | 859 | unsigned int rate_bits = status2 & HDSP_systemFrequencyMask; |
@@ -874,7 +870,7 @@ static int hdsp_external_sample_rate (hdsp_t *hdsp) | |||
874 | } | 870 | } |
875 | } | 871 | } |
876 | 872 | ||
877 | static int hdsp_spdif_sample_rate(hdsp_t *hdsp) | 873 | static int hdsp_spdif_sample_rate(struct hdsp *hdsp) |
878 | { | 874 | { |
879 | unsigned int status = hdsp_read(hdsp, HDSP_statusRegister); | 875 | unsigned int status = hdsp_read(hdsp, HDSP_statusRegister); |
880 | unsigned int rate_bits = (status & HDSP_spdifFrequencyMask); | 876 | unsigned int rate_bits = (status & HDSP_spdifFrequencyMask); |
@@ -905,12 +901,12 @@ static int hdsp_spdif_sample_rate(hdsp_t *hdsp) | |||
905 | return 0; | 901 | return 0; |
906 | } | 902 | } |
907 | 903 | ||
908 | static void hdsp_compute_period_size(hdsp_t *hdsp) | 904 | static void hdsp_compute_period_size(struct hdsp *hdsp) |
909 | { | 905 | { |
910 | hdsp->period_bytes = 1 << ((hdsp_decode_latency(hdsp->control_register) + 8)); | 906 | hdsp->period_bytes = 1 << ((hdsp_decode_latency(hdsp->control_register) + 8)); |
911 | } | 907 | } |
912 | 908 | ||
913 | static snd_pcm_uframes_t hdsp_hw_pointer(hdsp_t *hdsp) | 909 | static snd_pcm_uframes_t hdsp_hw_pointer(struct hdsp *hdsp) |
914 | { | 910 | { |
915 | int position; | 911 | int position; |
916 | 912 | ||
@@ -925,29 +921,29 @@ static snd_pcm_uframes_t hdsp_hw_pointer(hdsp_t *hdsp) | |||
925 | return position; | 921 | return position; |
926 | } | 922 | } |
927 | 923 | ||
928 | static void hdsp_reset_hw_pointer(hdsp_t *hdsp) | 924 | static void hdsp_reset_hw_pointer(struct hdsp *hdsp) |
929 | { | 925 | { |
930 | hdsp_write (hdsp, HDSP_resetPointer, 0); | 926 | hdsp_write (hdsp, HDSP_resetPointer, 0); |
931 | } | 927 | } |
932 | 928 | ||
933 | static void hdsp_start_audio(hdsp_t *s) | 929 | static void hdsp_start_audio(struct hdsp *s) |
934 | { | 930 | { |
935 | s->control_register |= (HDSP_AudioInterruptEnable | HDSP_Start); | 931 | s->control_register |= (HDSP_AudioInterruptEnable | HDSP_Start); |
936 | hdsp_write(s, HDSP_controlRegister, s->control_register); | 932 | hdsp_write(s, HDSP_controlRegister, s->control_register); |
937 | } | 933 | } |
938 | 934 | ||
939 | static void hdsp_stop_audio(hdsp_t *s) | 935 | static void hdsp_stop_audio(struct hdsp *s) |
940 | { | 936 | { |
941 | s->control_register &= ~(HDSP_Start | HDSP_AudioInterruptEnable); | 937 | s->control_register &= ~(HDSP_Start | HDSP_AudioInterruptEnable); |
942 | hdsp_write(s, HDSP_controlRegister, s->control_register); | 938 | hdsp_write(s, HDSP_controlRegister, s->control_register); |
943 | } | 939 | } |
944 | 940 | ||
945 | static void hdsp_silence_playback(hdsp_t *hdsp) | 941 | static void hdsp_silence_playback(struct hdsp *hdsp) |
946 | { | 942 | { |
947 | memset(hdsp->playback_buffer, 0, HDSP_DMA_AREA_BYTES); | 943 | memset(hdsp->playback_buffer, 0, HDSP_DMA_AREA_BYTES); |
948 | } | 944 | } |
949 | 945 | ||
950 | static int hdsp_set_interrupt_interval(hdsp_t *s, unsigned int frames) | 946 | static int hdsp_set_interrupt_interval(struct hdsp *s, unsigned int frames) |
951 | { | 947 | { |
952 | int n; | 948 | int n; |
953 | 949 | ||
@@ -972,7 +968,7 @@ static int hdsp_set_interrupt_interval(hdsp_t *s, unsigned int frames) | |||
972 | return 0; | 968 | return 0; |
973 | } | 969 | } |
974 | 970 | ||
975 | static int hdsp_set_rate(hdsp_t *hdsp, int rate, int called_internally) | 971 | static int hdsp_set_rate(struct hdsp *hdsp, int rate, int called_internally) |
976 | { | 972 | { |
977 | int reject_if_open = 0; | 973 | int reject_if_open = 0; |
978 | int current_rate; | 974 | int current_rate; |
@@ -1114,7 +1110,7 @@ static int hdsp_set_rate(hdsp_t *hdsp, int rate, int called_internally) | |||
1114 | MIDI | 1110 | MIDI |
1115 | ----------------------------------------------------------------------------*/ | 1111 | ----------------------------------------------------------------------------*/ |
1116 | 1112 | ||
1117 | static unsigned char snd_hdsp_midi_read_byte (hdsp_t *hdsp, int id) | 1113 | static unsigned char snd_hdsp_midi_read_byte (struct hdsp *hdsp, int id) |
1118 | { | 1114 | { |
1119 | /* the hardware already does the relevant bit-mask with 0xff */ | 1115 | /* the hardware already does the relevant bit-mask with 0xff */ |
1120 | if (id) | 1116 | if (id) |
@@ -1123,7 +1119,7 @@ static unsigned char snd_hdsp_midi_read_byte (hdsp_t *hdsp, int id) | |||
1123 | return hdsp_read(hdsp, HDSP_midiDataIn0); | 1119 | return hdsp_read(hdsp, HDSP_midiDataIn0); |
1124 | } | 1120 | } |
1125 | 1121 | ||
1126 | static void snd_hdsp_midi_write_byte (hdsp_t *hdsp, int id, int val) | 1122 | static void snd_hdsp_midi_write_byte (struct hdsp *hdsp, int id, int val) |
1127 | { | 1123 | { |
1128 | /* the hardware already does the relevant bit-mask with 0xff */ | 1124 | /* the hardware already does the relevant bit-mask with 0xff */ |
1129 | if (id) | 1125 | if (id) |
@@ -1132,7 +1128,7 @@ static void snd_hdsp_midi_write_byte (hdsp_t *hdsp, int id, int val) | |||
1132 | hdsp_write(hdsp, HDSP_midiDataOut0, val); | 1128 | hdsp_write(hdsp, HDSP_midiDataOut0, val); |
1133 | } | 1129 | } |
1134 | 1130 | ||
1135 | static int snd_hdsp_midi_input_available (hdsp_t *hdsp, int id) | 1131 | static int snd_hdsp_midi_input_available (struct hdsp *hdsp, int id) |
1136 | { | 1132 | { |
1137 | if (id) | 1133 | if (id) |
1138 | return (hdsp_read(hdsp, HDSP_midiStatusIn1) & 0xff); | 1134 | return (hdsp_read(hdsp, HDSP_midiStatusIn1) & 0xff); |
@@ -1140,7 +1136,7 @@ static int snd_hdsp_midi_input_available (hdsp_t *hdsp, int id) | |||
1140 | return (hdsp_read(hdsp, HDSP_midiStatusIn0) & 0xff); | 1136 | return (hdsp_read(hdsp, HDSP_midiStatusIn0) & 0xff); |
1141 | } | 1137 | } |
1142 | 1138 | ||
1143 | static int snd_hdsp_midi_output_possible (hdsp_t *hdsp, int id) | 1139 | static int snd_hdsp_midi_output_possible (struct hdsp *hdsp, int id) |
1144 | { | 1140 | { |
1145 | int fifo_bytes_used; | 1141 | int fifo_bytes_used; |
1146 | 1142 | ||
@@ -1155,13 +1151,13 @@ static int snd_hdsp_midi_output_possible (hdsp_t *hdsp, int id) | |||
1155 | return 0; | 1151 | return 0; |
1156 | } | 1152 | } |
1157 | 1153 | ||
1158 | static void snd_hdsp_flush_midi_input (hdsp_t *hdsp, int id) | 1154 | static void snd_hdsp_flush_midi_input (struct hdsp *hdsp, int id) |
1159 | { | 1155 | { |
1160 | while (snd_hdsp_midi_input_available (hdsp, id)) | 1156 | while (snd_hdsp_midi_input_available (hdsp, id)) |
1161 | snd_hdsp_midi_read_byte (hdsp, id); | 1157 | snd_hdsp_midi_read_byte (hdsp, id); |
1162 | } | 1158 | } |
1163 | 1159 | ||
1164 | static int snd_hdsp_midi_output_write (hdsp_midi_t *hmidi) | 1160 | static int snd_hdsp_midi_output_write (struct hdsp_midi *hmidi) |
1165 | { | 1161 | { |
1166 | unsigned long flags; | 1162 | unsigned long flags; |
1167 | int n_pending; | 1163 | int n_pending; |
@@ -1189,7 +1185,7 @@ static int snd_hdsp_midi_output_write (hdsp_midi_t *hmidi) | |||
1189 | return 0; | 1185 | return 0; |
1190 | } | 1186 | } |
1191 | 1187 | ||
1192 | static int snd_hdsp_midi_input_read (hdsp_midi_t *hmidi) | 1188 | static int snd_hdsp_midi_input_read (struct hdsp_midi *hmidi) |
1193 | { | 1189 | { |
1194 | unsigned char buf[128]; /* this buffer is designed to match the MIDI input FIFO size */ | 1190 | unsigned char buf[128]; /* this buffer is designed to match the MIDI input FIFO size */ |
1195 | unsigned long flags; | 1191 | unsigned long flags; |
@@ -1221,14 +1217,14 @@ static int snd_hdsp_midi_input_read (hdsp_midi_t *hmidi) | |||
1221 | return snd_hdsp_midi_output_write (hmidi); | 1217 | return snd_hdsp_midi_output_write (hmidi); |
1222 | } | 1218 | } |
1223 | 1219 | ||
1224 | static void snd_hdsp_midi_input_trigger(snd_rawmidi_substream_t * substream, int up) | 1220 | static void snd_hdsp_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) |
1225 | { | 1221 | { |
1226 | hdsp_t *hdsp; | 1222 | struct hdsp *hdsp; |
1227 | hdsp_midi_t *hmidi; | 1223 | struct hdsp_midi *hmidi; |
1228 | unsigned long flags; | 1224 | unsigned long flags; |
1229 | u32 ie; | 1225 | u32 ie; |
1230 | 1226 | ||
1231 | hmidi = (hdsp_midi_t *) substream->rmidi->private_data; | 1227 | hmidi = (struct hdsp_midi *) substream->rmidi->private_data; |
1232 | hdsp = hmidi->hdsp; | 1228 | hdsp = hmidi->hdsp; |
1233 | ie = hmidi->id ? HDSP_Midi1InterruptEnable : HDSP_Midi0InterruptEnable; | 1229 | ie = hmidi->id ? HDSP_Midi1InterruptEnable : HDSP_Midi0InterruptEnable; |
1234 | spin_lock_irqsave (&hdsp->lock, flags); | 1230 | spin_lock_irqsave (&hdsp->lock, flags); |
@@ -1248,7 +1244,7 @@ static void snd_hdsp_midi_input_trigger(snd_rawmidi_substream_t * substream, int | |||
1248 | 1244 | ||
1249 | static void snd_hdsp_midi_output_timer(unsigned long data) | 1245 | static void snd_hdsp_midi_output_timer(unsigned long data) |
1250 | { | 1246 | { |
1251 | hdsp_midi_t *hmidi = (hdsp_midi_t *) data; | 1247 | struct hdsp_midi *hmidi = (struct hdsp_midi *) data; |
1252 | unsigned long flags; | 1248 | unsigned long flags; |
1253 | 1249 | ||
1254 | snd_hdsp_midi_output_write(hmidi); | 1250 | snd_hdsp_midi_output_write(hmidi); |
@@ -1268,12 +1264,12 @@ static void snd_hdsp_midi_output_timer(unsigned long data) | |||
1268 | spin_unlock_irqrestore (&hmidi->lock, flags); | 1264 | spin_unlock_irqrestore (&hmidi->lock, flags); |
1269 | } | 1265 | } |
1270 | 1266 | ||
1271 | static void snd_hdsp_midi_output_trigger(snd_rawmidi_substream_t * substream, int up) | 1267 | static void snd_hdsp_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) |
1272 | { | 1268 | { |
1273 | hdsp_midi_t *hmidi; | 1269 | struct hdsp_midi *hmidi; |
1274 | unsigned long flags; | 1270 | unsigned long flags; |
1275 | 1271 | ||
1276 | hmidi = (hdsp_midi_t *) substream->rmidi->private_data; | 1272 | hmidi = (struct hdsp_midi *) substream->rmidi->private_data; |
1277 | spin_lock_irqsave (&hmidi->lock, flags); | 1273 | spin_lock_irqsave (&hmidi->lock, flags); |
1278 | if (up) { | 1274 | if (up) { |
1279 | if (!hmidi->istimer) { | 1275 | if (!hmidi->istimer) { |
@@ -1293,11 +1289,11 @@ static void snd_hdsp_midi_output_trigger(snd_rawmidi_substream_t * substream, in | |||
1293 | snd_hdsp_midi_output_write(hmidi); | 1289 | snd_hdsp_midi_output_write(hmidi); |
1294 | } | 1290 | } |
1295 | 1291 | ||
1296 | static int snd_hdsp_midi_input_open(snd_rawmidi_substream_t * substream) | 1292 | static int snd_hdsp_midi_input_open(struct snd_rawmidi_substream *substream) |
1297 | { | 1293 | { |
1298 | hdsp_midi_t *hmidi; | 1294 | struct hdsp_midi *hmidi; |
1299 | 1295 | ||
1300 | hmidi = (hdsp_midi_t *) substream->rmidi->private_data; | 1296 | hmidi = (struct hdsp_midi *) substream->rmidi->private_data; |
1301 | spin_lock_irq (&hmidi->lock); | 1297 | spin_lock_irq (&hmidi->lock); |
1302 | snd_hdsp_flush_midi_input (hmidi->hdsp, hmidi->id); | 1298 | snd_hdsp_flush_midi_input (hmidi->hdsp, hmidi->id); |
1303 | hmidi->input = substream; | 1299 | hmidi->input = substream; |
@@ -1306,11 +1302,11 @@ static int snd_hdsp_midi_input_open(snd_rawmidi_substream_t * substream) | |||
1306 | return 0; | 1302 | return 0; |
1307 | } | 1303 | } |
1308 | 1304 | ||
1309 | static int snd_hdsp_midi_output_open(snd_rawmidi_substream_t * substream) | 1305 | static int snd_hdsp_midi_output_open(struct snd_rawmidi_substream *substream) |
1310 | { | 1306 | { |
1311 | hdsp_midi_t *hmidi; | 1307 | struct hdsp_midi *hmidi; |
1312 | 1308 | ||
1313 | hmidi = (hdsp_midi_t *) substream->rmidi->private_data; | 1309 | hmidi = (struct hdsp_midi *) substream->rmidi->private_data; |
1314 | spin_lock_irq (&hmidi->lock); | 1310 | spin_lock_irq (&hmidi->lock); |
1315 | hmidi->output = substream; | 1311 | hmidi->output = substream; |
1316 | spin_unlock_irq (&hmidi->lock); | 1312 | spin_unlock_irq (&hmidi->lock); |
@@ -1318,13 +1314,13 @@ static int snd_hdsp_midi_output_open(snd_rawmidi_substream_t * substream) | |||
1318 | return 0; | 1314 | return 0; |
1319 | } | 1315 | } |
1320 | 1316 | ||
1321 | static int snd_hdsp_midi_input_close(snd_rawmidi_substream_t * substream) | 1317 | static int snd_hdsp_midi_input_close(struct snd_rawmidi_substream *substream) |
1322 | { | 1318 | { |
1323 | hdsp_midi_t *hmidi; | 1319 | struct hdsp_midi *hmidi; |
1324 | 1320 | ||
1325 | snd_hdsp_midi_input_trigger (substream, 0); | 1321 | snd_hdsp_midi_input_trigger (substream, 0); |
1326 | 1322 | ||
1327 | hmidi = (hdsp_midi_t *) substream->rmidi->private_data; | 1323 | hmidi = (struct hdsp_midi *) substream->rmidi->private_data; |
1328 | spin_lock_irq (&hmidi->lock); | 1324 | spin_lock_irq (&hmidi->lock); |
1329 | hmidi->input = NULL; | 1325 | hmidi->input = NULL; |
1330 | spin_unlock_irq (&hmidi->lock); | 1326 | spin_unlock_irq (&hmidi->lock); |
@@ -1332,13 +1328,13 @@ static int snd_hdsp_midi_input_close(snd_rawmidi_substream_t * substream) | |||
1332 | return 0; | 1328 | return 0; |
1333 | } | 1329 | } |
1334 | 1330 | ||
1335 | static int snd_hdsp_midi_output_close(snd_rawmidi_substream_t * substream) | 1331 | static int snd_hdsp_midi_output_close(struct snd_rawmidi_substream *substream) |
1336 | { | 1332 | { |
1337 | hdsp_midi_t *hmidi; | 1333 | struct hdsp_midi *hmidi; |
1338 | 1334 | ||
1339 | snd_hdsp_midi_output_trigger (substream, 0); | 1335 | snd_hdsp_midi_output_trigger (substream, 0); |
1340 | 1336 | ||
1341 | hmidi = (hdsp_midi_t *) substream->rmidi->private_data; | 1337 | hmidi = (struct hdsp_midi *) substream->rmidi->private_data; |
1342 | spin_lock_irq (&hmidi->lock); | 1338 | spin_lock_irq (&hmidi->lock); |
1343 | hmidi->output = NULL; | 1339 | hmidi->output = NULL; |
1344 | spin_unlock_irq (&hmidi->lock); | 1340 | spin_unlock_irq (&hmidi->lock); |
@@ -1346,21 +1342,21 @@ static int snd_hdsp_midi_output_close(snd_rawmidi_substream_t * substream) | |||
1346 | return 0; | 1342 | return 0; |
1347 | } | 1343 | } |
1348 | 1344 | ||
1349 | static snd_rawmidi_ops_t snd_hdsp_midi_output = | 1345 | static struct snd_rawmidi_ops snd_hdsp_midi_output = |
1350 | { | 1346 | { |
1351 | .open = snd_hdsp_midi_output_open, | 1347 | .open = snd_hdsp_midi_output_open, |
1352 | .close = snd_hdsp_midi_output_close, | 1348 | .close = snd_hdsp_midi_output_close, |
1353 | .trigger = snd_hdsp_midi_output_trigger, | 1349 | .trigger = snd_hdsp_midi_output_trigger, |
1354 | }; | 1350 | }; |
1355 | 1351 | ||
1356 | static snd_rawmidi_ops_t snd_hdsp_midi_input = | 1352 | static struct snd_rawmidi_ops snd_hdsp_midi_input = |
1357 | { | 1353 | { |
1358 | .open = snd_hdsp_midi_input_open, | 1354 | .open = snd_hdsp_midi_input_open, |
1359 | .close = snd_hdsp_midi_input_close, | 1355 | .close = snd_hdsp_midi_input_close, |
1360 | .trigger = snd_hdsp_midi_input_trigger, | 1356 | .trigger = snd_hdsp_midi_input_trigger, |
1361 | }; | 1357 | }; |
1362 | 1358 | ||
1363 | static int __devinit snd_hdsp_create_midi (snd_card_t *card, hdsp_t *hdsp, int id) | 1359 | static int __devinit snd_hdsp_create_midi (struct snd_card *card, struct hdsp *hdsp, int id) |
1364 | { | 1360 | { |
1365 | char buf[32]; | 1361 | char buf[32]; |
1366 | 1362 | ||
@@ -1394,7 +1390,7 @@ static int __devinit snd_hdsp_create_midi (snd_card_t *card, hdsp_t *hdsp, int i | |||
1394 | Control Interface | 1390 | Control Interface |
1395 | ----------------------------------------------------------------------------*/ | 1391 | ----------------------------------------------------------------------------*/ |
1396 | 1392 | ||
1397 | static u32 snd_hdsp_convert_from_aes(snd_aes_iec958_t *aes) | 1393 | static u32 snd_hdsp_convert_from_aes(struct snd_aes_iec958 *aes) |
1398 | { | 1394 | { |
1399 | u32 val = 0; | 1395 | u32 val = 0; |
1400 | val |= (aes->status[0] & IEC958_AES0_PROFESSIONAL) ? HDSP_SPDIFProfessional : 0; | 1396 | val |= (aes->status[0] & IEC958_AES0_PROFESSIONAL) ? HDSP_SPDIFProfessional : 0; |
@@ -1406,7 +1402,7 @@ static u32 snd_hdsp_convert_from_aes(snd_aes_iec958_t *aes) | |||
1406 | return val; | 1402 | return val; |
1407 | } | 1403 | } |
1408 | 1404 | ||
1409 | static void snd_hdsp_convert_to_aes(snd_aes_iec958_t *aes, u32 val) | 1405 | static void snd_hdsp_convert_to_aes(struct snd_aes_iec958 *aes, u32 val) |
1410 | { | 1406 | { |
1411 | aes->status[0] = ((val & HDSP_SPDIFProfessional) ? IEC958_AES0_PROFESSIONAL : 0) | | 1407 | aes->status[0] = ((val & HDSP_SPDIFProfessional) ? IEC958_AES0_PROFESSIONAL : 0) | |
1412 | ((val & HDSP_SPDIFNonAudio) ? IEC958_AES0_NONAUDIO : 0); | 1408 | ((val & HDSP_SPDIFNonAudio) ? IEC958_AES0_NONAUDIO : 0); |
@@ -1416,24 +1412,24 @@ static void snd_hdsp_convert_to_aes(snd_aes_iec958_t *aes, u32 val) | |||
1416 | aes->status[0] |= (val & HDSP_SPDIFEmphasis) ? IEC958_AES0_CON_EMPHASIS_5015 : 0; | 1412 | aes->status[0] |= (val & HDSP_SPDIFEmphasis) ? IEC958_AES0_CON_EMPHASIS_5015 : 0; |
1417 | } | 1413 | } |
1418 | 1414 | ||
1419 | static int snd_hdsp_control_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1415 | static int snd_hdsp_control_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1420 | { | 1416 | { |
1421 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 1417 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
1422 | uinfo->count = 1; | 1418 | uinfo->count = 1; |
1423 | return 0; | 1419 | return 0; |
1424 | } | 1420 | } |
1425 | 1421 | ||
1426 | static int snd_hdsp_control_spdif_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1422 | static int snd_hdsp_control_spdif_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1427 | { | 1423 | { |
1428 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1424 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1429 | 1425 | ||
1430 | snd_hdsp_convert_to_aes(&ucontrol->value.iec958, hdsp->creg_spdif); | 1426 | snd_hdsp_convert_to_aes(&ucontrol->value.iec958, hdsp->creg_spdif); |
1431 | return 0; | 1427 | return 0; |
1432 | } | 1428 | } |
1433 | 1429 | ||
1434 | static int snd_hdsp_control_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1430 | static int snd_hdsp_control_spdif_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1435 | { | 1431 | { |
1436 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1432 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1437 | int change; | 1433 | int change; |
1438 | u32 val; | 1434 | u32 val; |
1439 | 1435 | ||
@@ -1445,24 +1441,24 @@ static int snd_hdsp_control_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_va | |||
1445 | return change; | 1441 | return change; |
1446 | } | 1442 | } |
1447 | 1443 | ||
1448 | static int snd_hdsp_control_spdif_stream_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1444 | static int snd_hdsp_control_spdif_stream_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1449 | { | 1445 | { |
1450 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 1446 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
1451 | uinfo->count = 1; | 1447 | uinfo->count = 1; |
1452 | return 0; | 1448 | return 0; |
1453 | } | 1449 | } |
1454 | 1450 | ||
1455 | static int snd_hdsp_control_spdif_stream_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1451 | static int snd_hdsp_control_spdif_stream_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1456 | { | 1452 | { |
1457 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1453 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1458 | 1454 | ||
1459 | snd_hdsp_convert_to_aes(&ucontrol->value.iec958, hdsp->creg_spdif_stream); | 1455 | snd_hdsp_convert_to_aes(&ucontrol->value.iec958, hdsp->creg_spdif_stream); |
1460 | return 0; | 1456 | return 0; |
1461 | } | 1457 | } |
1462 | 1458 | ||
1463 | static int snd_hdsp_control_spdif_stream_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1459 | static int snd_hdsp_control_spdif_stream_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1464 | { | 1460 | { |
1465 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1461 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1466 | int change; | 1462 | int change; |
1467 | u32 val; | 1463 | u32 val; |
1468 | 1464 | ||
@@ -1476,14 +1472,14 @@ static int snd_hdsp_control_spdif_stream_put(snd_kcontrol_t * kcontrol, snd_ctl_ | |||
1476 | return change; | 1472 | return change; |
1477 | } | 1473 | } |
1478 | 1474 | ||
1479 | static int snd_hdsp_control_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1475 | static int snd_hdsp_control_spdif_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1480 | { | 1476 | { |
1481 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 1477 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
1482 | uinfo->count = 1; | 1478 | uinfo->count = 1; |
1483 | return 0; | 1479 | return 0; |
1484 | } | 1480 | } |
1485 | 1481 | ||
1486 | static int snd_hdsp_control_spdif_mask_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1482 | static int snd_hdsp_control_spdif_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1487 | { | 1483 | { |
1488 | ucontrol->value.iec958.status[0] = kcontrol->private_value; | 1484 | ucontrol->value.iec958.status[0] = kcontrol->private_value; |
1489 | return 0; | 1485 | return 0; |
@@ -1497,12 +1493,12 @@ static int snd_hdsp_control_spdif_mask_get(snd_kcontrol_t * kcontrol, snd_ctl_el | |||
1497 | .get = snd_hdsp_get_spdif_in, \ | 1493 | .get = snd_hdsp_get_spdif_in, \ |
1498 | .put = snd_hdsp_put_spdif_in } | 1494 | .put = snd_hdsp_put_spdif_in } |
1499 | 1495 | ||
1500 | static unsigned int hdsp_spdif_in(hdsp_t *hdsp) | 1496 | static unsigned int hdsp_spdif_in(struct hdsp *hdsp) |
1501 | { | 1497 | { |
1502 | return hdsp_decode_spdif_in(hdsp->control_register & HDSP_SPDIFInputMask); | 1498 | return hdsp_decode_spdif_in(hdsp->control_register & HDSP_SPDIFInputMask); |
1503 | } | 1499 | } |
1504 | 1500 | ||
1505 | static int hdsp_set_spdif_input(hdsp_t *hdsp, int in) | 1501 | static int hdsp_set_spdif_input(struct hdsp *hdsp, int in) |
1506 | { | 1502 | { |
1507 | hdsp->control_register &= ~HDSP_SPDIFInputMask; | 1503 | hdsp->control_register &= ~HDSP_SPDIFInputMask; |
1508 | hdsp->control_register |= hdsp_encode_spdif_in(in); | 1504 | hdsp->control_register |= hdsp_encode_spdif_in(in); |
@@ -1510,10 +1506,10 @@ static int hdsp_set_spdif_input(hdsp_t *hdsp, int in) | |||
1510 | return 0; | 1506 | return 0; |
1511 | } | 1507 | } |
1512 | 1508 | ||
1513 | static int snd_hdsp_info_spdif_in(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1509 | static int snd_hdsp_info_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1514 | { | 1510 | { |
1515 | static char *texts[4] = {"Optical", "Coaxial", "Internal", "AES"}; | 1511 | static char *texts[4] = {"Optical", "Coaxial", "Internal", "AES"}; |
1516 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1512 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1517 | 1513 | ||
1518 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1514 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
1519 | uinfo->count = 1; | 1515 | uinfo->count = 1; |
@@ -1524,17 +1520,17 @@ static int snd_hdsp_info_spdif_in(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
1524 | return 0; | 1520 | return 0; |
1525 | } | 1521 | } |
1526 | 1522 | ||
1527 | static int snd_hdsp_get_spdif_in(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1523 | static int snd_hdsp_get_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1528 | { | 1524 | { |
1529 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1525 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1530 | 1526 | ||
1531 | ucontrol->value.enumerated.item[0] = hdsp_spdif_in(hdsp); | 1527 | ucontrol->value.enumerated.item[0] = hdsp_spdif_in(hdsp); |
1532 | return 0; | 1528 | return 0; |
1533 | } | 1529 | } |
1534 | 1530 | ||
1535 | static int snd_hdsp_put_spdif_in(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1531 | static int snd_hdsp_put_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1536 | { | 1532 | { |
1537 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1533 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1538 | int change; | 1534 | int change; |
1539 | unsigned int val; | 1535 | unsigned int val; |
1540 | 1536 | ||
@@ -1554,12 +1550,12 @@ static int snd_hdsp_put_spdif_in(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1554 | .info = snd_hdsp_info_spdif_bits, \ | 1550 | .info = snd_hdsp_info_spdif_bits, \ |
1555 | .get = snd_hdsp_get_spdif_out, .put = snd_hdsp_put_spdif_out } | 1551 | .get = snd_hdsp_get_spdif_out, .put = snd_hdsp_put_spdif_out } |
1556 | 1552 | ||
1557 | static int hdsp_spdif_out(hdsp_t *hdsp) | 1553 | static int hdsp_spdif_out(struct hdsp *hdsp) |
1558 | { | 1554 | { |
1559 | return (hdsp->control_register & HDSP_SPDIFOpticalOut) ? 1 : 0; | 1555 | return (hdsp->control_register & HDSP_SPDIFOpticalOut) ? 1 : 0; |
1560 | } | 1556 | } |
1561 | 1557 | ||
1562 | static int hdsp_set_spdif_output(hdsp_t *hdsp, int out) | 1558 | static int hdsp_set_spdif_output(struct hdsp *hdsp, int out) |
1563 | { | 1559 | { |
1564 | if (out) | 1560 | if (out) |
1565 | hdsp->control_register |= HDSP_SPDIFOpticalOut; | 1561 | hdsp->control_register |= HDSP_SPDIFOpticalOut; |
@@ -1569,7 +1565,7 @@ static int hdsp_set_spdif_output(hdsp_t *hdsp, int out) | |||
1569 | return 0; | 1565 | return 0; |
1570 | } | 1566 | } |
1571 | 1567 | ||
1572 | static int snd_hdsp_info_spdif_bits(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1568 | static int snd_hdsp_info_spdif_bits(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1573 | { | 1569 | { |
1574 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 1570 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
1575 | uinfo->count = 1; | 1571 | uinfo->count = 1; |
@@ -1578,17 +1574,17 @@ static int snd_hdsp_info_spdif_bits(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_ | |||
1578 | return 0; | 1574 | return 0; |
1579 | } | 1575 | } |
1580 | 1576 | ||
1581 | static int snd_hdsp_get_spdif_out(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1577 | static int snd_hdsp_get_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1582 | { | 1578 | { |
1583 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1579 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1584 | 1580 | ||
1585 | ucontrol->value.integer.value[0] = hdsp_spdif_out(hdsp); | 1581 | ucontrol->value.integer.value[0] = hdsp_spdif_out(hdsp); |
1586 | return 0; | 1582 | return 0; |
1587 | } | 1583 | } |
1588 | 1584 | ||
1589 | static int snd_hdsp_put_spdif_out(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1585 | static int snd_hdsp_put_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1590 | { | 1586 | { |
1591 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1587 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1592 | int change; | 1588 | int change; |
1593 | unsigned int val; | 1589 | unsigned int val; |
1594 | 1590 | ||
@@ -1607,12 +1603,12 @@ static int snd_hdsp_put_spdif_out(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
1607 | .info = snd_hdsp_info_spdif_bits, \ | 1603 | .info = snd_hdsp_info_spdif_bits, \ |
1608 | .get = snd_hdsp_get_spdif_professional, .put = snd_hdsp_put_spdif_professional } | 1604 | .get = snd_hdsp_get_spdif_professional, .put = snd_hdsp_put_spdif_professional } |
1609 | 1605 | ||
1610 | static int hdsp_spdif_professional(hdsp_t *hdsp) | 1606 | static int hdsp_spdif_professional(struct hdsp *hdsp) |
1611 | { | 1607 | { |
1612 | return (hdsp->control_register & HDSP_SPDIFProfessional) ? 1 : 0; | 1608 | return (hdsp->control_register & HDSP_SPDIFProfessional) ? 1 : 0; |
1613 | } | 1609 | } |
1614 | 1610 | ||
1615 | static int hdsp_set_spdif_professional(hdsp_t *hdsp, int val) | 1611 | static int hdsp_set_spdif_professional(struct hdsp *hdsp, int val) |
1616 | { | 1612 | { |
1617 | if (val) | 1613 | if (val) |
1618 | hdsp->control_register |= HDSP_SPDIFProfessional; | 1614 | hdsp->control_register |= HDSP_SPDIFProfessional; |
@@ -1622,17 +1618,17 @@ static int hdsp_set_spdif_professional(hdsp_t *hdsp, int val) | |||
1622 | return 0; | 1618 | return 0; |
1623 | } | 1619 | } |
1624 | 1620 | ||
1625 | static int snd_hdsp_get_spdif_professional(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1621 | static int snd_hdsp_get_spdif_professional(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1626 | { | 1622 | { |
1627 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1623 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1628 | 1624 | ||
1629 | ucontrol->value.integer.value[0] = hdsp_spdif_professional(hdsp); | 1625 | ucontrol->value.integer.value[0] = hdsp_spdif_professional(hdsp); |
1630 | return 0; | 1626 | return 0; |
1631 | } | 1627 | } |
1632 | 1628 | ||
1633 | static int snd_hdsp_put_spdif_professional(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1629 | static int snd_hdsp_put_spdif_professional(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1634 | { | 1630 | { |
1635 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1631 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1636 | int change; | 1632 | int change; |
1637 | unsigned int val; | 1633 | unsigned int val; |
1638 | 1634 | ||
@@ -1651,12 +1647,12 @@ static int snd_hdsp_put_spdif_professional(snd_kcontrol_t * kcontrol, snd_ctl_el | |||
1651 | .info = snd_hdsp_info_spdif_bits, \ | 1647 | .info = snd_hdsp_info_spdif_bits, \ |
1652 | .get = snd_hdsp_get_spdif_emphasis, .put = snd_hdsp_put_spdif_emphasis } | 1648 | .get = snd_hdsp_get_spdif_emphasis, .put = snd_hdsp_put_spdif_emphasis } |
1653 | 1649 | ||
1654 | static int hdsp_spdif_emphasis(hdsp_t *hdsp) | 1650 | static int hdsp_spdif_emphasis(struct hdsp *hdsp) |
1655 | { | 1651 | { |
1656 | return (hdsp->control_register & HDSP_SPDIFEmphasis) ? 1 : 0; | 1652 | return (hdsp->control_register & HDSP_SPDIFEmphasis) ? 1 : 0; |
1657 | } | 1653 | } |
1658 | 1654 | ||
1659 | static int hdsp_set_spdif_emphasis(hdsp_t *hdsp, int val) | 1655 | static int hdsp_set_spdif_emphasis(struct hdsp *hdsp, int val) |
1660 | { | 1656 | { |
1661 | if (val) | 1657 | if (val) |
1662 | hdsp->control_register |= HDSP_SPDIFEmphasis; | 1658 | hdsp->control_register |= HDSP_SPDIFEmphasis; |
@@ -1666,17 +1662,17 @@ static int hdsp_set_spdif_emphasis(hdsp_t *hdsp, int val) | |||
1666 | return 0; | 1662 | return 0; |
1667 | } | 1663 | } |
1668 | 1664 | ||
1669 | static int snd_hdsp_get_spdif_emphasis(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1665 | static int snd_hdsp_get_spdif_emphasis(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1670 | { | 1666 | { |
1671 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1667 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1672 | 1668 | ||
1673 | ucontrol->value.integer.value[0] = hdsp_spdif_emphasis(hdsp); | 1669 | ucontrol->value.integer.value[0] = hdsp_spdif_emphasis(hdsp); |
1674 | return 0; | 1670 | return 0; |
1675 | } | 1671 | } |
1676 | 1672 | ||
1677 | static int snd_hdsp_put_spdif_emphasis(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1673 | static int snd_hdsp_put_spdif_emphasis(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1678 | { | 1674 | { |
1679 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1675 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1680 | int change; | 1676 | int change; |
1681 | unsigned int val; | 1677 | unsigned int val; |
1682 | 1678 | ||
@@ -1695,12 +1691,12 @@ static int snd_hdsp_put_spdif_emphasis(snd_kcontrol_t * kcontrol, snd_ctl_elem_v | |||
1695 | .info = snd_hdsp_info_spdif_bits, \ | 1691 | .info = snd_hdsp_info_spdif_bits, \ |
1696 | .get = snd_hdsp_get_spdif_nonaudio, .put = snd_hdsp_put_spdif_nonaudio } | 1692 | .get = snd_hdsp_get_spdif_nonaudio, .put = snd_hdsp_put_spdif_nonaudio } |
1697 | 1693 | ||
1698 | static int hdsp_spdif_nonaudio(hdsp_t *hdsp) | 1694 | static int hdsp_spdif_nonaudio(struct hdsp *hdsp) |
1699 | { | 1695 | { |
1700 | return (hdsp->control_register & HDSP_SPDIFNonAudio) ? 1 : 0; | 1696 | return (hdsp->control_register & HDSP_SPDIFNonAudio) ? 1 : 0; |
1701 | } | 1697 | } |
1702 | 1698 | ||
1703 | static int hdsp_set_spdif_nonaudio(hdsp_t *hdsp, int val) | 1699 | static int hdsp_set_spdif_nonaudio(struct hdsp *hdsp, int val) |
1704 | { | 1700 | { |
1705 | if (val) | 1701 | if (val) |
1706 | hdsp->control_register |= HDSP_SPDIFNonAudio; | 1702 | hdsp->control_register |= HDSP_SPDIFNonAudio; |
@@ -1710,17 +1706,17 @@ static int hdsp_set_spdif_nonaudio(hdsp_t *hdsp, int val) | |||
1710 | return 0; | 1706 | return 0; |
1711 | } | 1707 | } |
1712 | 1708 | ||
1713 | static int snd_hdsp_get_spdif_nonaudio(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1709 | static int snd_hdsp_get_spdif_nonaudio(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1714 | { | 1710 | { |
1715 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1711 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1716 | 1712 | ||
1717 | ucontrol->value.integer.value[0] = hdsp_spdif_nonaudio(hdsp); | 1713 | ucontrol->value.integer.value[0] = hdsp_spdif_nonaudio(hdsp); |
1718 | return 0; | 1714 | return 0; |
1719 | } | 1715 | } |
1720 | 1716 | ||
1721 | static int snd_hdsp_put_spdif_nonaudio(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1717 | static int snd_hdsp_put_spdif_nonaudio(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1722 | { | 1718 | { |
1723 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1719 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1724 | int change; | 1720 | int change; |
1725 | unsigned int val; | 1721 | unsigned int val; |
1726 | 1722 | ||
@@ -1743,10 +1739,10 @@ static int snd_hdsp_put_spdif_nonaudio(snd_kcontrol_t * kcontrol, snd_ctl_elem_v | |||
1743 | .get = snd_hdsp_get_spdif_sample_rate \ | 1739 | .get = snd_hdsp_get_spdif_sample_rate \ |
1744 | } | 1740 | } |
1745 | 1741 | ||
1746 | static int snd_hdsp_info_spdif_sample_rate(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1742 | static int snd_hdsp_info_spdif_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1747 | { | 1743 | { |
1748 | static char *texts[] = {"32000", "44100", "48000", "64000", "88200", "96000", "None", "128000", "176400", "192000"}; | 1744 | static char *texts[] = {"32000", "44100", "48000", "64000", "88200", "96000", "None", "128000", "176400", "192000"}; |
1749 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1745 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1750 | 1746 | ||
1751 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1747 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
1752 | uinfo->count = 1; | 1748 | uinfo->count = 1; |
@@ -1757,9 +1753,9 @@ static int snd_hdsp_info_spdif_sample_rate(snd_kcontrol_t *kcontrol, snd_ctl_ele | |||
1757 | return 0; | 1753 | return 0; |
1758 | } | 1754 | } |
1759 | 1755 | ||
1760 | static int snd_hdsp_get_spdif_sample_rate(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1756 | static int snd_hdsp_get_spdif_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1761 | { | 1757 | { |
1762 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1758 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1763 | 1759 | ||
1764 | switch (hdsp_spdif_sample_rate(hdsp)) { | 1760 | switch (hdsp_spdif_sample_rate(hdsp)) { |
1765 | case 32000: | 1761 | case 32000: |
@@ -1804,16 +1800,16 @@ static int snd_hdsp_get_spdif_sample_rate(snd_kcontrol_t * kcontrol, snd_ctl_ele | |||
1804 | .get = snd_hdsp_get_system_sample_rate \ | 1800 | .get = snd_hdsp_get_system_sample_rate \ |
1805 | } | 1801 | } |
1806 | 1802 | ||
1807 | static int snd_hdsp_info_system_sample_rate(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1803 | static int snd_hdsp_info_system_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1808 | { | 1804 | { |
1809 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 1805 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
1810 | uinfo->count = 1; | 1806 | uinfo->count = 1; |
1811 | return 0; | 1807 | return 0; |
1812 | } | 1808 | } |
1813 | 1809 | ||
1814 | static int snd_hdsp_get_system_sample_rate(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1810 | static int snd_hdsp_get_system_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1815 | { | 1811 | { |
1816 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1812 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1817 | 1813 | ||
1818 | ucontrol->value.enumerated.item[0] = hdsp->system_sample_rate; | 1814 | ucontrol->value.enumerated.item[0] = hdsp->system_sample_rate; |
1819 | return 0; | 1815 | return 0; |
@@ -1828,9 +1824,9 @@ static int snd_hdsp_get_system_sample_rate(snd_kcontrol_t * kcontrol, snd_ctl_el | |||
1828 | .get = snd_hdsp_get_autosync_sample_rate \ | 1824 | .get = snd_hdsp_get_autosync_sample_rate \ |
1829 | } | 1825 | } |
1830 | 1826 | ||
1831 | static int snd_hdsp_info_autosync_sample_rate(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1827 | static int snd_hdsp_info_autosync_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1832 | { | 1828 | { |
1833 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1829 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1834 | static char *texts[] = {"32000", "44100", "48000", "64000", "88200", "96000", "None", "128000", "176400", "192000"}; | 1830 | static char *texts[] = {"32000", "44100", "48000", "64000", "88200", "96000", "None", "128000", "176400", "192000"}; |
1835 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1831 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
1836 | uinfo->count = 1; | 1832 | uinfo->count = 1; |
@@ -1841,9 +1837,9 @@ static int snd_hdsp_info_autosync_sample_rate(snd_kcontrol_t *kcontrol, snd_ctl_ | |||
1841 | return 0; | 1837 | return 0; |
1842 | } | 1838 | } |
1843 | 1839 | ||
1844 | static int snd_hdsp_get_autosync_sample_rate(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1840 | static int snd_hdsp_get_autosync_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1845 | { | 1841 | { |
1846 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1842 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1847 | 1843 | ||
1848 | switch (hdsp_external_sample_rate(hdsp)) { | 1844 | switch (hdsp_external_sample_rate(hdsp)) { |
1849 | case 32000: | 1845 | case 32000: |
@@ -1888,7 +1884,7 @@ static int snd_hdsp_get_autosync_sample_rate(snd_kcontrol_t * kcontrol, snd_ctl_ | |||
1888 | .get = snd_hdsp_get_system_clock_mode \ | 1884 | .get = snd_hdsp_get_system_clock_mode \ |
1889 | } | 1885 | } |
1890 | 1886 | ||
1891 | static int hdsp_system_clock_mode(hdsp_t *hdsp) | 1887 | static int hdsp_system_clock_mode(struct hdsp *hdsp) |
1892 | { | 1888 | { |
1893 | if (hdsp->control_register & HDSP_ClockModeMaster) | 1889 | if (hdsp->control_register & HDSP_ClockModeMaster) |
1894 | return 0; | 1890 | return 0; |
@@ -1897,7 +1893,7 @@ static int hdsp_system_clock_mode(hdsp_t *hdsp) | |||
1897 | return 1; | 1893 | return 1; |
1898 | } | 1894 | } |
1899 | 1895 | ||
1900 | static int snd_hdsp_info_system_clock_mode(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 1896 | static int snd_hdsp_info_system_clock_mode(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
1901 | { | 1897 | { |
1902 | static char *texts[] = {"Master", "Slave" }; | 1898 | static char *texts[] = {"Master", "Slave" }; |
1903 | 1899 | ||
@@ -1910,9 +1906,9 @@ static int snd_hdsp_info_system_clock_mode(snd_kcontrol_t *kcontrol, snd_ctl_ele | |||
1910 | return 0; | 1906 | return 0; |
1911 | } | 1907 | } |
1912 | 1908 | ||
1913 | static int snd_hdsp_get_system_clock_mode(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 1909 | static int snd_hdsp_get_system_clock_mode(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
1914 | { | 1910 | { |
1915 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 1911 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
1916 | 1912 | ||
1917 | ucontrol->value.enumerated.item[0] = hdsp_system_clock_mode(hdsp); | 1913 | ucontrol->value.enumerated.item[0] = hdsp_system_clock_mode(hdsp); |
1918 | return 0; | 1914 | return 0; |
@@ -1927,7 +1923,7 @@ static int snd_hdsp_get_system_clock_mode(snd_kcontrol_t * kcontrol, snd_ctl_ele | |||
1927 | .put = snd_hdsp_put_clock_source \ | 1923 | .put = snd_hdsp_put_clock_source \ |
1928 | } | 1924 | } |
1929 | 1925 | ||
1930 | static int hdsp_clock_source(hdsp_t *hdsp) | 1926 | static int hdsp_clock_source(struct hdsp *hdsp) |
1931 | { | 1927 | { |
1932 | if (hdsp->control_register & HDSP_ClockModeMaster) { | 1928 | if (hdsp->control_register & HDSP_ClockModeMaster) { |
1933 | switch (hdsp->system_sample_rate) { | 1929 | switch (hdsp->system_sample_rate) { |
@@ -1957,7 +1953,7 @@ static int hdsp_clock_source(hdsp_t *hdsp) | |||
1957 | } | 1953 | } |
1958 | } | 1954 | } |
1959 | 1955 | ||
1960 | static int hdsp_set_clock_source(hdsp_t *hdsp, int mode) | 1956 | static int hdsp_set_clock_source(struct hdsp *hdsp, int mode) |
1961 | { | 1957 | { |
1962 | int rate; | 1958 | int rate; |
1963 | switch (mode) { | 1959 | switch (mode) { |
@@ -2006,10 +2002,10 @@ static int hdsp_set_clock_source(hdsp_t *hdsp, int mode) | |||
2006 | return 0; | 2002 | return 0; |
2007 | } | 2003 | } |
2008 | 2004 | ||
2009 | static int snd_hdsp_info_clock_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2005 | static int snd_hdsp_info_clock_source(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2010 | { | 2006 | { |
2011 | static char *texts[] = {"AutoSync", "Internal 32.0 kHz", "Internal 44.1 kHz", "Internal 48.0 kHz", "Internal 64.0 kHz", "Internal 88.2 kHz", "Internal 96.0 kHz", "Internal 128 kHz", "Internal 176.4 kHz", "Internal 192.0 KHz" }; | 2007 | static char *texts[] = {"AutoSync", "Internal 32.0 kHz", "Internal 44.1 kHz", "Internal 48.0 kHz", "Internal 64.0 kHz", "Internal 88.2 kHz", "Internal 96.0 kHz", "Internal 128 kHz", "Internal 176.4 kHz", "Internal 192.0 KHz" }; |
2012 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2008 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2013 | 2009 | ||
2014 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 2010 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
2015 | uinfo->count = 1; | 2011 | uinfo->count = 1; |
@@ -2023,17 +2019,17 @@ static int snd_hdsp_info_clock_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf | |||
2023 | return 0; | 2019 | return 0; |
2024 | } | 2020 | } |
2025 | 2021 | ||
2026 | static int snd_hdsp_get_clock_source(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2022 | static int snd_hdsp_get_clock_source(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2027 | { | 2023 | { |
2028 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2024 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2029 | 2025 | ||
2030 | ucontrol->value.enumerated.item[0] = hdsp_clock_source(hdsp); | 2026 | ucontrol->value.enumerated.item[0] = hdsp_clock_source(hdsp); |
2031 | return 0; | 2027 | return 0; |
2032 | } | 2028 | } |
2033 | 2029 | ||
2034 | static int snd_hdsp_put_clock_source(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2030 | static int snd_hdsp_put_clock_source(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2035 | { | 2031 | { |
2036 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2032 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2037 | int change; | 2033 | int change; |
2038 | int val; | 2034 | int val; |
2039 | 2035 | ||
@@ -2057,7 +2053,7 @@ static int snd_hdsp_put_clock_source(snd_kcontrol_t * kcontrol, snd_ctl_elem_val | |||
2057 | return change; | 2053 | return change; |
2058 | } | 2054 | } |
2059 | 2055 | ||
2060 | static int snd_hdsp_info_clock_source_lock(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2056 | static int snd_hdsp_info_clock_source_lock(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2061 | { | 2057 | { |
2062 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 2058 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
2063 | uinfo->count = 1; | 2059 | uinfo->count = 1; |
@@ -2066,17 +2062,17 @@ static int snd_hdsp_info_clock_source_lock(snd_kcontrol_t *kcontrol, snd_ctl_ele | |||
2066 | return 0; | 2062 | return 0; |
2067 | } | 2063 | } |
2068 | 2064 | ||
2069 | static int snd_hdsp_get_clock_source_lock(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2065 | static int snd_hdsp_get_clock_source_lock(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2070 | { | 2066 | { |
2071 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2067 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2072 | 2068 | ||
2073 | ucontrol->value.integer.value[0] = hdsp->clock_source_locked; | 2069 | ucontrol->value.integer.value[0] = hdsp->clock_source_locked; |
2074 | return 0; | 2070 | return 0; |
2075 | } | 2071 | } |
2076 | 2072 | ||
2077 | static int snd_hdsp_put_clock_source_lock(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2073 | static int snd_hdsp_put_clock_source_lock(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2078 | { | 2074 | { |
2079 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2075 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2080 | int change; | 2076 | int change; |
2081 | 2077 | ||
2082 | change = (int)ucontrol->value.integer.value[0] != hdsp->clock_source_locked; | 2078 | change = (int)ucontrol->value.integer.value[0] != hdsp->clock_source_locked; |
@@ -2094,7 +2090,7 @@ static int snd_hdsp_put_clock_source_lock(snd_kcontrol_t * kcontrol, snd_ctl_ele | |||
2094 | .put = snd_hdsp_put_da_gain \ | 2090 | .put = snd_hdsp_put_da_gain \ |
2095 | } | 2091 | } |
2096 | 2092 | ||
2097 | static int hdsp_da_gain(hdsp_t *hdsp) | 2093 | static int hdsp_da_gain(struct hdsp *hdsp) |
2098 | { | 2094 | { |
2099 | switch (hdsp->control_register & HDSP_DAGainMask) { | 2095 | switch (hdsp->control_register & HDSP_DAGainMask) { |
2100 | case HDSP_DAGainHighGain: | 2096 | case HDSP_DAGainHighGain: |
@@ -2108,7 +2104,7 @@ static int hdsp_da_gain(hdsp_t *hdsp) | |||
2108 | } | 2104 | } |
2109 | } | 2105 | } |
2110 | 2106 | ||
2111 | static int hdsp_set_da_gain(hdsp_t *hdsp, int mode) | 2107 | static int hdsp_set_da_gain(struct hdsp *hdsp, int mode) |
2112 | { | 2108 | { |
2113 | hdsp->control_register &= ~HDSP_DAGainMask; | 2109 | hdsp->control_register &= ~HDSP_DAGainMask; |
2114 | switch (mode) { | 2110 | switch (mode) { |
@@ -2129,7 +2125,7 @@ static int hdsp_set_da_gain(hdsp_t *hdsp, int mode) | |||
2129 | return 0; | 2125 | return 0; |
2130 | } | 2126 | } |
2131 | 2127 | ||
2132 | static int snd_hdsp_info_da_gain(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2128 | static int snd_hdsp_info_da_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2133 | { | 2129 | { |
2134 | static char *texts[] = {"Hi Gain", "+4 dBu", "-10 dbV"}; | 2130 | static char *texts[] = {"Hi Gain", "+4 dBu", "-10 dbV"}; |
2135 | 2131 | ||
@@ -2142,17 +2138,17 @@ static int snd_hdsp_info_da_gain(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * | |||
2142 | return 0; | 2138 | return 0; |
2143 | } | 2139 | } |
2144 | 2140 | ||
2145 | static int snd_hdsp_get_da_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2141 | static int snd_hdsp_get_da_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2146 | { | 2142 | { |
2147 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2143 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2148 | 2144 | ||
2149 | ucontrol->value.enumerated.item[0] = hdsp_da_gain(hdsp); | 2145 | ucontrol->value.enumerated.item[0] = hdsp_da_gain(hdsp); |
2150 | return 0; | 2146 | return 0; |
2151 | } | 2147 | } |
2152 | 2148 | ||
2153 | static int snd_hdsp_put_da_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2149 | static int snd_hdsp_put_da_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2154 | { | 2150 | { |
2155 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2151 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2156 | int change; | 2152 | int change; |
2157 | int val; | 2153 | int val; |
2158 | 2154 | ||
@@ -2179,7 +2175,7 @@ static int snd_hdsp_put_da_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
2179 | .put = snd_hdsp_put_ad_gain \ | 2175 | .put = snd_hdsp_put_ad_gain \ |
2180 | } | 2176 | } |
2181 | 2177 | ||
2182 | static int hdsp_ad_gain(hdsp_t *hdsp) | 2178 | static int hdsp_ad_gain(struct hdsp *hdsp) |
2183 | { | 2179 | { |
2184 | switch (hdsp->control_register & HDSP_ADGainMask) { | 2180 | switch (hdsp->control_register & HDSP_ADGainMask) { |
2185 | case HDSP_ADGainMinus10dBV: | 2181 | case HDSP_ADGainMinus10dBV: |
@@ -2193,7 +2189,7 @@ static int hdsp_ad_gain(hdsp_t *hdsp) | |||
2193 | } | 2189 | } |
2194 | } | 2190 | } |
2195 | 2191 | ||
2196 | static int hdsp_set_ad_gain(hdsp_t *hdsp, int mode) | 2192 | static int hdsp_set_ad_gain(struct hdsp *hdsp, int mode) |
2197 | { | 2193 | { |
2198 | hdsp->control_register &= ~HDSP_ADGainMask; | 2194 | hdsp->control_register &= ~HDSP_ADGainMask; |
2199 | switch (mode) { | 2195 | switch (mode) { |
@@ -2214,7 +2210,7 @@ static int hdsp_set_ad_gain(hdsp_t *hdsp, int mode) | |||
2214 | return 0; | 2210 | return 0; |
2215 | } | 2211 | } |
2216 | 2212 | ||
2217 | static int snd_hdsp_info_ad_gain(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2213 | static int snd_hdsp_info_ad_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2218 | { | 2214 | { |
2219 | static char *texts[] = {"-10 dBV", "+4 dBu", "Lo Gain"}; | 2215 | static char *texts[] = {"-10 dBV", "+4 dBu", "Lo Gain"}; |
2220 | 2216 | ||
@@ -2227,17 +2223,17 @@ static int snd_hdsp_info_ad_gain(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * | |||
2227 | return 0; | 2223 | return 0; |
2228 | } | 2224 | } |
2229 | 2225 | ||
2230 | static int snd_hdsp_get_ad_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2226 | static int snd_hdsp_get_ad_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2231 | { | 2227 | { |
2232 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2228 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2233 | 2229 | ||
2234 | ucontrol->value.enumerated.item[0] = hdsp_ad_gain(hdsp); | 2230 | ucontrol->value.enumerated.item[0] = hdsp_ad_gain(hdsp); |
2235 | return 0; | 2231 | return 0; |
2236 | } | 2232 | } |
2237 | 2233 | ||
2238 | static int snd_hdsp_put_ad_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2234 | static int snd_hdsp_put_ad_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2239 | { | 2235 | { |
2240 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2236 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2241 | int change; | 2237 | int change; |
2242 | int val; | 2238 | int val; |
2243 | 2239 | ||
@@ -2264,7 +2260,7 @@ static int snd_hdsp_put_ad_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
2264 | .put = snd_hdsp_put_phone_gain \ | 2260 | .put = snd_hdsp_put_phone_gain \ |
2265 | } | 2261 | } |
2266 | 2262 | ||
2267 | static int hdsp_phone_gain(hdsp_t *hdsp) | 2263 | static int hdsp_phone_gain(struct hdsp *hdsp) |
2268 | { | 2264 | { |
2269 | switch (hdsp->control_register & HDSP_PhoneGainMask) { | 2265 | switch (hdsp->control_register & HDSP_PhoneGainMask) { |
2270 | case HDSP_PhoneGain0dB: | 2266 | case HDSP_PhoneGain0dB: |
@@ -2278,7 +2274,7 @@ static int hdsp_phone_gain(hdsp_t *hdsp) | |||
2278 | } | 2274 | } |
2279 | } | 2275 | } |
2280 | 2276 | ||
2281 | static int hdsp_set_phone_gain(hdsp_t *hdsp, int mode) | 2277 | static int hdsp_set_phone_gain(struct hdsp *hdsp, int mode) |
2282 | { | 2278 | { |
2283 | hdsp->control_register &= ~HDSP_PhoneGainMask; | 2279 | hdsp->control_register &= ~HDSP_PhoneGainMask; |
2284 | switch (mode) { | 2280 | switch (mode) { |
@@ -2299,7 +2295,7 @@ static int hdsp_set_phone_gain(hdsp_t *hdsp, int mode) | |||
2299 | return 0; | 2295 | return 0; |
2300 | } | 2296 | } |
2301 | 2297 | ||
2302 | static int snd_hdsp_info_phone_gain(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2298 | static int snd_hdsp_info_phone_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2303 | { | 2299 | { |
2304 | static char *texts[] = {"0 dB", "-6 dB", "-12 dB"}; | 2300 | static char *texts[] = {"0 dB", "-6 dB", "-12 dB"}; |
2305 | 2301 | ||
@@ -2312,17 +2308,17 @@ static int snd_hdsp_info_phone_gain(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_ | |||
2312 | return 0; | 2308 | return 0; |
2313 | } | 2309 | } |
2314 | 2310 | ||
2315 | static int snd_hdsp_get_phone_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2311 | static int snd_hdsp_get_phone_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2316 | { | 2312 | { |
2317 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2313 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2318 | 2314 | ||
2319 | ucontrol->value.enumerated.item[0] = hdsp_phone_gain(hdsp); | 2315 | ucontrol->value.enumerated.item[0] = hdsp_phone_gain(hdsp); |
2320 | return 0; | 2316 | return 0; |
2321 | } | 2317 | } |
2322 | 2318 | ||
2323 | static int snd_hdsp_put_phone_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2319 | static int snd_hdsp_put_phone_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2324 | { | 2320 | { |
2325 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2321 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2326 | int change; | 2322 | int change; |
2327 | int val; | 2323 | int val; |
2328 | 2324 | ||
@@ -2349,14 +2345,14 @@ static int snd_hdsp_put_phone_gain(snd_kcontrol_t * kcontrol, snd_ctl_elem_value | |||
2349 | .put = snd_hdsp_put_xlr_breakout_cable \ | 2345 | .put = snd_hdsp_put_xlr_breakout_cable \ |
2350 | } | 2346 | } |
2351 | 2347 | ||
2352 | static int hdsp_xlr_breakout_cable(hdsp_t *hdsp) | 2348 | static int hdsp_xlr_breakout_cable(struct hdsp *hdsp) |
2353 | { | 2349 | { |
2354 | if (hdsp->control_register & HDSP_XLRBreakoutCable) | 2350 | if (hdsp->control_register & HDSP_XLRBreakoutCable) |
2355 | return 1; | 2351 | return 1; |
2356 | return 0; | 2352 | return 0; |
2357 | } | 2353 | } |
2358 | 2354 | ||
2359 | static int hdsp_set_xlr_breakout_cable(hdsp_t *hdsp, int mode) | 2355 | static int hdsp_set_xlr_breakout_cable(struct hdsp *hdsp, int mode) |
2360 | { | 2356 | { |
2361 | if (mode) | 2357 | if (mode) |
2362 | hdsp->control_register |= HDSP_XLRBreakoutCable; | 2358 | hdsp->control_register |= HDSP_XLRBreakoutCable; |
@@ -2366,7 +2362,7 @@ static int hdsp_set_xlr_breakout_cable(hdsp_t *hdsp, int mode) | |||
2366 | return 0; | 2362 | return 0; |
2367 | } | 2363 | } |
2368 | 2364 | ||
2369 | static int snd_hdsp_info_xlr_breakout_cable(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2365 | static int snd_hdsp_info_xlr_breakout_cable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2370 | { | 2366 | { |
2371 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 2367 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
2372 | uinfo->count = 1; | 2368 | uinfo->count = 1; |
@@ -2375,17 +2371,17 @@ static int snd_hdsp_info_xlr_breakout_cable(snd_kcontrol_t *kcontrol, snd_ctl_el | |||
2375 | return 0; | 2371 | return 0; |
2376 | } | 2372 | } |
2377 | 2373 | ||
2378 | static int snd_hdsp_get_xlr_breakout_cable(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2374 | static int snd_hdsp_get_xlr_breakout_cable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2379 | { | 2375 | { |
2380 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2376 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2381 | 2377 | ||
2382 | ucontrol->value.enumerated.item[0] = hdsp_xlr_breakout_cable(hdsp); | 2378 | ucontrol->value.enumerated.item[0] = hdsp_xlr_breakout_cable(hdsp); |
2383 | return 0; | 2379 | return 0; |
2384 | } | 2380 | } |
2385 | 2381 | ||
2386 | static int snd_hdsp_put_xlr_breakout_cable(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2382 | static int snd_hdsp_put_xlr_breakout_cable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2387 | { | 2383 | { |
2388 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2384 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2389 | int change; | 2385 | int change; |
2390 | int val; | 2386 | int val; |
2391 | 2387 | ||
@@ -2412,14 +2408,14 @@ static int snd_hdsp_put_xlr_breakout_cable(snd_kcontrol_t * kcontrol, snd_ctl_el | |||
2412 | .put = snd_hdsp_put_aeb \ | 2408 | .put = snd_hdsp_put_aeb \ |
2413 | } | 2409 | } |
2414 | 2410 | ||
2415 | static int hdsp_aeb(hdsp_t *hdsp) | 2411 | static int hdsp_aeb(struct hdsp *hdsp) |
2416 | { | 2412 | { |
2417 | if (hdsp->control_register & HDSP_AnalogExtensionBoard) | 2413 | if (hdsp->control_register & HDSP_AnalogExtensionBoard) |
2418 | return 1; | 2414 | return 1; |
2419 | return 0; | 2415 | return 0; |
2420 | } | 2416 | } |
2421 | 2417 | ||
2422 | static int hdsp_set_aeb(hdsp_t *hdsp, int mode) | 2418 | static int hdsp_set_aeb(struct hdsp *hdsp, int mode) |
2423 | { | 2419 | { |
2424 | if (mode) | 2420 | if (mode) |
2425 | hdsp->control_register |= HDSP_AnalogExtensionBoard; | 2421 | hdsp->control_register |= HDSP_AnalogExtensionBoard; |
@@ -2429,7 +2425,7 @@ static int hdsp_set_aeb(hdsp_t *hdsp, int mode) | |||
2429 | return 0; | 2425 | return 0; |
2430 | } | 2426 | } |
2431 | 2427 | ||
2432 | static int snd_hdsp_info_aeb(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2428 | static int snd_hdsp_info_aeb(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2433 | { | 2429 | { |
2434 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 2430 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
2435 | uinfo->count = 1; | 2431 | uinfo->count = 1; |
@@ -2438,17 +2434,17 @@ static int snd_hdsp_info_aeb(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uin | |||
2438 | return 0; | 2434 | return 0; |
2439 | } | 2435 | } |
2440 | 2436 | ||
2441 | static int snd_hdsp_get_aeb(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2437 | static int snd_hdsp_get_aeb(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2442 | { | 2438 | { |
2443 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2439 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2444 | 2440 | ||
2445 | ucontrol->value.enumerated.item[0] = hdsp_aeb(hdsp); | 2441 | ucontrol->value.enumerated.item[0] = hdsp_aeb(hdsp); |
2446 | return 0; | 2442 | return 0; |
2447 | } | 2443 | } |
2448 | 2444 | ||
2449 | static int snd_hdsp_put_aeb(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2445 | static int snd_hdsp_put_aeb(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2450 | { | 2446 | { |
2451 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2447 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2452 | int change; | 2448 | int change; |
2453 | int val; | 2449 | int val; |
2454 | 2450 | ||
@@ -2471,7 +2467,7 @@ static int snd_hdsp_put_aeb(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * uc | |||
2471 | .put = snd_hdsp_put_pref_sync_ref \ | 2467 | .put = snd_hdsp_put_pref_sync_ref \ |
2472 | } | 2468 | } |
2473 | 2469 | ||
2474 | static int hdsp_pref_sync_ref(hdsp_t *hdsp) | 2470 | static int hdsp_pref_sync_ref(struct hdsp *hdsp) |
2475 | { | 2471 | { |
2476 | /* Notice that this looks at the requested sync source, | 2472 | /* Notice that this looks at the requested sync source, |
2477 | not the one actually in use. | 2473 | not the one actually in use. |
@@ -2496,7 +2492,7 @@ static int hdsp_pref_sync_ref(hdsp_t *hdsp) | |||
2496 | return 0; | 2492 | return 0; |
2497 | } | 2493 | } |
2498 | 2494 | ||
2499 | static int hdsp_set_pref_sync_ref(hdsp_t *hdsp, int pref) | 2495 | static int hdsp_set_pref_sync_ref(struct hdsp *hdsp, int pref) |
2500 | { | 2496 | { |
2501 | hdsp->control_register &= ~HDSP_SyncRefMask; | 2497 | hdsp->control_register &= ~HDSP_SyncRefMask; |
2502 | switch (pref) { | 2498 | switch (pref) { |
@@ -2525,10 +2521,10 @@ static int hdsp_set_pref_sync_ref(hdsp_t *hdsp, int pref) | |||
2525 | return 0; | 2521 | return 0; |
2526 | } | 2522 | } |
2527 | 2523 | ||
2528 | static int snd_hdsp_info_pref_sync_ref(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2524 | static int snd_hdsp_info_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2529 | { | 2525 | { |
2530 | static char *texts[] = {"Word", "IEC958", "ADAT1", "ADAT Sync", "ADAT2", "ADAT3" }; | 2526 | static char *texts[] = {"Word", "IEC958", "ADAT1", "ADAT Sync", "ADAT2", "ADAT3" }; |
2531 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2527 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2532 | 2528 | ||
2533 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 2529 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
2534 | uinfo->count = 1; | 2530 | uinfo->count = 1; |
@@ -2555,17 +2551,17 @@ static int snd_hdsp_info_pref_sync_ref(snd_kcontrol_t *kcontrol, snd_ctl_elem_in | |||
2555 | return 0; | 2551 | return 0; |
2556 | } | 2552 | } |
2557 | 2553 | ||
2558 | static int snd_hdsp_get_pref_sync_ref(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2554 | static int snd_hdsp_get_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2559 | { | 2555 | { |
2560 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2556 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2561 | 2557 | ||
2562 | ucontrol->value.enumerated.item[0] = hdsp_pref_sync_ref(hdsp); | 2558 | ucontrol->value.enumerated.item[0] = hdsp_pref_sync_ref(hdsp); |
2563 | return 0; | 2559 | return 0; |
2564 | } | 2560 | } |
2565 | 2561 | ||
2566 | static int snd_hdsp_put_pref_sync_ref(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2562 | static int snd_hdsp_put_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2567 | { | 2563 | { |
2568 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2564 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2569 | int change, max; | 2565 | int change, max; |
2570 | unsigned int val; | 2566 | unsigned int val; |
2571 | 2567 | ||
@@ -2604,7 +2600,7 @@ static int snd_hdsp_put_pref_sync_ref(snd_kcontrol_t * kcontrol, snd_ctl_elem_va | |||
2604 | .get = snd_hdsp_get_autosync_ref, \ | 2600 | .get = snd_hdsp_get_autosync_ref, \ |
2605 | } | 2601 | } |
2606 | 2602 | ||
2607 | static int hdsp_autosync_ref(hdsp_t *hdsp) | 2603 | static int hdsp_autosync_ref(struct hdsp *hdsp) |
2608 | { | 2604 | { |
2609 | /* This looks at the autosync selected sync reference */ | 2605 | /* This looks at the autosync selected sync reference */ |
2610 | unsigned int status2 = hdsp_read(hdsp, HDSP_status2Register); | 2606 | unsigned int status2 = hdsp_read(hdsp, HDSP_status2Register); |
@@ -2630,7 +2626,7 @@ static int hdsp_autosync_ref(hdsp_t *hdsp) | |||
2630 | return 0; | 2626 | return 0; |
2631 | } | 2627 | } |
2632 | 2628 | ||
2633 | static int snd_hdsp_info_autosync_ref(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2629 | static int snd_hdsp_info_autosync_ref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2634 | { | 2630 | { |
2635 | static char *texts[] = {"Word", "ADAT Sync", "IEC958", "None", "ADAT1", "ADAT2", "ADAT3" }; | 2631 | static char *texts[] = {"Word", "ADAT Sync", "IEC958", "None", "ADAT1", "ADAT2", "ADAT3" }; |
2636 | 2632 | ||
@@ -2643,9 +2639,9 @@ static int snd_hdsp_info_autosync_ref(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf | |||
2643 | return 0; | 2639 | return 0; |
2644 | } | 2640 | } |
2645 | 2641 | ||
2646 | static int snd_hdsp_get_autosync_ref(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2642 | static int snd_hdsp_get_autosync_ref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2647 | { | 2643 | { |
2648 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2644 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2649 | 2645 | ||
2650 | ucontrol->value.enumerated.item[0] = hdsp_autosync_ref(hdsp); | 2646 | ucontrol->value.enumerated.item[0] = hdsp_autosync_ref(hdsp); |
2651 | return 0; | 2647 | return 0; |
@@ -2660,12 +2656,12 @@ static int snd_hdsp_get_autosync_ref(snd_kcontrol_t * kcontrol, snd_ctl_elem_val | |||
2660 | .put = snd_hdsp_put_line_out \ | 2656 | .put = snd_hdsp_put_line_out \ |
2661 | } | 2657 | } |
2662 | 2658 | ||
2663 | static int hdsp_line_out(hdsp_t *hdsp) | 2659 | static int hdsp_line_out(struct hdsp *hdsp) |
2664 | { | 2660 | { |
2665 | return (hdsp->control_register & HDSP_LineOut) ? 1 : 0; | 2661 | return (hdsp->control_register & HDSP_LineOut) ? 1 : 0; |
2666 | } | 2662 | } |
2667 | 2663 | ||
2668 | static int hdsp_set_line_output(hdsp_t *hdsp, int out) | 2664 | static int hdsp_set_line_output(struct hdsp *hdsp, int out) |
2669 | { | 2665 | { |
2670 | if (out) | 2666 | if (out) |
2671 | hdsp->control_register |= HDSP_LineOut; | 2667 | hdsp->control_register |= HDSP_LineOut; |
@@ -2675,7 +2671,7 @@ static int hdsp_set_line_output(hdsp_t *hdsp, int out) | |||
2675 | return 0; | 2671 | return 0; |
2676 | } | 2672 | } |
2677 | 2673 | ||
2678 | static int snd_hdsp_info_line_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2674 | static int snd_hdsp_info_line_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2679 | { | 2675 | { |
2680 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 2676 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
2681 | uinfo->count = 1; | 2677 | uinfo->count = 1; |
@@ -2684,9 +2680,9 @@ static int snd_hdsp_info_line_out(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
2684 | return 0; | 2680 | return 0; |
2685 | } | 2681 | } |
2686 | 2682 | ||
2687 | static int snd_hdsp_get_line_out(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2683 | static int snd_hdsp_get_line_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2688 | { | 2684 | { |
2689 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2685 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2690 | 2686 | ||
2691 | spin_lock_irq(&hdsp->lock); | 2687 | spin_lock_irq(&hdsp->lock); |
2692 | ucontrol->value.integer.value[0] = hdsp_line_out(hdsp); | 2688 | ucontrol->value.integer.value[0] = hdsp_line_out(hdsp); |
@@ -2694,9 +2690,9 @@ static int snd_hdsp_get_line_out(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
2694 | return 0; | 2690 | return 0; |
2695 | } | 2691 | } |
2696 | 2692 | ||
2697 | static int snd_hdsp_put_line_out(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2693 | static int snd_hdsp_put_line_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2698 | { | 2694 | { |
2699 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2695 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2700 | int change; | 2696 | int change; |
2701 | unsigned int val; | 2697 | unsigned int val; |
2702 | 2698 | ||
@@ -2719,7 +2715,7 @@ static int snd_hdsp_put_line_out(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
2719 | .put = snd_hdsp_put_precise_pointer \ | 2715 | .put = snd_hdsp_put_precise_pointer \ |
2720 | } | 2716 | } |
2721 | 2717 | ||
2722 | static int hdsp_set_precise_pointer(hdsp_t *hdsp, int precise) | 2718 | static int hdsp_set_precise_pointer(struct hdsp *hdsp, int precise) |
2723 | { | 2719 | { |
2724 | if (precise) | 2720 | if (precise) |
2725 | hdsp->precise_ptr = 1; | 2721 | hdsp->precise_ptr = 1; |
@@ -2728,7 +2724,7 @@ static int hdsp_set_precise_pointer(hdsp_t *hdsp, int precise) | |||
2728 | return 0; | 2724 | return 0; |
2729 | } | 2725 | } |
2730 | 2726 | ||
2731 | static int snd_hdsp_info_precise_pointer(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2727 | static int snd_hdsp_info_precise_pointer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2732 | { | 2728 | { |
2733 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 2729 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
2734 | uinfo->count = 1; | 2730 | uinfo->count = 1; |
@@ -2737,9 +2733,9 @@ static int snd_hdsp_info_precise_pointer(snd_kcontrol_t *kcontrol, snd_ctl_elem_ | |||
2737 | return 0; | 2733 | return 0; |
2738 | } | 2734 | } |
2739 | 2735 | ||
2740 | static int snd_hdsp_get_precise_pointer(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2736 | static int snd_hdsp_get_precise_pointer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2741 | { | 2737 | { |
2742 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2738 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2743 | 2739 | ||
2744 | spin_lock_irq(&hdsp->lock); | 2740 | spin_lock_irq(&hdsp->lock); |
2745 | ucontrol->value.integer.value[0] = hdsp->precise_ptr; | 2741 | ucontrol->value.integer.value[0] = hdsp->precise_ptr; |
@@ -2747,9 +2743,9 @@ static int snd_hdsp_get_precise_pointer(snd_kcontrol_t * kcontrol, snd_ctl_elem_ | |||
2747 | return 0; | 2743 | return 0; |
2748 | } | 2744 | } |
2749 | 2745 | ||
2750 | static int snd_hdsp_put_precise_pointer(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2746 | static int snd_hdsp_put_precise_pointer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2751 | { | 2747 | { |
2752 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2748 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2753 | int change; | 2749 | int change; |
2754 | unsigned int val; | 2750 | unsigned int val; |
2755 | 2751 | ||
@@ -2772,7 +2768,7 @@ static int snd_hdsp_put_precise_pointer(snd_kcontrol_t * kcontrol, snd_ctl_elem_ | |||
2772 | .put = snd_hdsp_put_use_midi_tasklet \ | 2768 | .put = snd_hdsp_put_use_midi_tasklet \ |
2773 | } | 2769 | } |
2774 | 2770 | ||
2775 | static int hdsp_set_use_midi_tasklet(hdsp_t *hdsp, int use_tasklet) | 2771 | static int hdsp_set_use_midi_tasklet(struct hdsp *hdsp, int use_tasklet) |
2776 | { | 2772 | { |
2777 | if (use_tasklet) | 2773 | if (use_tasklet) |
2778 | hdsp->use_midi_tasklet = 1; | 2774 | hdsp->use_midi_tasklet = 1; |
@@ -2781,7 +2777,7 @@ static int hdsp_set_use_midi_tasklet(hdsp_t *hdsp, int use_tasklet) | |||
2781 | return 0; | 2777 | return 0; |
2782 | } | 2778 | } |
2783 | 2779 | ||
2784 | static int snd_hdsp_info_use_midi_tasklet(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2780 | static int snd_hdsp_info_use_midi_tasklet(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2785 | { | 2781 | { |
2786 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 2782 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
2787 | uinfo->count = 1; | 2783 | uinfo->count = 1; |
@@ -2790,9 +2786,9 @@ static int snd_hdsp_info_use_midi_tasklet(snd_kcontrol_t *kcontrol, snd_ctl_elem | |||
2790 | return 0; | 2786 | return 0; |
2791 | } | 2787 | } |
2792 | 2788 | ||
2793 | static int snd_hdsp_get_use_midi_tasklet(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2789 | static int snd_hdsp_get_use_midi_tasklet(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2794 | { | 2790 | { |
2795 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2791 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2796 | 2792 | ||
2797 | spin_lock_irq(&hdsp->lock); | 2793 | spin_lock_irq(&hdsp->lock); |
2798 | ucontrol->value.integer.value[0] = hdsp->use_midi_tasklet; | 2794 | ucontrol->value.integer.value[0] = hdsp->use_midi_tasklet; |
@@ -2800,9 +2796,9 @@ static int snd_hdsp_get_use_midi_tasklet(snd_kcontrol_t * kcontrol, snd_ctl_elem | |||
2800 | return 0; | 2796 | return 0; |
2801 | } | 2797 | } |
2802 | 2798 | ||
2803 | static int snd_hdsp_put_use_midi_tasklet(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2799 | static int snd_hdsp_put_use_midi_tasklet(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2804 | { | 2800 | { |
2805 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2801 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2806 | int change; | 2802 | int change; |
2807 | unsigned int val; | 2803 | unsigned int val; |
2808 | 2804 | ||
@@ -2828,7 +2824,7 @@ static int snd_hdsp_put_use_midi_tasklet(snd_kcontrol_t * kcontrol, snd_ctl_elem | |||
2828 | .put = snd_hdsp_put_mixer \ | 2824 | .put = snd_hdsp_put_mixer \ |
2829 | } | 2825 | } |
2830 | 2826 | ||
2831 | static int snd_hdsp_info_mixer(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2827 | static int snd_hdsp_info_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2832 | { | 2828 | { |
2833 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 2829 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
2834 | uinfo->count = 3; | 2830 | uinfo->count = 3; |
@@ -2838,9 +2834,9 @@ static int snd_hdsp_info_mixer(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * u | |||
2838 | return 0; | 2834 | return 0; |
2839 | } | 2835 | } |
2840 | 2836 | ||
2841 | static int snd_hdsp_get_mixer(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2837 | static int snd_hdsp_get_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2842 | { | 2838 | { |
2843 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2839 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2844 | int source; | 2840 | int source; |
2845 | int destination; | 2841 | int destination; |
2846 | int addr; | 2842 | int addr; |
@@ -2859,9 +2855,9 @@ static int snd_hdsp_get_mixer(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * | |||
2859 | return 0; | 2855 | return 0; |
2860 | } | 2856 | } |
2861 | 2857 | ||
2862 | static int snd_hdsp_put_mixer(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2858 | static int snd_hdsp_put_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2863 | { | 2859 | { |
2864 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2860 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2865 | int change; | 2861 | int change; |
2866 | int source; | 2862 | int source; |
2867 | int destination; | 2863 | int destination; |
@@ -2898,7 +2894,7 @@ static int snd_hdsp_put_mixer(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * | |||
2898 | .get = snd_hdsp_get_wc_sync_check \ | 2894 | .get = snd_hdsp_get_wc_sync_check \ |
2899 | } | 2895 | } |
2900 | 2896 | ||
2901 | static int snd_hdsp_info_sync_check(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 2897 | static int snd_hdsp_info_sync_check(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
2902 | { | 2898 | { |
2903 | static char *texts[] = {"No Lock", "Lock", "Sync" }; | 2899 | static char *texts[] = {"No Lock", "Lock", "Sync" }; |
2904 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 2900 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
@@ -2910,7 +2906,7 @@ static int snd_hdsp_info_sync_check(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_ | |||
2910 | return 0; | 2906 | return 0; |
2911 | } | 2907 | } |
2912 | 2908 | ||
2913 | static int hdsp_wc_sync_check(hdsp_t *hdsp) | 2909 | static int hdsp_wc_sync_check(struct hdsp *hdsp) |
2914 | { | 2910 | { |
2915 | int status2 = hdsp_read(hdsp, HDSP_status2Register); | 2911 | int status2 = hdsp_read(hdsp, HDSP_status2Register); |
2916 | if (status2 & HDSP_wc_lock) { | 2912 | if (status2 & HDSP_wc_lock) { |
@@ -2923,9 +2919,9 @@ static int hdsp_wc_sync_check(hdsp_t *hdsp) | |||
2923 | return 0; | 2919 | return 0; |
2924 | } | 2920 | } |
2925 | 2921 | ||
2926 | static int snd_hdsp_get_wc_sync_check(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2922 | static int snd_hdsp_get_wc_sync_check(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2927 | { | 2923 | { |
2928 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2924 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2929 | 2925 | ||
2930 | ucontrol->value.enumerated.item[0] = hdsp_wc_sync_check(hdsp); | 2926 | ucontrol->value.enumerated.item[0] = hdsp_wc_sync_check(hdsp); |
2931 | return 0; | 2927 | return 0; |
@@ -2940,7 +2936,7 @@ static int snd_hdsp_get_wc_sync_check(snd_kcontrol_t * kcontrol, snd_ctl_elem_va | |||
2940 | .get = snd_hdsp_get_spdif_sync_check \ | 2936 | .get = snd_hdsp_get_spdif_sync_check \ |
2941 | } | 2937 | } |
2942 | 2938 | ||
2943 | static int hdsp_spdif_sync_check(hdsp_t *hdsp) | 2939 | static int hdsp_spdif_sync_check(struct hdsp *hdsp) |
2944 | { | 2940 | { |
2945 | int status = hdsp_read(hdsp, HDSP_statusRegister); | 2941 | int status = hdsp_read(hdsp, HDSP_statusRegister); |
2946 | if (status & HDSP_SPDIFErrorFlag) | 2942 | if (status & HDSP_SPDIFErrorFlag) |
@@ -2954,9 +2950,9 @@ static int hdsp_spdif_sync_check(hdsp_t *hdsp) | |||
2954 | return 0; | 2950 | return 0; |
2955 | } | 2951 | } |
2956 | 2952 | ||
2957 | static int snd_hdsp_get_spdif_sync_check(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2953 | static int snd_hdsp_get_spdif_sync_check(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2958 | { | 2954 | { |
2959 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2955 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2960 | 2956 | ||
2961 | ucontrol->value.enumerated.item[0] = hdsp_spdif_sync_check(hdsp); | 2957 | ucontrol->value.enumerated.item[0] = hdsp_spdif_sync_check(hdsp); |
2962 | return 0; | 2958 | return 0; |
@@ -2971,7 +2967,7 @@ static int snd_hdsp_get_spdif_sync_check(snd_kcontrol_t * kcontrol, snd_ctl_elem | |||
2971 | .get = snd_hdsp_get_adatsync_sync_check \ | 2967 | .get = snd_hdsp_get_adatsync_sync_check \ |
2972 | } | 2968 | } |
2973 | 2969 | ||
2974 | static int hdsp_adatsync_sync_check(hdsp_t *hdsp) | 2970 | static int hdsp_adatsync_sync_check(struct hdsp *hdsp) |
2975 | { | 2971 | { |
2976 | int status = hdsp_read(hdsp, HDSP_statusRegister); | 2972 | int status = hdsp_read(hdsp, HDSP_statusRegister); |
2977 | if (status & HDSP_TimecodeLock) { | 2973 | if (status & HDSP_TimecodeLock) { |
@@ -2983,9 +2979,9 @@ static int hdsp_adatsync_sync_check(hdsp_t *hdsp) | |||
2983 | return 0; | 2979 | return 0; |
2984 | } | 2980 | } |
2985 | 2981 | ||
2986 | static int snd_hdsp_get_adatsync_sync_check(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 2982 | static int snd_hdsp_get_adatsync_sync_check(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
2987 | { | 2983 | { |
2988 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 2984 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
2989 | 2985 | ||
2990 | ucontrol->value.enumerated.item[0] = hdsp_adatsync_sync_check(hdsp); | 2986 | ucontrol->value.enumerated.item[0] = hdsp_adatsync_sync_check(hdsp); |
2991 | return 0; | 2987 | return 0; |
@@ -2998,7 +2994,7 @@ static int snd_hdsp_get_adatsync_sync_check(snd_kcontrol_t * kcontrol, snd_ctl_e | |||
2998 | .get = snd_hdsp_get_adat_sync_check \ | 2994 | .get = snd_hdsp_get_adat_sync_check \ |
2999 | } | 2995 | } |
3000 | 2996 | ||
3001 | static int hdsp_adat_sync_check(hdsp_t *hdsp, int idx) | 2997 | static int hdsp_adat_sync_check(struct hdsp *hdsp, int idx) |
3002 | { | 2998 | { |
3003 | int status = hdsp_read(hdsp, HDSP_statusRegister); | 2999 | int status = hdsp_read(hdsp, HDSP_statusRegister); |
3004 | 3000 | ||
@@ -3011,10 +3007,10 @@ static int hdsp_adat_sync_check(hdsp_t *hdsp, int idx) | |||
3011 | return 0; | 3007 | return 0; |
3012 | } | 3008 | } |
3013 | 3009 | ||
3014 | static int snd_hdsp_get_adat_sync_check(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 3010 | static int snd_hdsp_get_adat_sync_check(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
3015 | { | 3011 | { |
3016 | int offset; | 3012 | int offset; |
3017 | hdsp_t *hdsp = snd_kcontrol_chip(kcontrol); | 3013 | struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); |
3018 | 3014 | ||
3019 | offset = ucontrol->id.index - 1; | 3015 | offset = ucontrol->id.index - 1; |
3020 | snd_assert(offset >= 0); | 3016 | snd_assert(offset >= 0); |
@@ -3038,14 +3034,14 @@ static int snd_hdsp_get_adat_sync_check(snd_kcontrol_t * kcontrol, snd_ctl_elem_ | |||
3038 | return 0; | 3034 | return 0; |
3039 | } | 3035 | } |
3040 | 3036 | ||
3041 | static snd_kcontrol_new_t snd_hdsp_9632_controls[] = { | 3037 | static struct snd_kcontrol_new snd_hdsp_9632_controls[] = { |
3042 | HDSP_DA_GAIN("DA Gain", 0), | 3038 | HDSP_DA_GAIN("DA Gain", 0), |
3043 | HDSP_AD_GAIN("AD Gain", 0), | 3039 | HDSP_AD_GAIN("AD Gain", 0), |
3044 | HDSP_PHONE_GAIN("Phones Gain", 0), | 3040 | HDSP_PHONE_GAIN("Phones Gain", 0), |
3045 | HDSP_XLR_BREAKOUT_CABLE("XLR Breakout Cable", 0) | 3041 | HDSP_XLR_BREAKOUT_CABLE("XLR Breakout Cable", 0) |
3046 | }; | 3042 | }; |
3047 | 3043 | ||
3048 | static snd_kcontrol_new_t snd_hdsp_controls[] = { | 3044 | static struct snd_kcontrol_new snd_hdsp_controls[] = { |
3049 | { | 3045 | { |
3050 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 3046 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
3051 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), | 3047 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), |
@@ -3111,14 +3107,14 @@ HDSP_PRECISE_POINTER("Precise Pointer", 0), | |||
3111 | HDSP_USE_MIDI_TASKLET("Use Midi Tasklet", 0), | 3107 | HDSP_USE_MIDI_TASKLET("Use Midi Tasklet", 0), |
3112 | }; | 3108 | }; |
3113 | 3109 | ||
3114 | static snd_kcontrol_new_t snd_hdsp_96xx_aeb = HDSP_AEB("Analog Extension Board", 0); | 3110 | static struct snd_kcontrol_new snd_hdsp_96xx_aeb = HDSP_AEB("Analog Extension Board", 0); |
3115 | static snd_kcontrol_new_t snd_hdsp_adat_sync_check = HDSP_ADAT_SYNC_CHECK; | 3111 | static struct snd_kcontrol_new snd_hdsp_adat_sync_check = HDSP_ADAT_SYNC_CHECK; |
3116 | 3112 | ||
3117 | static int snd_hdsp_create_controls(snd_card_t *card, hdsp_t *hdsp) | 3113 | static int snd_hdsp_create_controls(struct snd_card *card, struct hdsp *hdsp) |
3118 | { | 3114 | { |
3119 | unsigned int idx; | 3115 | unsigned int idx; |
3120 | int err; | 3116 | int err; |
3121 | snd_kcontrol_t *kctl; | 3117 | struct snd_kcontrol *kctl; |
3122 | 3118 | ||
3123 | for (idx = 0; idx < ARRAY_SIZE(snd_hdsp_controls); idx++) { | 3119 | for (idx = 0; idx < ARRAY_SIZE(snd_hdsp_controls); idx++) { |
3124 | if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_hdsp_controls[idx], hdsp))) < 0) | 3120 | if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_hdsp_controls[idx], hdsp))) < 0) |
@@ -3162,9 +3158,9 @@ static int snd_hdsp_create_controls(snd_card_t *card, hdsp_t *hdsp) | |||
3162 | ------------------------------------------------------------*/ | 3158 | ------------------------------------------------------------*/ |
3163 | 3159 | ||
3164 | static void | 3160 | static void |
3165 | snd_hdsp_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) | 3161 | snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) |
3166 | { | 3162 | { |
3167 | hdsp_t *hdsp = (hdsp_t *) entry->private_data; | 3163 | struct hdsp *hdsp = (struct hdsp *) entry->private_data; |
3168 | unsigned int status; | 3164 | unsigned int status; |
3169 | unsigned int status2; | 3165 | unsigned int status2; |
3170 | char *pref_sync_ref; | 3166 | char *pref_sync_ref; |
@@ -3469,21 +3465,21 @@ snd_hdsp_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) | |||
3469 | 3465 | ||
3470 | } | 3466 | } |
3471 | 3467 | ||
3472 | static void __devinit snd_hdsp_proc_init(hdsp_t *hdsp) | 3468 | static void __devinit snd_hdsp_proc_init(struct hdsp *hdsp) |
3473 | { | 3469 | { |
3474 | snd_info_entry_t *entry; | 3470 | struct snd_info_entry *entry; |
3475 | 3471 | ||
3476 | if (! snd_card_proc_new(hdsp->card, "hdsp", &entry)) | 3472 | if (! snd_card_proc_new(hdsp->card, "hdsp", &entry)) |
3477 | snd_info_set_text_ops(entry, hdsp, 1024, snd_hdsp_proc_read); | 3473 | snd_info_set_text_ops(entry, hdsp, 1024, snd_hdsp_proc_read); |
3478 | } | 3474 | } |
3479 | 3475 | ||
3480 | static void snd_hdsp_free_buffers(hdsp_t *hdsp) | 3476 | static void snd_hdsp_free_buffers(struct hdsp *hdsp) |
3481 | { | 3477 | { |
3482 | snd_hammerfall_free_buffer(&hdsp->capture_dma_buf, hdsp->pci); | 3478 | snd_hammerfall_free_buffer(&hdsp->capture_dma_buf, hdsp->pci); |
3483 | snd_hammerfall_free_buffer(&hdsp->playback_dma_buf, hdsp->pci); | 3479 | snd_hammerfall_free_buffer(&hdsp->playback_dma_buf, hdsp->pci); |
3484 | } | 3480 | } |
3485 | 3481 | ||
3486 | static int __devinit snd_hdsp_initialize_memory(hdsp_t *hdsp) | 3482 | static int __devinit snd_hdsp_initialize_memory(struct hdsp *hdsp) |
3487 | { | 3483 | { |
3488 | unsigned long pb_bus, cb_bus; | 3484 | unsigned long pb_bus, cb_bus; |
3489 | 3485 | ||
@@ -3511,7 +3507,7 @@ static int __devinit snd_hdsp_initialize_memory(hdsp_t *hdsp) | |||
3511 | return 0; | 3507 | return 0; |
3512 | } | 3508 | } |
3513 | 3509 | ||
3514 | static int snd_hdsp_set_defaults(hdsp_t *hdsp) | 3510 | static int snd_hdsp_set_defaults(struct hdsp *hdsp) |
3515 | { | 3511 | { |
3516 | unsigned int i; | 3512 | unsigned int i; |
3517 | 3513 | ||
@@ -3576,7 +3572,7 @@ static int snd_hdsp_set_defaults(hdsp_t *hdsp) | |||
3576 | 3572 | ||
3577 | static void hdsp_midi_tasklet(unsigned long arg) | 3573 | static void hdsp_midi_tasklet(unsigned long arg) |
3578 | { | 3574 | { |
3579 | hdsp_t *hdsp = (hdsp_t *)arg; | 3575 | struct hdsp *hdsp = (struct hdsp *)arg; |
3580 | 3576 | ||
3581 | if (hdsp->midi[0].pending) | 3577 | if (hdsp->midi[0].pending) |
3582 | snd_hdsp_midi_input_read (&hdsp->midi[0]); | 3578 | snd_hdsp_midi_input_read (&hdsp->midi[0]); |
@@ -3586,7 +3582,7 @@ static void hdsp_midi_tasklet(unsigned long arg) | |||
3586 | 3582 | ||
3587 | static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 3583 | static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
3588 | { | 3584 | { |
3589 | hdsp_t *hdsp = (hdsp_t *) dev_id; | 3585 | struct hdsp *hdsp = (struct hdsp *) dev_id; |
3590 | unsigned int status; | 3586 | unsigned int status; |
3591 | int audio; | 3587 | int audio; |
3592 | int midi0; | 3588 | int midi0; |
@@ -3644,13 +3640,13 @@ static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id, struct pt_regs *reg | |||
3644 | return IRQ_HANDLED; | 3640 | return IRQ_HANDLED; |
3645 | } | 3641 | } |
3646 | 3642 | ||
3647 | static snd_pcm_uframes_t snd_hdsp_hw_pointer(snd_pcm_substream_t *substream) | 3643 | static snd_pcm_uframes_t snd_hdsp_hw_pointer(struct snd_pcm_substream *substream) |
3648 | { | 3644 | { |
3649 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 3645 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
3650 | return hdsp_hw_pointer(hdsp); | 3646 | return hdsp_hw_pointer(hdsp); |
3651 | } | 3647 | } |
3652 | 3648 | ||
3653 | static char *hdsp_channel_buffer_location(hdsp_t *hdsp, | 3649 | static char *hdsp_channel_buffer_location(struct hdsp *hdsp, |
3654 | int stream, | 3650 | int stream, |
3655 | int channel) | 3651 | int channel) |
3656 | 3652 | ||
@@ -3668,10 +3664,10 @@ static char *hdsp_channel_buffer_location(hdsp_t *hdsp, | |||
3668 | return hdsp->playback_buffer + (mapped_channel * HDSP_CHANNEL_BUFFER_BYTES); | 3664 | return hdsp->playback_buffer + (mapped_channel * HDSP_CHANNEL_BUFFER_BYTES); |
3669 | } | 3665 | } |
3670 | 3666 | ||
3671 | static int snd_hdsp_playback_copy(snd_pcm_substream_t *substream, int channel, | 3667 | static int snd_hdsp_playback_copy(struct snd_pcm_substream *substream, int channel, |
3672 | snd_pcm_uframes_t pos, void __user *src, snd_pcm_uframes_t count) | 3668 | snd_pcm_uframes_t pos, void __user *src, snd_pcm_uframes_t count) |
3673 | { | 3669 | { |
3674 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 3670 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
3675 | char *channel_buf; | 3671 | char *channel_buf; |
3676 | 3672 | ||
3677 | snd_assert(pos + count <= HDSP_CHANNEL_BUFFER_BYTES / 4, return -EINVAL); | 3673 | snd_assert(pos + count <= HDSP_CHANNEL_BUFFER_BYTES / 4, return -EINVAL); |
@@ -3683,10 +3679,10 @@ static int snd_hdsp_playback_copy(snd_pcm_substream_t *substream, int channel, | |||
3683 | return count; | 3679 | return count; |
3684 | } | 3680 | } |
3685 | 3681 | ||
3686 | static int snd_hdsp_capture_copy(snd_pcm_substream_t *substream, int channel, | 3682 | static int snd_hdsp_capture_copy(struct snd_pcm_substream *substream, int channel, |
3687 | snd_pcm_uframes_t pos, void __user *dst, snd_pcm_uframes_t count) | 3683 | snd_pcm_uframes_t pos, void __user *dst, snd_pcm_uframes_t count) |
3688 | { | 3684 | { |
3689 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 3685 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
3690 | char *channel_buf; | 3686 | char *channel_buf; |
3691 | 3687 | ||
3692 | snd_assert(pos + count <= HDSP_CHANNEL_BUFFER_BYTES / 4, return -EINVAL); | 3688 | snd_assert(pos + count <= HDSP_CHANNEL_BUFFER_BYTES / 4, return -EINVAL); |
@@ -3698,10 +3694,10 @@ static int snd_hdsp_capture_copy(snd_pcm_substream_t *substream, int channel, | |||
3698 | return count; | 3694 | return count; |
3699 | } | 3695 | } |
3700 | 3696 | ||
3701 | static int snd_hdsp_hw_silence(snd_pcm_substream_t *substream, int channel, | 3697 | static int snd_hdsp_hw_silence(struct snd_pcm_substream *substream, int channel, |
3702 | snd_pcm_uframes_t pos, snd_pcm_uframes_t count) | 3698 | snd_pcm_uframes_t pos, snd_pcm_uframes_t count) |
3703 | { | 3699 | { |
3704 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 3700 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
3705 | char *channel_buf; | 3701 | char *channel_buf; |
3706 | 3702 | ||
3707 | channel_buf = hdsp_channel_buffer_location (hdsp, substream->pstr->stream, channel); | 3703 | channel_buf = hdsp_channel_buffer_location (hdsp, substream->pstr->stream, channel); |
@@ -3710,11 +3706,11 @@ static int snd_hdsp_hw_silence(snd_pcm_substream_t *substream, int channel, | |||
3710 | return count; | 3706 | return count; |
3711 | } | 3707 | } |
3712 | 3708 | ||
3713 | static int snd_hdsp_reset(snd_pcm_substream_t *substream) | 3709 | static int snd_hdsp_reset(struct snd_pcm_substream *substream) |
3714 | { | 3710 | { |
3715 | snd_pcm_runtime_t *runtime = substream->runtime; | 3711 | struct snd_pcm_runtime *runtime = substream->runtime; |
3716 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 3712 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
3717 | snd_pcm_substream_t *other; | 3713 | struct snd_pcm_substream *other; |
3718 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | 3714 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) |
3719 | other = hdsp->capture_substream; | 3715 | other = hdsp->capture_substream; |
3720 | else | 3716 | else |
@@ -3725,8 +3721,8 @@ static int snd_hdsp_reset(snd_pcm_substream_t *substream) | |||
3725 | runtime->status->hw_ptr = 0; | 3721 | runtime->status->hw_ptr = 0; |
3726 | if (other) { | 3722 | if (other) { |
3727 | struct list_head *pos; | 3723 | struct list_head *pos; |
3728 | snd_pcm_substream_t *s; | 3724 | struct snd_pcm_substream *s; |
3729 | snd_pcm_runtime_t *oruntime = other->runtime; | 3725 | struct snd_pcm_runtime *oruntime = other->runtime; |
3730 | snd_pcm_group_for_each(pos, substream) { | 3726 | snd_pcm_group_for_each(pos, substream) { |
3731 | s = snd_pcm_group_substream_entry(pos); | 3727 | s = snd_pcm_group_substream_entry(pos); |
3732 | if (s == other) { | 3728 | if (s == other) { |
@@ -3738,10 +3734,10 @@ static int snd_hdsp_reset(snd_pcm_substream_t *substream) | |||
3738 | return 0; | 3734 | return 0; |
3739 | } | 3735 | } |
3740 | 3736 | ||
3741 | static int snd_hdsp_hw_params(snd_pcm_substream_t *substream, | 3737 | static int snd_hdsp_hw_params(struct snd_pcm_substream *substream, |
3742 | snd_pcm_hw_params_t *params) | 3738 | struct snd_pcm_hw_params *params) |
3743 | { | 3739 | { |
3744 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 3740 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
3745 | int err; | 3741 | int err; |
3746 | pid_t this_pid; | 3742 | pid_t this_pid; |
3747 | pid_t other_pid; | 3743 | pid_t other_pid; |
@@ -3813,10 +3809,10 @@ static int snd_hdsp_hw_params(snd_pcm_substream_t *substream, | |||
3813 | return 0; | 3809 | return 0; |
3814 | } | 3810 | } |
3815 | 3811 | ||
3816 | static int snd_hdsp_channel_info(snd_pcm_substream_t *substream, | 3812 | static int snd_hdsp_channel_info(struct snd_pcm_substream *substream, |
3817 | snd_pcm_channel_info_t *info) | 3813 | struct snd_pcm_channel_info *info) |
3818 | { | 3814 | { |
3819 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 3815 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
3820 | int mapped_channel; | 3816 | int mapped_channel; |
3821 | 3817 | ||
3822 | snd_assert(info->channel < hdsp->max_channels, return -EINVAL); | 3818 | snd_assert(info->channel < hdsp->max_channels, return -EINVAL); |
@@ -3830,7 +3826,7 @@ static int snd_hdsp_channel_info(snd_pcm_substream_t *substream, | |||
3830 | return 0; | 3826 | return 0; |
3831 | } | 3827 | } |
3832 | 3828 | ||
3833 | static int snd_hdsp_ioctl(snd_pcm_substream_t *substream, | 3829 | static int snd_hdsp_ioctl(struct snd_pcm_substream *substream, |
3834 | unsigned int cmd, void *arg) | 3830 | unsigned int cmd, void *arg) |
3835 | { | 3831 | { |
3836 | switch (cmd) { | 3832 | switch (cmd) { |
@@ -3845,10 +3841,10 @@ static int snd_hdsp_ioctl(snd_pcm_substream_t *substream, | |||
3845 | return snd_pcm_lib_ioctl(substream, cmd, arg); | 3841 | return snd_pcm_lib_ioctl(substream, cmd, arg); |
3846 | } | 3842 | } |
3847 | 3843 | ||
3848 | static int snd_hdsp_trigger(snd_pcm_substream_t *substream, int cmd) | 3844 | static int snd_hdsp_trigger(struct snd_pcm_substream *substream, int cmd) |
3849 | { | 3845 | { |
3850 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 3846 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
3851 | snd_pcm_substream_t *other; | 3847 | struct snd_pcm_substream *other; |
3852 | int running; | 3848 | int running; |
3853 | 3849 | ||
3854 | if (hdsp_check_for_iobox (hdsp)) | 3850 | if (hdsp_check_for_iobox (hdsp)) |
@@ -3878,7 +3874,7 @@ static int snd_hdsp_trigger(snd_pcm_substream_t *substream, int cmd) | |||
3878 | 3874 | ||
3879 | if (other) { | 3875 | if (other) { |
3880 | struct list_head *pos; | 3876 | struct list_head *pos; |
3881 | snd_pcm_substream_t *s; | 3877 | struct snd_pcm_substream *s; |
3882 | snd_pcm_group_for_each(pos, substream) { | 3878 | snd_pcm_group_for_each(pos, substream) { |
3883 | s = snd_pcm_group_substream_entry(pos); | 3879 | s = snd_pcm_group_substream_entry(pos); |
3884 | if (s == other) { | 3880 | if (s == other) { |
@@ -3915,9 +3911,9 @@ static int snd_hdsp_trigger(snd_pcm_substream_t *substream, int cmd) | |||
3915 | return 0; | 3911 | return 0; |
3916 | } | 3912 | } |
3917 | 3913 | ||
3918 | static int snd_hdsp_prepare(snd_pcm_substream_t *substream) | 3914 | static int snd_hdsp_prepare(struct snd_pcm_substream *substream) |
3919 | { | 3915 | { |
3920 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 3916 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
3921 | int result = 0; | 3917 | int result = 0; |
3922 | 3918 | ||
3923 | if (hdsp_check_for_iobox (hdsp)) | 3919 | if (hdsp_check_for_iobox (hdsp)) |
@@ -3933,7 +3929,7 @@ static int snd_hdsp_prepare(snd_pcm_substream_t *substream) | |||
3933 | return result; | 3929 | return result; |
3934 | } | 3930 | } |
3935 | 3931 | ||
3936 | static snd_pcm_hardware_t snd_hdsp_playback_subinfo = | 3932 | static struct snd_pcm_hardware snd_hdsp_playback_subinfo = |
3937 | { | 3933 | { |
3938 | .info = (SNDRV_PCM_INFO_MMAP | | 3934 | .info = (SNDRV_PCM_INFO_MMAP | |
3939 | SNDRV_PCM_INFO_MMAP_VALID | | 3935 | SNDRV_PCM_INFO_MMAP_VALID | |
@@ -3963,7 +3959,7 @@ static snd_pcm_hardware_t snd_hdsp_playback_subinfo = | |||
3963 | .fifo_size = 0 | 3959 | .fifo_size = 0 |
3964 | }; | 3960 | }; |
3965 | 3961 | ||
3966 | static snd_pcm_hardware_t snd_hdsp_capture_subinfo = | 3962 | static struct snd_pcm_hardware snd_hdsp_capture_subinfo = |
3967 | { | 3963 | { |
3968 | .info = (SNDRV_PCM_INFO_MMAP | | 3964 | .info = (SNDRV_PCM_INFO_MMAP | |
3969 | SNDRV_PCM_INFO_MMAP_VALID | | 3965 | SNDRV_PCM_INFO_MMAP_VALID | |
@@ -3994,7 +3990,7 @@ static snd_pcm_hardware_t snd_hdsp_capture_subinfo = | |||
3994 | 3990 | ||
3995 | static unsigned int hdsp_period_sizes[] = { 64, 128, 256, 512, 1024, 2048, 4096, 8192 }; | 3991 | static unsigned int hdsp_period_sizes[] = { 64, 128, 256, 512, 1024, 2048, 4096, 8192 }; |
3996 | 3992 | ||
3997 | static snd_pcm_hw_constraint_list_t hdsp_hw_constraints_period_sizes = { | 3993 | static struct snd_pcm_hw_constraint_list hdsp_hw_constraints_period_sizes = { |
3998 | .count = ARRAY_SIZE(hdsp_period_sizes), | 3994 | .count = ARRAY_SIZE(hdsp_period_sizes), |
3999 | .list = hdsp_period_sizes, | 3995 | .list = hdsp_period_sizes, |
4000 | .mask = 0 | 3996 | .mask = 0 |
@@ -4002,17 +3998,17 @@ static snd_pcm_hw_constraint_list_t hdsp_hw_constraints_period_sizes = { | |||
4002 | 3998 | ||
4003 | static unsigned int hdsp_9632_sample_rates[] = { 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000 }; | 3999 | static unsigned int hdsp_9632_sample_rates[] = { 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000 }; |
4004 | 4000 | ||
4005 | static snd_pcm_hw_constraint_list_t hdsp_hw_constraints_9632_sample_rates = { | 4001 | static struct snd_pcm_hw_constraint_list hdsp_hw_constraints_9632_sample_rates = { |
4006 | .count = ARRAY_SIZE(hdsp_9632_sample_rates), | 4002 | .count = ARRAY_SIZE(hdsp_9632_sample_rates), |
4007 | .list = hdsp_9632_sample_rates, | 4003 | .list = hdsp_9632_sample_rates, |
4008 | .mask = 0 | 4004 | .mask = 0 |
4009 | }; | 4005 | }; |
4010 | 4006 | ||
4011 | static int snd_hdsp_hw_rule_in_channels(snd_pcm_hw_params_t *params, | 4007 | static int snd_hdsp_hw_rule_in_channels(struct snd_pcm_hw_params *params, |
4012 | snd_pcm_hw_rule_t *rule) | 4008 | struct snd_pcm_hw_rule *rule) |
4013 | { | 4009 | { |
4014 | hdsp_t *hdsp = rule->private; | 4010 | struct hdsp *hdsp = rule->private; |
4015 | snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); | 4011 | struct snd_interval *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); |
4016 | if (hdsp->io_type == H9632) { | 4012 | if (hdsp->io_type == H9632) { |
4017 | unsigned int list[3]; | 4013 | unsigned int list[3]; |
4018 | list[0] = hdsp->qs_in_channels; | 4014 | list[0] = hdsp->qs_in_channels; |
@@ -4027,12 +4023,12 @@ static int snd_hdsp_hw_rule_in_channels(snd_pcm_hw_params_t *params, | |||
4027 | } | 4023 | } |
4028 | } | 4024 | } |
4029 | 4025 | ||
4030 | static int snd_hdsp_hw_rule_out_channels(snd_pcm_hw_params_t *params, | 4026 | static int snd_hdsp_hw_rule_out_channels(struct snd_pcm_hw_params *params, |
4031 | snd_pcm_hw_rule_t *rule) | 4027 | struct snd_pcm_hw_rule *rule) |
4032 | { | 4028 | { |
4033 | unsigned int list[3]; | 4029 | unsigned int list[3]; |
4034 | hdsp_t *hdsp = rule->private; | 4030 | struct hdsp *hdsp = rule->private; |
4035 | snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); | 4031 | struct snd_interval *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); |
4036 | if (hdsp->io_type == H9632) { | 4032 | if (hdsp->io_type == H9632) { |
4037 | list[0] = hdsp->qs_out_channels; | 4033 | list[0] = hdsp->qs_out_channels; |
4038 | list[1] = hdsp->ds_out_channels; | 4034 | list[1] = hdsp->ds_out_channels; |
@@ -4045,28 +4041,28 @@ static int snd_hdsp_hw_rule_out_channels(snd_pcm_hw_params_t *params, | |||
4045 | return snd_interval_list(c, 2, list, 0); | 4041 | return snd_interval_list(c, 2, list, 0); |
4046 | } | 4042 | } |
4047 | 4043 | ||
4048 | static int snd_hdsp_hw_rule_in_channels_rate(snd_pcm_hw_params_t *params, | 4044 | static int snd_hdsp_hw_rule_in_channels_rate(struct snd_pcm_hw_params *params, |
4049 | snd_pcm_hw_rule_t *rule) | 4045 | struct snd_pcm_hw_rule *rule) |
4050 | { | 4046 | { |
4051 | hdsp_t *hdsp = rule->private; | 4047 | struct hdsp *hdsp = rule->private; |
4052 | snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); | 4048 | struct snd_interval *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); |
4053 | snd_interval_t *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); | 4049 | struct snd_interval *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); |
4054 | if (r->min > 96000 && hdsp->io_type == H9632) { | 4050 | if (r->min > 96000 && hdsp->io_type == H9632) { |
4055 | snd_interval_t t = { | 4051 | struct snd_interval t = { |
4056 | .min = hdsp->qs_in_channels, | 4052 | .min = hdsp->qs_in_channels, |
4057 | .max = hdsp->qs_in_channels, | 4053 | .max = hdsp->qs_in_channels, |
4058 | .integer = 1, | 4054 | .integer = 1, |
4059 | }; | 4055 | }; |
4060 | return snd_interval_refine(c, &t); | 4056 | return snd_interval_refine(c, &t); |
4061 | } else if (r->min > 48000 && r->max <= 96000) { | 4057 | } else if (r->min > 48000 && r->max <= 96000) { |
4062 | snd_interval_t t = { | 4058 | struct snd_interval t = { |
4063 | .min = hdsp->ds_in_channels, | 4059 | .min = hdsp->ds_in_channels, |
4064 | .max = hdsp->ds_in_channels, | 4060 | .max = hdsp->ds_in_channels, |
4065 | .integer = 1, | 4061 | .integer = 1, |
4066 | }; | 4062 | }; |
4067 | return snd_interval_refine(c, &t); | 4063 | return snd_interval_refine(c, &t); |
4068 | } else if (r->max < 64000) { | 4064 | } else if (r->max < 64000) { |
4069 | snd_interval_t t = { | 4065 | struct snd_interval t = { |
4070 | .min = hdsp->ss_in_channels, | 4066 | .min = hdsp->ss_in_channels, |
4071 | .max = hdsp->ss_in_channels, | 4067 | .max = hdsp->ss_in_channels, |
4072 | .integer = 1, | 4068 | .integer = 1, |
@@ -4076,28 +4072,28 @@ static int snd_hdsp_hw_rule_in_channels_rate(snd_pcm_hw_params_t *params, | |||
4076 | return 0; | 4072 | return 0; |
4077 | } | 4073 | } |
4078 | 4074 | ||
4079 | static int snd_hdsp_hw_rule_out_channels_rate(snd_pcm_hw_params_t *params, | 4075 | static int snd_hdsp_hw_rule_out_channels_rate(struct snd_pcm_hw_params *params, |
4080 | snd_pcm_hw_rule_t *rule) | 4076 | struct snd_pcm_hw_rule *rule) |
4081 | { | 4077 | { |
4082 | hdsp_t *hdsp = rule->private; | 4078 | struct hdsp *hdsp = rule->private; |
4083 | snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); | 4079 | struct snd_interval *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); |
4084 | snd_interval_t *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); | 4080 | struct snd_interval *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); |
4085 | if (r->min > 96000 && hdsp->io_type == H9632) { | 4081 | if (r->min > 96000 && hdsp->io_type == H9632) { |
4086 | snd_interval_t t = { | 4082 | struct snd_interval t = { |
4087 | .min = hdsp->qs_out_channels, | 4083 | .min = hdsp->qs_out_channels, |
4088 | .max = hdsp->qs_out_channels, | 4084 | .max = hdsp->qs_out_channels, |
4089 | .integer = 1, | 4085 | .integer = 1, |
4090 | }; | 4086 | }; |
4091 | return snd_interval_refine(c, &t); | 4087 | return snd_interval_refine(c, &t); |
4092 | } else if (r->min > 48000 && r->max <= 96000) { | 4088 | } else if (r->min > 48000 && r->max <= 96000) { |
4093 | snd_interval_t t = { | 4089 | struct snd_interval t = { |
4094 | .min = hdsp->ds_out_channels, | 4090 | .min = hdsp->ds_out_channels, |
4095 | .max = hdsp->ds_out_channels, | 4091 | .max = hdsp->ds_out_channels, |
4096 | .integer = 1, | 4092 | .integer = 1, |
4097 | }; | 4093 | }; |
4098 | return snd_interval_refine(c, &t); | 4094 | return snd_interval_refine(c, &t); |
4099 | } else if (r->max < 64000) { | 4095 | } else if (r->max < 64000) { |
4100 | snd_interval_t t = { | 4096 | struct snd_interval t = { |
4101 | .min = hdsp->ss_out_channels, | 4097 | .min = hdsp->ss_out_channels, |
4102 | .max = hdsp->ss_out_channels, | 4098 | .max = hdsp->ss_out_channels, |
4103 | .integer = 1, | 4099 | .integer = 1, |
@@ -4107,28 +4103,28 @@ static int snd_hdsp_hw_rule_out_channels_rate(snd_pcm_hw_params_t *params, | |||
4107 | return 0; | 4103 | return 0; |
4108 | } | 4104 | } |
4109 | 4105 | ||
4110 | static int snd_hdsp_hw_rule_rate_out_channels(snd_pcm_hw_params_t *params, | 4106 | static int snd_hdsp_hw_rule_rate_out_channels(struct snd_pcm_hw_params *params, |
4111 | snd_pcm_hw_rule_t *rule) | 4107 | struct snd_pcm_hw_rule *rule) |
4112 | { | 4108 | { |
4113 | hdsp_t *hdsp = rule->private; | 4109 | struct hdsp *hdsp = rule->private; |
4114 | snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); | 4110 | struct snd_interval *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); |
4115 | snd_interval_t *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); | 4111 | struct snd_interval *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); |
4116 | if (c->min >= hdsp->ss_out_channels) { | 4112 | if (c->min >= hdsp->ss_out_channels) { |
4117 | snd_interval_t t = { | 4113 | struct snd_interval t = { |
4118 | .min = 32000, | 4114 | .min = 32000, |
4119 | .max = 48000, | 4115 | .max = 48000, |
4120 | .integer = 1, | 4116 | .integer = 1, |
4121 | }; | 4117 | }; |
4122 | return snd_interval_refine(r, &t); | 4118 | return snd_interval_refine(r, &t); |
4123 | } else if (c->max <= hdsp->qs_out_channels && hdsp->io_type == H9632) { | 4119 | } else if (c->max <= hdsp->qs_out_channels && hdsp->io_type == H9632) { |
4124 | snd_interval_t t = { | 4120 | struct snd_interval t = { |
4125 | .min = 128000, | 4121 | .min = 128000, |
4126 | .max = 192000, | 4122 | .max = 192000, |
4127 | .integer = 1, | 4123 | .integer = 1, |
4128 | }; | 4124 | }; |
4129 | return snd_interval_refine(r, &t); | 4125 | return snd_interval_refine(r, &t); |
4130 | } else if (c->max <= hdsp->ds_out_channels) { | 4126 | } else if (c->max <= hdsp->ds_out_channels) { |
4131 | snd_interval_t t = { | 4127 | struct snd_interval t = { |
4132 | .min = 64000, | 4128 | .min = 64000, |
4133 | .max = 96000, | 4129 | .max = 96000, |
4134 | .integer = 1, | 4130 | .integer = 1, |
@@ -4138,28 +4134,28 @@ static int snd_hdsp_hw_rule_rate_out_channels(snd_pcm_hw_params_t *params, | |||
4138 | return 0; | 4134 | return 0; |
4139 | } | 4135 | } |
4140 | 4136 | ||
4141 | static int snd_hdsp_hw_rule_rate_in_channels(snd_pcm_hw_params_t *params, | 4137 | static int snd_hdsp_hw_rule_rate_in_channels(struct snd_pcm_hw_params *params, |
4142 | snd_pcm_hw_rule_t *rule) | 4138 | struct snd_pcm_hw_rule *rule) |
4143 | { | 4139 | { |
4144 | hdsp_t *hdsp = rule->private; | 4140 | struct hdsp *hdsp = rule->private; |
4145 | snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); | 4141 | struct snd_interval *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); |
4146 | snd_interval_t *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); | 4142 | struct snd_interval *r = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); |
4147 | if (c->min >= hdsp->ss_in_channels) { | 4143 | if (c->min >= hdsp->ss_in_channels) { |
4148 | snd_interval_t t = { | 4144 | struct snd_interval t = { |
4149 | .min = 32000, | 4145 | .min = 32000, |
4150 | .max = 48000, | 4146 | .max = 48000, |
4151 | .integer = 1, | 4147 | .integer = 1, |
4152 | }; | 4148 | }; |
4153 | return snd_interval_refine(r, &t); | 4149 | return snd_interval_refine(r, &t); |
4154 | } else if (c->max <= hdsp->qs_in_channels && hdsp->io_type == H9632) { | 4150 | } else if (c->max <= hdsp->qs_in_channels && hdsp->io_type == H9632) { |
4155 | snd_interval_t t = { | 4151 | struct snd_interval t = { |
4156 | .min = 128000, | 4152 | .min = 128000, |
4157 | .max = 192000, | 4153 | .max = 192000, |
4158 | .integer = 1, | 4154 | .integer = 1, |
4159 | }; | 4155 | }; |
4160 | return snd_interval_refine(r, &t); | 4156 | return snd_interval_refine(r, &t); |
4161 | } else if (c->max <= hdsp->ds_in_channels) { | 4157 | } else if (c->max <= hdsp->ds_in_channels) { |
4162 | snd_interval_t t = { | 4158 | struct snd_interval t = { |
4163 | .min = 64000, | 4159 | .min = 64000, |
4164 | .max = 96000, | 4160 | .max = 96000, |
4165 | .integer = 1, | 4161 | .integer = 1, |
@@ -4169,10 +4165,10 @@ static int snd_hdsp_hw_rule_rate_in_channels(snd_pcm_hw_params_t *params, | |||
4169 | return 0; | 4165 | return 0; |
4170 | } | 4166 | } |
4171 | 4167 | ||
4172 | static int snd_hdsp_playback_open(snd_pcm_substream_t *substream) | 4168 | static int snd_hdsp_playback_open(struct snd_pcm_substream *substream) |
4173 | { | 4169 | { |
4174 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 4170 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
4175 | snd_pcm_runtime_t *runtime = substream->runtime; | 4171 | struct snd_pcm_runtime *runtime = substream->runtime; |
4176 | 4172 | ||
4177 | if (hdsp_check_for_iobox (hdsp)) | 4173 | if (hdsp_check_for_iobox (hdsp)) |
4178 | return -EIO; | 4174 | return -EIO; |
@@ -4224,9 +4220,9 @@ static int snd_hdsp_playback_open(snd_pcm_substream_t *substream) | |||
4224 | return 0; | 4220 | return 0; |
4225 | } | 4221 | } |
4226 | 4222 | ||
4227 | static int snd_hdsp_playback_release(snd_pcm_substream_t *substream) | 4223 | static int snd_hdsp_playback_release(struct snd_pcm_substream *substream) |
4228 | { | 4224 | { |
4229 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 4225 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
4230 | 4226 | ||
4231 | spin_lock_irq(&hdsp->lock); | 4227 | spin_lock_irq(&hdsp->lock); |
4232 | 4228 | ||
@@ -4242,10 +4238,10 @@ static int snd_hdsp_playback_release(snd_pcm_substream_t *substream) | |||
4242 | } | 4238 | } |
4243 | 4239 | ||
4244 | 4240 | ||
4245 | static int snd_hdsp_capture_open(snd_pcm_substream_t *substream) | 4241 | static int snd_hdsp_capture_open(struct snd_pcm_substream *substream) |
4246 | { | 4242 | { |
4247 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 4243 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
4248 | snd_pcm_runtime_t *runtime = substream->runtime; | 4244 | struct snd_pcm_runtime *runtime = substream->runtime; |
4249 | 4245 | ||
4250 | if (hdsp_check_for_iobox (hdsp)) | 4246 | if (hdsp_check_for_iobox (hdsp)) |
4251 | return -EIO; | 4247 | return -EIO; |
@@ -4287,9 +4283,9 @@ static int snd_hdsp_capture_open(snd_pcm_substream_t *substream) | |||
4287 | return 0; | 4283 | return 0; |
4288 | } | 4284 | } |
4289 | 4285 | ||
4290 | static int snd_hdsp_capture_release(snd_pcm_substream_t *substream) | 4286 | static int snd_hdsp_capture_release(struct snd_pcm_substream *substream) |
4291 | { | 4287 | { |
4292 | hdsp_t *hdsp = snd_pcm_substream_chip(substream); | 4288 | struct hdsp *hdsp = snd_pcm_substream_chip(substream); |
4293 | 4289 | ||
4294 | spin_lock_irq(&hdsp->lock); | 4290 | spin_lock_irq(&hdsp->lock); |
4295 | 4291 | ||
@@ -4300,7 +4296,7 @@ static int snd_hdsp_capture_release(snd_pcm_substream_t *substream) | |||
4300 | return 0; | 4296 | return 0; |
4301 | } | 4297 | } |
4302 | 4298 | ||
4303 | static int snd_hdsp_hwdep_dummy_op(snd_hwdep_t *hw, struct file *file) | 4299 | static int snd_hdsp_hwdep_dummy_op(struct snd_hwdep *hw, struct file *file) |
4304 | { | 4300 | { |
4305 | /* we have nothing to initialize but the call is required */ | 4301 | /* we have nothing to initialize but the call is required */ |
4306 | return 0; | 4302 | return 0; |
@@ -4334,7 +4330,7 @@ static inline int copy_u48_le(void __user *dest, void __iomem *src_low, void __i | |||
4334 | return copy_to_user(dest, &rms, 8); | 4330 | return copy_to_user(dest, &rms, 8); |
4335 | } | 4331 | } |
4336 | 4332 | ||
4337 | static int hdsp_9652_get_peak(hdsp_t *hdsp, hdsp_peak_rms_t __user *peak_rms) | 4333 | static int hdsp_9652_get_peak(struct hdsp *hdsp, struct hdsp_peak_rms __user *peak_rms) |
4338 | { | 4334 | { |
4339 | int doublespeed = 0; | 4335 | int doublespeed = 0; |
4340 | int i, j, channels, ofs; | 4336 | int i, j, channels, ofs; |
@@ -4371,15 +4367,15 @@ static int hdsp_9652_get_peak(hdsp_t *hdsp, hdsp_peak_rms_t __user *peak_rms) | |||
4371 | return 0; | 4367 | return 0; |
4372 | } | 4368 | } |
4373 | 4369 | ||
4374 | static int hdsp_9632_get_peak(hdsp_t *hdsp, hdsp_peak_rms_t __user *peak_rms) | 4370 | static int hdsp_9632_get_peak(struct hdsp *hdsp, struct hdsp_peak_rms __user *peak_rms) |
4375 | { | 4371 | { |
4376 | int i, j; | 4372 | int i, j; |
4377 | hdsp_9632_meters_t __iomem *m; | 4373 | struct hdsp_9632_meters __iomem *m; |
4378 | int doublespeed = 0; | 4374 | int doublespeed = 0; |
4379 | 4375 | ||
4380 | if (hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DoubleSpeedStatus) | 4376 | if (hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DoubleSpeedStatus) |
4381 | doublespeed = 1; | 4377 | doublespeed = 1; |
4382 | m = (hdsp_9632_meters_t __iomem *)(hdsp->iobase+HDSP_9632_metersBase); | 4378 | m = (struct hdsp_9632_meters __iomem *)(hdsp->iobase+HDSP_9632_metersBase); |
4383 | for (i = 0, j = 0; i < 16; ++i, ++j) { | 4379 | for (i = 0, j = 0; i < 16; ++i, ++j) { |
4384 | if (copy_u32_le(&peak_rms->input_peaks[i], &m->input_peak[j])) | 4380 | if (copy_u32_le(&peak_rms->input_peaks[i], &m->input_peak[j])) |
4385 | return -EFAULT; | 4381 | return -EFAULT; |
@@ -4401,7 +4397,7 @@ static int hdsp_9632_get_peak(hdsp_t *hdsp, hdsp_peak_rms_t __user *peak_rms) | |||
4401 | return 0; | 4397 | return 0; |
4402 | } | 4398 | } |
4403 | 4399 | ||
4404 | static int hdsp_get_peak(hdsp_t *hdsp, hdsp_peak_rms_t __user *peak_rms) | 4400 | static int hdsp_get_peak(struct hdsp *hdsp, struct hdsp_peak_rms __user *peak_rms) |
4405 | { | 4401 | { |
4406 | int i; | 4402 | int i; |
4407 | 4403 | ||
@@ -4431,14 +4427,14 @@ static int hdsp_get_peak(hdsp_t *hdsp, hdsp_peak_rms_t __user *peak_rms) | |||
4431 | return 0; | 4427 | return 0; |
4432 | } | 4428 | } |
4433 | 4429 | ||
4434 | static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int cmd, unsigned long arg) | 4430 | static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigned int cmd, unsigned long arg) |
4435 | { | 4431 | { |
4436 | hdsp_t *hdsp = (hdsp_t *)hw->private_data; | 4432 | struct hdsp *hdsp = (struct hdsp *)hw->private_data; |
4437 | void __user *argp = (void __user *)arg; | 4433 | void __user *argp = (void __user *)arg; |
4438 | 4434 | ||
4439 | switch (cmd) { | 4435 | switch (cmd) { |
4440 | case SNDRV_HDSP_IOCTL_GET_PEAK_RMS: { | 4436 | case SNDRV_HDSP_IOCTL_GET_PEAK_RMS: { |
4441 | hdsp_peak_rms_t __user *peak_rms = (hdsp_peak_rms_t __user *)arg; | 4437 | struct hdsp_peak_rms __user *peak_rms = (struct hdsp_peak_rms __user *)arg; |
4442 | 4438 | ||
4443 | if (!(hdsp->state & HDSP_FirmwareLoaded)) { | 4439 | if (!(hdsp->state & HDSP_FirmwareLoaded)) { |
4444 | snd_printk(KERN_ERR "Hammerfall-DSP: firmware needs to be uploaded to the card.\n"); | 4440 | snd_printk(KERN_ERR "Hammerfall-DSP: firmware needs to be uploaded to the card.\n"); |
@@ -4455,7 +4451,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int | |||
4455 | } | 4451 | } |
4456 | } | 4452 | } |
4457 | case SNDRV_HDSP_IOCTL_GET_CONFIG_INFO: { | 4453 | case SNDRV_HDSP_IOCTL_GET_CONFIG_INFO: { |
4458 | hdsp_config_info_t info; | 4454 | struct hdsp_config_info info; |
4459 | unsigned long flags; | 4455 | unsigned long flags; |
4460 | int i; | 4456 | int i; |
4461 | 4457 | ||
@@ -4498,7 +4494,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int | |||
4498 | break; | 4494 | break; |
4499 | } | 4495 | } |
4500 | case SNDRV_HDSP_IOCTL_GET_9632_AEB: { | 4496 | case SNDRV_HDSP_IOCTL_GET_9632_AEB: { |
4501 | hdsp_9632_aeb_t h9632_aeb; | 4497 | struct hdsp_9632_aeb h9632_aeb; |
4502 | 4498 | ||
4503 | if (hdsp->io_type != H9632) return -EINVAL; | 4499 | if (hdsp->io_type != H9632) return -EINVAL; |
4504 | h9632_aeb.aebi = hdsp->ss_in_channels - H9632_SS_CHANNELS; | 4500 | h9632_aeb.aebi = hdsp->ss_in_channels - H9632_SS_CHANNELS; |
@@ -4508,7 +4504,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int | |||
4508 | break; | 4504 | break; |
4509 | } | 4505 | } |
4510 | case SNDRV_HDSP_IOCTL_GET_VERSION: { | 4506 | case SNDRV_HDSP_IOCTL_GET_VERSION: { |
4511 | hdsp_version_t hdsp_version; | 4507 | struct hdsp_version hdsp_version; |
4512 | int err; | 4508 | int err; |
4513 | 4509 | ||
4514 | if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return -EINVAL; | 4510 | if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return -EINVAL; |
@@ -4523,7 +4519,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int | |||
4523 | break; | 4519 | break; |
4524 | } | 4520 | } |
4525 | case SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE: { | 4521 | case SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE: { |
4526 | hdsp_firmware_t __user *firmware; | 4522 | struct hdsp_firmware __user *firmware; |
4527 | u32 __user *firmware_data; | 4523 | u32 __user *firmware_data; |
4528 | int err; | 4524 | int err; |
4529 | 4525 | ||
@@ -4535,7 +4531,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int | |||
4535 | return -EBUSY; | 4531 | return -EBUSY; |
4536 | 4532 | ||
4537 | snd_printk(KERN_INFO "Hammerfall-DSP: initializing firmware upload\n"); | 4533 | snd_printk(KERN_INFO "Hammerfall-DSP: initializing firmware upload\n"); |
4538 | firmware = (hdsp_firmware_t __user *)argp; | 4534 | firmware = (struct hdsp_firmware __user *)argp; |
4539 | 4535 | ||
4540 | if (get_user(firmware_data, &firmware->firmware_data)) | 4536 | if (get_user(firmware_data, &firmware->firmware_data)) |
4541 | return -EFAULT; | 4537 | return -EFAULT; |
@@ -4566,7 +4562,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int | |||
4566 | break; | 4562 | break; |
4567 | } | 4563 | } |
4568 | case SNDRV_HDSP_IOCTL_GET_MIXER: { | 4564 | case SNDRV_HDSP_IOCTL_GET_MIXER: { |
4569 | hdsp_mixer_t __user *mixer = (hdsp_mixer_t __user *)argp; | 4565 | struct hdsp_mixer __user *mixer = (struct hdsp_mixer __user *)argp; |
4570 | if (copy_to_user(mixer->matrix, hdsp->mixer_matrix, sizeof(unsigned short)*HDSP_MATRIX_MIXER_SIZE)) | 4566 | if (copy_to_user(mixer->matrix, hdsp->mixer_matrix, sizeof(unsigned short)*HDSP_MATRIX_MIXER_SIZE)) |
4571 | return -EFAULT; | 4567 | return -EFAULT; |
4572 | break; | 4568 | break; |
@@ -4577,7 +4573,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int | |||
4577 | return 0; | 4573 | return 0; |
4578 | } | 4574 | } |
4579 | 4575 | ||
4580 | static snd_pcm_ops_t snd_hdsp_playback_ops = { | 4576 | static struct snd_pcm_ops snd_hdsp_playback_ops = { |
4581 | .open = snd_hdsp_playback_open, | 4577 | .open = snd_hdsp_playback_open, |
4582 | .close = snd_hdsp_playback_release, | 4578 | .close = snd_hdsp_playback_release, |
4583 | .ioctl = snd_hdsp_ioctl, | 4579 | .ioctl = snd_hdsp_ioctl, |
@@ -4589,7 +4585,7 @@ static snd_pcm_ops_t snd_hdsp_playback_ops = { | |||
4589 | .silence = snd_hdsp_hw_silence, | 4585 | .silence = snd_hdsp_hw_silence, |
4590 | }; | 4586 | }; |
4591 | 4587 | ||
4592 | static snd_pcm_ops_t snd_hdsp_capture_ops = { | 4588 | static struct snd_pcm_ops snd_hdsp_capture_ops = { |
4593 | .open = snd_hdsp_capture_open, | 4589 | .open = snd_hdsp_capture_open, |
4594 | .close = snd_hdsp_capture_release, | 4590 | .close = snd_hdsp_capture_release, |
4595 | .ioctl = snd_hdsp_ioctl, | 4591 | .ioctl = snd_hdsp_ioctl, |
@@ -4600,10 +4596,10 @@ static snd_pcm_ops_t snd_hdsp_capture_ops = { | |||
4600 | .copy = snd_hdsp_capture_copy, | 4596 | .copy = snd_hdsp_capture_copy, |
4601 | }; | 4597 | }; |
4602 | 4598 | ||
4603 | static int __devinit snd_hdsp_create_hwdep(snd_card_t *card, | 4599 | static int __devinit snd_hdsp_create_hwdep(struct snd_card *card, |
4604 | hdsp_t *hdsp) | 4600 | struct hdsp *hdsp) |
4605 | { | 4601 | { |
4606 | snd_hwdep_t *hw; | 4602 | struct snd_hwdep *hw; |
4607 | int err; | 4603 | int err; |
4608 | 4604 | ||
4609 | if ((err = snd_hwdep_new(card, "HDSP hwdep", 0, &hw)) < 0) | 4605 | if ((err = snd_hwdep_new(card, "HDSP hwdep", 0, &hw)) < 0) |
@@ -4620,9 +4616,9 @@ static int __devinit snd_hdsp_create_hwdep(snd_card_t *card, | |||
4620 | return 0; | 4616 | return 0; |
4621 | } | 4617 | } |
4622 | 4618 | ||
4623 | static int snd_hdsp_create_pcm(snd_card_t *card, hdsp_t *hdsp) | 4619 | static int snd_hdsp_create_pcm(struct snd_card *card, struct hdsp *hdsp) |
4624 | { | 4620 | { |
4625 | snd_pcm_t *pcm; | 4621 | struct snd_pcm *pcm; |
4626 | int err; | 4622 | int err; |
4627 | 4623 | ||
4628 | if ((err = snd_pcm_new(card, hdsp->card_name, 0, 1, 1, &pcm)) < 0) | 4624 | if ((err = snd_pcm_new(card, hdsp->card_name, 0, 1, 1, &pcm)) < 0) |
@@ -4640,13 +4636,13 @@ static int snd_hdsp_create_pcm(snd_card_t *card, hdsp_t *hdsp) | |||
4640 | return 0; | 4636 | return 0; |
4641 | } | 4637 | } |
4642 | 4638 | ||
4643 | static void snd_hdsp_9652_enable_mixer (hdsp_t *hdsp) | 4639 | static void snd_hdsp_9652_enable_mixer (struct hdsp *hdsp) |
4644 | { | 4640 | { |
4645 | hdsp->control2_register |= HDSP_9652_ENABLE_MIXER; | 4641 | hdsp->control2_register |= HDSP_9652_ENABLE_MIXER; |
4646 | hdsp_write (hdsp, HDSP_control2Reg, hdsp->control2_register); | 4642 | hdsp_write (hdsp, HDSP_control2Reg, hdsp->control2_register); |
4647 | } | 4643 | } |
4648 | 4644 | ||
4649 | static int snd_hdsp_enable_io (hdsp_t *hdsp) | 4645 | static int snd_hdsp_enable_io (struct hdsp *hdsp) |
4650 | { | 4646 | { |
4651 | int i; | 4647 | int i; |
4652 | 4648 | ||
@@ -4663,7 +4659,7 @@ static int snd_hdsp_enable_io (hdsp_t *hdsp) | |||
4663 | return 0; | 4659 | return 0; |
4664 | } | 4660 | } |
4665 | 4661 | ||
4666 | static void snd_hdsp_initialize_channels(hdsp_t *hdsp) | 4662 | static void snd_hdsp_initialize_channels(struct hdsp *hdsp) |
4667 | { | 4663 | { |
4668 | int status, aebi_channels, aebo_channels; | 4664 | int status, aebi_channels, aebo_channels; |
4669 | 4665 | ||
@@ -4706,13 +4702,13 @@ static void snd_hdsp_initialize_channels(hdsp_t *hdsp) | |||
4706 | } | 4702 | } |
4707 | } | 4703 | } |
4708 | 4704 | ||
4709 | static void snd_hdsp_initialize_midi_flush (hdsp_t *hdsp) | 4705 | static void snd_hdsp_initialize_midi_flush (struct hdsp *hdsp) |
4710 | { | 4706 | { |
4711 | snd_hdsp_flush_midi_input (hdsp, 0); | 4707 | snd_hdsp_flush_midi_input (hdsp, 0); |
4712 | snd_hdsp_flush_midi_input (hdsp, 1); | 4708 | snd_hdsp_flush_midi_input (hdsp, 1); |
4713 | } | 4709 | } |
4714 | 4710 | ||
4715 | static int snd_hdsp_create_alsa_devices(snd_card_t *card, hdsp_t *hdsp) | 4711 | static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp) |
4716 | { | 4712 | { |
4717 | int err; | 4713 | int err; |
4718 | 4714 | ||
@@ -4769,7 +4765,7 @@ static int snd_hdsp_create_alsa_devices(snd_card_t *card, hdsp_t *hdsp) | |||
4769 | 4765 | ||
4770 | #ifdef HDSP_FW_LOADER | 4766 | #ifdef HDSP_FW_LOADER |
4771 | /* load firmware via hotplug fw loader */ | 4767 | /* load firmware via hotplug fw loader */ |
4772 | static int __devinit hdsp_request_fw_loader(hdsp_t *hdsp) | 4768 | static int __devinit hdsp_request_fw_loader(struct hdsp *hdsp) |
4773 | { | 4769 | { |
4774 | const char *fwfile; | 4770 | const char *fwfile; |
4775 | const struct firmware *fw; | 4771 | const struct firmware *fw; |
@@ -4842,8 +4838,8 @@ static int __devinit hdsp_request_fw_loader(hdsp_t *hdsp) | |||
4842 | } | 4838 | } |
4843 | #endif | 4839 | #endif |
4844 | 4840 | ||
4845 | static int __devinit snd_hdsp_create(snd_card_t *card, | 4841 | static int __devinit snd_hdsp_create(struct snd_card *card, |
4846 | hdsp_t *hdsp) | 4842 | struct hdsp *hdsp) |
4847 | { | 4843 | { |
4848 | struct pci_dev *pci = hdsp->pci; | 4844 | struct pci_dev *pci = hdsp->pci; |
4849 | int err; | 4845 | int err; |
@@ -4980,7 +4976,7 @@ static int __devinit snd_hdsp_create(snd_card_t *card, | |||
4980 | return 0; | 4976 | return 0; |
4981 | } | 4977 | } |
4982 | 4978 | ||
4983 | static int snd_hdsp_free(hdsp_t *hdsp) | 4979 | static int snd_hdsp_free(struct hdsp *hdsp) |
4984 | { | 4980 | { |
4985 | if (hdsp->port) { | 4981 | if (hdsp->port) { |
4986 | /* stop the audio, and cancel all interrupts */ | 4982 | /* stop the audio, and cancel all interrupts */ |
@@ -5004,9 +5000,9 @@ static int snd_hdsp_free(hdsp_t *hdsp) | |||
5004 | return 0; | 5000 | return 0; |
5005 | } | 5001 | } |
5006 | 5002 | ||
5007 | static void snd_hdsp_card_free(snd_card_t *card) | 5003 | static void snd_hdsp_card_free(struct snd_card *card) |
5008 | { | 5004 | { |
5009 | hdsp_t *hdsp = (hdsp_t *) card->private_data; | 5005 | struct hdsp *hdsp = (struct hdsp *) card->private_data; |
5010 | 5006 | ||
5011 | if (hdsp) | 5007 | if (hdsp) |
5012 | snd_hdsp_free(hdsp); | 5008 | snd_hdsp_free(hdsp); |
@@ -5016,8 +5012,8 @@ static int __devinit snd_hdsp_probe(struct pci_dev *pci, | |||
5016 | const struct pci_device_id *pci_id) | 5012 | const struct pci_device_id *pci_id) |
5017 | { | 5013 | { |
5018 | static int dev; | 5014 | static int dev; |
5019 | hdsp_t *hdsp; | 5015 | struct hdsp *hdsp; |
5020 | snd_card_t *card; | 5016 | struct snd_card *card; |
5021 | int err; | 5017 | int err; |
5022 | 5018 | ||
5023 | if (dev >= SNDRV_CARDS) | 5019 | if (dev >= SNDRV_CARDS) |
@@ -5027,10 +5023,10 @@ static int __devinit snd_hdsp_probe(struct pci_dev *pci, | |||
5027 | return -ENOENT; | 5023 | return -ENOENT; |
5028 | } | 5024 | } |
5029 | 5025 | ||
5030 | if (!(card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(hdsp_t)))) | 5026 | if (!(card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct hdsp)))) |
5031 | return -ENOMEM; | 5027 | return -ENOMEM; |
5032 | 5028 | ||
5033 | hdsp = (hdsp_t *) card->private_data; | 5029 | hdsp = (struct hdsp *) card->private_data; |
5034 | card->private_free = snd_hdsp_card_free; | 5030 | card->private_free = snd_hdsp_card_free; |
5035 | hdsp->dev = dev; | 5031 | hdsp->dev = dev; |
5036 | hdsp->pci = pci; | 5032 | hdsp->pci = pci; |