]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: fireface: share register for async transaction of MIDI messages
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 11 Dec 2018 10:17:32 +0000 (19:17 +0900)
committerTakashi Iwai <tiwai@suse.de>
Tue, 11 Dec 2018 13:56:58 +0000 (14:56 +0100)
As long as investigating packet dumps from Fireface 400/800, a register
to receive asynchronous transactions for MIDI messages is the same. For
Fireface 800, minor register is used.

This commit declares macros for the transactions and obsoletes
model-specific parameters.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/fireface/ff-protocol-ff400.c
sound/firewire/fireface/ff-transaction.c
sound/firewire/fireface/ff.h

index d2fbb0382223e291518d7172f37b92f2a0bb1b85..5cbaff9d6a406eec4ac8235da20c06cffd7ba1f5 100644 (file)
@@ -16,8 +16,6 @@
 #define FF400_ISOC_COMM_STOP   0x000080100510ull
 
 #define FF400_MIDI_HIGH_ADDR   0x0000801003f4ull
-#define FF400_MIDI_RX_PORT_0   0x000080180000ull
-#define FF400_MIDI_RX_PORT_1   0x000080190000ull
 
 static int ff400_begin_session(struct snd_ff *ff, unsigned int rate)
 {
@@ -115,6 +113,4 @@ const struct snd_ff_protocol snd_ff_protocol_ff400 = {
        .switch_fetching_mode   = ff400_switch_fetching_mode,
 
        .midi_high_addr_reg     = FF400_MIDI_HIGH_ADDR,
-       .midi_rx_port_0_reg     = FF400_MIDI_RX_PORT_0,
-       .midi_rx_port_1_reg     = FF400_MIDI_RX_PORT_1,
 };
index 751662b62389d129a3b83bcf2bc2f1933262d5db..fa0bc956696fee9cb0bcc0d541dfc2b4757918af 100644 (file)
@@ -8,6 +8,9 @@
 
 #include "ff.h"
 
+#define SND_FF_REG_MIDI_RX_PORT_0      0x000080180000ull
+#define SND_FF_REG_MIDI_RX_PORT_1      0x000080190000ull
+
 int snd_ff_transaction_get_clock(struct snd_ff *ff, unsigned int *rate,
                                 enum snd_ff_clock_src *src)
 {
@@ -153,10 +156,10 @@ static void transmit_midi_msg(struct snd_ff *ff, unsigned int port)
                fill_midi_buf(ff, port, i, buf[i]);
 
        if (port == 0) {
-               addr = ff->spec->protocol->midi_rx_port_0_reg;
+               addr = SND_FF_REG_MIDI_RX_PORT_0;
                callback = finish_transmit_midi0_msg;
        } else {
-               addr = ff->spec->protocol->midi_rx_port_1_reg;
+               addr = SND_FF_REG_MIDI_RX_PORT_1;
                callback = finish_transmit_midi1_msg;
        }
 
index 95cf90b4b5335699cb96177c9db389f5efa1acca..ea905285beabbe1fc954ca60d2cb9ca05ebc47b2 100644 (file)
@@ -107,8 +107,6 @@ struct snd_ff_protocol {
        int (*switch_fetching_mode)(struct snd_ff *ff, bool enable);
 
        u64 midi_high_addr_reg;
-       u64 midi_rx_port_0_reg;
-       u64 midi_rx_port_1_reg;
 };
 
 extern const struct snd_ff_protocol snd_ff_protocol_ff400;