Home | History | Annotate | Download | only in hal
      1 /*
      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 */
     29 typedef void (*acdb_deallocate_t)();
     30 typedef int  (*acdb_init_v3_t)(const char *, char *, struct listnode *);
     31 typedef int  (*acdb_init_v2_cvd_t)(char *, char *, int);
     32 typedef int  (*acdb_init_v2_t)(char *);
     33 typedef int  (*acdb_init_t)();
     34 typedef void (*acdb_send_audio_cal_t)(int, int);
     35 typedef void (*acdb_send_voice_cal_t)(int, int);
     36 typedef int (*acdb_get_audio_cal_t) (void *, void *, uint32_t*);
     37 typedef int (*acdb_reload_vocvoltable_t)(int);
     38 typedef int (*acdb_send_gain_dep_cal_t)(int, int, int, int, int);
     39 typedef int (*acdb_send_custom_top_t) (void);
     40 typedef int (*acdb_set_audio_cal_t) (void *, void *, uint32_t);
     41 
     42 struct 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 
     48 struct 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 
     58 int acdb_init(int);
     59 
     60 int acdb_set_metainfo_key(void *platform, char *name, int key);
     61 int acdb_set_parameters(void *platform, struct str_parms *parms);
     62 #endif //ACDB_H
     63