mb/google/octopus: Enable RT5682 headset codec for BIP board

Patch adds required changes for RT5682 codec enablement for the BIP board.
And code clean-up nhlt blob selection method in config.

BUG=b:77892150
TEST=build and boot on a BIP PO board.
verify headset codec i2cdetects at address 1a.

Change-Id: Iee91518c03a0e9e6ed52bc54a60fc607730a0b7d
Signed-off-by: Naveen Manohar <naveen.m@intel.com>
Reviewed-on: https://review.coreboot.org/26211
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Naveen Manohar 2018-05-10 08:54:14 +05:30 committed by Martin Roth
parent 39130a4f1e
commit e098c8a593
5 changed files with 34 additions and 7 deletions

View File

@ -85,9 +85,9 @@ config UART_FOR_CONSOLE
default 2 default 2
config INCLUDE_NHLT_BLOBS config INCLUDE_NHLT_BLOBS
bool "Include blobs for audio." bool "Include blobs for audio"
select NHLT_DMIC_2CH_16B
select NHLT_DMIC_4CH_16B select NHLT_DMIC_4CH_16B
select NHLT_DA7219
select NHLT_MAX98357 select NHLT_MAX98357
config DRIVER_TPM_SPI_BUS config DRIVER_TPM_SPI_BUS

View File

@ -8,11 +8,14 @@ config BOARD_GOOGLE_YORP
bool "-> Yorp" bool "-> Yorp"
select BOARD_GOOGLE_BASEBOARD_OCTOPUS select BOARD_GOOGLE_BASEBOARD_OCTOPUS
select BASEBOARD_OCTOPUS_LAPTOP select BASEBOARD_OCTOPUS_LAPTOP
select NHLT_DA7219 if INCLUDE_NHLT_BLOBS
config BOARD_GOOGLE_BIP config BOARD_GOOGLE_BIP
bool "-> Bip" bool "-> Bip"
select BOARD_GOOGLE_BASEBOARD_OCTOPUS select BOARD_GOOGLE_BASEBOARD_OCTOPUS
select BASEBOARD_OCTOPUS_LAPTOP select BASEBOARD_OCTOPUS_LAPTOP
select NHLT_RT5682 if INCLUDE_NHLT_BLOBS
config BOARD_GOOGLE_PHASER config BOARD_GOOGLE_PHASER
bool "-> Phaser" bool "-> Phaser"
select BOARD_GOOGLE_BASEBOARD_OCTOPUS select BOARD_GOOGLE_BASEBOARD_OCTOPUS
select BASEBOARD_OCTOPUS_LAPTOP select BASEBOARD_OCTOPUS_LAPTOP
select NHLT_DA7219 if INCLUDE_NHLT_BLOBS

View File

@ -29,12 +29,21 @@ void __weak variant_nhlt_init(struct nhlt *nhlt)
if (!nhlt_soc_add_dmic_array(nhlt, 4)) if (!nhlt_soc_add_dmic_array(nhlt, 4))
printk(BIOS_ERR, "Added 4CH DMIC arrays.\n"); printk(BIOS_ERR, "Added 4CH DMIC arrays.\n");
/* Dialog for Headset codec. /*
* Headset codec is bi-directional but uses the same configuration * Headset codec is bi-directional but uses the same configuration
* settings for render and capture endpoints. * settings for render and capture endpoints.
*/ */
if (IS_ENABLED(CONFIG_NHLT_DA7219)) {
/* Dialog for Headset codec */
if (!nhlt_soc_add_da7219(nhlt, AUDIO_LINK_SSP2)) if (!nhlt_soc_add_da7219(nhlt, AUDIO_LINK_SSP2))
printk(BIOS_ERR, "Added Dialog_7219 codec.\n"); printk(BIOS_ERR, "Added Dialog_7219 codec.\n");
}
if (IS_ENABLED(CONFIG_NHLT_RT5682)) {
/* Realtek for Headset codec */
if (!nhlt_soc_add_rt5682(nhlt, AUDIO_LINK_SSP2))
printk(BIOS_ERR, "Added ALC5682 codec.\n");
}
/* MAXIM Smart Amps for left and right speakers. */ /* MAXIM Smart Amps for left and right speakers. */
if (!nhlt_soc_add_max98357(nhlt, AUDIO_LINK_SSP1)) if (!nhlt_soc_add_max98357(nhlt, AUDIO_LINK_SSP1))

View File

@ -142,7 +142,21 @@ chip soc/intel/apollolake
device pci 16.2 on end # - I2C 2 device pci 16.2 on end # - I2C 2
device pci 16.3 on end # - I2C 3 device pci 16.3 on end # - I2C 3
device pci 17.0 on end # - I2C 4 device pci 17.0 on end # - I2C 4
device pci 17.1 on end # - I2C 5 device pci 17.1 on
chip drivers/i2c/generic
register "hid" = ""10EC5682""
register "name" = ""RT58""
register "desc" = ""Realtek RT5682""
register "irq" = "ACPI_IRQ_LEVEL_LOW(GPIO_137_IRQ)"
register "probed" = "1"
register "property_count" = "1"
# Set the jd_src to RT5668_JD1 for jack detection
register "property_list[0].type" = "ACPI_DP_TYPE_INTEGER"
register "property_list[0].name" = ""realtek,jd-src""
register "property_list[0].integer" = "1"
device i2c 1a on end
end
end # - I2C 5
device pci 17.2 on device pci 17.2 on
chip drivers/i2c/generic chip drivers/i2c/generic
register "hid" = ""ELAN0000"" register "hid" = ""ELAN0000""

View File

@ -193,7 +193,8 @@ static const struct pad_config gpio_table[] = {
PAD_CFG_GPI(GPIO_134, NONE, DEEP),/* GPIO_134 -- SD_CD_OD */ PAD_CFG_GPI(GPIO_134, NONE, DEEP),/* GPIO_134 -- SD_CD_OD */
PAD_CFG_GPI_APIC_LOW(GPIO_135, NONE, DEEP),/* GPIO_135 -- TRACKPAD_INT1_1V8_ODL */ PAD_CFG_GPI_APIC_LOW(GPIO_135, NONE, DEEP),/* GPIO_135 -- TRACKPAD_INT1_1V8_ODL */
PAD_CFG_GPI_APIC_IOS(GPIO_136, NONE, DEEP, LEVEL, INVERT, TxDRxE, DISPUPD),/* GPIO_136 -- PMIC_PCH_INT_ODL */ PAD_CFG_GPI_APIC_IOS(GPIO_136, NONE, DEEP, LEVEL, INVERT, TxDRxE, DISPUPD),/* GPIO_136 -- PMIC_PCH_INT_ODL */
PAD_CFG_GPI_APIC_IOS(GPIO_137, NONE, DEEP, LEVEL, INVERT, HIZCRx1, DISPUPD),/* GPIO_137 -- HP_INT_ODL */ PAD_CFG_GPI_APIC_IOS(GPIO_137, NONE, DEEP, EDGE_BOTH, INVERT, HIZCRx1,
DISPUPD),/* GPIO_137 -- HP_INT_ODL */
PAD_CFG_GPI(GPIO_138, NONE, DEEP),/* GPIO_138 -- PEN_PDCT_ODL */ PAD_CFG_GPI(GPIO_138, NONE, DEEP),/* GPIO_138 -- PEN_PDCT_ODL */
PAD_CFG_GPI_APIC_IOS(GPIO_139, NONE, DEEP, LEVEL, INVERT, HIZCRx1, DISPUPD),/* GPIO_138 -- PEN_INT_ODL */ PAD_CFG_GPI_APIC_IOS(GPIO_139, NONE, DEEP, LEVEL, INVERT, HIZCRx1, DISPUPD),/* GPIO_138 -- PEN_INT_ODL */
PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 0, DEEP, NONE, Tx1RXDCRx0, DISPUPD),/* GPIO_140 -- PEN_RESET */ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 0, DEEP, NONE, Tx1RXDCRx0, DISPUPD),/* GPIO_140 -- PEN_RESET */