Banajit Goswami | 0530e2f | 2016-12-09 21:34:37 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2014, 2017 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 | */ |
| 21 | #define ALL_CAL_BLOCKS -1 |
| 22 | |
| 23 | |
| 24 | struct audio_cal_callbacks { |
| 25 | int (*alloc)(int32_t cal_type, size_t data_size, void *data); |
| 26 | int (*dealloc)(int32_t cal_type, size_t data_size, void *data); |
| 27 | int (*pre_cal)(int32_t cal_type, size_t data_size, void *data); |
| 28 | int (*set_cal)(int32_t cal_type, size_t data_size, void *data); |
| 29 | int (*get_cal)(int32_t cal_type, size_t data_size, void *data); |
| 30 | int (*post_cal)(int32_t cal_type, size_t data_size, void *data); |
| 31 | }; |
| 32 | |
| 33 | struct audio_cal_reg { |
| 34 | int32_t cal_type; |
| 35 | struct audio_cal_callbacks callbacks; |
| 36 | }; |
| 37 | |
| 38 | int audio_cal_register(int num_cal_types, struct audio_cal_reg *reg_data); |
| 39 | int audio_cal_deregister(int num_cal_types, struct audio_cal_reg *reg_data); |
| 40 | |
| 41 | #endif |