]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: Give each driver an IRQ type
authorSimon Glass <sjg@chromium.org>
Thu, 6 Feb 2020 16:54:58 +0000 (09:54 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Fri, 7 Feb 2020 14:45:35 +0000 (22:45 +0800)
Add an IRQ type to each driver and use irq_first_device_type() to find
and probe the correct one.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/apollolake/fsp_s.c
arch/x86/cpu/i386/interrupt.c
arch/x86/cpu/intel_common/itss.c
arch/x86/cpu/irq.c
drivers/pinctrl/intel/pinctrl.c

index f8fa4dec8f718352954b66efd31944c9338e95b2..b2d91308411f4b32e6c963a046bab51fff34c835 100644 (file)
@@ -535,7 +535,7 @@ int arch_fsps_preinit(void)
        struct udevice *itss;
        int ret;
 
-       ret = uclass_first_device_err(UCLASS_IRQ, &itss);
+       ret = irq_first_device_type(X86_IRQT_ITSS, &itss);
        if (ret)
                return log_msg_ret("no itss", ret);
        /*
@@ -576,7 +576,7 @@ int arch_fsp_init_r(void)
        if (ret)
                return ret;
 
-       ret = uclass_first_device_err(UCLASS_IRQ, &itss);
+       ret = irq_first_device_type(X86_IRQT_ITSS, &itss);
        if (ret)
                return log_msg_ret("no itss", ret);
        /* Restore GPIO IRQ polarities back to previous settings */
index 70edbe06e4c6150b6828129a767db81188cf2f42..4c7e9ea2151e26573d321c23f3301cde892a751a 100644 (file)
@@ -15,6 +15,7 @@
 #include <efi_loader.h>
 #include <hang.h>
 #include <init.h>
+#include <irq.h>
 #include <irq_func.h>
 #include <asm/control_regs.h>
 #include <asm/i8259.h>
@@ -264,7 +265,7 @@ int interrupt_init(void)
        int ret;
 
        /* Try to set up the interrupt router, but don't require one */
-       ret = uclass_first_device_err(UCLASS_IRQ, &dev);
+       ret = irq_first_device_type(X86_IRQT_BASE, &dev);
        if (ret && ret != -ENODEV)
                return ret;
 
index 9df51adecc10168733dbb202dec4f315c8ad2630..33962cb9a0e62bda53de3392107ed3f9f21b1948 100644 (file)
@@ -199,7 +199,7 @@ static const struct irq_ops itss_ops = {
 };
 
 static const struct udevice_id itss_ids[] = {
-       { .compatible = "intel,itss"},
+       { .compatible = "intel,itss", .data = X86_IRQT_ITSS },
        { }
 };
 
index ed9938f7f7f547c7dd99b7a12cf486465f7f152e..bafa0310822d5b133f81dbad160fac9b56081b57 100644 (file)
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <errno.h>
 #include <fdtdec.h>
+#include <irq.h>
 #include <malloc.h>
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -351,7 +352,7 @@ int irq_router_probe(struct udevice *dev)
 }
 
 static const struct udevice_id irq_router_ids[] = {
-       { .compatible = "intel,irq-router" },
+       { .compatible = "intel,irq-router", .data = X86_IRQT_BASE },
        { }
 };
 
index 5bf5d8b0e24abb4c4094828155f8b5543f8c1bc5..f4cc55aa3b4f6fd4cf888b525c12ae86e29d167c 100644 (file)
@@ -613,7 +613,7 @@ int intel_pinctrl_ofdata_to_platdata(struct udevice *dev,
                log_err("Cannot find community for pid %d\n", pplat->pid);
                return -EDOM;
        }
-       ret = uclass_first_device_err(UCLASS_IRQ, &priv->itss);
+       ret = irq_first_device_type(X86_IRQT_ITSS, &priv->itss);
        if (ret)
                return log_msg_ret("Cannot find ITSS", ret);
        priv->comm = comm;