Vignesh Kulothungan | 5539688 | 2017-04-20 14:37:02 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. |
| 3 | * Not a Contribution. |
| 4 | * |
| 5 | * Copyright (C) 2013 The Android Open Source Project |
| 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | * you may not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | */ |
| 19 | |
| 20 | #ifndef ACDB_H |
| 21 | #define ACDB_H |
| 22 | |
| 23 | #include <linux/msm_audio_calibration.h> |
| 24 | |
| 25 | #define MAX_CVD_VERSION_STRING_SIZE 100 |
| 26 | #define LIB_ACDB_LOADER "libacdbloader.so" |
| 27 | #define CVD_VERSION_MIXER_CTL "CVD Version" |
| 28 | #define ACDB_METAINFO_KEY_MODULE_NAME_LEN 100 |
| 29 | |
| 30 | #ifdef LINUX_ENABLED |
| 31 | #define PLATFORM_INFO_XML_PATH "/etc/audio_platform_info.xml" |
| 32 | #else |
| 33 | #define PLATFORM_INFO_XML_PATH "/system/etc/audio_platform_info.xml" |
| 34 | #endif |
| 35 | |
| 36 | /* Audio calibration related functions */ |
| 37 | typedef void (*acdb_deallocate_t)(); |
| 38 | typedef int (*acdb_init_t)(); |
| 39 | typedef int (*acdb_init_v2_t)(const char *, char *, int); |
| 40 | typedef int (*acdb_init_v3_t)(const char *, char *, struct listnode *); |
| 41 | typedef void (*acdb_send_audio_cal_t)(int, int, int , int); |
| 42 | typedef void (*acdb_send_audio_cal_v3_t)(int, int, int, int, int); |
| 43 | typedef void (*acdb_send_voice_cal_t)(int, int); |
| 44 | typedef int (*acdb_reload_vocvoltable_t)(int); |
| 45 | typedef int (*acdb_get_default_app_type_t)(void); |
| 46 | typedef int (*acdb_loader_get_calibration_t)(char *attr, int size, void *data); |
| 47 | typedef int (*acdb_set_audio_cal_t) (void *, void *, uint32_t); |
| 48 | typedef int (*acdb_get_audio_cal_t) (void *, void *, uint32_t*); |
| 49 | typedef int (*acdb_send_common_top_t) (void); |
| 50 | typedef int (*acdb_set_codec_data_t) (void *, char *); |
| 51 | typedef int (*acdb_reload_t) (char *, char *, char *, int); |
| 52 | typedef int (*acdb_reload_v2_t) (char *, char *, char *, struct listnode *); |
| 53 | typedef int (*acdb_send_gain_dep_cal_t)(int, int, int, int, int); |
| 54 | |
| 55 | struct meta_key_list { |
| 56 | struct listnode list; |
| 57 | struct audio_cal_info_metainfo cal_info; |
| 58 | char name[ACDB_METAINFO_KEY_MODULE_NAME_LEN]; |
| 59 | }; |
| 60 | |
| 61 | struct acdb_platform_data { |
| 62 | /* Audio calibration related functions */ |
| 63 | void *acdb_handle; |
| 64 | acdb_init_t acdb_init; |
| 65 | acdb_init_v2_t acdb_init_v2; |
| 66 | acdb_init_v3_t acdb_init_v3; |
| 67 | struct listnode acdb_meta_key_list; |
| 68 | }; |
| 69 | |
| 70 | int acdb_init(int); |
| 71 | |
| 72 | int acdb_set_metainfo_key(void *platform, char *name, int key); |
| 73 | #endif //ACDB_H |