Skip to content

Commit 4bdcb8d

Browse files
takaswietiwai
authored andcommittedJan 13, 2023
ALSA: fireface: pick up time stamp for request subaction of asynchronous transaction
The time stamp of isochronous cycle at which asynchronous transaction is sent is perhaps useful somehow. A commit b2405aa ("firewire: add kernel API to access packet structure in request structure for AR context") adds kernel API to retrieve the time stamp in inner structure of request subaction. This commit changes local framework to handle message delivered by the asynchronous transaction so that time stamp is picked up by the kernel API. Signed-off-by: Takashi Sakamoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 50c597c commit 4bdcb8d

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed
 

‎sound/firewire/fireface/ff-protocol-former.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ static void ff800_finish_session(struct snd_ff *ff)
403403
// A write transaction to clear registered higher 4 bytes of destination address
404404
// has an effect to suppress asynchronous transaction from device.
405405
static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
406-
size_t length)
406+
size_t length, u32 tstamp)
407407
{
408408
int i;
409409

@@ -554,7 +554,7 @@ static void ff400_finish_session(struct snd_ff *ff)
554554
// in its lower offset and expects userspace application to configure the
555555
// register for it.
556556
static void ff400_handle_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
557-
size_t length)
557+
size_t length, u32 tstamp)
558558
{
559559
int i;
560560

‎sound/firewire/fireface/ff-protocol-latter.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ static void latter_dump_status(struct snd_ff *ff, struct snd_info_buffer *buffer
394394
// (0x'....'....'0000'0000) and expects userspace application to configure the
395395
// register for it.
396396
static void latter_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
397-
size_t length)
397+
size_t length, u32 tstamp)
398398
{
399399
u32 data = le32_to_cpu(*buf);
400400
unsigned int index = (data & 0x000000f0) >> 4;

‎sound/firewire/fireface/ff-transaction.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,12 @@ static void handle_msg(struct fw_card *card, struct fw_request *request, int tco
131131
{
132132
struct snd_ff *ff = callback_data;
133133
__le32 *buf = data;
134+
u32 tstamp = fw_request_get_timestamp(request);
134135

135136
fw_send_response(card, request, RCODE_COMPLETE);
136137

137138
offset -= ff->async_handler.offset;
138-
ff->spec->protocol->handle_msg(ff, (unsigned int)offset, buf, length);
139+
ff->spec->protocol->handle_msg(ff, (unsigned int)offset, buf, length, tstamp);
139140
}
140141

141142
static int allocate_own_address(struct snd_ff *ff, int i)

‎sound/firewire/fireface/ff.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ enum snd_ff_clock_src {
111111

112112
struct snd_ff_protocol {
113113
void (*handle_msg)(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
114-
size_t length);
114+
size_t length, u32 tstamp);
115115
int (*fill_midi_msg)(struct snd_ff *ff,
116116
struct snd_rawmidi_substream *substream,
117117
unsigned int port);

0 commit comments

Comments
 (0)