x86, irq, devicetree: Use common irqdomain map interface to program IOAPIC pins
authorJiang Liu <jiang.liu@linux.intel.com>
Mon, 9 Jun 2014 08:20:02 +0000 (16:20 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 21 Jun 2014 21:05:43 +0000 (23:05 +0200)
Refine devicetree to use common irqdomain map interface to program
IOAPIC pins, so we can unify the callsite to progam IOAPIC pins.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tony Lindgren <tony@atomide.com>
Link: http://lkml.kernel.org/r/1402302011-23642-34-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/devicetree.c

index ee26feca93d95e8b8c74430eb1e164ecfc94ef7f..f33bb436b8f41ddd8afb0ab076017e9ca659028e 100644 (file)
@@ -201,10 +201,8 @@ static int ioapic_xlate(struct irq_domain *domain,
                        const u32 *intspec, u32 intsize,
                        irq_hw_number_t *out_hwirq, u32 *out_type)
 {
-       struct io_apic_irq_attr attr;
        struct of_ioapic_type *it;
-       u32 line, idx;
-       int rc;
+       u32 line, idx, gsi;
 
        if (WARN_ON(intsize < 2))
                return -EINVAL;
@@ -217,12 +215,9 @@ static int ioapic_xlate(struct irq_domain *domain,
        it = &of_ioapic_type[intspec[1]];
 
        idx = (u32)(long)domain->host_data;
-       set_io_apic_irq_attr(&attr, idx, line, it->trigger, it->polarity);
-
-       rc = io_apic_setup_irq_pin_once(irq_find_mapping(domain, line),
-                                       cpu_to_node(0), &attr);
-       if (rc)
-               return rc;
+       gsi = mp_pin_to_gsi(idx, line);
+       if (mp_set_gsi_attr(gsi, it->trigger, it->polarity, cpu_to_node(0)))
+               return -EBUSY;
 
        *out_hwirq = line;
        *out_type = it->out_type;
@@ -230,6 +225,7 @@ static int ioapic_xlate(struct irq_domain *domain,
 }
 
 const struct irq_domain_ops ioapic_irq_domain_ops = {
+       .map = mp_irqdomain_map,
        .xlate = ioapic_xlate,
 };