ALSA: oxfw: Add hwdep interface
This interface is designed for mixer/control application. By using this interface, an application can get information about firewire node, can lock/unlock kernel streaming and can get notification at starting/stopping kernel streaming. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:

committed by
Takashi Iwai

parent
05588d340a
commit
8985f4ac1c
@@ -13,6 +13,10 @@ static int midi_capture_open(struct snd_rawmidi_substream *substream)
|
||||
struct snd_oxfw *oxfw = substream->rmidi->private_data;
|
||||
int err;
|
||||
|
||||
err = snd_oxfw_stream_lock_try(oxfw);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
mutex_lock(&oxfw->mutex);
|
||||
|
||||
oxfw->capture_substreams++;
|
||||
@@ -20,6 +24,9 @@ static int midi_capture_open(struct snd_rawmidi_substream *substream)
|
||||
|
||||
mutex_unlock(&oxfw->mutex);
|
||||
|
||||
if (err < 0)
|
||||
snd_oxfw_stream_lock_release(oxfw);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -28,6 +35,10 @@ static int midi_playback_open(struct snd_rawmidi_substream *substream)
|
||||
struct snd_oxfw *oxfw = substream->rmidi->private_data;
|
||||
int err;
|
||||
|
||||
err = snd_oxfw_stream_lock_try(oxfw);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
mutex_lock(&oxfw->mutex);
|
||||
|
||||
oxfw->playback_substreams++;
|
||||
@@ -35,6 +46,9 @@ static int midi_playback_open(struct snd_rawmidi_substream *substream)
|
||||
|
||||
mutex_unlock(&oxfw->mutex);
|
||||
|
||||
if (err < 0)
|
||||
snd_oxfw_stream_lock_release(oxfw);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -49,6 +63,7 @@ static int midi_capture_close(struct snd_rawmidi_substream *substream)
|
||||
|
||||
mutex_unlock(&oxfw->mutex);
|
||||
|
||||
snd_oxfw_stream_lock_release(oxfw);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -63,6 +78,7 @@ static int midi_playback_close(struct snd_rawmidi_substream *substream)
|
||||
|
||||
mutex_unlock(&oxfw->mutex);
|
||||
|
||||
snd_oxfw_stream_lock_release(oxfw);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user