Lines Matching refs:devc

78 static struct opl_devinfo *devc = NULL;  variable
94 devc->cmask = 0x3f; /* Connect all possible 4 OP voice operators */ in enter_4op_mode()
95 opl3_command(devc->right_io, CONNECTION_SELECT_REGISTER, 0x3f); in enter_4op_mode()
108 devc->lv_map[i] = v4op[i]; in enter_4op_mode()
109 devc->v_alloc->max_voice = devc->nr_voice = 12; in enter_4op_mode()
128 devc->fm_info.nr_voices = (devc->nr_voice == 12) ? 6 : devc->nr_voice; in opl3_ioctl()
129 if (copy_to_user(arg, &devc->fm_info, sizeof(devc->fm_info))) in opl3_ioctl()
137 if (devc->model == 2) in opl3_ioctl()
162 if (devc != NULL) in opl3_detect()
168 devc = kzalloc(sizeof(*devc), GFP_KERNEL); in opl3_detect()
170 if (devc == NULL) in opl3_detect()
177 strcpy(devc->fm_info.name, "OPL2"); in opl3_detect()
179 if (!request_region(ioaddr, 4, devc->fm_info.name)) { in opl3_detect()
184 devc->base = ioaddr; in opl3_detect()
263 kfree(devc); in opl3_detect()
264 devc = NULL; in opl3_detect()
272 if (voice < 0 || voice >= devc->nr_voice) in opl3_kill_note()
275 devc->v_alloc->map[voice] = 0; in opl3_kill_note()
277 map = &pv_map[devc->lv_map[voice]]; in opl3_kill_note()
283 opl3_command(map->ioaddr, KEYON_BLOCK + map->voice_num, devc->voc[voice].keyon_byte & ~0x20); in opl3_kill_note()
284 devc->voc[voice].keyon_byte = 0; in opl3_kill_note()
285 devc->voc[voice].bender = 0; in opl3_kill_note()
286 devc->voc[voice].volume = 64; in opl3_kill_note()
287 devc->voc[voice].panning = 0xffff; /* Not set */ in opl3_kill_note()
288 devc->voc[voice].bender_range = 200; in opl3_kill_note()
289 devc->voc[voice].orig_freq = 0; in opl3_kill_note()
290 devc->voc[voice].current_freq = 0; in opl3_kill_note()
291 devc->voc[voice].mode = 0; in opl3_kill_note()
305 if (instr->key != FM_PATCH && (instr->key != OPL3_PATCH || devc->model != 2)) in store_instr()
307 memcpy((char *) &(devc->i_map[instr_no]), (char *) instr, sizeof(*instr)); in store_instr()
313 if (voice < 0 || voice >= devc->nr_voice) in opl3_set_instr()
318 devc->act_i[voice] = &devc->i_map[instr_no]; in opl3_set_instr()
377 if (voice < 0 || voice >= devc->nr_voice) in set_voice_volume()
380 map = &pv_map[devc->lv_map[voice]]; in set_voice_volume()
381 instr = devc->act_i[voice]; in set_voice_volume()
384 instr = &devc->i_map[0]; in set_voice_volume()
389 if (devc->voc[voice].mode == 0) in set_voice_volume()
392 if (devc->voc[voice].mode == 2) in set_voice_volume()
465 if (voice < 0 || voice >= devc->nr_voice) in opl3_start_note()
468 map = &pv_map[devc->lv_map[voice]]; in opl3_start_note()
469 pan = devc->voc[voice].panning; in opl3_start_note()
478 set_voice_volume(voice, volume, devc->voc[voice].volume); in opl3_start_note()
507 instr = devc->act_i[voice]; in opl3_start_note()
510 instr = &devc->i_map[0]; in opl3_start_note()
529 voice_shift = (map->ioaddr == devc->left_io) ? 0 : 3; in opl3_start_note()
537 devc->cmask &= ~(1 << voice_shift); in opl3_start_note()
541 devc->cmask |= (1 << voice_shift); in opl3_start_note()
544 opl3_command(devc->right_io, CONNECTION_SELECT_REGISTER, devc->cmask); in opl3_start_note()
645 devc->voc[voice].mode = voice_mode; in opl3_start_note()
646 set_voice_volume(voice, volume, devc->voc[voice].volume); in opl3_start_note()
648 freq = devc->voc[voice].orig_freq = note_to_freq(note) / 1000; in opl3_start_note()
655 …freq = compute_finetune(devc->voc[voice].orig_freq, devc->voc[voice].bender, devc->voc[voice].bend… in opl3_start_note()
656 devc->voc[voice].current_freq = freq; in opl3_start_note()
670 devc->voc[voice].keyon_byte = data; in opl3_start_note()
730 if (devc->model != 2) in opl3_command()
738 if (devc->model != 2) in opl3_command()
750 devc->lv_map[i] = i; in opl3_reset()
752 for (i = 0; i < devc->nr_voice; i++) in opl3_reset()
754 opl3_command(pv_map[devc->lv_map[i]].ioaddr, in opl3_reset()
755 KSL_LEVEL + pv_map[devc->lv_map[i]].op[0], 0xff); in opl3_reset()
757 opl3_command(pv_map[devc->lv_map[i]].ioaddr, in opl3_reset()
758 KSL_LEVEL + pv_map[devc->lv_map[i]].op[1], 0xff); in opl3_reset()
760 if (pv_map[devc->lv_map[i]].voice_mode == 4) in opl3_reset()
762 opl3_command(pv_map[devc->lv_map[i]].ioaddr, in opl3_reset()
763 KSL_LEVEL + pv_map[devc->lv_map[i]].op[2], 0xff); in opl3_reset()
765 opl3_command(pv_map[devc->lv_map[i]].ioaddr, in opl3_reset()
766 KSL_LEVEL + pv_map[devc->lv_map[i]].op[3], 0xff); in opl3_reset()
772 if (devc->model == 2) in opl3_reset()
774 devc->v_alloc->max_voice = devc->nr_voice = 18; in opl3_reset()
786 if (devc->busy) in opl3_open()
788 devc->busy = 1; in opl3_open()
790 devc->v_alloc->max_voice = devc->nr_voice = (devc->model == 2) ? 18 : 9; in opl3_open()
791 devc->v_alloc->timestamp = 0; in opl3_open()
795 devc->v_alloc->map[i] = 0; in opl3_open()
796 devc->v_alloc->alloc_times[i] = 0; in opl3_open()
799 devc->cmask = 0x00; /* in opl3_open()
802 if (devc->model == 2) in opl3_open()
803 opl3_command(devc->right_io, CONNECTION_SELECT_REGISTER, devc->cmask); in opl3_open()
809 devc->busy = 0; in opl3_close()
810 devc->v_alloc->max_voice = devc->nr_voice = (devc->model == 2) ? 18 : 9; in opl3_close()
812 devc->fm_info.nr_drums = 0; in opl3_close()
813 devc->fm_info.perc_mode = 0; in opl3_close()
849 if (voice < 0 || voice >= devc->nr_voice) in opl3_panning()
852 devc->voc[voice].panning = value; in opl3_panning()
871 if (voice < 0 || voice >= devc->nr_voice) in opl3_aftertouch()
874 map = &pv_map[devc->lv_map[voice]]; in opl3_aftertouch()
885 instr = devc->act_i[voice]; in opl3_aftertouch()
888 instr = &devc->i_map[0]; in opl3_aftertouch()
890 if (devc->voc[voice].mode == 4) in opl3_aftertouch()
940 map = &pv_map[devc->lv_map[voice]]; in bend_pitch()
945 devc->voc[voice].bender = value; in bend_pitch()
948 if (!(devc->voc[voice].keyon_byte & 0x20)) in bend_pitch()
953 …freq = compute_finetune(devc->voc[voice].orig_freq, devc->voc[voice].bender, devc->voc[voice].bend… in bend_pitch()
954 devc->voc[voice].current_freq = freq; in bend_pitch()
964 devc->voc[voice].keyon_byte = data; in bend_pitch()
970 if (voice < 0 || voice >= devc->nr_voice) in opl3_controller()
980 devc->voc[voice].bender_range = value; in opl3_controller()
984 devc->voc[voice].volume = value / 128; in opl3_controller()
988 devc->voc[voice].panning = (value * 2) - 128; in opl3_controller()
995 if (voice < 0 || voice >= devc->nr_voice) in opl3_bender()
1011 instr_no = devc->chn_info[chn].pgm_num; in opl3_alloc_voice()
1013 instr = &devc->i_map[instr_no]; in opl3_alloc_voice()
1015 devc->nr_voice != 12) /* Not in 4 OP mode */ in opl3_alloc_voice()
1017 else if (devc->nr_voice == 12) /* 4 OP mode */ in opl3_alloc_voice()
1029 if (devc->nr_voice == 12) /* 4 OP mode. Use the '2 OP only' operators first */ in opl3_alloc_voice()
1033 avail = devc->nr_voice; in opl3_alloc_voice()
1061 if (best > devc->nr_voice) in opl3_alloc_voice()
1062 best -= devc->nr_voice; in opl3_alloc_voice()
1071 if (voice < 0 || voice >= devc->nr_voice) in opl3_setup_voice()
1081 devc->voc[voice].bender = 0; in opl3_setup_voice()
1082 devc->voc[voice].bender_range = info->bender_range; in opl3_setup_voice()
1083 devc->voc[voice].volume = info->controllers[CTL_MAIN_VOLUME]; in opl3_setup_voice()
1084 devc->voc[voice].panning = (info->controllers[CTL_PAN] * 2) - 128; in opl3_setup_voice()
1118 if (devc == NULL) in opl3_init()
1130 devc->nr_voice = 9; in opl3_init()
1132 devc->fm_info.device = 0; in opl3_init()
1133 devc->fm_info.synth_type = SYNTH_TYPE_FM; in opl3_init()
1134 devc->fm_info.synth_subtype = FM_TYPE_ADLIB; in opl3_init()
1135 devc->fm_info.perc_mode = 0; in opl3_init()
1136 devc->fm_info.nr_voices = 9; in opl3_init()
1137 devc->fm_info.nr_drums = 0; in opl3_init()
1138 devc->fm_info.instr_bank_size = SBFM_MAXINSTR; in opl3_init()
1139 devc->fm_info.capabilities = 0; in opl3_init()
1140 devc->left_io = ioaddr; in opl3_init()
1141 devc->right_io = ioaddr + 2; in opl3_init()
1144 devc->model = 1; in opl3_init()
1147 devc->model = 2; in opl3_init()
1149 devc->is_opl4 = 1; in opl3_init()
1152 opl3_operations.info = &devc->fm_info; in opl3_init()
1160 devc->v_alloc = &opl3_operations.alloc; in opl3_init()
1161 devc->chn_info = &opl3_operations.chn_info[0]; in opl3_init()
1163 if (devc->model == 2) in opl3_init()
1165 if (devc->is_opl4) in opl3_init()
1166 strcpy(devc->fm_info.name, "Yamaha OPL4/OPL3 FM"); in opl3_init()
1168 strcpy(devc->fm_info.name, "Yamaha OPL3"); in opl3_init()
1170 devc->v_alloc->max_voice = devc->nr_voice = 18; in opl3_init()
1171 devc->fm_info.nr_drums = 0; in opl3_init()
1172 devc->fm_info.synth_subtype = FM_TYPE_OPL3; in opl3_init()
1173 devc->fm_info.capabilities |= SYNTH_CAP_OPL3; in opl3_init()
1178 pv_map[i].ioaddr = devc->left_io; in opl3_init()
1180 pv_map[i].ioaddr = devc->right_io; in opl3_init()
1182 opl3_command(devc->right_io, OPL3_MODE_REGISTER, OPL3_ENABLE); in opl3_init()
1183 opl3_command(devc->right_io, CONNECTION_SELECT_REGISTER, 0x00); in opl3_init()
1187 strcpy(devc->fm_info.name, "Yamaha OPL2"); in opl3_init()
1188 devc->v_alloc->max_voice = devc->nr_voice = 9; in opl3_init()
1189 devc->fm_info.nr_drums = 0; in opl3_init()
1192 pv_map[i].ioaddr = devc->left_io; in opl3_init()
1194 conf_printf2(devc->fm_info.name, ioaddr, 0, -1, -1); in opl3_init()
1197 devc->i_map[i].channel = -1; in opl3_init()
1227 if (devc && io != -1) in cleanup_opl3()
1229 if (devc->base) { in cleanup_opl3()
1230 release_region(devc->base,4); in cleanup_opl3()
1231 if (devc->is_opl4) in cleanup_opl3()
1232 release_region(devc->base - 8, 2); in cleanup_opl3()
1234 kfree(devc); in cleanup_opl3()
1235 devc = NULL; in cleanup_opl3()