1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <acpi/acpigen.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
);
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
))
32 printk(BIOS_INFO
, "ACPI: * H8\n");
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
) ?
42 acpigen_write_name_byte("HUWB", (conf
&& conf
->has_uwb
) ?
45 acpigen_pop_len(); /* Scope HKEY */