Lines Matching refs:midi_dev
120 static int mpu_timer_init(int midi_dev);
768 int midi_dev; in mpu_synth_ioctl() local
771 midi_dev = synth_devs[dev]->midi_dev; in mpu_synth_ioctl()
773 if (midi_dev < 0 || midi_dev >= num_midis || midi_devs[midi_dev] == NULL) in mpu_synth_ioctl()
776 devc = &dev_conf[midi_dev]; in mpu_synth_ioctl()
782 if (copy_to_user(arg, &mpu_synth_info[midi_dev], in mpu_synth_ioctl()
797 int midi_dev, err; in mpu_synth_open() local
801 midi_dev = synth_devs[dev]->midi_dev; in mpu_synth_open()
803 if (midi_dev < 0 || midi_dev > num_midis || midi_devs[midi_dev] == NULL) in mpu_synth_open()
806 devc = &dev_conf[midi_dev]; in mpu_synth_open()
831 coprocessor = midi_devs[midi_dev]->coproc; in mpu_synth_open()
847 mpu_cmd(midi_dev, 0x8B, 0); /* Enable data in stop mode */ in mpu_synth_open()
848 mpu_cmd(midi_dev, 0x34, 0); /* Return timing bytes in stop mode */ in mpu_synth_open()
849 mpu_cmd(midi_dev, 0x87, 0); /* Enable pitch & controller */ in mpu_synth_open()
856 int midi_dev; in mpu_synth_close() local
860 midi_dev = synth_devs[dev]->midi_dev; in mpu_synth_close()
862 devc = &dev_conf[midi_dev]; in mpu_synth_close()
863 mpu_cmd(midi_dev, 0x15, 0); /* Stop recording, playback and MIDI */ in mpu_synth_close()
864 mpu_cmd(midi_dev, 0x8a, 0); /* Disable data in stopped mode */ in mpu_synth_close()
868 coprocessor = midi_devs[midi_dev]->coproc; in mpu_synth_close()
886 .midi_dev = 0,
1088 mpu401_synth_operations[m]->midi_dev = devc->devno = m; in attach_mpu401()
1251 static void set_timebase(int midi_dev, int val) in set_timebase() argument
1265 if (mpu_cmd(midi_dev, 0xC0 | (hw_val & 0x0f), 0) < 0) in set_timebase()
1286 static void set_timer_mode(int midi_dev) in set_timer_mode() argument
1289 mpu_cmd(midi_dev, 0x3c, 0); /* Use CLS sync */ in set_timer_mode()
1291 mpu_cmd(midi_dev, 0x3d, 0); /* Use SMPTE sync */ in set_timer_mode()
1295 mpu_cmd(midi_dev, 0x80, 0); /* Use MIDI sync */ in set_timer_mode()
1301 mpu_cmd(midi_dev, 0x82, 0); /* Use MIDI sync */ in set_timer_mode()
1302 mpu_cmd(midi_dev, 0x91, 0); /* Enable ext MIDI ctrl */ in set_timer_mode()
1305 mpu_cmd(midi_dev, 0x81, 0); /* Use FSK sync */ in set_timer_mode()
1309 static void stop_metronome(int midi_dev) in stop_metronome() argument
1311 mpu_cmd(midi_dev, 0x84, 0); /* Disable metronome */ in stop_metronome()
1314 static void setup_metronome(int midi_dev) in setup_metronome() argument
1327 mpu_cmd(midi_dev, 0x84, 0); /* Disable metronome */ in setup_metronome()
1330 mpu_cmd(midi_dev, 0xE4, clks_per_click); in setup_metronome()
1331 mpu_cmd(midi_dev, 0xE6, beats_per_measure); in setup_metronome()
1332 mpu_cmd(midi_dev, 0x83, 0); /* Enable metronome without accents */ in setup_metronome()
1336 static int mpu_start_timer(int midi_dev) in mpu_start_timer() argument
1338 struct mpu_config *devc= &dev_conf[midi_dev]; in mpu_start_timer()
1341 set_timer_mode(midi_dev); in mpu_start_timer()
1348 mpu_cmd(midi_dev, 0x02, 0); /* Send MIDI start */ in mpu_start_timer()
1354 mpu_cmd(midi_dev, 0x35, 0); /* Enable mode messages to PC */ in mpu_start_timer()
1355 mpu_cmd(midi_dev, 0x38, 0); /* Enable sys common messages to PC */ in mpu_start_timer()
1356 mpu_cmd(midi_dev, 0x39, 0); /* Enable real time messages to PC */ in mpu_start_timer()
1357 mpu_cmd(midi_dev, 0x97, 0); /* Enable system exclusive messages to PC */ in mpu_start_timer()
1364 int midi_dev = sound_timer_devs[dev]->devlink; in mpu_timer_open() local
1365 struct mpu_config *devc= &dev_conf[midi_dev]; in mpu_timer_open()
1372 mpu_cmd(midi_dev, 0xE0, 50); in mpu_timer_open()
1374 set_timebase(midi_dev, 120); in mpu_timer_open()
1377 set_timer_mode(midi_dev); in mpu_timer_open()
1379 mpu_cmd(midi_dev, 0xe7, 0x04); /* Send all clocks to host */ in mpu_timer_open()
1380 mpu_cmd(midi_dev, 0x95, 0); /* Enable clock to host */ in mpu_timer_open()
1387 int midi_dev = sound_timer_devs[dev]->devlink; in mpu_timer_close() local
1390 mpu_cmd(midi_dev, 0x15, 0); /* Stop all */ in mpu_timer_close()
1391 mpu_cmd(midi_dev, 0x94, 0); /* Disable clock to host */ in mpu_timer_close()
1392 mpu_cmd(midi_dev, 0x8c, 0); /* Disable measure end messages to host */ in mpu_timer_close()
1393 stop_metronome(midi_dev); in mpu_timer_close()
1400 int midi_dev = sound_timer_devs[dev]->devlink; in mpu_timer_event() local
1423 return mpu_start_timer(midi_dev); in mpu_timer_event()
1426 mpu_cmd(midi_dev, 0x01, 0); /* Send MIDI stop */ in mpu_timer_event()
1427 stop_metronome(midi_dev); in mpu_timer_event()
1434 mpu_cmd(midi_dev, 0x03, 0); /* Send MIDI continue */ in mpu_timer_event()
1435 setup_metronome(midi_dev); in mpu_timer_event()
1446 if (mpu_cmd(midi_dev, 0xE0, parm) < 0) in mpu_timer_event()
1460 setup_metronome(midi_dev); in mpu_timer_event()
1479 int midi_dev = sound_timer_devs[dev]->devlink; in mpu_timer_ioctl() local
1497 mpu_cmd(midi_dev, 0x3c, 0); /* Use CLS sync */ in mpu_timer_ioctl()
1499 mpu_cmd(midi_dev, 0x3d, 0); /* Use SMPTE sync */ in mpu_timer_ioctl()
1508 mpu_start_timer(midi_dev); in mpu_timer_ioctl()
1513 mpu_cmd(midi_dev, 0x01, 0); /* Send MIDI stop */ in mpu_timer_ioctl()
1514 stop_metronome(midi_dev); in mpu_timer_ioctl()
1521 mpu_cmd(midi_dev, 0x03, 0); /* Send MIDI continue */ in mpu_timer_ioctl()
1530 set_timebase(midi_dev, val); in mpu_timer_ioctl()
1551 if ((ret = mpu_cmd(midi_dev, 0xE0, val)) < 0) in mpu_timer_ioctl()
1587 setup_metronome(midi_dev); in mpu_timer_ioctl()
1639 int midi_dev = devc->devno; in timer_ext_event() local
1657 setup_metronome(midi_dev); in timer_ext_event()
1669 stop_metronome(midi_dev); in timer_ext_event()
1679 setup_metronome(midi_dev); in timer_ext_event()
1694 static int mpu_timer_init(int midi_dev) in mpu_timer_init() argument
1699 devc = &dev_conf[midi_dev]; in mpu_timer_init()
1706 mpu_timer.devlink = midi_dev; in mpu_timer_init()
1707 dev_conf[midi_dev].timer_flag = 1; in mpu_timer_init()