wcdcal-hwdep.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2014, The Linux Foundation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef __WCD9XXX_HWDEP_H__
  14. #define __WCD9XXX_HWDEP_H__
  15. #include <sound/msmcal-hwdep.h>
  16. enum wcd_cal_states {
  17. WCDCAL_UNINITIALISED,
  18. WCDCAL_INITIALISED,
  19. WCDCAL_RECIEVED
  20. };
  21. struct fw_info {
  22. struct firmware_cal *fw[WCD9XXX_MAX_CAL];
  23. DECLARE_BITMAP(cal_bit, WCD9XXX_MAX_CAL);
  24. /* for calibration tracking */
  25. unsigned long wcdcal_state[WCD9XXX_MAX_CAL];
  26. struct mutex lock;
  27. };
  28. struct firmware_cal {
  29. u8 *data;
  30. size_t size;
  31. };
  32. struct snd_soc_codec;
  33. int wcd_cal_create_hwdep(void *fw, int node, struct snd_soc_codec *codec);
  34. struct firmware_cal *wcdcal_get_fw_cal(struct fw_info *fw_data,
  35. enum wcd_cal_type type);
  36. #endif /* __WCD9XXX_HWDEP_H__ */