aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnil Kumar <anil.kumar.k@intel.corp-partner.google.com>2023-08-09 11:20:14 -0700
committerJakub Czapiga <jacz@semihalf.com>2023-08-28 12:16:34 +0000
commit9acaa2b7fc0cd4331b9ce67d58cef51c758b6aa3 (patch)
tree9d443f5061949a984f547a267f922fdc3dc34764
parent7865ce89ffb583d82d6a76f7a4299178af10e6ac (diff)
mb/google/rex/var/rex0: Enable BT offload audio for Intel MtP2 module
Enable the required GPIO and FW_CONFIG support to configure BT offload audio in discrete mode for Intel Mysty Peak module on google/rex Proto2 HW. BUG=b:297125514 Test=Verified BT audio playback on google/rex Proto2. Change-Id: I560f1700f78f8b653dfcc2f26764f0ebf2652689 Signed-off-by: Anil Kumar <anil.kumar.k@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77357 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
-rw-r--r--src/mainboard/google/rex/variants/rex0/fw_config.c16
-rw-r--r--src/mainboard/google/rex/variants/rex0/overridetree.cb3
-rw-r--r--src/mainboard/google/rex/variants/rex0/variant.c3
3 files changed, 21 insertions, 1 deletions
diff --git a/src/mainboard/google/rex/variants/rex0/fw_config.c b/src/mainboard/google/rex/variants/rex0/fw_config.c
index 417bc39f33..ce5fe8d03c 100644
--- a/src/mainboard/google/rex/variants/rex0/fw_config.c
+++ b/src/mainboard/google/rex/variants/rex0/fw_config.c
@@ -53,6 +53,17 @@ static const struct pad_config bt_i2s_enable_pads[] = {
PAD_CFG_NF(GPP_VGPIO37, NONE, DEEP, NF1),
};
+static const struct pad_config discrete_bt_i2s_enable_pads[] = {
+ /* GPP_S00 : [] ==> I2S1_SCLK */
+ PAD_CFG_NF(GPP_S00, NONE, DEEP, NF6),
+ /* GPP_S01 : [] ==> I2S1_SFRM */
+ PAD_CFG_NF(GPP_S01, NONE, DEEP, NF6),
+ /* GPP_S02 : [] ==> I2S1_TXD */
+ PAD_CFG_NF(GPP_S02, NONE, DEEP, NF6),
+ /* GPP_S03 : [] ==> I2S1_RXD */
+ PAD_CFG_NF(GPP_S03, NONE, DEEP, NF6),
+};
+
static const struct pad_config bt_i2s_disable_pads[] = {
/* GPP_V30 : [] ==> BT_I2S_BCLK */
PAD_NC(GPP_VGPIO30, NONE),
@@ -131,6 +142,11 @@ void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
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);
+ } else if (fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_DISCRETE_I2S_BT))) {
+ 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(discrete).\n");
+ GPIO_PADBASED_OVERRIDE(padbased_table, discrete_bt_i2s_enable_pads);
}
if (fw_config_probe(FW_CONFIG(ISH, ISH_ENABLE))) {
diff --git a/src/mainboard/google/rex/variants/rex0/overridetree.cb b/src/mainboard/google/rex/variants/rex0/overridetree.cb
index 5c7958a72f..c08ff2b493 100644
--- a/src/mainboard/google/rex/variants/rex0/overridetree.cb
+++ b/src/mainboard/google/rex/variants/rex0/overridetree.cb
@@ -3,6 +3,7 @@ fw_config
option AUDIO_UNKNOWN 0
option MAX98360_ALC5682I_I2S 1
option MAX98363_CS42L42_SNDW 2
+ option MAX98360_ALC5682I_DISCRETE_I2S_BT 3
end
field CELLULAR 4 5
option CELLULAR_ABSENT 0
@@ -462,6 +463,7 @@ chip soc/intel/meteorlake
register "property_list[0].integer" = "1"
device i2c 1a on
probe AUDIO MAX98360_ALC5682I_I2S
+ probe AUDIO MAX98360_ALC5682I_DISCRETE_I2S_BT
end
end
chip drivers/intel/mipi_camera
@@ -808,6 +810,7 @@ chip soc/intel/meteorlake
register "sdmode_delay" = "5"
device generic 0 on
probe AUDIO MAX98360_ALC5682I_I2S
+ probe AUDIO MAX98360_ALC5682I_DISCRETE_I2S_BT
end
end
chip drivers/intel/soundwire
diff --git a/src/mainboard/google/rex/variants/rex0/variant.c b/src/mainboard/google/rex/variants/rex0/variant.c
index 2441f96cfd..a7e26e69e5 100644
--- a/src/mainboard/google/rex/variants/rex0/variant.c
+++ b/src/mainboard/google/rex/variants/rex0/variant.c
@@ -29,7 +29,8 @@ void variant_generate_s0ix_hook(enum s0ix_entry entry)
void variant_update_soc_chip_config(struct soc_intel_meteorlake_config *config)
{
if (fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_I2S)) ||
- fw_config_probe(FW_CONFIG(AUDIO, MAX98363_CS42L42_SNDW))) {
+ fw_config_probe(FW_CONFIG(AUDIO, MAX98363_CS42L42_SNDW)) ||
+ fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_DISCRETE_I2S_BT))) {
config->cnvi_bt_audio_offload = true;
}