Skip to content

Commit 4dce2f0

Browse files
committed
ALSA: ump: Export snd_ump_receive_ump_val()
This is another preliminary patch for USB MIDI 2.0 gadget driver. Export the currently local snd_ump_receive_ump_val(). It can be used by the gadget driver for processing the UMP data. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent eacd9c7 commit 4dce2f0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

include/sound/ump.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ static inline int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump,
109109
}
110110
#endif
111111

112+
int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val);
112113
int snd_ump_switch_protocol(struct snd_ump_endpoint *ump, unsigned int protocol);
113114

114115
/*

sound/core/ump.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,16 @@ static unsigned char ump_packet_words[0x10] = {
263263
1, 1, 1, 2, 2, 4, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4
264264
};
265265

266-
/* parse the UMP packet data;
267-
* the data is copied onto ump->input_buf[].
266+
/**
267+
* snd_ump_receive_ump_val - parse the UMP packet data
268+
* @ump: UMP endpoint
269+
* @val: UMP packet data
270+
*
271+
* The data is copied onto ump->input_buf[].
268272
* When a full packet is completed, returns the number of words (from 1 to 4).
269273
* OTOH, if the packet is incomplete, returns 0.
270274
*/
271-
static int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val)
275+
int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val)
272276
{
273277
int words;
274278

@@ -284,6 +288,7 @@ static int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val)
284288
}
285289
return 0;
286290
}
291+
EXPORT_SYMBOL_GPL(snd_ump_receive_ump_val);
287292

288293
/**
289294
* snd_ump_receive - transfer UMP packets from the device

0 commit comments

Comments
 (0)