1 // SPDX-License-Identifier: GPL-2.0-or-later
2 #ifndef __SOUND_UMP_CONVERT_H
3 #define __SOUND_UMP_CONVERT_H
5 #include <sound/ump_msg.h>
7 /* context for converting from legacy control messages to UMP packet */
8 struct ump_cvt_to_ump_bank {
12 unsigned char cc_rpn_msb, cc_rpn_lsb;
13 unsigned char cc_nrpn_msb, cc_nrpn_lsb;
14 unsigned char cc_data_msb, cc_data_lsb;
15 unsigned char cc_bank_msb, cc_bank_lsb;
18 /* context for converting from MIDI1 byte stream to UMP packet */
19 struct ump_cvt_to_ump {
20 /* MIDI1 intermediate buffer */
25 /* UMP output packet */
30 unsigned int in_sysex;
31 struct ump_cvt_to_ump_bank bank[16]; /* per channel */
34 int snd_ump_convert_from_ump(const u32 *data, unsigned char *dst,
35 unsigned char *group_ret);
36 void snd_ump_convert_to_ump(struct ump_cvt_to_ump *cvt, unsigned char group,
37 unsigned int protocol, unsigned char c);
39 /* reset the converter context, called at each open to ump */
40 static inline void snd_ump_convert_reset(struct ump_cvt_to_ump *ctx)
42 memset(ctx, 0, sizeof(*ctx));
46 #endif /* __SOUND_UMP_CONVERT_H */