diff options
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r-- | src/soc/intel/common/block/uart/uart.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/soc/intel/common/block/uart/uart.c b/src/soc/intel/common/block/uart/uart.c index 8d96e44bfc..26edd47b66 100644 --- a/src/soc/intel/common/block/uart/uart.c +++ b/src/soc/intel/common/block/uart/uart.c @@ -9,11 +9,11 @@ #include <device/pci_def.h> #include <device/pci_ids.h> #include <device/pci_ops.h> +#include <intelblocks/irq.h> #include <intelblocks/lpss.h> #include <intelblocks/uart.h> #include <soc/pci_devs.h> #include <soc/iomap.h> -#include <soc/irq.h> #include <soc/nvs.h> #include "chip.h" @@ -203,23 +203,13 @@ static void uart_common_enable_resources(struct device *dev) static void uart_acpi_write_irq(const struct device *dev) { - struct acpi_irq irq; - - switch (dev->path.pci.devfn) { - case PCH_DEVFN_UART0: - irq = (struct acpi_irq)ACPI_IRQ_LEVEL_LOW(LPSS_UART0_IRQ); - break; - case PCH_DEVFN_UART1: - irq = (struct acpi_irq)ACPI_IRQ_LEVEL_LOW(LPSS_UART1_IRQ); - break; - case PCH_DEVFN_UART2: - irq = (struct acpi_irq)ACPI_IRQ_LEVEL_LOW(LPSS_UART2_IRQ); - break; - default: - return; + if (CONFIG(SOC_INTEL_COMMON_BLOCK_IRQ)) { + const int irq = get_pci_devfn_irq(dev->path.pci.devfn); + if (irq != INVALID_IRQ) { + struct acpi_irq airq = (struct acpi_irq)ACPI_IRQ_LEVEL_LOW(irq); + acpi_device_write_interrupt(&airq); + } } - - acpi_device_write_interrupt(&irq); } /* |