blob: e6410d6e64ef71e6288bf66de29011c2427208f6 [file] [log] [blame]
vivek mehta0fb11312017-05-15 19:35:32 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ACDB_H
18#define ACDB_H
19
20#include <cutils/list.h>
21#include <linux/msm_audio_calibration.h>
22
23#define MAX_CVD_VERSION_STRING_SIZE 100
24#define LIB_ACDB_LOADER "libacdbloader.so"
25#define CVD_VERSION_MIXER_CTL "CVD Version"
26#define ACDB_METAINFO_KEY_MODULE_NAME_LEN 100
27
28/* Audio calibration related functions */
29typedef void (*acdb_deallocate_t)();
30typedef int (*acdb_init_v3_t)(const char *, char *, struct listnode *);
31typedef int (*acdb_init_v2_cvd_t)(char *, char *, int);
32typedef int (*acdb_init_v2_t)(char *);
33typedef int (*acdb_init_t)();
34typedef void (*acdb_send_audio_cal_t)(int, int);
35typedef void (*acdb_send_voice_cal_t)(int, int);
Ashish Jain1c849702018-05-11 20:11:55 +053036typedef int (*acdb_get_audio_cal_t) (void *, void *, uint32_t*);
vivek mehta0fb11312017-05-15 19:35:32 -070037typedef int (*acdb_reload_vocvoltable_t)(int);
38typedef int (*acdb_send_gain_dep_cal_t)(int, int, int, int, int);
39typedef int (*acdb_send_custom_top_t) (void);
jasmine chac89321b2018-04-10 21:37:01 +080040typedef int (*acdb_set_audio_cal_t) (void *, void *, uint32_t);
vivek mehta0fb11312017-05-15 19:35:32 -070041
42struct meta_key_list {
43 struct listnode list;
44 struct audio_cal_info_metainfo cal_info;
45 char name[ACDB_METAINFO_KEY_MODULE_NAME_LEN];
46};
47
48struct acdb_platform_data {
49 /* Audio calibration related functions */
50 void *acdb_handle;
51 acdb_init_t acdb_init;
52 acdb_init_v2_cvd_t acdb_init_v2;
53 acdb_init_v3_t acdb_init_v3;
54 char *snd_card_name;
55 struct listnode acdb_meta_key_list;
56};
57
58int acdb_init(int);
59
60int acdb_set_metainfo_key(void *platform, char *name, int key);
61int acdb_set_parameters(void *platform, struct str_parms *parms);
62#endif //ACDB_H