Malik Hsu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59173 )
Change subject: mb/google/brya/variants/primus: enable ALC5682I-VS ......................................................................
mb/google/brya/variants/primus: enable ALC5682I-VS
In next phase build, the audio codec will chang to ALC5682I-VS
BUB=b:205883511 TEST=emerge-brya coreboot chromeos-bootimage and check audio function
Signed-off-by: Malik_Hsu malik_hsu@wistron.corp-partner.google.com Change-Id: I5906ef9bb88da7fe450a986bf7dd1ee701227f95 --- M src/mainboard/google/brya/variants/primus/variant.c 1 file changed, 26 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/73/59173/1
diff --git a/src/mainboard/google/brya/variants/primus/variant.c b/src/mainboard/google/brya/variants/primus/variant.c index 82521b0..bebe001 100644 --- a/src/mainboard/google/brya/variants/primus/variant.c +++ b/src/mainboard/google/brya/variants/primus/variant.c @@ -5,8 +5,11 @@ #include <boardid.h> #include <soc/pci_devs.h> #include <device/device.h> +#include <string.h> +#include <drivers/i2c/hid/chip.h>
extern struct chip_operations soc_intel_common_block_pcie_rtd3_ops; +extern struct chip_operations drivers_i2c_generic_ops;
static void devtree_update_emmc_rtd3(uint32_t board_ver) { @@ -27,8 +30,31 @@ rtd3_dev->enabled = 0; }
+static void devtree_update_audio_codec(void) +{ + struct device *alc_dev = NULL, *child = NULL; + struct device *i2c0_dev = pcidev_path_on_root(PCH_DEVFN_I2C0); + + while ((child = dev_bus_each_child(i2c0_dev->link_list, child)) != NULL) { + if (child->path.type != DEVICE_PATH_I2C) + continue; + if (child->path.i2c.device != 0x1a) + continue; + if (child->chip_ops == &drivers_i2c_generic_ops) { + struct drivers_i2c_generic_config *config = child->chip_info; + if (!strcmp(config->hid, "10EC5682")) { + config->hid = "RTL5682"; + config->name = "RT58"; + alc_dev=child; + } + } + } + alc_dev->enabled=1; +} + void variant_devtree_update(void) { uint32_t board_ver = board_id(); devtree_update_emmc_rtd3(board_ver); + devtree_update_audio_codec(board_ver); }