hal: init hw info for lahaina

Add case for lahaina target when initializing hw info

CRs-Fixed: 2619253
Change-Id: I634049ff1fce9973846fe2d19dae9c973e8cfaee
This commit is contained in:
Aalique Grahame 2020-02-07 23:24:57 -08:00
parent 0dd5924d75
commit 03b184e107
1 changed files with 20 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -553,6 +553,22 @@ static void update_hardware_info_kona(
} }
} }
static void update_hardware_info_lahaina(
struct hardware_info *hw_info,
const char *snd_card_name)
{
if (!strncmp(snd_card_name, "lahaina-mtp-snd-card",
sizeof("lahaina-mtp-snd-card"))) {
strlcpy(hw_info->name, "lahaina", sizeof(hw_info->name));
} else if (!strncmp(snd_card_name, "lahaina-qrd-snd-card",
sizeof("lahaina-qrd-snd-card"))) {
strlcpy(hw_info->name, "lahaina", sizeof(hw_info->name));
hw_info->is_stereo_spkr = true;
} else {
ALOGW("%s: Not a lahaina device", __func__);
}
}
static void update_hardware_info_sda845(struct hardware_info *hw_info, const char *snd_card_name) static void update_hardware_info_sda845(struct hardware_info *hw_info, const char *snd_card_name)
{ {
if (!strncmp(snd_card_name, "sda845-tavil-i2s-snd-card", sizeof("sda845-tavil-i2s-snd-card"))) { if (!strncmp(snd_card_name, "sda845-tavil-i2s-snd-card", sizeof("sda845-tavil-i2s-snd-card"))) {
@ -829,6 +845,9 @@ void *hw_info_init(const char *snd_card_name)
|| strstr(snd_card_name, "atoll") || strstr(snd_card_name, "bengal")) { || strstr(snd_card_name, "atoll") || strstr(snd_card_name, "bengal")) {
ALOGV("KONA - variant soundcard"); ALOGV("KONA - variant soundcard");
update_hardware_info_kona(hw_info, snd_card_name); update_hardware_info_kona(hw_info, snd_card_name);
} else if(strstr(snd_card_name, "lahaina")) {
ALOGV("LAHAINA - variant soundcard");
update_hardware_info_lahaina(hw_info, snd_card_name);
} else if(strstr(snd_card_name, "sdm439")) { } else if(strstr(snd_card_name, "sdm439")) {
ALOGV("SDM439 - variant soundcard"); ALOGV("SDM439 - variant soundcard");
update_hardware_info_sdm439(hw_info, snd_card_name); update_hardware_info_sdm439(hw_info, snd_card_name);