summaryrefslogtreecommitdiff
path: root/src/acpi/acpigen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/acpi/acpigen.c')
-rw-r--r--src/acpi/acpigen.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c
index e0892e654f..37bfec1654 100644
--- a/src/acpi/acpigen.c
+++ b/src/acpi/acpigen.c
@@ -1798,13 +1798,11 @@ void acpigen_write_CPPC_package(const struct cppc_config *config)
acpigen_write_byte(config->version);
for (i = 0; i < max; ++i) {
- const acpi_addr_t *reg = &(config->regs[i]);
- if (reg->space_id == ACPI_ADDRESS_SPACE_MEMORY &&
- reg->bit_width == 32 && reg->access_size == ACPI_ACCESS_SIZE_UNDEFINED) {
- acpigen_write_dword(reg->addrl);
- } else {
- acpigen_write_register_resource(reg);
- }
+ const cppc_entry_t *entry = &config->entries[i];
+ if (entry->type == CPPC_TYPE_DWORD)
+ acpigen_write_dword(entry->dword);
+ else
+ acpigen_write_register_resource(&entry->reg);
}
acpigen_pop_len();
}