mb/google/brya/var/skolas: add nau8318 speaker support

Add variant of NAU8318(SPK) + NAU88L25B(Headphone) audio support
on brya and skolas board.
In fw_config settings, reuse max98360_enable_pads[] due to
identical i2s configurations as nau8318.
In addition, separated GPP_R7 as SPK_BEEP_EN pin.

BUG=b:236561637
TEST=emerge-brya coreboot
BRANCH=none

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Suggested-by: David Lin <CTLIN0@nuvoton.com>
Signed-off-by: AlanKY Lee <alanky_lee@compal.corp-partner.google.com>

Change-Id: Ife47a83fca902cf63e09d11206e9d99fac0dc9a1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76925
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
This commit is contained in:
Mac Chiang 2023-06-20 04:30:40 -04:00 committed by Martin L Roth
parent 96f7bd1318
commit eefdfb5c17
5 changed files with 41 additions and 2 deletions

View file

@ -59,6 +59,7 @@ config BOARD_GOOGLE_BRYA0
select SOC_INTEL_COMMON_BLOCK_IPU
select SOC_INTEL_CRASHLOG
select SOC_INTEL_RAPTORLAKE
select DRIVERS_GENERIC_NAU8315
config BOARD_GOOGLE_CRAASK
bool "-> Craask"
@ -320,6 +321,7 @@ config BOARD_GOOGLE_SKOLAS
select INTEL_GMA_HAVE_VBT
select SOC_INTEL_COMMON_BLOCK_IPU
select SOC_INTEL_RAPTORLAKE
select DRIVERS_GENERIC_NAU8315
config BOARD_GOOGLE_SKOLAS4ES
bool "-> Skolas4ES"

View file

@ -39,6 +39,10 @@ static const struct pad_config max98360_enable_pads[] = {
PAD_NC(GPP_R7, NONE),
};
static const struct pad_config nau8318_enable_pads[] = {
PAD_CFG_GPO(GPP_R7, 0, DEEP), /* SPK_BEEP_EN */
};
static const struct pad_config sndw_disable_pads[] = {
PAD_NC(GPP_S0, NONE),
PAD_NC(GPP_S1, NONE),
@ -140,12 +144,16 @@ static void fw_config_handle(void *unused)
enable_i2s();
}
if (fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_I2S))) {
if (fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_I2S)) ||
fw_config_probe(FW_CONFIG(AUDIO, NAU8318_NAU88L25B_I2S))) {
printk(BIOS_INFO, "Configure audio over I2S with MAX98360 ALC5682I.\n");
gpio_configure_pads(max98360_enable_pads, ARRAY_SIZE(max98360_enable_pads));
printk(BIOS_INFO, "BT offload enabled\n");
gpio_configure_pads(i2s0_enable_pads, ARRAY_SIZE(i2s0_enable_pads));
gpio_configure_pads(bt_i2s_enable_pads, ARRAY_SIZE(bt_i2s_enable_pads));
if (fw_config_probe(FW_CONFIG(AUDIO, NAU8318_NAU88L25B_I2S)))
gpio_configure_pads(nau8318_enable_pads, ARRAY_SIZE(nau8318_enable_pads));
}
}
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);

View file

@ -18,6 +18,8 @@ fw_config
option MAX98373_NAU88L25B_I2S 3
option ALC1019_NAU88L25B_I2S 4
option MAX98360_ALC5682I_I2S 5
option NAU8318_NAU88L25B_I2S 6
end
field DB_LTE 11 12
option LTE_ABSENT 0
@ -521,6 +523,7 @@ chip soc/intel/alderlake
register "jack_eject_debounce" = "7" # 512ms
device i2c 1a on
probe AUDIO ALC1019_NAU88L25B_I2S
probe AUDIO NAU8318_NAU88L25B_I2S
end
end
chip drivers/generic/alc1015
@ -966,6 +969,14 @@ chip soc/intel/alderlake
end
end
end
chip drivers/generic/nau8315
register "hid" = "NAU8318"
register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_A11)"
device generic 0 on
probe AUDIO NAU8318_NAU88L25B_I2S
end
end
end
device ref gspi1 on
chip drivers/spi/acpi

View file

@ -39,6 +39,10 @@ static const struct pad_config max98360_enable_pads[] = {
PAD_NC(GPP_R7, NONE),
};
static const struct pad_config nau8318_enable_pads[] = {
PAD_CFG_GPO(GPP_R7, 0, DEEP), /* SPK_BEEP_EN */
};
static const struct pad_config sndw_disable_pads[] = {
PAD_NC(GPP_S0, NONE),
PAD_NC(GPP_S1, NONE),
@ -140,12 +144,16 @@ static void fw_config_handle(void *unused)
enable_i2s();
}
if (fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_I2S))) {
if (fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_I2S)) ||
fw_config_probe(FW_CONFIG(AUDIO, NAU8318_NAU88L25B_I2S))) {
printk(BIOS_INFO, "Configure audio over I2S with MAX98360 ALC5682I.\n");
gpio_configure_pads(max98360_enable_pads, ARRAY_SIZE(max98360_enable_pads));
printk(BIOS_INFO, "BT offload enabled\n");
gpio_configure_pads(i2s0_enable_pads, ARRAY_SIZE(i2s0_enable_pads));
gpio_configure_pads(bt_i2s_enable_pads, ARRAY_SIZE(bt_i2s_enable_pads));
if (fw_config_probe(FW_CONFIG(AUDIO, NAU8318_NAU88L25B_I2S)))
gpio_configure_pads(nau8318_enable_pads, ARRAY_SIZE(nau8318_enable_pads));
}
}
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);

View file

@ -18,6 +18,7 @@ fw_config
option MAX98373_NAU88L25B_I2S 3
option ALC1019_NAU88L25B_I2S 4
option MAX98360_ALC5682I_I2S 5
option NAU8318_NAU88L25B_I2S 6
end
field DB_LTE 11 12
option LTE_ABSENT 0
@ -521,6 +522,7 @@ chip soc/intel/alderlake
register "jack_eject_debounce" = "7" # 512ms
device i2c 1a on
probe AUDIO ALC1019_NAU88L25B_I2S
probe AUDIO NAU8318_NAU88L25B_I2S
end
end
chip drivers/generic/alc1015
@ -966,6 +968,14 @@ chip soc/intel/alderlake
end
end
end
chip drivers/generic/nau8315
register "hid" = "NAU8318"
register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_A11)"
device generic 0 on
probe AUDIO NAU8318_NAU88L25B_I2S
end
end
end
device ref gspi1 on
chip drivers/spi/acpi