control.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Linux driver for TerraTec DMX 6Fire USB
  4. *
  5. * Author: Torsten Schenk <[email protected]>
  6. * Created: Jan 01, 2011
  7. * Copyright: (C) Torsten Schenk
  8. */
  9. #ifndef USB6FIRE_CONTROL_H
  10. #define USB6FIRE_CONTROL_H
  11. #include "common.h"
  12. enum {
  13. CONTROL_MAX_ELEMENTS = 32
  14. };
  15. enum {
  16. CONTROL_RATE_44KHZ,
  17. CONTROL_RATE_48KHZ,
  18. CONTROL_RATE_88KHZ,
  19. CONTROL_RATE_96KHZ,
  20. CONTROL_RATE_176KHZ,
  21. CONTROL_RATE_192KHZ,
  22. CONTROL_N_RATES
  23. };
  24. struct control_runtime {
  25. int (*update_streaming)(struct control_runtime *rt);
  26. int (*set_rate)(struct control_runtime *rt, int rate);
  27. int (*set_channels)(struct control_runtime *rt, int n_analog_out,
  28. int n_analog_in, bool spdif_out, bool spdif_in);
  29. struct sfire_chip *chip;
  30. struct snd_kcontrol *element[CONTROL_MAX_ELEMENTS];
  31. bool opt_coax_switch;
  32. bool line_phono_switch;
  33. bool digital_thru_switch;
  34. bool usb_streaming;
  35. u8 output_vol[6];
  36. u8 ovol_updated;
  37. u8 output_mute;
  38. s8 input_vol[2];
  39. u8 ivol_updated;
  40. };
  41. int usb6fire_control_init(struct sfire_chip *chip);
  42. void usb6fire_control_abort(struct sfire_chip *chip);
  43. void usb6fire_control_destroy(struct sfire_chip *chip);
  44. #endif /* USB6FIRE_CONTROL_H */