1 /* Copyright (c) 2014, The Linux Foundation. All rights reserved.
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
13 #ifndef _AUDIO_CALIBRATION_H
14 #define _AUDIO_CALIBRATION_H
16 #include <linux/msm_audio_calibration.h>
18 /* Used by driver in buffer_number field to notify client
19 * To update all blocks, for example: freeing all memory */
20 #define ALL_CAL_BLOCKS -1
23 struct audio_cal_callbacks {
24 int (*alloc) (int32_t cal_type, size_t data_size, void *data);
25 int (*dealloc) (int32_t cal_type, size_t data_size, void *data);
26 int (*pre_cal) (int32_t cal_type, size_t data_size, void *data);
27 int (*set_cal) (int32_t cal_type, size_t data_size, void *data);
28 int (*get_cal) (int32_t cal_type, size_t data_size, void *data);
29 int (*post_cal) (int32_t cal_type, size_t data_size, void *data);
32 struct audio_cal_reg {
34 struct audio_cal_callbacks callbacks;
37 int audio_cal_register(int num_cal_types, struct audio_cal_reg *reg_data);
38 int audio_cal_deregister(int num_cal_types, struct audio_cal_reg *reg_data);