xonar_dg.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef XONAR_DG_H_INCLUDED
  2. #define XONAR_DG_H_INCLUDED
  3. #include "oxygen.h"
  4. #define GPIO_MAGIC 0x0008
  5. #define GPIO_HP_DETECT 0x0010
  6. #define GPIO_INPUT_ROUTE 0x0060
  7. #define GPIO_HP_REAR 0x0080
  8. #define GPIO_OUTPUT_ENABLE 0x0100
  9. #define CAPTURE_SRC_MIC 0
  10. #define CAPTURE_SRC_FP_MIC 1
  11. #define CAPTURE_SRC_LINE 2
  12. #define CAPTURE_SRC_AUX 3
  13. #define PLAYBACK_DST_HP 0
  14. #define PLAYBACK_DST_HP_FP 1
  15. #define PLAYBACK_DST_MULTICH 2
  16. enum cs4245_shadow_operation {
  17. CS4245_SAVE_TO_SHADOW,
  18. CS4245_LOAD_FROM_SHADOW
  19. };
  20. struct dg {
  21. /* shadow copy of the CS4245 register space */
  22. unsigned char cs4245_shadow[17];
  23. /* output select: headphone/speakers */
  24. unsigned char output_sel;
  25. /* volumes for all capture sources */
  26. char input_vol[4][2];
  27. /* input select: mic/fp mic/line/aux */
  28. unsigned char input_sel;
  29. };
  30. /* Xonar DG control routines */
  31. int cs4245_write_spi(struct oxygen *chip, u8 reg);
  32. int cs4245_read_spi(struct oxygen *chip, u8 reg);
  33. int cs4245_shadow_control(struct oxygen *chip, enum cs4245_shadow_operation op);
  34. void dg_init(struct oxygen *chip);
  35. void set_cs4245_dac_params(struct oxygen *chip,
  36. struct snd_pcm_hw_params *params);
  37. void set_cs4245_adc_params(struct oxygen *chip,
  38. struct snd_pcm_hw_params *params);
  39. unsigned int adjust_dg_dac_routing(struct oxygen *chip,
  40. unsigned int play_routing);
  41. void dump_cs4245_registers(struct oxygen *chip,
  42. struct snd_info_buffer *buffer);
  43. void dg_suspend(struct oxygen *chip);
  44. void dg_resume(struct oxygen *chip);
  45. void dg_cleanup(struct oxygen *chip);
  46. extern struct oxygen_model model_xonar_dg;
  47. #endif