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
;
16 bool cc_data_msb_set
, cc_data_lsb_set
;
19 /* context for converting from MIDI1 byte stream to UMP packet */
20 struct ump_cvt_to_ump
{
21 /* MIDI1 intermediate buffer */
26 /* UMP output packet */
31 unsigned int in_sysex
;
32 struct ump_cvt_to_ump_bank bank
[16]; /* per channel */
35 int snd_ump_convert_from_ump(const u32
*data
, unsigned char *dst
,
36 unsigned char *group_ret
);
37 void snd_ump_convert_to_ump(struct ump_cvt_to_ump
*cvt
, unsigned char group
,
38 unsigned int protocol
, unsigned char c
);
40 /* reset the converter context, called at each open to ump */
41 static inline void snd_ump_convert_reset(struct ump_cvt_to_ump
*ctx
)
43 memset(ctx
, 0, sizeof(*ctx
));
47 #endif /* __SOUND_UMP_CONVERT_H */