ALSA: fireworks: Remove a constant over width to which it's applied
[cascardo/linux.git] / sound / firewire / fireworks / fireworks.h
index ce511be..4f0201a 100644 (file)
 #include <sound/core.h>
 #include <sound/initval.h>
 #include <sound/pcm.h>
+#include <sound/info.h>
+#include <sound/rawmidi.h>
+#include <sound/pcm_params.h>
+#include <sound/firewire.h>
+#include <sound/hwdep.h>
 
 #include "../packets-buffer.h"
 #include "../iso-resources.h"
@@ -44,6 +49,9 @@
  */
 #define SND_EFW_RESPONSE_MAXIMUM_BYTES 0x200U
 
+extern unsigned int snd_efw_resp_buf_size;
+extern bool snd_efw_resp_buf_debug;
+
 struct snd_efw_phys_grp {
        u8 type;        /* see enum snd_efw_grp_type */
        u8 count;
@@ -61,6 +69,10 @@ struct snd_efw {
        u32 seqnum;
        bool resp_addr_changable;
 
+       /* for quirks */
+       bool is_af9;
+       u32 firmware_version;
+
        unsigned int midi_in_ports;
        unsigned int midi_out_ports;
 
@@ -75,23 +87,37 @@ struct snd_efw {
        struct cmp_connection in_conn;
        atomic_t capture_substreams;
        atomic_t playback_substreams;
-};
 
-struct snd_efw_transaction {
-       __be32 length;
-       __be32 version;
-       __be32 seqnum;
-       __be32 category;
-       __be32 command;
-       __be32 status;
-       __be32 params[0];
+       /* hardware metering parameters */
+       unsigned int phys_out;
+       unsigned int phys_in;
+       unsigned int phys_out_grp_count;
+       unsigned int phys_in_grp_count;
+       struct snd_efw_phys_grp phys_out_grps[HWINFO_MAX_CAPS_GROUPS];
+       struct snd_efw_phys_grp phys_in_grps[HWINFO_MAX_CAPS_GROUPS];
+
+       /* for uapi */
+       int dev_lock_count;
+       bool dev_lock_changed;
+       wait_queue_head_t hwdep_wait;
+
+       /* response queue */
+       u8 *resp_buf;
+       u8 *pull_ptr;
+       u8 *push_ptr;
+       unsigned int resp_queues;
 };
+
+int snd_efw_transaction_cmd(struct fw_unit *unit,
+                           const void *cmd, unsigned int size);
 int snd_efw_transaction_run(struct fw_unit *unit,
                            const void *cmd, unsigned int cmd_size,
                            void *resp, unsigned int resp_size);
 int snd_efw_transaction_register(void);
 void snd_efw_transaction_unregister(void);
 void snd_efw_transaction_bus_reset(struct fw_unit *unit);
+void snd_efw_transaction_add_instance(struct snd_efw *efw);
+void snd_efw_transaction_remove_instance(struct snd_efw *efw);
 
 struct snd_efw_hwinfo {
        u32 flags;
@@ -136,7 +162,6 @@ enum snd_efw_grp_type {
        SND_EFW_CH_TYPE_GUITAR                  = 7,
        SND_EFW_CH_TYPE_PIEZO_GUITAR            = 8,
        SND_EFW_CH_TYPE_GUITAR_STRING           = 9,
-       SND_EFW_CH_TYPE_VIRTUAL                 = 0x10000,
        SND_EFW_CH_TYPE_DUMMY
 };
 struct snd_efw_phys_meters {
@@ -166,7 +191,8 @@ enum snd_efw_transport_mode {
 };
 int snd_efw_command_set_resp_addr(struct snd_efw *efw,
                                  u16 addr_high, u32 addr_low);
-int snd_efw_command_set_tx_mode(struct snd_efw *efw, unsigned int mode);
+int snd_efw_command_set_tx_mode(struct snd_efw *efw,
+                               enum snd_efw_transport_mode mode);
 int snd_efw_command_get_hwinfo(struct snd_efw *efw,
                               struct snd_efw_hwinfo *hwinfo);
 int snd_efw_command_get_phys_meters(struct snd_efw *efw,
@@ -178,10 +204,22 @@ int snd_efw_command_get_sampling_rate(struct snd_efw *efw, unsigned int *rate);
 int snd_efw_command_set_sampling_rate(struct snd_efw *efw, unsigned int rate);
 
 int snd_efw_stream_init_duplex(struct snd_efw *efw);
-int snd_efw_stream_start_duplex(struct snd_efw *efw, int sampling_rate);
+int snd_efw_stream_start_duplex(struct snd_efw *efw, unsigned int rate);
 void snd_efw_stream_stop_duplex(struct snd_efw *efw);
 void snd_efw_stream_update_duplex(struct snd_efw *efw);
 void snd_efw_stream_destroy_duplex(struct snd_efw *efw);
+void snd_efw_stream_lock_changed(struct snd_efw *efw);
+int snd_efw_stream_lock_try(struct snd_efw *efw);
+void snd_efw_stream_lock_release(struct snd_efw *efw);
+
+void snd_efw_proc_init(struct snd_efw *efw);
+
+int snd_efw_create_midi_devices(struct snd_efw *efw);
+
+int snd_efw_create_pcm_devices(struct snd_efw *efw);
+int snd_efw_get_multiplier_mode(unsigned int sampling_rate, unsigned int *mode);
+
+int snd_efw_create_hwdep_device(struct snd_efw *efw);
 
 #define SND_EFW_DEV_ENTRY(vendor, model) \
 { \