From 03b184e1074b7ce369cbbb030f70b4cb89fdfd39 Mon Sep 17 00:00:00 2001 From: Aalique Grahame Date: Fri, 7 Feb 2020 23:24:57 -0800 Subject: [PATCH] hal: init hw info for lahaina Add case for lahaina target when initializing hw info CRs-Fixed: 2619253 Change-Id: I634049ff1fce9973846fe2d19dae9c973e8cfaee --- hal/msm8974/hw_info.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/hal/msm8974/hw_info.c b/hal/msm8974/hw_info.c index bcc5a583..9423a39f 100644 --- a/hal/msm8974/hw_info.c +++ b/hal/msm8974/hw_info.c @@ -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 * 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) { 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")) { ALOGV("KONA - variant soundcard"); 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")) { ALOGV("SDM439 - variant soundcard"); update_hardware_info_sdm439(hw_info, snd_card_name);