aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/intel/pmc_mux/mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/intel/pmc_mux/mux.c')
-rw-r--r--src/drivers/intel/pmc_mux/mux.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/drivers/intel/pmc_mux/mux.c b/src/drivers/intel/pmc_mux/mux.c
new file mode 100644
index 0000000000..29ed1a9603
--- /dev/null
+++ b/src/drivers/intel/pmc_mux/mux.c
@@ -0,0 +1,42 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <acpi/acpigen.h>
+#include <device/device.h>
+#include "chip.h"
+
+#define TGL_PMC_MUX_HID "INTC105C"
+
+static const char *mux_acpi_name(const struct device *dev)
+{
+ return "MUX";
+}
+
+static void mux_fill_ssdt(const struct device *dev)
+{
+ acpigen_write_scope(acpi_device_scope(dev));
+ acpigen_write_device(acpi_device_name(dev));
+
+ acpigen_write_name_string("_HID", TGL_PMC_MUX_HID);
+ acpigen_write_name_string("_DDN", dev->chip_ops->name);
+
+ acpigen_pop_len(); /* Device */
+ acpigen_pop_len(); /* Scope */
+}
+
+static struct device_operations mux_dev_ops = {
+ .read_resources = noop_read_resources,
+ .set_resources = noop_set_resources,
+ .acpi_name = mux_acpi_name,
+ .acpi_fill_ssdt = mux_fill_ssdt,
+ .scan_bus = scan_static_bus,
+};
+
+static void mux_enable(struct device *dev)
+{
+ dev->ops = &mux_dev_ops;
+}
+
+struct chip_operations drivers_intel_pmc_mux_ops = {
+ CHIP_NAME("Intel PMC MUX Driver")
+ .enable_dev = mux_enable,
+};