Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / x86 / cpu / intel_common / itss.c
index 9df51adecc10168733dbb202dec4f315c8ad2630..963afa8f5beba1c5eee5b7799819f1634da81d36 100644 (file)
@@ -13,6 +13,8 @@
 #include <dm.h>
 #include <dt-structs.h>
 #include <irq.h>
+#include <log.h>
+#include <malloc.h>
 #include <p2sb.h>
 #include <spl.h>
 #include <asm/itss.h>
@@ -146,6 +148,15 @@ static int route_pmc_gpio_gpe(struct udevice *dev, uint pmc_gpe_num)
        return -ENOENT;
 }
 
+static int itss_bind(struct udevice *dev)
+{
+       /* This is not set with of-platdata, so set it manually */
+       if (CONFIG_IS_ENABLED(OF_PLATDATA))
+               dev->driver_data = X86_IRQT_ITSS;
+
+       return 0;
+}
+
 static int itss_ofdata_to_platdata(struct udevice *dev)
 {
        struct itss_priv *priv = dev_get_priv(dev);
@@ -199,7 +210,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 },
        { }
 };
 
@@ -208,6 +219,7 @@ U_BOOT_DRIVER(itss_drv) = {
        .id             = UCLASS_IRQ,
        .of_match       = itss_ids,
        .ops            = &itss_ops,
+       .bind           = itss_bind,
        .ofdata_to_platdata = itss_ofdata_to_platdata,
        .platdata_auto_alloc_size = sizeof(struct itss_platdata),
        .priv_auto_alloc_size = sizeof(struct itss_priv),