Skip to content

Commit

Permalink
ALSA: fireface: pick up time stamp for request subaction of asynchron…
Browse files Browse the repository at this point in the history
…ous 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]>
  • Loading branch information
takaswie authored and tiwai committed Jan 13, 2023
1 parent 50c597c commit 4bdcb8d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sound/firewire/fireface/ff-protocol-former.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ static void ff800_finish_session(struct snd_ff *ff)
// A write transaction to clear registered higher 4 bytes of destination address
// has an effect to suppress asynchronous transaction from device.
static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
size_t length)
size_t length, u32 tstamp)
{
int i;

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

Expand Down
2 changes: 1 addition & 1 deletion sound/firewire/fireface/ff-protocol-latter.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static void latter_dump_status(struct snd_ff *ff, struct snd_info_buffer *buffer
// (0x'....'....'0000'0000) and expects userspace application to configure the
// register for it.
static void latter_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
size_t length)
size_t length, u32 tstamp)
{
u32 data = le32_to_cpu(*buf);
unsigned int index = (data & 0x000000f0) >> 4;
Expand Down
3 changes: 2 additions & 1 deletion sound/firewire/fireface/ff-transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,12 @@ static void handle_msg(struct fw_card *card, struct fw_request *request, int tco
{
struct snd_ff *ff = callback_data;
__le32 *buf = data;
u32 tstamp = fw_request_get_timestamp(request);

fw_send_response(card, request, RCODE_COMPLETE);

offset -= ff->async_handler.offset;
ff->spec->protocol->handle_msg(ff, (unsigned int)offset, buf, length);
ff->spec->protocol->handle_msg(ff, (unsigned int)offset, buf, length, tstamp);
}

static int allocate_own_address(struct snd_ff *ff, int i)
Expand Down
2 changes: 1 addition & 1 deletion sound/firewire/fireface/ff.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ enum snd_ff_clock_src {

struct snd_ff_protocol {
void (*handle_msg)(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
size_t length);
size_t length, u32 tstamp);
int (*fill_midi_msg)(struct snd_ff *ff,
struct snd_rawmidi_substream *substream,
unsigned int port);
Expand Down

0 comments on commit 4bdcb8d

Please sign in to comment.