mb/google/fatcat/var/fatcat: Conditionally init ALC256 HDA

This commit implements `mainboard_is_hda_codec_enabled()` for the
Google Fatcat mainboard variant. This overrides the default weak HDA
common initialization.

Initialization of the High Definition Audio (HDA) controller,
managed by `azalia_audio_init()` (which handles HDA verb table
loading), is now conditional. It proceeds only if the firmware
config `FW_CONFIG(AUDIO, AUDIO_ALC256_HDA)` is set. This value
(3) specifically targets the ALC256 HDA codec.

This change ensures that HDA verb tables are loaded only when the
ALC256 HDA codec is actively configured for the Fatcat variant.
Crucially, this prevents attempts to incorrectly load HDA verbs
for other audio interfaces, like SoundWire (SNDW) or I2S, which might
be present in different Fatcat hardware configurations.

The header file `intelblocks/hda.h` added for this. As a minor stylistic
update, header inclusions in this file are also alphabetized.

BUG=b:413638298
TEST=Verified HDA verb table loading is skipped on Fatcat platforms
     when configured with non-HDA audio codecs (e.g., SNDW, I2S),
     and proceeds as expected when ALC256 HDA is configured.

Change-Id: Ifc158b7d15c763cc07d28154259b7e64709bea16
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87462
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Pranava Y N <pranavayn@google.com>
This commit is contained in:
Subrata Banik 2025-04-26 23:57:09 +05:30
commit e545494f6d

View file

@ -1,12 +1,13 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <baseboard/variants.h>
#include <drivers/intel/touch/chip.h>
#include <ec/google/chromeec/ec.h>
#include <fsp/api.h>
#include <fw_config.h>
#include <intelblocks/hda.h>
#include <sar.h>
#include <soc/gpio_soc_defs.h>
#include <drivers/intel/touch/chip.h>
const char *get_wifi_sar_cbfs_filename(void)
{
@ -93,3 +94,22 @@ bool variant_is_barrel_charger_present(void)
else
return false;
}
/*
* HDA verb table loading is supported based on the firmware configuration.
*
* This function determines if the current platform has an HDA codec enabled by
* examining the `FW_CONFIG` value. Specifically, it checks if the
* `FW_CONFIG` includes the `AUDIO_ALC256_HDA` value, which is used to identify
* Fatcat SKUs with HDA codec support.
*
* Return true if the `FW_CONFIG` indicates HDA support (i.e., contains
* `AUDIO_ALC256_HDA`), false otherwise.
*/
bool mainboard_is_hda_codec_enabled(void)
{
if (fw_config_probe(FW_CONFIG(AUDIO, AUDIO_ALC256_HDA)))
return true;
return false;
}