diff options
author | Ravi Sarawadi <ravishankar.sarawadi@intel.com> | 2023-02-07 09:33:46 -0800 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2023-06-15 16:13:23 +0000 |
commit | 9afa18f0e936e07c51298c0376c23f3af8aaa65e (patch) | |
tree | f5c6ff9dc32460893096cc3085fd8c8fb6bd1d8f /src/mainboard/google/rex/variants | |
parent | 6eec8beb1b23aa5076fe55d1687512c3d33d81f5 (diff) |
mb/google/rex: Enable audio BT offload
This patch enables BT offload feature on Rex over SSP1.
BT mode is selected via FW_CONFIG and corresponding VGPIOs are
programmed.
BUG=b:275538390
TEST=Verified audio playback using BT speaker/headset in I2S mode on google/rex.
Signed-off-by: Ravi Sarawadi <ravishankar.sarawadi@intel.com>
Change-Id: I46e9702add37464122ffc78826ebf8a6c5b5b07c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72881
Reviewed-by: Wonkyu Kim <wonkyu.kim@intel.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/rex/variants')
-rw-r--r-- | src/mainboard/google/rex/variants/rex0/fw_config.c | 43 | ||||
-rw-r--r-- | src/mainboard/google/rex/variants/rex0/variant.c | 6 |
2 files changed, 49 insertions, 0 deletions
diff --git a/src/mainboard/google/rex/variants/rex0/fw_config.c b/src/mainboard/google/rex/variants/rex0/fw_config.c index 7d7c901270..11014b5325 100644 --- a/src/mainboard/google/rex/variants/rex0/fw_config.c +++ b/src/mainboard/google/rex/variants/rex0/fw_config.c @@ -34,12 +34,51 @@ static const struct pad_config i2s_disable_pads[] = { PAD_NC(GPP_D17, NONE), }; +static const struct pad_config bt_i2s_enable_pads[] = { + /* GPP_V30 : [] ==> BT_I2S_BCLK */ + PAD_CFG_NF(GPP_VGPIO30, NONE, DEEP, NF2), + /* GPP_V31 : [] ==> BT_I2S_SYNC */ + PAD_CFG_NF(GPP_VGPIO31, NONE, DEEP, NF2), + /* GPP_V32 : [] ==> BT_I2S_SDO */ + PAD_CFG_NF(GPP_VGPIO32, NONE, DEEP, NF2), + /* GPP_V33 : [] ==> BT_I2S_SDI */ + PAD_CFG_NF(GPP_VGPIO33, NONE, DEEP, NF2), + /* GPP_V34 : [] ==> SSP2_SCLK */ + PAD_CFG_NF(GPP_VGPIO34, NONE, DEEP, NF1), + /* GPP_V35 : [] ==> SSP2_SFRM */ + PAD_CFG_NF(GPP_VGPIO35, NONE, DEEP, NF1), + /* GPP_V36 : [] ==> SSP_TXD */ + PAD_CFG_NF(GPP_VGPIO36, NONE, DEEP, NF1), + /* GPP_V37 : [] ==> SSP_RXD */ + PAD_CFG_NF(GPP_VGPIO37, NONE, DEEP, NF1), +}; + +static const struct pad_config bt_i2s_disable_pads[] = { + /* GPP_V30 : [] ==> BT_I2S_BCLK */ + PAD_NC(GPP_VGPIO30, NONE), + /* GPP_V31 : [] ==> BT_I2S_SYNC */ + PAD_NC(GPP_VGPIO31, NONE), + /* GPP_V32 : [] ==> BT_I2S_SDO */ + PAD_NC(GPP_VGPIO32, NONE), + /* GPP_V33 : [] ==> BT_I2S_SDI */ + PAD_NC(GPP_VGPIO33, NONE), + /* GPP_V34 : [] ==> SSP2_SCLK */ + PAD_NC(GPP_VGPIO34, NONE), + /* GPP_V35 : [] ==> SSP2_SFRM */ + PAD_NC(GPP_VGPIO35, NONE), + /* GPP_V36 : [] ==> SSP_TXD */ + PAD_NC(GPP_VGPIO36, NONE), + /* GPP_V37 : [] ==> SSP_RXD */ + PAD_NC(GPP_VGPIO37, NONE), +}; + void fw_config_gpio_padbased_override(struct pad_config *padbased_table) { if (!fw_config_is_provisioned()) { GPIO_PADBASED_OVERRIDE(padbased_table, i2s_disable_pads); GPIO_PADBASED_OVERRIDE(padbased_table, dmic_disable_pads); GPIO_PADBASED_OVERRIDE(padbased_table, sndw_disable_pads); + GPIO_PADBASED_OVERRIDE(padbased_table, bt_i2s_disable_pads); return; } @@ -48,11 +87,15 @@ void fw_config_gpio_padbased_override(struct pad_config *padbased_table) GPIO_PADBASED_OVERRIDE(padbased_table, i2s_disable_pads); GPIO_PADBASED_OVERRIDE(padbased_table, dmic_disable_pads); GPIO_PADBASED_OVERRIDE(padbased_table, sndw_disable_pads); + GPIO_PADBASED_OVERRIDE(padbased_table, bt_i2s_disable_pads); } else if (fw_config_probe(FW_CONFIG(AUDIO, MAX98363_CS42L42_SNDW))) { printk(BIOS_INFO, "Configure GPIOs for SoundWire audio.\n"); GPIO_PADBASED_OVERRIDE(padbased_table, i2s_disable_pads); + GPIO_PADBASED_OVERRIDE(padbased_table, bt_i2s_disable_pads); } else if (fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_I2S))) { printk(BIOS_INFO, "Configure GPIOs for I2S audio.\n"); GPIO_PADBASED_OVERRIDE(padbased_table, sndw_disable_pads); + printk(BIOS_INFO, "Configure GPIOs for BT offload mode.\n"); + GPIO_PADBASED_OVERRIDE(padbased_table, bt_i2s_enable_pads); } } diff --git a/src/mainboard/google/rex/variants/rex0/variant.c b/src/mainboard/google/rex/variants/rex0/variant.c index 3aec24b165..b259636d66 100644 --- a/src/mainboard/google/rex/variants/rex0/variant.c +++ b/src/mainboard/google/rex/variants/rex0/variant.c @@ -21,3 +21,9 @@ void variant_generate_s0ix_hook(enum s0ix_entry entry) acpigen_soc_set_tx_gpio(GPP_B09); } } + +void variant_update_soc_chip_config(struct soc_intel_meteorlake_config *config) +{ + config->cnvi_bt_audio_offload = fw_config_probe(FW_CONFIG(AUDIO, + MAX98360_ALC5682I_I2S)); +} |