diff --git a/tfa98xx/Android.mk b/tfa98xx/Android.mk index b59d62b..221c976 100644 --- a/tfa98xx/Android.mk +++ b/tfa98xx/Android.mk @@ -18,37 +18,27 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_SHARED_LIBRARIES := \ - libbase \ - liblog \ - libcutils \ - libtinyalsa \ - libtinycompress \ + audio.primary.$(TARGET_BOARD_PLATFORM) \ libaudioroute \ - libdl \ libaudioutils \ - libhwbinder \ - libhidlbase \ - libprocessgroup \ - libutils \ - audio.primary.sm6150 + libcutils \ + liblog \ + libtinyalsa \ + libtinycompress LOCAL_C_INCLUDES += \ - external/tinyalsa/include \ - external/tinycompress/include \ - hardware/libhardware/include \ - system/media/audio_utils/include \ - $(call include-path-for, audio-effects) \ - $(call include-path-for, audio-route) \ + $(call include-path-for,audio-route) \ $(call project-path-for,qcom-audio)/hal \ $(call project-path-for,qcom-audio)/hal/msm8974 \ $(call project-path-for,qcom-audio)/hal/audio_extn \ - $(call project-path-for,qcom-audio)/hal/voice_extn -LOCAL_HEADER_LIBRARIES := generated_kernel_headers +LOCAL_HEADER_LIBRARIES := \ + generated_kernel_headers \ + libhardware_headers + LOCAL_SRC_FILES := tfa98xx_feedback.c -LOCAL_MODULE := audio_amplifier.sm6150 +LOCAL_MODULE := audio_amplifier.$(TARGET_BOARD_PLATFORM) LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_MODULE_TAGS := optional LOCAL_VENDOR_MODULE := true include $(BUILD_SHARED_LIBRARY) diff --git a/tfa98xx/tfa98xx_feedback.c b/tfa98xx/tfa98xx_feedback.c index ba2dea4..8a8c545 100644 --- a/tfa98xx/tfa98xx_feedback.c +++ b/tfa98xx/tfa98xx_feedback.c @@ -16,21 +16,12 @@ */ #define LOG_TAG "audio_amplifier_tfa98xx" -//#define LOG_NDEBUG 0 -#include -#include -#include #include -#include -#include -#include -/* clang-format off */ #include "audio_hw.h" #include "platform.h" #include "platform_api.h" -/* clang-format on */ #define UNUSED __attribute__((unused)) @@ -43,22 +34,20 @@ typedef struct amp_device { static tfa_t* tfa_dev = NULL; -static int is_speaker(uint32_t snd_device) { - int speaker = 0; +static bool is_speaker(uint32_t snd_device) { switch (snd_device) { case SND_DEVICE_OUT_SPEAKER: - case SND_DEVICE_OUT_SPEAKER_REVERSE: case SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES: - case SND_DEVICE_OUT_VOICE_SPEAKER: - case SND_DEVICE_OUT_VOICE_SPEAKER_2: + case SND_DEVICE_OUT_SPEAKER_REVERSE: + case SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET: case SND_DEVICE_OUT_SPEAKER_AND_HDMI: case SND_DEVICE_OUT_SPEAKER_AND_USB_HEADSET: - case SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET: - speaker = 1; - break; + case SND_DEVICE_OUT_VOICE_SPEAKER: + case SND_DEVICE_OUT_VOICE_SPEAKER_2: + return true; + default: + return false; } - - return speaker; } int tfa98xx_start_feedback(void* adev, uint32_t snd_device) {