emumixer.c (f01387d2693813eb5271a3448e6a082322c7d75d) | emumixer.c (1541c66d3bb78c8a388025b074c75658c790b72f) |
---|---|
1/* 2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, 3 * Takashi Iwai <tiwai@suse.de> 4 * Creative Labs, Inc. 5 * Routines for control of EMU10K1 chips / mixer routines 6 * Multichannel PCM support Copyright (c) Lee Revell <rlrevell@joe-job.com> 7 * 8 * Copyright (c) by James Courtier-Dutton <James@superbug.co.uk> --- 69 unchanged lines hidden (view full) --- 78 ucontrol->value.iec958.status[3] = 0xff; 79 return 0; 80} 81 82/* 83 * Items labels in enum mixer controls assigning source data to 84 * each destination 85 */ | 1/* 2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, 3 * Takashi Iwai <tiwai@suse.de> 4 * Creative Labs, Inc. 5 * Routines for control of EMU10K1 chips / mixer routines 6 * Multichannel PCM support Copyright (c) Lee Revell <rlrevell@joe-job.com> 7 * 8 * Copyright (c) by James Courtier-Dutton <James@superbug.co.uk> --- 69 unchanged lines hidden (view full) --- 78 ucontrol->value.iec958.status[3] = 0xff; 79 return 0; 80} 81 82/* 83 * Items labels in enum mixer controls assigning source data to 84 * each destination 85 */ |
86static char *emu1010_src_texts[] = { | 86static const char * const emu1010_src_texts[] = { |
87 "Silence", 88 "Dock Mic A", 89 "Dock Mic B", 90 "Dock ADC1 Left", 91 "Dock ADC1 Right", 92 "Dock ADC2 Left", 93 "Dock ADC2 Right", 94 "Dock ADC3 Left", --- 41 unchanged lines hidden (view full) --- 136 "DSP 28", 137 "DSP 29", 138 "DSP 30", 139 "DSP 31", 140}; 141 142/* 1616(m) cardbus */ 143 | 87 "Silence", 88 "Dock Mic A", 89 "Dock Mic B", 90 "Dock ADC1 Left", 91 "Dock ADC1 Right", 92 "Dock ADC2 Left", 93 "Dock ADC2 Right", 94 "Dock ADC3 Left", --- 41 unchanged lines hidden (view full) --- 136 "DSP 28", 137 "DSP 29", 138 "DSP 30", 139 "DSP 31", 140}; 141 142/* 1616(m) cardbus */ 143 |
144static char *emu1616_src_texts[] = { | 144static const char * const emu1616_src_texts[] = { |
145 "Silence", 146 "Dock Mic A", 147 "Dock Mic B", 148 "Dock ADC1 Left", 149 "Dock ADC1 Right", 150 "Dock ADC2 Left", 151 "Dock ADC2 Right", 152 "Dock SPDIF Left", --- 235 unchanged lines hidden (view full) --- 388 EMU_DST_ALICE_I2S2_LEFT, 389 EMU_DST_ALICE_I2S2_RIGHT, 390}; 391 392static int snd_emu1010_input_output_source_info(struct snd_kcontrol *kcontrol, 393 struct snd_ctl_elem_info *uinfo) 394{ 395 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); | 145 "Silence", 146 "Dock Mic A", 147 "Dock Mic B", 148 "Dock ADC1 Left", 149 "Dock ADC1 Right", 150 "Dock ADC2 Left", 151 "Dock ADC2 Right", 152 "Dock SPDIF Left", --- 235 unchanged lines hidden (view full) --- 388 EMU_DST_ALICE_I2S2_LEFT, 389 EMU_DST_ALICE_I2S2_RIGHT, 390}; 391 392static int snd_emu1010_input_output_source_info(struct snd_kcontrol *kcontrol, 393 struct snd_ctl_elem_info *uinfo) 394{ 395 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); |
396 char **items; | |
397 | 396 |
398 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 399 uinfo->count = 1; 400 if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616) { 401 uinfo->value.enumerated.items = 49; 402 items = emu1616_src_texts; 403 } else { 404 uinfo->value.enumerated.items = 53; 405 items = emu1010_src_texts; 406 } 407 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) 408 uinfo->value.enumerated.item = 409 uinfo->value.enumerated.items - 1; 410 strcpy(uinfo->value.enumerated.name, 411 items[uinfo->value.enumerated.item]); 412 return 0; | 397 if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1616) 398 return snd_ctl_enum_info(uinfo, 1, 49, emu1616_src_texts); 399 else 400 return snd_ctl_enum_info(uinfo, 1, 53, emu1010_src_texts); |
413} 414 415static int snd_emu1010_output_source_get(struct snd_kcontrol *kcontrol, 416 struct snd_ctl_elem_value *ucontrol) 417{ 418 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 419 unsigned int channel; 420 --- 273 unchanged lines hidden (view full) --- 694 EMU1010_DAC_PADS("DAC4 Audio Dock 14dB PAD Playback Switch", EMU_HANA_DOCK_DAC_PAD4), 695 EMU1010_DAC_PADS("DAC1 0202 14dB PAD Playback Switch", EMU_HANA_0202_DAC_PAD1), 696}; 697 698 699static int snd_emu1010_internal_clock_info(struct snd_kcontrol *kcontrol, 700 struct snd_ctl_elem_info *uinfo) 701{ | 401} 402 403static int snd_emu1010_output_source_get(struct snd_kcontrol *kcontrol, 404 struct snd_ctl_elem_value *ucontrol) 405{ 406 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 407 unsigned int channel; 408 --- 273 unchanged lines hidden (view full) --- 682 EMU1010_DAC_PADS("DAC4 Audio Dock 14dB PAD Playback Switch", EMU_HANA_DOCK_DAC_PAD4), 683 EMU1010_DAC_PADS("DAC1 0202 14dB PAD Playback Switch", EMU_HANA_0202_DAC_PAD1), 684}; 685 686 687static int snd_emu1010_internal_clock_info(struct snd_kcontrol *kcontrol, 688 struct snd_ctl_elem_info *uinfo) 689{ |
702 static char *texts[4] = { | 690 static const char * const texts[4] = { |
703 "44100", "48000", "SPDIF", "ADAT" 704 }; 705 | 691 "44100", "48000", "SPDIF", "ADAT" 692 }; 693 |
706 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 707 uinfo->count = 1; 708 uinfo->value.enumerated.items = 4; 709 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) 710 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; 711 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); 712 return 0; 713 714 | 694 return snd_ctl_enum_info(uinfo, 1, 4, texts); |
715} 716 717static int snd_emu1010_internal_clock_get(struct snd_kcontrol *kcontrol, 718 struct snd_ctl_elem_value *ucontrol) 719{ 720 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 721 722 ucontrol->value.enumerated.item[0] = emu->emu1010.internal_clock; --- 102 unchanged lines hidden (view full) --- 825 .get = snd_emu1010_internal_clock_get, 826 .put = snd_emu1010_internal_clock_put 827}; 828 829static int snd_audigy_i2c_capture_source_info(struct snd_kcontrol *kcontrol, 830 struct snd_ctl_elem_info *uinfo) 831{ 832#if 0 | 695} 696 697static int snd_emu1010_internal_clock_get(struct snd_kcontrol *kcontrol, 698 struct snd_ctl_elem_value *ucontrol) 699{ 700 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 701 702 ucontrol->value.enumerated.item[0] = emu->emu1010.internal_clock; --- 102 unchanged lines hidden (view full) --- 805 .get = snd_emu1010_internal_clock_get, 806 .put = snd_emu1010_internal_clock_put 807}; 808 809static int snd_audigy_i2c_capture_source_info(struct snd_kcontrol *kcontrol, 810 struct snd_ctl_elem_info *uinfo) 811{ 812#if 0 |
833 static char *texts[4] = { | 813 static const char * const texts[4] = { |
834 "Unknown1", "Unknown2", "Mic", "Line" 835 }; 836#endif | 814 "Unknown1", "Unknown2", "Mic", "Line" 815 }; 816#endif |
837 static char *texts[2] = { | 817 static const char * const texts[2] = { |
838 "Mic", "Line" 839 }; 840 | 818 "Mic", "Line" 819 }; 820 |
841 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 842 uinfo->count = 1; 843 uinfo->value.enumerated.items = 2; 844 if (uinfo->value.enumerated.item > 1) 845 uinfo->value.enumerated.item = 1; 846 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); 847 return 0; | 821 return snd_ctl_enum_info(uinfo, 1, 2, texts); |
848} 849 850static int snd_audigy_i2c_capture_source_get(struct snd_kcontrol *kcontrol, 851 struct snd_ctl_elem_value *ucontrol) 852{ 853 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 854 855 ucontrol->value.enumerated.item[0] = emu->i2c_capture_source; --- 136 unchanged lines hidden (view full) --- 992static struct snd_kcontrol_new snd_audigy_i2c_volume_ctls[] = { 993 I2C_VOLUME("Mic Capture Volume", 0), 994 I2C_VOLUME("Line Capture Volume", 0) 995}; 996 997#if 0 998static int snd_audigy_spdif_output_rate_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 999{ | 822} 823 824static int snd_audigy_i2c_capture_source_get(struct snd_kcontrol *kcontrol, 825 struct snd_ctl_elem_value *ucontrol) 826{ 827 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 828 829 ucontrol->value.enumerated.item[0] = emu->i2c_capture_source; --- 136 unchanged lines hidden (view full) --- 966static struct snd_kcontrol_new snd_audigy_i2c_volume_ctls[] = { 967 I2C_VOLUME("Mic Capture Volume", 0), 968 I2C_VOLUME("Line Capture Volume", 0) 969}; 970 971#if 0 972static int snd_audigy_spdif_output_rate_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 973{ |
1000 static char *texts[] = {"44100", "48000", "96000"}; | 974 static const char * const texts[] = {"44100", "48000", "96000"}; |
1001 | 975 |
1002 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 1003 uinfo->count = 1; 1004 uinfo->value.enumerated.items = 3; 1005 if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) 1006 uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; 1007 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); 1008 return 0; | 976 return snd_ctl_enum_info(uinfo, 1, 3, texts); |
1009} 1010 1011static int snd_audigy_spdif_output_rate_get(struct snd_kcontrol *kcontrol, 1012 struct snd_ctl_elem_value *ucontrol) 1013{ 1014 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1015 unsigned int tmp; 1016 unsigned long flags; --- 1129 unchanged lines hidden --- | 977} 978 979static int snd_audigy_spdif_output_rate_get(struct snd_kcontrol *kcontrol, 980 struct snd_ctl_elem_value *ucontrol) 981{ 982 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 983 unsigned int tmp; 984 unsigned long flags; --- 1129 unchanged lines hidden --- |