mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
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/20230621110241.4751-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
@@ -109,6 +109,7 @@ static inline int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val);
|
||||||
int snd_ump_switch_protocol(struct snd_ump_endpoint *ump, unsigned int protocol);
|
int snd_ump_switch_protocol(struct snd_ump_endpoint *ump, unsigned int protocol);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -263,12 +263,16 @@ static unsigned char ump_packet_words[0x10] = {
|
|||||||
1, 1, 1, 2, 2, 4, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4
|
1, 1, 1, 2, 2, 4, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/* parse the UMP packet data;
|
/**
|
||||||
* the data is copied onto ump->input_buf[].
|
* snd_ump_receive_ump_val - parse the UMP packet data
|
||||||
|
* @ump: UMP endpoint
|
||||||
|
* @val: UMP packet data
|
||||||
|
*
|
||||||
|
* The data is copied onto ump->input_buf[].
|
||||||
* When a full packet is completed, returns the number of words (from 1 to 4).
|
* When a full packet is completed, returns the number of words (from 1 to 4).
|
||||||
* OTOH, if the packet is incomplete, returns 0.
|
* OTOH, if the packet is incomplete, returns 0.
|
||||||
*/
|
*/
|
||||||
static int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val)
|
int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val)
|
||||||
{
|
{
|
||||||
int words;
|
int words;
|
||||||
|
|
||||||
@@ -284,6 +288,7 @@ static int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val)
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(snd_ump_receive_ump_val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* snd_ump_receive - transfer UMP packets from the device
|
* snd_ump_receive - transfer UMP packets from the device
|
||||||
|
Reference in New Issue
Block a user