hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/sound/firewire/tascam/tascam.h
....@@ -1,9 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * tascam.h - a part of driver for TASCAM FireWire series
34 *
45 * Copyright (c) 2015 Takashi Sakamoto
5
- *
6
- * Licensed under the terms of the GNU General Public License, version 2.
76 */
87
98 #ifndef SOUND_TASCAM_H_INCLUDED
....@@ -62,6 +61,8 @@
6261 int consume_bytes;
6362 };
6463
64
+#define SND_TSCM_QUEUE_COUNT 16
65
+
6566 struct snd_tscm {
6667 struct snd_card *card;
6768 struct fw_unit *unit;
....@@ -89,6 +90,15 @@
8990
9091 /* For MIDI message outgoing transactions. */
9192 struct snd_fw_async_midi_port out_ports[TSCM_MIDI_OUT_PORT_MAX];
93
+
94
+ // A cache of status information in tx isoc packets.
95
+ __be32 state[SNDRV_FIREWIRE_TASCAM_STATE_COUNT];
96
+ struct snd_hwdep *hwdep;
97
+ struct snd_firewire_tascam_change queue[SND_TSCM_QUEUE_COUNT];
98
+ unsigned int pull_pos;
99
+ unsigned int push_pos;
100
+
101
+ struct amdtp_domain domain;
92102 };
93103
94104 #define TSCM_ADDR_BASE 0xffff00000000ull
....@@ -119,6 +129,26 @@
119129
120130 #define TSCM_OFFSET_MIDI_RX_QUAD 0x4000
121131
132
+// Although FE-8 supports the above registers, it has no I/O interfaces for
133
+// audio samples and music messages. Otherwise it supports another notification
134
+// for status and control message as well as LED brightening. The message
135
+// consists of quadlet-aligned data up to 32 quadlets. The first byte of message
136
+// is fixed to 0x40. The second byte is between 0x00 to 0x1f and represent each
137
+// control:
138
+// fader: 0x00-0x07
139
+// button: 0x0d, 0x0e
140
+// knob: 0x14-0x1b
141
+// sensing: 0x0b
142
+//
143
+// The rest two bytes represent state of the controls; e.g. current value for
144
+// fader and knob, bitmasks for button and sensing.
145
+// Just after turning on, 32 quadlets messages with 0x00-0x1f are immediately
146
+// sent in one transaction. After, several quadlets are sent in one transaction.
147
+//
148
+// TSCM_OFFSET_FE8_CTL_TX_ON 0x0310
149
+// TSCM_OFFSET_FE8_CTL_TX_ADDR_HI 0x0314
150
+// TSCM_OFFSET_FE8_CTL_TX_ADDR_LO 0x0318
151
+
122152 enum snd_tscm_clock {
123153 SND_TSCM_CLOCK_INTERNAL = 0,
124154 SND_TSCM_CLOCK_WORD = 1,
....@@ -138,6 +168,9 @@
138168 int snd_tscm_stream_init_duplex(struct snd_tscm *tscm);
139169 void snd_tscm_stream_update_duplex(struct snd_tscm *tscm);
140170 void snd_tscm_stream_destroy_duplex(struct snd_tscm *tscm);
171
+int snd_tscm_stream_reserve_duplex(struct snd_tscm *tscm, unsigned int rate,
172
+ unsigned int frames_per_period,
173
+ unsigned int frames_per_buffer);
141174 int snd_tscm_stream_start_duplex(struct snd_tscm *tscm, unsigned int rate);
142175 void snd_tscm_stream_stop_duplex(struct snd_tscm *tscm);
143176