From 5f168e9441d5b52ababb9035cfc661f24d7ddf8f Mon Sep 17 00:00:00 2001 From: Avi Uday Date: Mon, 25 Aug 2025 14:26:09 +0530 Subject: [PATCH] mb/google/ocelot/var/ocelot: Conditionally init ALC256 HDA using fw_config This commit implements `mainboard_is_hda_codec_enabled()` for the Google Ocelot mainboard variant. This overrides the default weak HDA common initialization. Change-Id: I11f9d8ae00d1a3d7f03e068aa3980ecd98a47ecd Signed-off-by: Avi Uday Reviewed-on: https://review.coreboot.org/c/coreboot/+/88933 Reviewed-by: Pranava Y N Reviewed-by: Paul Menzel Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) --- .../google/ocelot/variants/ocelot/variant.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/mainboard/google/ocelot/variants/ocelot/variant.c b/src/mainboard/google/ocelot/variants/ocelot/variant.c index cb3908277e..5765b29c4a 100644 --- a/src/mainboard/google/ocelot/variants/ocelot/variant.c +++ b/src/mainboard/google/ocelot/variants/ocelot/variant.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -71,3 +72,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; +}