.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * tascam.h - a part of driver for TASCAM FireWire series |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (c) 2015 Takashi Sakamoto |
---|
5 | | - * |
---|
6 | | - * Licensed under the terms of the GNU General Public License, version 2. |
---|
7 | 6 | */ |
---|
8 | 7 | |
---|
9 | 8 | #ifndef SOUND_TASCAM_H_INCLUDED |
---|
.. | .. |
---|
62 | 61 | int consume_bytes; |
---|
63 | 62 | }; |
---|
64 | 63 | |
---|
| 64 | +#define SND_TSCM_QUEUE_COUNT 16 |
---|
| 65 | + |
---|
65 | 66 | struct snd_tscm { |
---|
66 | 67 | struct snd_card *card; |
---|
67 | 68 | struct fw_unit *unit; |
---|
.. | .. |
---|
89 | 90 | |
---|
90 | 91 | /* For MIDI message outgoing transactions. */ |
---|
91 | 92 | 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; |
---|
92 | 102 | }; |
---|
93 | 103 | |
---|
94 | 104 | #define TSCM_ADDR_BASE 0xffff00000000ull |
---|
.. | .. |
---|
119 | 129 | |
---|
120 | 130 | #define TSCM_OFFSET_MIDI_RX_QUAD 0x4000 |
---|
121 | 131 | |
---|
| 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 | + |
---|
122 | 152 | enum snd_tscm_clock { |
---|
123 | 153 | SND_TSCM_CLOCK_INTERNAL = 0, |
---|
124 | 154 | SND_TSCM_CLOCK_WORD = 1, |
---|
.. | .. |
---|
138 | 168 | int snd_tscm_stream_init_duplex(struct snd_tscm *tscm); |
---|
139 | 169 | void snd_tscm_stream_update_duplex(struct snd_tscm *tscm); |
---|
140 | 170 | 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); |
---|
141 | 174 | int snd_tscm_stream_start_duplex(struct snd_tscm *tscm, unsigned int rate); |
---|
142 | 175 | void snd_tscm_stream_stop_duplex(struct snd_tscm *tscm); |
---|
143 | 176 | |
---|