Commit 50c597c7 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai
Browse files

ALSA: fireface: rename callback functions



It's cleared that Fireface 400 transmits quadlet message for two purposes
at least; received MIDI messages and notification of knob control
operation. Nevertheless current implementation uses callback function name
just for MIDI messages.

This commit renames the callback functions.

Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20230112120954.500692-2-o-takashi@sakamocchi.jp


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent af13842c
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -402,8 +402,8 @@ static void ff800_finish_session(struct snd_ff *ff)
// address.
// address.
// A write transaction to clear registered higher 4 bytes of destination address
// A write transaction to clear registered higher 4 bytes of destination address
// has an effect to suppress asynchronous transaction from device.
// has an effect to suppress asynchronous transaction from device.
static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset,
static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
				  __le32 *buf, size_t length)
				  size_t length)
{
{
	int i;
	int i;


@@ -418,7 +418,7 @@ static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset,
}
}


const struct snd_ff_protocol snd_ff_protocol_ff800 = {
const struct snd_ff_protocol snd_ff_protocol_ff800 = {
	.handle_midi_msg	= ff800_handle_midi_msg,
	.handle_msg		= ff800_handle_midi_msg,
	.fill_midi_msg		= former_fill_midi_msg,
	.fill_midi_msg		= former_fill_midi_msg,
	.get_clock		= former_get_clock,
	.get_clock		= former_get_clock,
	.switch_fetching_mode	= former_switch_fetching_mode,
	.switch_fetching_mode	= former_switch_fetching_mode,
@@ -553,8 +553,8 @@ static void ff400_finish_session(struct snd_ff *ff)
// input attenuation. This driver allocates destination address with '0000'0000
// input attenuation. This driver allocates destination address with '0000'0000
// in its lower offset and expects userspace application to configure the
// in its lower offset and expects userspace application to configure the
// register for it.
// register for it.
static void ff400_handle_midi_msg(struct snd_ff *ff, unsigned int offset,
static void ff400_handle_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
				  __le32 *buf, size_t length)
			     size_t length)
{
{
	int i;
	int i;


@@ -592,7 +592,7 @@ static void ff400_handle_midi_msg(struct snd_ff *ff, unsigned int offset,
}
}


const struct snd_ff_protocol snd_ff_protocol_ff400 = {
const struct snd_ff_protocol snd_ff_protocol_ff400 = {
	.handle_midi_msg	= ff400_handle_midi_msg,
	.handle_msg		= ff400_handle_msg,
	.fill_midi_msg		= former_fill_midi_msg,
	.fill_midi_msg		= former_fill_midi_msg,
	.get_clock		= former_get_clock,
	.get_clock		= former_get_clock,
	.switch_fetching_mode	= former_switch_fetching_mode,
	.switch_fetching_mode	= former_switch_fetching_mode,
+3 −3
Original line number Original line Diff line number Diff line
@@ -393,8 +393,8 @@ static void latter_dump_status(struct snd_ff *ff, struct snd_info_buffer *buffer
// input attenuation. This driver allocates for the first option
// input attenuation. This driver allocates for the first option
// (0x'....'....'0000'0000) and expects userspace application to configure the
// (0x'....'....'0000'0000) and expects userspace application to configure the
// register for it.
// register for it.
static void latter_handle_midi_msg(struct snd_ff *ff, unsigned int offset,
static void latter_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf,
				   __le32 *buf, size_t length)
				   size_t length)
{
{
	u32 data = le32_to_cpu(*buf);
	u32 data = le32_to_cpu(*buf);
	unsigned int index = (data & 0x000000f0) >> 4;
	unsigned int index = (data & 0x000000f0) >> 4;
@@ -529,7 +529,7 @@ static int latter_fill_midi_msg(struct snd_ff *ff,
}
}


const struct snd_ff_protocol snd_ff_protocol_latter = {
const struct snd_ff_protocol snd_ff_protocol_latter = {
	.handle_midi_msg	= latter_handle_midi_msg,
	.handle_msg		= latter_handle_midi_msg,
	.fill_midi_msg		= latter_fill_midi_msg,
	.fill_midi_msg		= latter_fill_midi_msg,
	.get_clock		= latter_get_clock,
	.get_clock		= latter_get_clock,
	.switch_fetching_mode	= latter_switch_fetching_mode,
	.switch_fetching_mode	= latter_switch_fetching_mode,
+5 −7
Original line number Original line Diff line number Diff line
@@ -125,9 +125,8 @@ static void transmit_midi1_msg(struct work_struct *work)
	transmit_midi_msg(ff, 1);
	transmit_midi_msg(ff, 1);
}
}


static void handle_midi_msg(struct fw_card *card, struct fw_request *request,
static void handle_msg(struct fw_card *card, struct fw_request *request, int tcode,
			    int tcode, int destination, int source,
		       int destination, int source, int generation, unsigned long long offset,
			    int generation, unsigned long long offset,
		       void *data, size_t length, void *callback_data)
		       void *data, size_t length, void *callback_data)
{
{
	struct snd_ff *ff = callback_data;
	struct snd_ff *ff = callback_data;
@@ -136,8 +135,7 @@ static void handle_midi_msg(struct fw_card *card, struct fw_request *request,
	fw_send_response(card, request, RCODE_COMPLETE);
	fw_send_response(card, request, RCODE_COMPLETE);


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


static int allocate_own_address(struct snd_ff *ff, int i)
static int allocate_own_address(struct snd_ff *ff, int i)
@@ -146,7 +144,7 @@ static int allocate_own_address(struct snd_ff *ff, int i)
	int err;
	int err;


	ff->async_handler.length = ff->spec->midi_addr_range;
	ff->async_handler.length = ff->spec->midi_addr_range;
	ff->async_handler.address_callback = handle_midi_msg;
	ff->async_handler.address_callback = handle_msg;
	ff->async_handler.callback_data = ff;
	ff->async_handler.callback_data = ff;


	midi_msg_region.start = 0x000100000000ull * i;
	midi_msg_region.start = 0x000100000000ull * i;
+2 −2
Original line number Original line Diff line number Diff line
@@ -110,8 +110,8 @@ enum snd_ff_clock_src {
};
};


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