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

Commit 5ef96fa8 authored by Neema Shetty's avatar Neema Shetty
Browse files

hal: Add WCD9330 based soundcard for wearables

Sound card for WCD9330 and its corresponding mixer controls path
is added on wearables platform.

CRs-fixed: 853822
Change-Id: If06ad3aaf8ca317d4540d880e4cd213f65e076ab
parent 8d849ba6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013, 2015 The Linux Foundation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
@@ -216,7 +216,8 @@ static void update_hardware_info_8610(struct hardware_info *hw_info, const char

static void update_hardware_info_8226(struct hardware_info *hw_info, const char *snd_card_name)
{
    if (!strcmp(snd_card_name, "msm8226-tapan-snd-card")) {
    if ((!strcmp(snd_card_name, "msm8226-tapan-snd-card")) ||
        (!strcmp(snd_card_name, "msm8226-tomtom-snd-card"))) {
        strlcpy(hw_info->type, "", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8226", sizeof(hw_info->name));
        hw_info->snd_devices = NULL;
+10 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2013 The Android Open Source Project
@@ -41,6 +41,7 @@

#define MIXER_XML_PATH "/system/etc/mixer_paths.xml"
#define MIXER_XML_PATH_AUXPCM "/system/etc/mixer_paths_auxpcm.xml"
#define MIXER_XML_PATH_WCD9330 "/system/etc/mixer_paths_wcd9330.xml"
#define LIB_ACDB_LOADER "libacdbloader.so"
#define AUDIO_DATA_BLOCK_MIXER_CTL "HDMI EDID"

@@ -590,13 +591,19 @@ void *platform_init(struct audio_device *adev)
        }

        snd_card_name = mixer_get_name(adev->mixer);
        ALOGV("%s: snd_card_name: %s", __func__, snd_card_name);
        ALOGD("%s: snd_card_name: %s", __func__, snd_card_name);

        my_data->hw_info = hw_info_init(snd_card_name);
        if (!my_data->hw_info) {
            ALOGE("%s: Failed to init hardware info", __func__);
        } else {
            if (audio_extn_read_xml(adev, snd_card_num, MIXER_XML_PATH,
            if (!strncmp(snd_card_name, "msm8226-tomtom-snd-card",
                         sizeof("msm8226-tomtom-snd-card"))) {
                ALOGE("%s: Call MIXER_XML_PATH_WCD9330", __func__);

                adev->audio_route = audio_route_init(snd_card_num,
                                                     MIXER_XML_PATH_WCD9330);
            } else if (audio_extn_read_xml(adev, snd_card_num, MIXER_XML_PATH,
                                    MIXER_XML_PATH_AUXPCM) == -ENOSYS)
                adev->audio_route = audio_route_init(snd_card_num,
                                                 MIXER_XML_PATH);