OSDN Git Service

Merge android-4.4-p.205 (5169787) into msm-4.4
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / include / sound / audio_calibration.h
1 /* Copyright (c) 2014, The Linux Foundation. All rights reserved.
2  *
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.
6  *
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.
11  *
12  */
13 #ifndef _AUDIO_CALIBRATION_H
14 #define _AUDIO_CALIBRATION_H
15
16 #include <linux/msm_audio_calibration.h>
17
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
21
22
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);
30 };
31
32 struct audio_cal_reg {
33         int32_t                         cal_type;
34         struct audio_cal_callbacks      callbacks;
35 };
36
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);
39
40 #endif