ctmixer.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved.
  4. *
  5. * @File ctmixer.h
  6. *
  7. * @Brief
  8. * This file contains the definition of the mixer device functions.
  9. *
  10. * @Author Liu Chun
  11. * @Date Mar 28 2008
  12. */
  13. #ifndef CTMIXER_H
  14. #define CTMIXER_H
  15. #include "ctatc.h"
  16. #include "ctresource.h"
  17. #define INIT_VOL 0x1c00
  18. enum MIXER_PORT_T {
  19. MIX_WAVE_FRONT,
  20. MIX_WAVE_REAR,
  21. MIX_WAVE_CENTLFE,
  22. MIX_WAVE_SURROUND,
  23. MIX_SPDIF_OUT,
  24. MIX_PCMO_FRONT,
  25. MIX_MIC_IN,
  26. MIX_LINE_IN,
  27. MIX_SPDIF_IN,
  28. MIX_PCMI_FRONT,
  29. MIX_PCMI_REAR,
  30. MIX_PCMI_CENTLFE,
  31. MIX_PCMI_SURROUND,
  32. NUM_MIX_PORTS
  33. };
  34. /* alsa mixer descriptor */
  35. struct ct_mixer {
  36. struct ct_atc *atc;
  37. void **amixers; /* amixer resources for volume control */
  38. void **sums; /* sum resources for signal collection */
  39. unsigned int switch_state; /* A bit-map to indicate state of switches */
  40. int (*get_output_ports)(struct ct_mixer *mixer, enum MIXER_PORT_T type,
  41. struct rsc **rleft, struct rsc **rright);
  42. int (*set_input_left)(struct ct_mixer *mixer,
  43. enum MIXER_PORT_T type, struct rsc *rsc);
  44. int (*set_input_right)(struct ct_mixer *mixer,
  45. enum MIXER_PORT_T type, struct rsc *rsc);
  46. #ifdef CONFIG_PM_SLEEP
  47. int (*resume)(struct ct_mixer *mixer);
  48. #endif
  49. };
  50. int ct_alsa_mix_create(struct ct_atc *atc,
  51. enum CTALSADEVS device,
  52. const char *device_name);
  53. int ct_mixer_create(struct ct_atc *atc, struct ct_mixer **rmixer);
  54. int ct_mixer_destroy(struct ct_mixer *mixer);
  55. #endif /* CTMIXER_H */