marimba-codec.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Copyright (c) 2009, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #ifndef __LINUX_MFD_MSM_MARIMBA_CODEC_H
  14. #define __LINUX_MFD_MSM_MARIMBA_CODEC_H
  15. #include <mach/qdsp5v2/adie_marimba.h>
  16. struct adie_codec_register {
  17. u8 reg;
  18. u8 mask;
  19. u8 val;
  20. };
  21. struct adie_codec_register_image {
  22. struct adie_codec_register *regs;
  23. u32 img_sz;
  24. };
  25. struct adie_codec_path {
  26. struct adie_codec_dev_profile *profile;
  27. struct adie_codec_register_image img;
  28. u32 hwsetting_idx;
  29. u32 stage_idx;
  30. u32 curr_stage;
  31. };
  32. int adie_codec_open(struct adie_codec_dev_profile *profile,
  33. struct adie_codec_path **path_pptr);
  34. int adie_codec_setpath(struct adie_codec_path *path_ptr,
  35. u32 freq_plan, u32 osr);
  36. int adie_codec_proceed_stage(struct adie_codec_path *path_ptr, u32 state);
  37. int adie_codec_close(struct adie_codec_path *path_ptr);
  38. u32 adie_codec_freq_supported(struct adie_codec_dev_profile *profile,
  39. u32 requested_freq);
  40. int adie_codec_enable_sidetone(struct adie_codec_path *rx_path_ptr, u32 enable);
  41. int adie_codec_set_device_digital_volume(struct adie_codec_path *path_ptr,
  42. u32 num_channels, u32 vol_percentage /* in percentage */);
  43. int adie_codec_set_device_analog_volume(struct adie_codec_path *path_ptr,
  44. u32 num_channels, u32 volume /* in percentage */);
  45. #endif