Lines Matching +full:hall +full:- +full:channel

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright (C) 1999-2000 Takashi Iwai <tiwai@suse.de>
38 spin_lock_irqsave(&emu->reg_lock, flags); in snd_emu8000_poke()
39 if (reg != emu->last_reg) { in snd_emu8000_poke()
41 emu->last_reg = reg; in snd_emu8000_poke()
44 spin_unlock_irqrestore(&emu->reg_lock, flags); in snd_emu8000_poke()
52 spin_lock_irqsave(&emu->reg_lock, flags); in snd_emu8000_peek()
53 if (reg != emu->last_reg) { in snd_emu8000_peek()
55 emu->last_reg = reg; in snd_emu8000_peek()
58 spin_unlock_irqrestore(&emu->reg_lock, flags); in snd_emu8000_peek()
66 spin_lock_irqsave(&emu->reg_lock, flags); in snd_emu8000_poke_dw()
67 if (reg != emu->last_reg) { in snd_emu8000_poke_dw()
69 emu->last_reg = reg; in snd_emu8000_poke_dw()
73 spin_unlock_irqrestore(&emu->reg_lock, flags); in snd_emu8000_poke_dw()
82 spin_lock_irqsave(&emu->reg_lock, flags); in snd_emu8000_peek_dw()
83 if (reg != emu->last_reg) { in snd_emu8000_peek_dw()
85 emu->last_reg = reg; in snd_emu8000_peek_dw()
89 spin_unlock_irqrestore(&emu->reg_lock, flags); in snd_emu8000_peek_dw()
94 * Set up / close a channel to be used for DMA.
156 return -ENODEV; in snd_emu8000_detect()
159 return -ENODEV; in snd_emu8000_detect()
161 return -ENODEV; in snd_emu8000_detect()
163 dev_dbg(emu->card->dev, "EMU8000 [0x%lx]: Synth chip found\n", in snd_emu8000_detect()
164 emu->port1); in snd_emu8000_detect()
362 * seems that the only way to do this is to use the one channel and keep
370 if (emu->dram_checked) in size_dram()
443 pr_info("EMU8000 [0x%lx]: %d KiB on-board DRAM detected\n", in size_dram()
444 emu->port1, size/1024); in size_dram()
446 emu->mem_size = size; in size_dram()
447 emu->dram_checked = 1; in size_dram()
461 the reverb and chorus effects for Yamaha OPL-3 synthesizer */ in snd_emu8000_init_fm()
463 /* 31: FM left channel, 0xffffe0-0xffffe8 */ in snd_emu8000_init_fm()
466 EMU8000_CSL_WRITE(emu, 30, 0x00FFFFE8 | (emu->fm_chorus_depth << 24)); in snd_emu8000_init_fm()
467 EMU8000_PTRX_WRITE(emu, 30, (emu->fm_reverb_depth << 8)); in snd_emu8000_init_fm()
471 /* 32: FM right channel, 0xfffff0-0xfffff8 */ in snd_emu8000_init_fm()
474 EMU8000_CSL_WRITE(emu, 31, 0x00FFFFF8 | (emu->fm_chorus_depth << 24)); in snd_emu8000_init_fm()
475 EMU8000_PTRX_WRITE(emu, 31, (emu->fm_reverb_depth << 8)); in snd_emu8000_init_fm()
481 spin_lock_irqsave(&emu->reg_lock, flags); in snd_emu8000_init_fm()
486 spin_unlock_irqrestore(&emu->reg_lock, flags); in snd_emu8000_init_fm()
506 emu->last_reg = 0xffff; /* reset the last register index */ in snd_emu8000_init_hw()
547 /*----------------------------------------------------------------
549 *----------------------------------------------------------------*/
552 {0xD26A, 0xD36A, 0x0000}, /* -12 dB */
553 {0xD25B, 0xD35B, 0x0000}, /* -8 */
554 {0xD24C, 0xD34C, 0x0000}, /* -6 */
555 {0xD23D, 0xD33D, 0x0000}, /* -4 */
556 {0xD21F, 0xD31F, 0x0000}, /* -2 */
567 {0x821E, 0xC26A, 0x031E, 0xC36A, 0x021E, 0xD208, 0x831E, 0xD308, 0x0001}, /* -12 dB */
583 * set Emu8000 digital equalizer; from 0 to 11 [-12dB - 12dB]
589 int bass = emu->bass_level; in snd_emu8000_update_equalizer()
590 int treble = emu->treble_level; in snd_emu8000_update_equalizer()
610 /*----------------------------------------------------------------
612 *----------------------------------------------------------------*/
630 unsigned short feedback; /* feedback level (0xE600-0xE6FF) */
631 unsigned short delay_offset; /* delay (0-0x0DA3) [1/44100 sec] */
632 unsigned short lfo_depth; /* LFO depth (0xBC00-0xBCFF) */
633 unsigned int delay; /* right delay (0-0xFFFFFFFF) [1/256/44100 sec] */
634 unsigned int lfo_freq; /* LFO freq LFO freq (0-0xFFFFFFFF) */
655 dev_warn(emu->card->dev, "invalid chorus mode %d for uploading\n", mode); in snd_emu8000_load_chorus_fx()
656 return -EINVAL; in snd_emu8000_load_chorus_fx()
659 return -EFAULT; in snd_emu8000_load_chorus_fx()
668 int effect = emu->chorus_mode; in snd_emu8000_update_chorus_mode()
681 /*----------------------------------------------------------------
683 *----------------------------------------------------------------*/
727 {{ /* hall 1 */
733 {{ /* hall 2 */
783 dev_warn(emu->card->dev, "invalid reverb mode %d for uploading\n", mode); in snd_emu8000_load_reverb_fx()
784 return -EINVAL; in snd_emu8000_load_reverb_fx()
787 return -EFAULT; in snd_emu8000_load_reverb_fx()
796 int effect = emu->reverb_mode; in snd_emu8000_update_reverb_mode()
813 /*----------------------------------------------------------------
815 *----------------------------------------------------------------*/
822 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in mixer_bass_treble_info()
823 uinfo->count = 1; in mixer_bass_treble_info()
824 uinfo->value.integer.min = 0; in mixer_bass_treble_info()
825 uinfo->value.integer.max = 11; in mixer_bass_treble_info()
833 ucontrol->value.integer.value[0] = kcontrol->private_value ? emu->treble_level : emu->bass_level; in mixer_bass_treble_get()
844 val1 = ucontrol->value.integer.value[0] % 12; in mixer_bass_treble_put()
845 spin_lock_irqsave(&emu->control_lock, flags); in mixer_bass_treble_put()
846 if (kcontrol->private_value) { in mixer_bass_treble_put()
847 change = val1 != emu->treble_level; in mixer_bass_treble_put()
848 emu->treble_level = val1; in mixer_bass_treble_put()
850 change = val1 != emu->bass_level; in mixer_bass_treble_put()
851 emu->bass_level = val1; in mixer_bass_treble_put()
853 spin_unlock_irqrestore(&emu->control_lock, flags); in mixer_bass_treble_put()
861 .name = "Synth Tone Control - Bass",
871 .name = "Synth Tone Control - Treble",
883 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in mixer_chorus_reverb_info()
884 uinfo->count = 1; in mixer_chorus_reverb_info()
885 uinfo->value.integer.min = 0; in mixer_chorus_reverb_info()
886 …uinfo->value.integer.max = kcontrol->private_value ? (SNDRV_EMU8000_CHORUS_NUMBERS-1) : (SNDRV_EMU… in mixer_chorus_reverb_info()
894 ucontrol->value.integer.value[0] = kcontrol->private_value ? emu->chorus_mode : emu->reverb_mode; in mixer_chorus_reverb_get()
905 spin_lock_irqsave(&emu->control_lock, flags); in mixer_chorus_reverb_put()
906 if (kcontrol->private_value) { in mixer_chorus_reverb_put()
907 val1 = ucontrol->value.integer.value[0] % SNDRV_EMU8000_CHORUS_NUMBERS; in mixer_chorus_reverb_put()
908 change = val1 != emu->chorus_mode; in mixer_chorus_reverb_put()
909 emu->chorus_mode = val1; in mixer_chorus_reverb_put()
911 val1 = ucontrol->value.integer.value[0] % SNDRV_EMU8000_REVERB_NUMBERS; in mixer_chorus_reverb_put()
912 change = val1 != emu->reverb_mode; in mixer_chorus_reverb_put()
913 emu->reverb_mode = val1; in mixer_chorus_reverb_put()
915 spin_unlock_irqrestore(&emu->control_lock, flags); in mixer_chorus_reverb_put()
917 if (kcontrol->private_value) in mixer_chorus_reverb_put()
950 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in mixer_fm_depth_info()
951 uinfo->count = 1; in mixer_fm_depth_info()
952 uinfo->value.integer.min = 0; in mixer_fm_depth_info()
953 uinfo->value.integer.max = 255; in mixer_fm_depth_info()
961 …ucontrol->value.integer.value[0] = kcontrol->private_value ? emu->fm_chorus_depth : emu->fm_reverb… in mixer_fm_depth_get()
972 val1 = ucontrol->value.integer.value[0] % 256; in mixer_fm_depth_put()
973 spin_lock_irqsave(&emu->control_lock, flags); in mixer_fm_depth_put()
974 if (kcontrol->private_value) { in mixer_fm_depth_put()
975 change = val1 != emu->fm_chorus_depth; in mixer_fm_depth_put()
976 emu->fm_chorus_depth = val1; in mixer_fm_depth_put()
978 change = val1 != emu->fm_reverb_depth; in mixer_fm_depth_put()
979 emu->fm_reverb_depth = val1; in mixer_fm_depth_put()
981 spin_unlock_irqrestore(&emu->control_lock, flags); in mixer_fm_depth_put()
1027 return -EINVAL; in snd_emu8000_create_mixer()
1029 spin_lock_init(&emu->control_lock); in snd_emu8000_create_mixer()
1031 memset(emu->controls, 0, sizeof(emu->controls)); in snd_emu8000_create_mixer()
1037 emu->controls[i] = kctl; in snd_emu8000_create_mixer()
1043 snd_ctl_remove(card, emu->controls[i]); in snd_emu8000_create_mixer()
1064 hw = devm_kzalloc(card->dev, sizeof(*hw), GFP_KERNEL); in snd_emu8000_new()
1066 return -ENOMEM; in snd_emu8000_new()
1067 spin_lock_init(&hw->reg_lock); in snd_emu8000_new()
1068 hw->index = index; in snd_emu8000_new()
1069 hw->port1 = port; in snd_emu8000_new()
1070 hw->port2 = port + 0x400; in snd_emu8000_new()
1071 hw->port3 = port + 0x800; in snd_emu8000_new()
1072 if (!devm_request_region(card->dev, hw->port1, 4, "Emu8000-1") || in snd_emu8000_new()
1073 !devm_request_region(card->dev, hw->port2, 4, "Emu8000-2") || in snd_emu8000_new()
1074 !devm_request_region(card->dev, hw->port3, 4, "Emu8000-3")) { in snd_emu8000_new()
1075 dev_err(card->dev, "sbawe: can't grab ports 0x%lx, 0x%lx, 0x%lx\n", in snd_emu8000_new()
1076 hw->port1, hw->port2, hw->port3); in snd_emu8000_new()
1077 return -EBUSY; in snd_emu8000_new()
1079 hw->mem_size = 0; in snd_emu8000_new()
1080 hw->card = card; in snd_emu8000_new()
1081 hw->seq_ports = seq_ports; in snd_emu8000_new()
1082 hw->bass_level = 5; in snd_emu8000_new()
1083 hw->treble_level = 9; in snd_emu8000_new()
1084 hw->chorus_mode = 2; in snd_emu8000_new()
1085 hw->reverb_mode = 4; in snd_emu8000_new()
1086 hw->fm_chorus_depth = 0; in snd_emu8000_new()
1087 hw->fm_reverb_depth = 0; in snd_emu8000_new()
1090 return -ENODEV; in snd_emu8000_new()
1099 strcpy(awe->name, "EMU-8000"); in snd_emu8000_new()