diff options
author | Mac Chiang <mac.chiang@intel.com> | 2023-06-20 04:30:40 -0400 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2023-09-02 16:14:34 +0000 |
commit | eefdfb5c179cb42556d4f82b9f56eb08f1dd0700 (patch) | |
tree | 98648eb4644dd1ae151304f10d052ab1cac6c619 | |
parent | 96f7bd13180f284ae0dd700f3bd73a6b61139846 (diff) |
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>
5 files changed, 41 insertions, 2 deletions
diff --git a/src/mainboard/google/brya/Kconfig.name b/src/mainboard/google/brya/Kconfig.name index 8d1600bbe2..f0accf1e35 100644 --- a/src/mainboard/google/brya/Kconfig.name +++ b/src/mainboard/google/brya/Kconfig.name @@ -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" diff --git a/src/mainboard/google/brya/variants/brya0/fw_config.c b/src/mainboard/google/brya/variants/brya0/fw_config.c index c2b963fe22..9ff34818b1 100644 --- a/src/mainboard/google/brya/variants/brya0/fw_config.c +++ b/src/mainboard/google/brya/variants/brya0/fw_config.c @@ -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); diff --git a/src/mainboard/google/brya/variants/brya0/overridetree.cb b/src/mainboard/google/brya/variants/brya0/overridetree.cb index 1884269ad9..20d43ca9a5 100644 --- a/src/mainboard/google/brya/variants/brya0/overridetree.cb +++ b/src/mainboard/google/brya/variants/brya0/overridetree.cb @@ -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 diff --git a/src/mainboard/google/brya/variants/skolas/fw_config.c b/src/mainboard/google/brya/variants/skolas/fw_config.c index c2b963fe22..9ff34818b1 100644 --- a/src/mainboard/google/brya/variants/skolas/fw_config.c +++ b/src/mainboard/google/brya/variants/skolas/fw_config.c @@ -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); diff --git a/src/mainboard/google/brya/variants/skolas/overridetree.cb b/src/mainboard/google/brya/variants/skolas/overridetree.cb index 0f6cb866fa..70b00058a5 100644 --- a/src/mainboard/google/brya/variants/skolas/overridetree.cb +++ b/src/mainboard/google/brya/variants/skolas/overridetree.cb @@ -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 |