Lines Matching refs:hmidi
1847 static int snd_hdspm_midi_output_write (struct hdspm_midi *hmidi) in snd_hdspm_midi_output_write() argument
1857 spin_lock_irqsave (&hmidi->lock, flags); in snd_hdspm_midi_output_write()
1858 if (hmidi->output && in snd_hdspm_midi_output_write()
1859 !snd_rawmidi_transmit_empty (hmidi->output)) { in snd_hdspm_midi_output_write()
1860 n_pending = snd_hdspm_midi_output_possible (hmidi->hdspm, in snd_hdspm_midi_output_write()
1861 hmidi->id); in snd_hdspm_midi_output_write()
1866 to_write = snd_rawmidi_transmit (hmidi->output, buf, in snd_hdspm_midi_output_write()
1870 snd_hdspm_midi_write_byte (hmidi->hdspm, in snd_hdspm_midi_output_write()
1871 hmidi->id, in snd_hdspm_midi_output_write()
1876 spin_unlock_irqrestore (&hmidi->lock, flags); in snd_hdspm_midi_output_write()
1880 static int snd_hdspm_midi_input_read (struct hdspm_midi *hmidi) in snd_hdspm_midi_input_read() argument
1889 spin_lock_irqsave (&hmidi->lock, flags); in snd_hdspm_midi_input_read()
1890 n_pending = snd_hdspm_midi_input_available (hmidi->hdspm, hmidi->id); in snd_hdspm_midi_input_read()
1892 if (hmidi->input) { in snd_hdspm_midi_input_read()
1896 buf[i] = snd_hdspm_midi_read_byte (hmidi->hdspm, in snd_hdspm_midi_input_read()
1897 hmidi->id); in snd_hdspm_midi_input_read()
1899 snd_rawmidi_receive (hmidi->input, buf, in snd_hdspm_midi_input_read()
1904 snd_hdspm_midi_read_byte (hmidi->hdspm, in snd_hdspm_midi_input_read()
1905 hmidi->id); in snd_hdspm_midi_input_read()
1908 hmidi->pending = 0; in snd_hdspm_midi_input_read()
1909 spin_unlock_irqrestore(&hmidi->lock, flags); in snd_hdspm_midi_input_read()
1911 spin_lock_irqsave(&hmidi->hdspm->lock, flags); in snd_hdspm_midi_input_read()
1912 hmidi->hdspm->control_register |= hmidi->ie; in snd_hdspm_midi_input_read()
1913 hdspm_write(hmidi->hdspm, HDSPM_controlRegister, in snd_hdspm_midi_input_read()
1914 hmidi->hdspm->control_register); in snd_hdspm_midi_input_read()
1915 spin_unlock_irqrestore(&hmidi->hdspm->lock, flags); in snd_hdspm_midi_input_read()
1917 return snd_hdspm_midi_output_write (hmidi); in snd_hdspm_midi_input_read()
1924 struct hdspm_midi *hmidi; in snd_hdspm_midi_input_trigger() local
1927 hmidi = substream->rmidi->private_data; in snd_hdspm_midi_input_trigger()
1928 hdspm = hmidi->hdspm; in snd_hdspm_midi_input_trigger()
1932 if (!(hdspm->control_register & hmidi->ie)) { in snd_hdspm_midi_input_trigger()
1933 snd_hdspm_flush_midi_input (hdspm, hmidi->id); in snd_hdspm_midi_input_trigger()
1934 hdspm->control_register |= hmidi->ie; in snd_hdspm_midi_input_trigger()
1937 hdspm->control_register &= ~hmidi->ie; in snd_hdspm_midi_input_trigger()
1946 struct hdspm_midi *hmidi = from_timer(hmidi, t, timer); in snd_hdspm_midi_output_timer() local
1949 snd_hdspm_midi_output_write(hmidi); in snd_hdspm_midi_output_timer()
1950 spin_lock_irqsave (&hmidi->lock, flags); in snd_hdspm_midi_output_timer()
1958 if (hmidi->istimer) in snd_hdspm_midi_output_timer()
1959 mod_timer(&hmidi->timer, 1 + jiffies); in snd_hdspm_midi_output_timer()
1961 spin_unlock_irqrestore (&hmidi->lock, flags); in snd_hdspm_midi_output_timer()
1967 struct hdspm_midi *hmidi; in snd_hdspm_midi_output_trigger() local
1970 hmidi = substream->rmidi->private_data; in snd_hdspm_midi_output_trigger()
1971 spin_lock_irqsave (&hmidi->lock, flags); in snd_hdspm_midi_output_trigger()
1973 if (!hmidi->istimer) { in snd_hdspm_midi_output_trigger()
1974 timer_setup(&hmidi->timer, in snd_hdspm_midi_output_trigger()
1976 mod_timer(&hmidi->timer, 1 + jiffies); in snd_hdspm_midi_output_trigger()
1977 hmidi->istimer++; in snd_hdspm_midi_output_trigger()
1980 if (hmidi->istimer && --hmidi->istimer <= 0) in snd_hdspm_midi_output_trigger()
1981 del_timer (&hmidi->timer); in snd_hdspm_midi_output_trigger()
1983 spin_unlock_irqrestore (&hmidi->lock, flags); in snd_hdspm_midi_output_trigger()
1985 snd_hdspm_midi_output_write(hmidi); in snd_hdspm_midi_output_trigger()
1990 struct hdspm_midi *hmidi; in snd_hdspm_midi_input_open() local
1992 hmidi = substream->rmidi->private_data; in snd_hdspm_midi_input_open()
1993 spin_lock_irq (&hmidi->lock); in snd_hdspm_midi_input_open()
1994 snd_hdspm_flush_midi_input (hmidi->hdspm, hmidi->id); in snd_hdspm_midi_input_open()
1995 hmidi->input = substream; in snd_hdspm_midi_input_open()
1996 spin_unlock_irq (&hmidi->lock); in snd_hdspm_midi_input_open()
2003 struct hdspm_midi *hmidi; in snd_hdspm_midi_output_open() local
2005 hmidi = substream->rmidi->private_data; in snd_hdspm_midi_output_open()
2006 spin_lock_irq (&hmidi->lock); in snd_hdspm_midi_output_open()
2007 hmidi->output = substream; in snd_hdspm_midi_output_open()
2008 spin_unlock_irq (&hmidi->lock); in snd_hdspm_midi_output_open()
2015 struct hdspm_midi *hmidi; in snd_hdspm_midi_input_close() local
2019 hmidi = substream->rmidi->private_data; in snd_hdspm_midi_input_close()
2020 spin_lock_irq (&hmidi->lock); in snd_hdspm_midi_input_close()
2021 hmidi->input = NULL; in snd_hdspm_midi_input_close()
2022 spin_unlock_irq (&hmidi->lock); in snd_hdspm_midi_input_close()
2029 struct hdspm_midi *hmidi; in snd_hdspm_midi_output_close() local
2033 hmidi = substream->rmidi->private_data; in snd_hdspm_midi_output_close()
2034 spin_lock_irq (&hmidi->lock); in snd_hdspm_midi_output_close()
2035 hmidi->output = NULL; in snd_hdspm_midi_output_close()
2036 spin_unlock_irq (&hmidi->lock); in snd_hdspm_midi_output_close()