Karthik Ramasubramanian has submitted this change. ( https://review.coreboot.org/c/coreboot/+/56795 )
Change subject: mb/google/dedede/var/cappy2: Add fw_config probe for multi audio codec ......................................................................
mb/google/dedede/var/cappy2: Add fw_config probe for multi audio codec
Compatible headphone codec "Realtek ALC5682I-VD" and "cirrus CS42L42" Compatible AMP codec "ALC1015Q-VB" and "MAX98360"
BUG=b:193373320 BRANCH=dedede TEST=Both realtek and cirrus audio codec can work normally
Signed-off-by: Sunwei Li lisunwei@huaqin.corp-partner.google.com Change-Id: I9121e75eaf46b43e6dc5ef2e31029a153c7a807d Reviewed-on: https://review.coreboot.org/c/coreboot/+/56795 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Weimin Wu wuweimin@huaqin.corp-partner.google.com Reviewed-by: Karthik Ramasubramanian kramasub@google.com Reviewed-by: Paul Fagerburg pfagerburg@chromium.org --- M src/mainboard/google/dedede/Kconfig M src/mainboard/google/dedede/variants/cappy2/gpio.c M src/mainboard/google/dedede/variants/cappy2/overridetree.cb 3 files changed, 63 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Karthik Ramasubramanian: Looks good to me, approved Paul Fagerburg: Looks good to me, approved Weimin Wu: Looks good to me, but someone else must approve
diff --git a/src/mainboard/google/dedede/Kconfig b/src/mainboard/google/dedede/Kconfig index 9437ddc..aa72c32 100644 --- a/src/mainboard/google/dedede/Kconfig +++ b/src/mainboard/google/dedede/Kconfig @@ -30,6 +30,7 @@ select DRIVERS_INTEL_MIPI_CAMERA select SOC_INTEL_COMMON_BLOCK_IPU select DRIVERS_GENERIC_ALC1015 + select DRIVERS_GENERIC_MAX98357A select SPI_FLASH_SMM
config BOARD_GOOGLE_BASEBOARD_DEDEDE_CR50 diff --git a/src/mainboard/google/dedede/variants/cappy2/gpio.c b/src/mainboard/google/dedede/variants/cappy2/gpio.c index 3ac420c..87f5e46 100644 --- a/src/mainboard/google/dedede/variants/cappy2/gpio.c +++ b/src/mainboard/google/dedede/variants/cappy2/gpio.c @@ -2,11 +2,15 @@
#include <baseboard/gpio.h> #include <baseboard/variants.h> +#include <bootstate.h> +#include <fw_config.h>
/* Pad configuration in ramstage */ static const struct pad_config gpio_table[] = { /* D15 : EN_PP3300_CAMERA */ PAD_CFG_GPO(GPP_D15, 1, PLTRST), + /* H16 : AP_SUB_IO_L ==> HP_RST_ODL */ + PAD_CFG_GPO(GPP_H16, 1, PWROK), };
const struct pad_config *variant_override_gpio_table(size_t *num) @@ -14,3 +18,21 @@ *num = ARRAY_SIZE(gpio_table); return gpio_table; } + +static const struct pad_config codec_rt5682_pads[] = { + PAD_NC(GPP_H16, NONE), +}; + +static const struct pad_config codec_cs42l42_pads[] = { + PAD_NC(GPP_D18, NONE), +}; + +static void fw_config_handle(void *unused) +{ + if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE, AUDIO_CODEC_ALC5682))) + gpio_configure_pads(codec_rt5682_pads, ARRAY_SIZE(codec_rt5682_pads)); + if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE, AUDIO_CODEC_CS42l42))) + gpio_configure_pads(codec_cs42l42_pads, ARRAY_SIZE(codec_cs42l42_pads)); +} + +BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); diff --git a/src/mainboard/google/dedede/variants/cappy2/overridetree.cb b/src/mainboard/google/dedede/variants/cappy2/overridetree.cb index 41d1660..2635b34 100644 --- a/src/mainboard/google/dedede/variants/cappy2/overridetree.cb +++ b/src/mainboard/google/dedede/variants/cappy2/overridetree.cb @@ -1,3 +1,11 @@ +fw_config + field AUDIO_CODEC_SOURCE 41 43 + option AUDIO_CODEC_UNPROVISIONED 0 + option AUDIO_CODEC_ALC5682 1 + option AUDIO_CODEC_CS42l42 2 + end +end + chip soc/intel/jasperlake
# Intel Common SoC Config @@ -95,8 +103,29 @@ register "property_list[0].type" = "ACPI_DP_TYPE_INTEGER" register "property_list[0].name" = ""realtek,jd-src"" register "property_list[0].integer" = "1" - device i2c 1a on end + device i2c 1a on + probe AUDIO_CODEC_SOURCE AUDIO_CODEC_UNPROVISIONED + probe AUDIO_CODEC_SOURCE AUDIO_CODEC_ALC5682 + end end + chip drivers/i2c/cs42l42 + register "irq" = "ACPI_IRQ_LEVEL_LOW(GPP_D16_IRQ)" + register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_H16)" + register "ts_inv" = "true" + register "ts_dbnc_rise" = "RISE_DEB_1000_MS" + register "ts_dbnc_fall" = "FALL_DEB_0_MS" + register "btn_det_init_dbnce" = "100" + register "btn_det_event_dbnce" = "10" + register "bias_lvls[0]" = "15" + register "bias_lvls[1]" = "8" + register "bias_lvls[2]" = "4" + register "bias_lvls[3]" = "1" + register "hs_bias_ramp_rate" = "HSBIAS_RAMP_SLOW" + register "hs_bias_sense_disable" = "true" + device i2c 48 on + probe AUDIO_CODEC_SOURCE AUDIO_CODEC_CS42l42 + end + end end #I2C 4 device pci 1f.0 on chip drivers/pc80/tpm @@ -106,7 +135,16 @@ device pci 1f.3 on chip drivers/generic/alc1015 register "sdb" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_D17)" - device generic 0 on end + device generic 0 on + probe AUDIO_AMP UNPROVISIONED + end + end + chip drivers/generic/max98357a + register "hid" = ""MX98360A"" + register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_D17)" + device generic 0 on + probe AUDIO_AMP MAX98360 + end end end # Intel HDA end