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

Commit c964fa34 authored by Xiaoyu Ye's avatar Xiaoyu Ye Committed by Gerrit - the friendly Code Review server
Browse files

hal: Add support for speaker variant of SDM845 QRD

Identify SDM845 QRD device to select QRD specific speaker variant.

Change-Id: Ib6cf8e878a6319f224ebcb848806524d0b32f6d9
parent 3fcdcef2
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -210,6 +210,10 @@ static const snd_device_t tasha_liquid_variant_devices[] = {
    SND_DEVICE_IN_SPEAKER_STEREO_DMIC,
};

static const snd_device_t tavil_qrd_variant_devices[] = {
    SND_DEVICE_OUT_SPEAKER
};

static void  update_hardware_info_8084(struct hardware_info *hw_info, const char *snd_card_name)
{
    if (!strcmp(snd_card_name, "apq8084-taiko-mtp-snd-card") ||
@@ -366,10 +370,19 @@ static void update_hardware_info_msm8998(struct hardware_info *hw_info, const c
    }
}

static void  update_hardware_info_sdm845(struct hardware_info *hw_info __unused, const char *snd_card_name __unused)
static void  update_hardware_info_sdm845(struct hardware_info *hw_info, const char *snd_card_name)
{
    if (!strcmp(snd_card_name, "sdm845-tavil-qrd-snd-card")) {
        strlcpy(hw_info->type, " qrd", sizeof(hw_info->type));
        strlcpy(hw_info->name, "sdm845", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *)tavil_qrd_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(tavil_qrd_variant_devices);
        hw_info->is_stereo_spkr = false;
        strlcpy(hw_info->dev_extn, "-qrd", sizeof(hw_info->dev_extn));
    } else {
        ALOGW("%s: Not a sdm845 device", __func__);
    }
}

static void  update_hardware_info_8974(struct hardware_info *hw_info, const char *snd_card_name)
{