drivers/wifi: Remove unnecessary data structure copy
[coreboot2.git] / src / ec / lenovo / h8 / ssdt.c
blob7d7bfac66c487baed2a6062330a9004e6ab1beb3
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <acpi/acpigen.h>
5 #include <stdio.h>
6 #include <string.h>
8 #include "h8.h"
9 #include "chip.h"
11 static char *h8_dsdt_scope(const struct device *dev, const char *scope)
13 static char buf[DEVICE_PATH_MAX] = {};
14 const char *path = acpi_device_path(dev);
16 memset(buf, 0, sizeof(buf));
17 snprintf(buf, sizeof(buf) - 1, "%s.%s", path, scope);
19 return buf;
23 * Generates EC SSDT.
25 void h8_ssdt_generator(const struct device *dev)
27 struct ec_lenovo_h8_config *conf = dev->chip_info;
29 if (!acpi_device_path(dev))
30 return;
32 printk(BIOS_INFO, "ACPI: * H8\n");
34 /* Scope HKEY */
35 acpigen_write_scope(h8_dsdt_scope(dev, "HKEY"));
37 /* Used by thinkpad_acpi */
38 acpigen_write_name_byte("HBDC", h8_has_bdc(dev) ? ONE_OP : ZERO_OP);
39 acpigen_write_name_byte("HWAN", h8_has_wwan(dev) ? ONE_OP : ZERO_OP);
40 acpigen_write_name_byte("HKBL", (conf && conf->has_keyboard_backlight) ?
41 ONE_OP : ZERO_OP);
42 acpigen_write_name_byte("HUWB", (conf && conf->has_uwb) ?
43 ONE_OP : ZERO_OP);
45 acpigen_pop_len(); /* Scope HKEY */