Debian Codegraph @

src/drivers/intel/pmc_mux/mux.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include <acpi/acpigen.h>
4 #include <device/device.h>
5 #include "chip.h"
6
7 #define TGL_PMC_MUX_HID "INTC105C"
8
9 static const char *mux_acpi_name(const struct device *dev)
10 {
11 return "MUX";
12 }
13
14 static void mux_fill_ssdt(const struct device *dev)
15 {
16 const char *scope = acpi_device_scope(dev);
17 const char *name = acpi_device_name(dev);
18
19 if (!scope || !name)
20 return;
21
22 acpigen_write_scope(scope);
23 acpigen_write_device(name);
24
25 acpigen_write_name_string("_HID", TGL_PMC_MUX_HID);
26 acpigen_write_name_string("_DDN", dev->chip_ops->name);
27
28 acpigen_pop_len(); /* Device */
29 acpigen_pop_len(); /* Scope */
30 }
31
32 static struct device_operations mux_dev_ops = {
33 .read_resources = noop_read_resources,
34 .set_resources = noop_set_resources,
35 .acpi_name = mux_acpi_name,
36 .acpi_fill_ssdt = mux_fill_ssdt,
37 .scan_bus = scan_static_bus,
38 };
39
40 static void mux_enable(struct device *dev)
41 {
42 dev->ops = &mux_dev_ops;
43 }
44
45 struct chip_operations drivers_intel_pmc_mux_ops = {
46 .name = "Intel PMC MUX Driver",
47 .enable_dev = mux_enable,
48 };