Martin L Roth has submitted this change. ( https://review.coreboot.org/c/coreboot/+/76925?usp=email )
Change subject: mb/google/brya/var/skolas: add nau8318 speaker support ......................................................................
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 --- M src/mainboard/google/brya/Kconfig.name M src/mainboard/google/brya/variants/brya0/fw_config.c M src/mainboard/google/brya/variants/brya0/overridetree.cb M src/mainboard/google/brya/variants/skolas/fw_config.c M src/mainboard/google/brya/variants/skolas/overridetree.cb 5 files changed, 41 insertions(+), 2 deletions(-)
Approvals: Eric Lai: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/mainboard/google/brya/Kconfig.name b/src/mainboard/google/brya/Kconfig.name index 8d1600b..f0accf1 100644 --- a/src/mainboard/google/brya/Kconfig.name +++ b/src/mainboard/google/brya/Kconfig.name @@ -59,6 +59,7 @@ 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 @@ 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 c2b963f..9ff3481 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 @@ 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 @@ 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 1884269..20d43ca 100644 --- a/src/mainboard/google/brya/variants/brya0/overridetree.cb +++ b/src/mainboard/google/brya/variants/brya0/overridetree.cb @@ -18,6 +18,8 @@ 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 @@ 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 @@ 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 c2b963f..9ff3481 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 @@ 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 @@ 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 0f6cb86..70b0005 100644 --- a/src/mainboard/google/brya/variants/skolas/overridetree.cb +++ b/src/mainboard/google/brya/variants/skolas/overridetree.cb @@ -18,6 +18,7 @@ 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 @@ 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 @@ 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