blob: 08026fbf8d97faa3c6a29422d2f65df580df35ab [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);
36typedef int (*acdb_reload_vocvoltable_t)(int);
37typedef int (*acdb_send_gain_dep_cal_t)(int, int, int, int, int);
38typedef int (*acdb_send_custom_top_t) (void);
39
40struct meta_key_list {
41 struct listnode list;
42 struct audio_cal_info_metainfo cal_info;
43 char name[ACDB_METAINFO_KEY_MODULE_NAME_LEN];
44};
45
46struct acdb_platform_data {
47 /* Audio calibration related functions */
48 void *acdb_handle;
49 acdb_init_t acdb_init;
50 acdb_init_v2_cvd_t acdb_init_v2;
51 acdb_init_v3_t acdb_init_v3;
52 char *snd_card_name;
53 struct listnode acdb_meta_key_list;
54};
55
56int acdb_init(int);
57
58int acdb_set_metainfo_key(void *platform, char *name, int key);
59int acdb_set_parameters(void *platform, struct str_parms *parms);
60#endif //ACDB_H