mb/google/brya/var/orisa: Update Type C DisplayPort HPD Configuration
[coreboot2.git] / src / mainboard / google / brya / variants / taeko4es / fw_config.c
blob5068f84581fcf4c806cc255555ec0d2d7caf18e4
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <bootstate.h>
4 #include <console/console.h>
5 #include <fw_config.h>
6 #include <gpio.h>
8 static const struct pad_config dmic_enable_pads[] = {
9 PAD_CFG_NF(GPP_S2, NONE, DEEP, NF2), /* DMIC_CLK0_R */
10 PAD_CFG_NF(GPP_S3, NONE, DEEP, NF2), /* DMIC_DATA0_R */
14 static const struct pad_config dmic_disable_pads[] = {
15 PAD_NC(GPP_S2, NONE),
16 PAD_NC(GPP_S3, NONE),
19 static const struct pad_config i2s_enable_pads[] = {
20 PAD_CFG_NF(GPP_R0, NONE, DEEP, NF2), /* I2S_HP_SCLK_R */
21 PAD_CFG_NF(GPP_R1, NONE, DEEP, NF2), /* I2S_HP_SFRM_R */
22 PAD_CFG_NF(GPP_R2, DN_20K, DEEP, NF2), /* I2S_PCH_TX_HP_RX_STRAP */
23 PAD_CFG_NF(GPP_R3, NONE, DEEP, NF2), /* I2S_PCH_RX_HP_TX */
24 PAD_CFG_NF(GPP_R4, NONE, DEEP, NF2), /* I2S_SPKR_SCLK_R */
25 PAD_CFG_NF(GPP_R5, NONE, DEEP, NF2), /* I2S_SPKR_SFRM_R */
26 PAD_CFG_NF(GPP_R6, NONE, DEEP, NF2), /* I2S_PCH_TX_SPKR_RX_R */
27 PAD_NC(GPP_R7, NONE), /* I2S_PCH_RX_SPKR_TX */
30 static const struct pad_config i2s_disable_pads[] = {
31 PAD_NC(GPP_R0, NONE),
32 PAD_NC(GPP_R1, NONE),
33 PAD_NC(GPP_R2, NONE),
34 PAD_NC(GPP_R3, NONE),
35 PAD_NC(GPP_R4, NONE),
36 PAD_NC(GPP_R5, NONE),
37 PAD_NC(GPP_R6, NONE),
38 PAD_NC(GPP_R7, NONE),
41 static void fw_config_handle(void *unused)
43 if (!fw_config_is_provisioned() || fw_config_probe(FW_CONFIG(AUDIO, AUDIO_UNKNOWN))) {
44 printk(BIOS_INFO, "Disable audio related GPIO pins.\n");
45 gpio_configure_pads(i2s_disable_pads, ARRAY_SIZE(i2s_disable_pads));
46 gpio_configure_pads(dmic_disable_pads, ARRAY_SIZE(dmic_disable_pads));
47 return;
50 if (fw_config_probe(FW_CONFIG(AUDIO, AUDIO_MAX98357_ALC5682I_I2S))) {
51 printk(BIOS_INFO, "Configure audio over I2S with MAX98357 ALC5682I.\n");
52 gpio_configure_pads(dmic_enable_pads, ARRAY_SIZE(dmic_enable_pads));
53 gpio_configure_pads(i2s_enable_pads, ARRAY_SIZE(i2s_enable_pads));
56 if (fw_config_probe(FW_CONFIG(AUDIO, AUDIO_MAX98357_ALC5682I_VS_I2S))) {
57 printk(BIOS_INFO, "Configure audio over I2S with MAX98357 ALC5682I-VS.\n");
58 gpio_configure_pads(dmic_enable_pads, ARRAY_SIZE(dmic_enable_pads));
59 gpio_configure_pads(i2s_enable_pads, ARRAY_SIZE(i2s_enable_pads));
62 BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);