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

Commit f6942f1c authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: update haptics PCM ID"

parents 846e8f2d 51d8c2a2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -328,6 +328,7 @@ const char * const use_case_table[AUDIO_USECASE_MAX] = {
    [USECASE_AUDIO_PLAYBACK_DEEP_BUFFER] = "deep-buffer-playback",
    [USECASE_AUDIO_PLAYBACK_LOW_LATENCY] = "low-latency-playback",
    [USECASE_AUDIO_PLAYBACK_WITH_HAPTICS] = "audio-with-haptics-playback",
    [USECASE_AUDIO_PLAYBACK_HAPTICS] = "haptics-playback",
    [USECASE_AUDIO_PLAYBACK_ULL]         = "audio-ull-playback",
    [USECASE_AUDIO_PLAYBACK_MULTI_CH]    = "multi-channel-playback",
    [USECASE_AUDIO_PLAYBACK_OFFLOAD] = "compress-offload-playback",
@@ -3780,7 +3781,8 @@ int start_output_stream(struct stream_out *out)
    }

    if (is_haptic_usecase) {
        adev->haptic_pcm_device_id = platform_get_haptics_pcm_device_id();
        adev->haptic_pcm_device_id = platform_get_pcm_device_id(
                     USECASE_AUDIO_PLAYBACK_HAPTICS, PCM_PLAYBACK);
        if (adev->haptic_pcm_device_id < 0) {
            ALOGE("%s: Invalid Haptics pcm device id(%d) for the usecase(%d)",
                  __func__, adev->haptic_pcm_device_id, out->usecase);
+1 −0
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@ enum {
    USECASE_AUDIO_PLAYBACK_ULL,
    USECASE_AUDIO_PLAYBACK_MMAP,
    USECASE_AUDIO_PLAYBACK_WITH_HAPTICS,
    USECASE_AUDIO_PLAYBACK_HAPTICS,
    USECASE_AUDIO_PLAYBACK_HIFI,
    USECASE_AUDIO_PLAYBACK_TTS,

+3 −5
Original line number Diff line number Diff line
@@ -379,6 +379,8 @@ static int pcm_device_table[AUDIO_USECASE_MAX][2] = {
                                            DEEP_BUFFER_PCM_DEVICE},
    [USECASE_AUDIO_PLAYBACK_WITH_HAPTICS] = {AUDIO_HAPTICS_PCM_DEVICE,
                                             AUDIO_HAPTICS_PCM_DEVICE},
    [USECASE_AUDIO_PLAYBACK_HAPTICS] = {HAPTICS_PCM_DEVICE,
                                             HAPTICS_PCM_DEVICE},
    [USECASE_AUDIO_PLAYBACK_LOW_LATENCY] = {LOWLATENCY_PCM_DEVICE,
                                           LOWLATENCY_PCM_DEVICE},
    [USECASE_AUDIO_PLAYBACK_ULL]         = {MULTIMEDIA3_PCM_DEVICE,
@@ -1312,6 +1314,7 @@ static char * hw_interface_table[SND_DEVICE_MAX] = {0};
static struct name_to_index usecase_name_index[AUDIO_USECASE_MAX] = {
    {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_DEEP_BUFFER)},
    {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_WITH_HAPTICS)},
    {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_HAPTICS)},
    {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_LOW_LATENCY)},
    {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_HIFI)},
    {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_TTS)},
@@ -4442,11 +4445,6 @@ int platform_get_pcm_device_id(audio_usecase_t usecase, int device_type)
    return device_id;
}

int platform_get_haptics_pcm_device_id()
{
    return HAPTICS_PCM_DEVICE;
}

uint64_t getQtime()
{
    uint64_t qTimerCount = 0;
+0 −1
Original line number Diff line number Diff line
@@ -381,7 +381,6 @@ int platform_get_active_microphones(void *platform, unsigned int channels,

int platform_get_license_by_product(void *platform, const char* product_name, int *product_id, char* product_license);
bool platform_get_eccarstate(void *platform);
int platform_get_haptics_pcm_device_id();
int platform_set_qtime(void *platform, int audio_pcm_device_id,
                       int haptic_pcm_device_id);
int platform_get_delay(void *platform, int pcm_device_id);