wcdcal-hwdep.h 796 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2014, 2018, 2020 The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __WCD9XXX_HWDEP_H__
  6. #define __WCD9XXX_HWDEP_H__
  7. #include <sound/msmcal-hwdep.h>
  8. enum wcd_cal_states {
  9. WCDCAL_UNINITIALISED,
  10. WCDCAL_INITIALISED,
  11. WCDCAL_RECIEVED
  12. };
  13. struct fw_info {
  14. struct firmware_cal *fw[WCD9XXX_MAX_CAL];
  15. DECLARE_BITMAP(cal_bit, WCD9XXX_MAX_CAL);
  16. /* for calibration tracking */
  17. unsigned long wcdcal_state[WCD9XXX_MAX_CAL];
  18. struct mutex lock;
  19. };
  20. struct firmware_cal {
  21. u8 *data;
  22. size_t size;
  23. };
  24. struct snd_soc_codec;
  25. int wcd_cal_create_hwdep(void *fw, int node,
  26. struct snd_soc_component *component);
  27. struct firmware_cal *wcdcal_get_fw_cal(struct fw_info *fw_data,
  28. enum wcd_cal_type type);
  29. #endif /* __WCD9XXX_HWDEP_H__ */