xref: /linux/sound/usb/6fire/control.h (revision 2475b0d407614ea5a41b8325d45c614d94087088)
1c6d43ba8STorsten Schenk /*
2c6d43ba8STorsten Schenk  * Linux driver for TerraTec DMX 6Fire USB
3c6d43ba8STorsten Schenk  *
4c6d43ba8STorsten Schenk  * Author:	Torsten Schenk <torsten.schenk@zoho.com>
5c6d43ba8STorsten Schenk  * Created:	Jan 01, 2011
6c6d43ba8STorsten Schenk  * Version:	0.3.0
7c6d43ba8STorsten Schenk  * Copyright:	(C) Torsten Schenk
8c6d43ba8STorsten Schenk  *
9c6d43ba8STorsten Schenk  * This program is free software; you can redistribute it and/or modify
10c6d43ba8STorsten Schenk  * it under the terms of the GNU General Public License as published by
11c6d43ba8STorsten Schenk  * the Free Software Foundation; either version 2 of the License, or
12c6d43ba8STorsten Schenk  * (at your option) any later version.
13c6d43ba8STorsten Schenk  */
14c6d43ba8STorsten Schenk 
15c6d43ba8STorsten Schenk #ifndef USB6FIRE_CONTROL_H
16c6d43ba8STorsten Schenk #define USB6FIRE_CONTROL_H
17c6d43ba8STorsten Schenk 
18c6d43ba8STorsten Schenk #include "common.h"
19c6d43ba8STorsten Schenk 
20c6d43ba8STorsten Schenk enum {
21c6d43ba8STorsten Schenk 	CONTROL_MAX_ELEMENTS = 32
22c6d43ba8STorsten Schenk };
23c6d43ba8STorsten Schenk 
24*2475b0d4STorsten Schenk enum {
25*2475b0d4STorsten Schenk 	CONTROL_RATE_44KHZ,
26*2475b0d4STorsten Schenk 	CONTROL_RATE_48KHZ,
27*2475b0d4STorsten Schenk 	CONTROL_RATE_88KHZ,
28*2475b0d4STorsten Schenk 	CONTROL_RATE_96KHZ,
29*2475b0d4STorsten Schenk 	CONTROL_RATE_176KHZ,
30*2475b0d4STorsten Schenk 	CONTROL_RATE_192KHZ,
31*2475b0d4STorsten Schenk 	CONTROL_N_RATES
32*2475b0d4STorsten Schenk };
33*2475b0d4STorsten Schenk 
34c6d43ba8STorsten Schenk struct control_runtime {
35*2475b0d4STorsten Schenk 	int (*update_streaming)(struct control_runtime *rt);
36*2475b0d4STorsten Schenk 	int (*set_rate)(struct control_runtime *rt, int rate);
37*2475b0d4STorsten Schenk 	int (*set_channels)(struct control_runtime *rt, int n_analog_out,
38*2475b0d4STorsten Schenk 		int n_analog_in, bool spdif_out, bool spdif_in);
39*2475b0d4STorsten Schenk 
40c6d43ba8STorsten Schenk 	struct sfire_chip *chip;
41c6d43ba8STorsten Schenk 
42c6d43ba8STorsten Schenk 	struct snd_kcontrol *element[CONTROL_MAX_ELEMENTS];
43c6d43ba8STorsten Schenk 	bool opt_coax_switch;
44c6d43ba8STorsten Schenk 	bool line_phono_switch;
45*2475b0d4STorsten Schenk 	bool digital_thru_switch;
46*2475b0d4STorsten Schenk 	bool usb_streaming;
47c6d43ba8STorsten Schenk 	u8 master_vol;
48c6d43ba8STorsten Schenk };
49c6d43ba8STorsten Schenk 
50c6d43ba8STorsten Schenk int __devinit usb6fire_control_init(struct sfire_chip *chip);
51c6d43ba8STorsten Schenk void usb6fire_control_abort(struct sfire_chip *chip);
52c6d43ba8STorsten Schenk void usb6fire_control_destroy(struct sfire_chip *chip);
53c6d43ba8STorsten Schenk #endif /* USB6FIRE_CONTROL_H */
54c6d43ba8STorsten Schenk 
55