Merge tag 'uml-for-linus-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / include / sound / ump_convert.h
blobd099ae27f8491afbbcc65dea5f22149d448b7a92
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 {
9 bool rpn_set;
10 bool nrpn_set;
11 bool bank_set;
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 */
22 unsigned char buf[4];
23 int len;
24 int cmd_bytes;
26 /* UMP output packet */
27 u32 ump[4];
28 int ump_bytes;
30 /* various status */
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 */