aboutsummaryrefslogtreecommitdiff
path: root/src/ec/google/chromeec/ec_acpi.c
diff options
context:
space:
mode:
authorTim Wawrzynczak <twawrzynczak@chromium.org>2020-05-29 15:44:25 -0600
committerDuncan Laurie <dlaurie@chromium.org>2020-07-07 20:31:30 +0000
commit93d7bcbc67658fd1fb2ec084666283eb4b5dc728 (patch)
tree9da8acffd881fd4841c077933dcb274bc35715a0 /src/ec/google/chromeec/ec_acpi.c
parentf6945026974e371a16a5343964f2751dffc29efd (diff)
ec/google: Add function ec_fill_dptf_helpers()
ec_fill_dptf_helpers() is used to generate all of the "helper" methods that DPTF requires. A system with a Chrome EC is typically in charge of fan PWM control as well as battery charging, so if DPTF needs to manipulate those, then it requires Methods provided by the EC. BUG=b:143539650 TEST=compiles Change-Id: Ib30072d1d0748b31bcab240a0fd0e2f12d34aaa4 Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41894 Reviewed-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/ec/google/chromeec/ec_acpi.c')
-rw-r--r--src/ec/google/chromeec/ec_acpi.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/ec_acpi.c b/src/ec/google/chromeec/ec_acpi.c
index dca52854c5..8a76805407 100644
--- a/src/ec/google/chromeec/ec_acpi.c
+++ b/src/ec/google/chromeec/ec_acpi.c
@@ -7,6 +7,7 @@
#include <acpi/acpigen_usb.h>
#include <console/console.h>
#include <drivers/usb/acpi/chip.h>
+#include <ec/google/common/dptf.h>
#include "chip.h"
#include "ec.h"
@@ -241,11 +242,32 @@ static void fill_ssdt_ps2_keyboard(const struct device *dev)
!!(keybd.capabilities & KEYBD_CAP_SCRNLOCK_KEY));
}
+static const char *ec_acpi_name(const struct device *dev)
+{
+ return "EC0";
+}
+
+static struct device_operations ec_ops = {
+ .acpi_name = ec_acpi_name,
+};
+
void google_chromeec_fill_ssdt_generator(const struct device *dev)
{
+ struct device_path path;
+ struct device *ec;
+
if (!dev->enabled)
return;
+ /* Set up a minimal EC0 device to pass to the DPTF helpers */
+ path.type = DEVICE_PATH_GENERIC;
+ path.generic.id = 0;
+ ec = alloc_find_dev(dev->bus, &path);
+ ec->ops = &ec_ops;
+
+ if (CONFIG(DRIVERS_INTEL_DPTF))
+ ec_fill_dptf_helpers(ec);
+
fill_ssdt_typec_device(dev);
fill_ssdt_ps2_keyboard(dev);
}