Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 471c2254 authored by Thomas Wendt's avatar Thomas Wendt Committed by Michael Bestas
Browse files

hal: Tell Huawei acdb loader which files to load

Huaweis's audio.primary.msm8916 HAL constructs this path from
/sys/bus/platform/drivers/hw_audio_info/hw_audio_info/product_identifier.

Change-Id: I34034d1c7365ebf704be033293821377fb5ce615
(cherry picked from commit 4ec87c17e0ac9f3da38f30e8c2fc2d9b8d64e1e6)
parent 3f5e4954
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -144,6 +144,9 @@ struct audio_block_header
/* Audio calibration related functions */
typedef void (*acdb_deallocate_t)();
typedef int  (*acdb_init_t)(char *, char *, int);
#ifdef HUAWEI_SOUND_PARAM_PATH
typedef void (*acdb_set_param_path_t)(char *path);
#endif
typedef void (*acdb_send_audio_cal_t)(int, int, int, int);
typedef void (*acdb_send_voice_cal_t)(int, int);
typedef int (*acdb_reload_vocvoltable_t)(int);
@@ -169,6 +172,9 @@ struct platform_data {
    void                       *acdb_handle;
    int                        voice_feature_set;
    acdb_init_t                acdb_init;
#ifdef HUAWEI_SOUND_PARAM_PATH
    acdb_set_param_path_t      acdb_set_param_path;
#endif
    acdb_deallocate_t          acdb_deallocate;
    acdb_send_audio_cal_t      acdb_send_audio_cal;
    acdb_send_voice_cal_t      acdb_send_voice_cal;
@@ -1362,6 +1368,16 @@ void *platform_init(struct audio_device *adev)
            ALOGE("%s: Could not find the symbol acdb_get_default_app_type from %s",
                  __func__, LIB_ACDB_LOADER);

#ifdef HUAWEI_SOUND_PARAM_PATH
        my_data->acdb_set_param_path = (acdb_set_param_path_t)dlsym(my_data->acdb_handle,
                                                    "acdb_loader_set_param_path");
        if (!my_data->acdb_set_param_path)
            ALOGE("%s: Could not find the symbol acdb_loader_set_param_path from %s",
                  __func__, LIB_ACDB_LOADER);
        else
            my_data->acdb_set_param_path(HUAWEI_SOUND_PARAM_PATH);
#endif

        my_data->acdb_init = (acdb_init_t)dlsym(my_data->acdb_handle,
                                                    "acdb_loader_init_v2");
        if (my_data->acdb_init == NULL) {