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

Commit 12125e85 authored by Mingming Yin's avatar Mingming Yin Committed by Gerrit - the friendly Code Review server
Browse files

hal: fix compilation issues with audio FM extention

- Update FM device references to match latest
  definitions to fix compilation of FM extention.
- Update FM feature flag for power optimization.

Change-Id: I17a9e240e552c4089d3e9c7a25e437fb5b5433f9
parent 6c6171bd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -85,8 +85,8 @@ ifeq ($(strip $(AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE)),true)
    LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
endif

ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FM)),true)
    LOCAL_CFLAGS += -DFM_ENABLED
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FM_POWER_OPT)),true)
    LOCAL_CFLAGS += -DFM_POWER_OPT
    LOCAL_SRC_FILES += audio_extn/fm.c
endif

+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ static struct audio_extn_module aextnmod = {
#define AUDIO_PARAMETER_OFFLOAD_NUM_ACTIVE "offload_num_active"
#define AUDIO_PARAMETER_HPX            "HPX"

#ifndef FM_ENABLED
#ifndef FM_POWER_OPT
#define audio_extn_fm_set_parameters(adev, parms) (0)
#else
void audio_extn_fm_set_parameters(struct audio_device *adev,
+2 −7
Original line number Diff line number Diff line
@@ -59,13 +59,8 @@
#define AUDIO_OUTPUT_FLAG_INCALL_MUSIC 0x8000
#endif

#ifndef FM_ENABLED
#define AUDIO_DEVICE_OUT_FM 0x80000
#define AUDIO_DEVICE_OUT_FM_TX 0x100000
#define AUDIO_SOURCE_FM_RX 9
#define AUDIO_SOURCE_FM_RX_A2DP 10
#define AUDIO_DEVICE_IN_FM_RX (AUDIO_DEVICE_BIT_IN | 0x8000)
#define AUDIO_DEVICE_IN_FM_RX_A2DP (AUDIO_DEVICE_BIT_IN | 0x10000)
#ifndef AUDIO_DEVICE_OUT_FM_TX
#define AUDIO_DEVICE_OUT_FM_TX 0x8000000
#endif

#ifndef FLAC_OFFLOAD_ENABLED
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#include <stdlib.h>
#include <cutils/str_parms.h>

#ifdef FM_ENABLED
#ifdef FM_POWER_OPT
#define AUDIO_PARAMETER_KEY_HANDLE_FM "handle_fm"
#define AUDIO_PARAMETER_KEY_FM_VOLUME "fm_volume"
#define AUDIO_PARAMETER_KEY_REC_PLAY_CONC "rec_play_conc_on"
@@ -299,4 +299,4 @@ void audio_extn_fm_set_parameters(struct audio_device *adev,
exit:
    ALOGV("%s: exit", __func__);
}
#endif /* FM_ENABLED end */
#endif /* FM_POWER_OPT end */
+3 −7
Original line number Diff line number Diff line
@@ -2792,9 +2792,7 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
                }
            }
        }
    } else if (source == AUDIO_SOURCE_FM_RX ||
               source == AUDIO_SOURCE_FM_RX_A2DP ||
               source == AUDIO_SOURCE_FM_TUNER) {
    } else if (source == AUDIO_SOURCE_FM_TUNER) {
        snd_device = SND_DEVICE_IN_CAPTURE_FM;
    } else if (source == AUDIO_SOURCE_DEFAULT) {
        goto exit;
@@ -2837,8 +2835,7 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
        } else if (in_device & AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET ||
                   in_device & AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET) {
            snd_device = SND_DEVICE_IN_USB_HEADSET_MIC;
        } else if (in_device & AUDIO_DEVICE_IN_FM_RX ||
                   in_device & AUDIO_DEVICE_IN_FM_TUNER) {
        } else if (in_device & AUDIO_DEVICE_IN_FM_TUNER) {
            snd_device = SND_DEVICE_IN_CAPTURE_FM;
        } else {
            ALOGE("%s: Unknown input device(s) %#x", __func__, in_device);
@@ -3522,8 +3519,7 @@ int64_t platform_render_latency(audio_usecase_t usecase)
int platform_update_usecase_from_source(int source, int usecase)
{
    ALOGV("%s: input source :%d", __func__, source);
    if (source == AUDIO_SOURCE_FM_RX_A2DP ||
        source == AUDIO_SOURCE_FM_TUNER)
    if (source == AUDIO_SOURCE_FM_TUNER)
        usecase = USECASE_AUDIO_RECORD_FM_VIRTUAL;
    return usecase;
}
Loading