control.h 1.4 KB

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