audio_calibration.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2014, 2017, 2020 The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _AUDIO_CALIBRATION_H
  6. #define _AUDIO_CALIBRATION_H
  7. #include <audio/linux/msm_audio_calibration.h>
  8. /* Used by driver in buffer_number field to notify client
  9. * To update all blocks, for example: freeing all memory
  10. */
  11. #define ALL_CAL_BLOCKS -1
  12. struct audio_cal_callbacks {
  13. int (*alloc)(int32_t cal_type, size_t data_size, void *data);
  14. int (*dealloc)(int32_t cal_type, size_t data_size, void *data);
  15. int (*pre_cal)(int32_t cal_type, size_t data_size, void *data);
  16. int (*set_cal)(int32_t cal_type, size_t data_size, void *data);
  17. int (*get_cal)(int32_t cal_type, size_t data_size, void *data);
  18. int (*post_cal)(int32_t cal_type, size_t data_size, void *data);
  19. };
  20. struct audio_cal_reg {
  21. int32_t cal_type;
  22. struct audio_cal_callbacks callbacks;
  23. };
  24. int audio_cal_register(int num_cal_types, struct audio_cal_reg *reg_data);
  25. int audio_cal_deregister(int num_cal_types, struct audio_cal_reg *reg_data);
  26. #endif