From 660dd3d52ead45b8e60dcf966daf304de2121a28 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Wed, 30 Sep 2015 09:39:21 +0900 Subject: ALSA: firewire-digi00x: add hwdep interface This commit adds hwdep interface so as the other sound drivers for units on IEEE 1394 bus have. This interface is designed for mixer/control applications. 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 Signed-off-by: Takashi Iwai --- sound/firewire/digi00x/digi00x.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sound/firewire/digi00x/digi00x.h') diff --git a/sound/firewire/digi00x/digi00x.h b/sound/firewire/digi00x/digi00x.h index 199064504a55..5ba531806262 100644 --- a/sound/firewire/digi00x/digi00x.h +++ b/sound/firewire/digi00x/digi00x.h @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include "../lib.h" #include "../iso-resources.h" @@ -32,6 +34,7 @@ struct snd_dg00x { struct fw_unit *unit; struct mutex mutex; + spinlock_t lock; struct amdtp_stream tx_stream; struct fw_iso_resources tx_resources; @@ -40,6 +43,12 @@ struct snd_dg00x { struct fw_iso_resources rx_resources; unsigned int substreams_counter; + + /* for uapi */ + int dev_lock_count; + bool dev_lock_changed; + wait_queue_head_t hwdep_wait; + }; #define DG00X_ADDR_BASE 0xffffe0000000ull @@ -118,8 +127,13 @@ void snd_dg00x_stream_stop_duplex(struct snd_dg00x *dg00x); void snd_dg00x_stream_update_duplex(struct snd_dg00x *dg00x); void snd_dg00x_stream_destroy_duplex(struct snd_dg00x *dg00x); +void snd_dg00x_stream_lock_changed(struct snd_dg00x *dg00x); +int snd_dg00x_stream_lock_try(struct snd_dg00x *dg00x); +void snd_dg00x_stream_lock_release(struct snd_dg00x *dg00x); + void snd_dg00x_proc_init(struct snd_dg00x *dg00x); int snd_dg00x_create_pcm_devices(struct snd_dg00x *dg00x); +int snd_dg00x_create_hwdep_device(struct snd_dg00x *dg00x); #endif -- cgit v1.2.3