Lines Matching refs:midi
326 } midi; member
3849 if (s->midi.icnt < MIDIINBUF) { in cs4281_handle_midi()
3850 s->midi.ibuf[s->midi.iwr] = ch; in cs4281_handle_midi()
3851 s->midi.iwr = (s->midi.iwr + 1) % MIDIINBUF; in cs4281_handle_midi()
3852 s->midi.icnt++; in cs4281_handle_midi()
3857 wake_up(&s->midi.iwait); in cs4281_handle_midi()
3859 while (!(readl(s->pBA0 + BA0_MIDSR) & 0x40) && s->midi.ocnt > 0) { in cs4281_handle_midi()
3860 temp1 = (s->midi.obuf[s->midi.ord]) & 0x000000ff; in cs4281_handle_midi()
3862 s->midi.ord = (s->midi.ord + 1) % MIDIOUTBUF; in cs4281_handle_midi()
3863 s->midi.ocnt--; in cs4281_handle_midi()
3864 if (s->midi.ocnt < MIDIOUTBUF - 16) in cs4281_handle_midi()
3868 wake_up(&s->midi.owait); in cs4281_handle_midi()
3916 s->midi.timer.expires = jiffies + 1; in cs4281_midi_timer()
3917 add_timer(&s->midi.timer); in cs4281_midi_timer()
3941 ptr = s->midi.ird; in cs4281_midi_read()
3943 if (s->midi.icnt < cnt) in cs4281_midi_read()
3944 cnt = s->midi.icnt; in cs4281_midi_read()
3951 interruptible_sleep_on(&s->midi.iwait); in cs4281_midi_read()
3956 if (copy_to_user(buffer, s->midi.ibuf + ptr, cnt)) in cs4281_midi_read()
3960 s->midi.ird = ptr; in cs4281_midi_read()
3961 s->midi.icnt -= cnt; in cs4281_midi_read()
3989 ptr = s->midi.owr; in cs4281_midi_write()
3991 if (s->midi.ocnt + cnt > MIDIOUTBUF) in cs4281_midi_write()
3992 cnt = MIDIOUTBUF - s->midi.ocnt; in cs4281_midi_write()
4001 interruptible_sleep_on(&s->midi.owait); in cs4281_midi_write()
4006 if (copy_from_user(s->midi.obuf + ptr, buffer, cnt)) in cs4281_midi_write()
4010 s->midi.owr = ptr; in cs4281_midi_write()
4011 s->midi.ocnt += cnt; in cs4281_midi_write()
4034 poll_wait(file, &s->midi.owait, wait); in cs4281_midi_poll()
4036 poll_wait(file, &s->midi.iwait, wait); in cs4281_midi_poll()
4039 if (s->midi.icnt > 0) in cs4281_midi_poll()
4043 if (s->midi.ocnt < MIDIOUTBUF) in cs4281_midi_poll()
4090 s->midi.ird = s->midi.iwr = s->midi.icnt = 0; in cs4281_midi_open()
4091 s->midi.ord = s->midi.owr = s->midi.ocnt = 0; in cs4281_midi_open()
4094 s->midi.ird = s->midi.iwr = s->midi.icnt = 0; in cs4281_midi_open()
4099 init_timer(&s->midi.timer); in cs4281_midi_open()
4100 s->midi.timer.expires = jiffies + 1; in cs4281_midi_open()
4101 s->midi.timer.data = (unsigned long) s; in cs4281_midi_open()
4102 s->midi.timer.function = cs4281_midi_timer; in cs4281_midi_open()
4103 add_timer(&s->midi.timer); in cs4281_midi_open()
4106 s->midi.ird = s->midi.iwr = s->midi.icnt = 0; in cs4281_midi_open()
4109 s->midi.ord = s->midi.owr = s->midi.ocnt = 0; in cs4281_midi_open()
4133 add_wait_queue(&s->midi.owait, &wait); in cs4281_midi_release()
4137 count = s->midi.ocnt; in cs4281_midi_release()
4144 remove_wait_queue(&s->midi.owait, &wait); in cs4281_midi_release()
4153 remove_wait_queue(&s->midi.owait, &wait); in cs4281_midi_release()
4163 del_timer(&s->midi.timer); in cs4281_midi_release()
4429 init_waitqueue_head(&s->midi.iwait); in cs4281_probe()
4430 init_waitqueue_head(&s->midi.owait); in cs4281_probe()