From 74782cb2f4601f5b67c6b169a7ab9b1d0778c638 Mon Sep 17 00:00:00 2001 From: Vitaly Rodionov Date: Tue, 24 May 2022 14:58:01 +0100 Subject: [PATCH] drivers/i2c/cs35l53: Add device description and UID BUG=b:207333035 BRANCH=none TEST=built and verified speaker Signed-off-by: Vitaly Rodionov Change-Id: I0dd39760dc5f44f46838c07d2e52946edc2a6d7e Reviewed-on: https://review.coreboot.org/c/coreboot/+/64638 Reviewed-by: Vitaly Rodionov Reviewed-by: Tim Wawrzynczak Tested-by: build bot (Jenkins) --- src/drivers/i2c/cs35l53/chip.h | 6 ++++++ src/drivers/i2c/cs35l53/cs35l53.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/drivers/i2c/cs35l53/chip.h b/src/drivers/i2c/cs35l53/chip.h index 9aeb874011..8631666e0c 100644 --- a/src/drivers/i2c/cs35l53/chip.h +++ b/src/drivers/i2c/cs35l53/chip.h @@ -48,6 +48,12 @@ struct drivers_i2c_cs35l53_config { const char *sub; /* SUB ID to uniquely identify system */ + /* Device Description */ + const char *desc; + + /* Identifier for chips */ + uint32_t uid; + /* Interrupt configuration */ struct acpi_irq irq; diff --git a/src/drivers/i2c/cs35l53/cs35l53.c b/src/drivers/i2c/cs35l53/cs35l53.c index 1909bef7b5..9857203b8c 100644 --- a/src/drivers/i2c/cs35l53/cs35l53.c +++ b/src/drivers/i2c/cs35l53/cs35l53.c @@ -33,8 +33,11 @@ static void cs35l53_fill_ssdt(const struct device *dev) acpigen_write_scope(scope); acpigen_write_device(acpi_device_name(dev)); acpigen_write_name_string("_HID", CS35L53_ACPI_HID); - acpigen_write_name_integer("_UID", 0); - acpigen_write_name_string("_DDN", dev->chip_ops->name); + acpigen_write_name_integer("_UID", config->uid); + if (config->desc == NULL) + acpigen_write_name_string("_DDN", dev->chip_ops->name); + else + acpigen_write_name_string("_DDN", config->desc); acpigen_write_name_string("_SUB", config->sub); acpigen_write_STA(acpi_device_status(dev));