wcd934x-dsd.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
  3. */
  4. #ifndef __WCD934X_DSD_H__
  5. #define __WCD934X_DSD_H__
  6. #include <sound/soc.h>
  7. #include "wcd934x.h"
  8. enum {
  9. DSD0,
  10. DSD1,
  11. DSD_MAX,
  12. };
  13. enum {
  14. DSD_INP_SEL_ZERO = 0,
  15. DSD_INP_SEL_RX0,
  16. DSD_INP_SEL_RX1,
  17. DSD_INP_SEL_RX2,
  18. DSD_INP_SEL_RX3,
  19. DSD_INP_SEL_RX4,
  20. DSD_INP_SEL_RX5,
  21. DSD_INP_SEL_RX6,
  22. DSD_INP_SEL_RX7,
  23. };
  24. struct tavil_dsd_config {
  25. struct snd_soc_component *component;
  26. unsigned int dsd_interp_mixer[INTERP_MAX];
  27. u32 base_sample_rate[DSD_MAX];
  28. int volume[DSD_MAX];
  29. struct mutex vol_mutex;
  30. int version;
  31. };
  32. #if IS_ENABLED(CONFIG_SND_SOC_WCD934X_DSD)
  33. int tavil_dsd_set_mixer_value(struct tavil_dsd_config *dsd_conf,
  34. int interp_num, int sw_value);
  35. int tavil_dsd_get_current_mixer_value(struct tavil_dsd_config *dsd_conf,
  36. int interp_num);
  37. int tavil_dsd_set_out_select(struct tavil_dsd_config *dsd_conf,
  38. int interp_num);
  39. void tavil_dsd_reset(struct tavil_dsd_config *dsd_conf);
  40. void tavil_dsd_set_interp_rate(struct tavil_dsd_config *dsd_conf, u16 rx_port,
  41. u32 sample_rate, u8 sample_rate_val);
  42. struct tavil_dsd_config *tavil_dsd_init(struct snd_soc_component *component);
  43. void tavil_dsd_deinit(struct tavil_dsd_config *dsd_config);
  44. int tavil_dsd_post_ssr_init(struct tavil_dsd_config *dsd_config);
  45. #else
  46. int tavil_dsd_set_mixer_value(struct tavil_dsd_config *dsd_conf,
  47. int interp_num, int sw_value)
  48. {
  49. return 0;
  50. }
  51. int tavil_dsd_get_current_mixer_value(struct tavil_dsd_config *dsd_conf,
  52. int interp_num)
  53. {
  54. return 0;
  55. }
  56. int tavil_dsd_set_out_select(struct tavil_dsd_config *dsd_conf,
  57. int interp_num)
  58. {
  59. return 0;
  60. }
  61. void tavil_dsd_reset(struct tavil_dsd_config *dsd_conf)
  62. { }
  63. void tavil_dsd_set_interp_rate(struct tavil_dsd_config *dsd_conf, u16 rx_port,
  64. u32 sample_rate, u8 sample_rate_val)
  65. { }
  66. struct tavil_dsd_config *tavil_dsd_init(struct snd_soc_component *component)
  67. {
  68. return NULL;
  69. }
  70. void tavil_dsd_deinit(struct tavil_dsd_config *dsd_config)
  71. { }
  72. int tavil_dsd_post_ssr_init(struct tavil_dsd_config *dsd_config)
  73. {
  74. return 0;
  75. }
  76. #endif
  77. #endif