1 /*
2  * Copyright (c) 2023, Intel Corporation
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 #include <zephyr/acpi/acpi.h>
7 #include <zephyr/dt-bindings/interrupt-controller/intel-ioapic.h>
8 
arch_acpi_encode_irq_flags(uint8_t polarity,uint8_t trigger)9 uint32_t arch_acpi_encode_irq_flags(uint8_t polarity, uint8_t trigger)
10 {
11 	uint32_t irq_flag = IRQ_DELIVERY_LOWEST;
12 
13 	if (trigger == ACPI_LEVEL_SENSITIVE) {
14 		irq_flag |= IRQ_TYPE_LEVEL;
15 	} else {
16 		irq_flag |= IRQ_TYPE_EDGE;
17 	}
18 
19 	if (polarity == ACPI_ACTIVE_HIGH) {
20 		irq_flag |= IRQ_TYPE_HIGH;
21 	} else if (polarity == ACPI_ACTIVE_LOW) {
22 		irq_flag |= IRQ_TYPE_LOW;
23 	}
24 
25 	return irq_flag;
26 }
27