q6afecal-hwdep.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2014, 2018, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __Q6AFECAL_HWDEP_H__
  6. #define __Q6AFECAL_HWDEP_H__
  7. #include <sound/msmcal-hwdep.h>
  8. enum q6afe_cal_states {
  9. Q6AFECAL_UNINITIALISED,
  10. Q6AFECAL_INITIALISED,
  11. Q6AFECAL_RECEIVED
  12. };
  13. struct afe_fw_info {
  14. struct firmware_cal *fw[Q6AFE_MAX_CAL];
  15. DECLARE_BITMAP(cal_bit, Q6AFE_MAX_CAL);
  16. /* for calibration tracking */
  17. unsigned long q6afecal_state[Q6AFE_MAX_CAL];
  18. struct mutex lock;
  19. };
  20. struct firmware_cal {
  21. u8 *data;
  22. size_t size;
  23. };
  24. #if IS_ENABLED(CONFIG_AFE_HWDEP)
  25. int q6afe_cal_create_hwdep(void *fw, int node, void *card);
  26. struct firmware_cal *q6afecal_get_fw_cal(struct afe_fw_info *fw_data,
  27. enum q6afe_cal_type type);
  28. #else /* CONFIG_AFE_HWDEP */
  29. static inline int q6afe_cal_create_hwdep(void *fw, int node, void *card)
  30. {
  31. return 0;
  32. }
  33. static inline struct firmware_cal *q6afecal_get_fw_cal(
  34. struct afe_fw_info *fw_data,
  35. enum q6afe_cal_type type)
  36. {
  37. return NULL;
  38. }
  39. #endif /* CONFIG_AFE_HWDEP */
  40. #endif /* __Q6AFECAL_HWDEP_H__ */