hal: bengal bringup changes to add sound card

Add support for bengal sound card in HAL.

Change-Id: I5d639b38851ed024704e9560f44fb5534a3d0c6b
This commit is contained in:
Harshal Ahire 2019-10-22 11:37:12 +05:30
parent e9023e2acf
commit 4637415fe2
3 changed files with 19 additions and 4 deletions

View File

@ -225,6 +225,7 @@ static int enum_sndcards()
(strncasecmp(card_id, "sa", 2) != 0) &&
(strncasecmp(card_id, "kona", 4) != 0) &&
(strncasecmp(card_id, "atoll", 5) != 0) &&
(strncasecmp(card_id, "bengal", 6) != 0) &&
(strncasecmp(card_id, "lito", 4) != 0)) {
ALOGW("Skip over non-ADSP snd card %s", card_id);
continue;

View File

@ -520,7 +520,11 @@ static void update_hardware_info_kona(
struct hardware_info *hw_info,
const char *snd_card_name)
{
if (!strncmp(snd_card_name, "kona-mtp-snd-card",
if (!strncmp(snd_card_name, "bengal-idp-snd-card",
sizeof("bengal-idp-snd-card"))) {
strlcpy(hw_info->name, "bengal", sizeof(hw_info->name));
hw_info->is_stereo_spkr = false;
} else if (!strncmp(snd_card_name, "kona-mtp-snd-card",
sizeof("kona-mtp-snd-card"))) {
strlcpy(hw_info->name, "kona", sizeof(hw_info->name));
} else if (!strncmp(snd_card_name, "lito-mtp-snd-card",
@ -822,7 +826,7 @@ void *hw_info_init(const char *snd_card_name)
ALOGV("SDA845 - variant soundcard");
update_hardware_info_sda845(hw_info, snd_card_name);
} else if (strstr(snd_card_name, "kona") || strstr(snd_card_name, "lito")
|| strstr(snd_card_name, "atoll")) {
|| 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, "sdm439")) {

View File

@ -1702,7 +1702,9 @@ static void update_codec_type_and_interface(struct platform_data * my_data,
!strncmp(snd_card_name, "atoll-idp-snd-card",
sizeof("atoll-idp-snd-card")) ||
!strncmp(snd_card_name, "atoll-qrd-snd-card",
sizeof("atoll-qrd-snd-card"))) {
sizeof("atoll-qrd-snd-card")) ||
!strncmp(snd_card_name, "bengal-idp-snd-card",
sizeof("bengal-idp-snd-card"))) {
ALOGI("%s: snd_card_name: %s",__func__,snd_card_name);
my_data->is_internal_codec = true;
my_data->is_slimbus_interface = false;
@ -3525,7 +3527,8 @@ acdb_init_fail:
!strncmp(snd_card_name, "kona", strlen("kona")) ||
!strncmp(snd_card_name, "lito", strlen("lito")) ||
!strncmp(snd_card_name, "atoll", strlen("atoll")) ||
!strncmp(snd_card_name, "trinket", strlen("trinket"))) {
!strncmp(snd_card_name, "trinket", strlen("trinket"))||
!strncmp(snd_card_name, "bengal", strlen("bengal"))) {
my_data->current_backend_cfg[DEFAULT_CODEC_BACKEND].bitwidth_mixer_ctl =
strdup("WSA_CDC_DMA_RX_0 Format");
my_data->current_backend_cfg[DEFAULT_CODEC_BACKEND].samplerate_mixer_ctl =
@ -3553,6 +3556,13 @@ acdb_init_fail:
if (default_rx_backend)
free(default_rx_backend);
default_rx_backend = strdup("WSA_CDC_DMA_RX_0");
if(!strncmp(snd_card_name, "bengal", strlen("bengal"))) {
my_data->current_backend_cfg[DEFAULT_CODEC_BACKEND].bitwidth_mixer_ctl =
strdup("RX_CDC_DMA_RX_1 Format");
my_data->current_backend_cfg[DEFAULT_CODEC_BACKEND].samplerate_mixer_ctl =
strdup("RX_CDC_DMA_RX_1 SampleRate");
default_rx_backend = strdup("RX_CDC_DMA_RX_1");
}
} else if (!strncmp(snd_card_name, "sdm660", strlen("sdm660")) ||
!strncmp(snd_card_name, "sdm670", strlen("sdm670")) ||
!strncmp(snd_card_name, "qcs605", strlen("qcs605"))) {