blob: 24dcb8fb6e3dab89aa6ab4f5184ed728d05236ef [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);
jasmine chac89321b2018-04-10 21:37:01 +080039typedef int (*acdb_set_audio_cal_t) (void *, void *, uint32_t);
vivek mehta0fb11312017-05-15 19:35:32 -070040
41struct meta_key_list {
42 struct listnode list;
43 struct audio_cal_info_metainfo cal_info;
44 char name[ACDB_METAINFO_KEY_MODULE_NAME_LEN];
45};
46
47struct acdb_platform_data {
48 /* Audio calibration related functions */
49 void *acdb_handle;
50 acdb_init_t acdb_init;
51 acdb_init_v2_cvd_t acdb_init_v2;
52 acdb_init_v3_t acdb_init_v3;
53 char *snd_card_name;
54 struct listnode acdb_meta_key_list;
55};
56
57int acdb_init(int);
58
59int acdb_set_metainfo_key(void *platform, char *name, int key);
60int acdb_set_parameters(void *platform, struct str_parms *parms);
61#endif //ACDB_H