summaryrefslogtreecommitdiff
path: root/src/drivers/generic
diff options
context:
space:
mode:
authorDavid Lin <CTLIN0@nuvoton.com>2022-11-24 15:00:37 +0800
committerMartin L Roth <gaumless@gmail.com>2022-12-17 20:29:15 +0000
commit69a6dd6aaef8234931bd4f02bdaa29aa7193de0a (patch)
treece2c5380da8651e3e8cd6af43e66271132830d6e /src/drivers/generic
parent964a60360a11ce06a65d1eceb15ee0100574dc3d (diff)
drivers/generic/nau8315: Change method for HID assignment
This patch is to change method of HID assignment with compatible id style in nau8315_config and allow mainboards to set it. Signed-off-by: David Lin <CTLIN0@nuvoton.com> Change-Id: Ia6f02e495eeb06290947edc9e44fa25a4ce18956 Reviewed-on: https://review.coreboot.org/c/coreboot/+/69965 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@gmail.com>
Diffstat (limited to 'src/drivers/generic')
-rw-r--r--src/drivers/generic/nau8315/chip.h6
-rw-r--r--src/drivers/generic/nau8315/nau8315.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/src/drivers/generic/nau8315/chip.h b/src/drivers/generic/nau8315/chip.h
index aa194bb3e9..45cb412d48 100644
--- a/src/drivers/generic/nau8315/chip.h
+++ b/src/drivers/generic/nau8315/chip.h
@@ -3,6 +3,12 @@
#include <acpi/acpi_device.h>
struct drivers_generic_nau8315_config {
+ /* ACPI _HID */
+ enum {
+ NAU8315,
+ NAU8318,
+ MAX_HID,
+ } hid;
/* ENABLE GPIO */
struct acpi_gpio enable_gpio;
};
diff --git a/src/drivers/generic/nau8315/nau8315.c b/src/drivers/generic/nau8315/nau8315.c
index 21b8ff9e17..ac2bfd1b55 100644
--- a/src/drivers/generic/nau8315/nau8315.c
+++ b/src/drivers/generic/nau8315/nau8315.c
@@ -8,6 +8,8 @@
#include <gpio.h>
#include "chip.h"
+const char *nauhid[MAX_HID] = {"NVTN2010", "NVTN2012"};
+
static void nau8315_fill_ssdt(const struct device *dev)
{
struct drivers_generic_nau8315_config *config = dev->chip_info;
@@ -26,7 +28,7 @@ static void nau8315_fill_ssdt(const struct device *dev)
acpigen_write_scope(scope);
acpigen_write_device(name);
- acpigen_write_name_string("_HID", "NVTN2010");
+ acpigen_write_name_string("_HID", nauhid[config->hid]);
acpigen_write_name_integer("_UID", 0);
acpigen_write_name_string("_DDN", dev->chip_ops->name);
acpigen_write_STA(acpi_device_status(dev));