mb/google/dedede/var/sasukette: Drop special codec device handling

On sasukette, codec device might be either 10EC5682 or RTL5682
depending upon the provisioned FW_CONFIG value for
AUDIO_CODEC_SOURCE. The HID for the device was updated in ramstage.c
because sconfig lacked the support for multiple override
devices. Commit b9c22e0 ("util/sconfig: Compare probe conditions for
override device match") fixed this behavior in sconfig and now we can
add multiple override devices using different FW_CONFIG probe
statements in override tree. Hence, this change moves the codec device
to override tree and drops the special handling in ramstage.c

This change also probes for UNPROVISIONED value of FW_CONFIG for
"10EC5682" device since some devices might have shipped with
UNPROVISIONED value and using "10EC5682" device.

Change-Id: I909a29c3df0cbb7ac3c07ca7663a49ad47007232
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57741
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
This commit is contained in:
Furquan Shaikh 2021-09-16 16:56:40 -07:00
parent e48043b095
commit 2cf88c185a
2 changed files with 18 additions and 29 deletions

View File

@ -192,7 +192,7 @@ chip soc/intel/jasperlake
end #I2C 0
device pci 19.0 on
chip drivers/i2c/generic
# register "hid" is set in ramstage.c because of FW_CONFIG
register "hid" = ""10EC5682""
register "name" = ""RT58""
register "desc" = ""Realtek RT5682""
register "irq_gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_D16)"
@ -200,7 +200,23 @@ chip soc/intel/jasperlake
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
device i2c 1a on
probe AUDIO_CODEC_SOURCE AUDIO_CODEC_ALC5682
probe AUDIO_CODEC_SOURCE AUDIO_CODEC_UNPROVISIONED
end
end
chip drivers/i2c/generic
register "hid" = ""RTL5682""
register "name" = ""RT58""
register "desc" = ""Realtek RT5682""
register "irq_gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_D16)"
register "property_count" = "1"
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
probe AUDIO_CODEC_SOURCE AUDIO_CODEC_ALC5682I_VS
end
end
end #I2C 4
device pci 1f.3 on

View File

@ -1,35 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <baseboard/variants.h>
#include <device/device.h>
#include <device/path.h>
#include <fw_config.h>
#include <soc/pci_devs.h>
#include <drivers/i2c/generic/chip.h>
#include <soc/soc_chip.h>
extern struct chip_operations drivers_i2c_generic_ops;
static void audio_codec_update(void)
{
const struct device_path codec_path[] = {
{.type = DEVICE_PATH_PCI, .pci.devfn = PCH_DEVFN_I2C4},
{.type = DEVICE_PATH_I2C, .i2c.device = 0x1a}
};
const struct device *codec =
find_dev_nested_path(pci_root_bus(), codec_path, ARRAY_SIZE(codec_path));
struct drivers_i2c_generic_config *config;
if (!codec || (codec->chip_ops != &drivers_i2c_generic_ops) || !codec->chip_info)
return;
config = codec->chip_info;
if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE, AUDIO_CODEC_ALC5682)))
config->hid = "10EC5682";
else if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE, AUDIO_CODEC_ALC5682I_VS)))
config->hid = "RTL5682";
}
static void ext_vr_update(void)
{
struct soc_intel_jasperlake_config *cfg = config_of_soc();
@ -40,6 +14,5 @@ static void ext_vr_update(void)
void variant_devtree_update(void)
{
audio_codec_update();
ext_vr_update();
}