1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  *
4  * Copyright (c) 2003 by Karsten Wiese <annabellesgarden@yahoo.de>
5  */
6 
7 enum E_In84{
8 	eFader0 = 0,
9 	eFader1,
10 	eFader2,
11 	eFader3,
12 	eFader4,
13 	eFader5,
14 	eFader6,
15 	eFader7,
16 	eFaderM,
17 	eTransport,
18 	eModifier = 10,
19 	eFilterSelect,
20 	eSelect,
21 	eMute,
22 
23 	eSwitch   = 15,
24 	eWheelGain,
25 	eWheelFreq,
26 	eWheelQ,
27 	eWheelPan,
28 	eWheel    = 20
29 };
30 
31 #define T_RECORD   1
32 #define T_PLAY     2
33 #define T_STOP     4
34 #define T_F_FWD    8
35 #define T_REW   0x10
36 #define T_SOLO  0x20
37 #define T_REC   0x40
38 #define T_NULL  0x80
39 
40 
41 struct us428_ctls {
42 	unsigned char   Fader[9];
43 	unsigned char 	Transport;
44 	unsigned char 	Modifier;
45 	unsigned char 	FilterSelect;
46 	unsigned char 	Select;
47 	unsigned char   Mute;
48 	unsigned char   UNKNOWN;
49 	unsigned char   Switch;
50 	unsigned char   Wheel[5];
51 };
52 
53 struct us428_setByte {
54 	unsigned char Offset,
55 		Value;
56 };
57 
58 enum {
59 	eLT_Volume = 0,
60 	eLT_Light
61 };
62 
63 struct usX2Y_volume {
64 	unsigned char Channel,
65 		LH,
66 		LL,
67 		RH,
68 		RL;
69 };
70 
71 struct us428_lights {
72 	struct us428_setByte Light[7];
73 };
74 
75 struct us428_p4out {
76 	char type;
77 	union {
78 		struct usX2Y_volume vol;
79 		struct us428_lights lights;
80 	} val;
81 };
82 
83 #define N_us428_ctl_BUFS 16
84 #define N_us428_p4out_BUFS 16
85 struct us428ctls_sharedmem{
86 	struct us428_ctls	CtlSnapShot[N_us428_ctl_BUFS];
87 	int			CtlSnapShotDiffersAt[N_us428_ctl_BUFS];
88 	int			CtlSnapShotLast, CtlSnapShotRed;
89 	struct us428_p4out	p4out[N_us428_p4out_BUFS];
90 	int			p4outLast, p4outSent;
91 };
92