aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2006-07-03 03:24:10 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-03 18:26:58 -0400
commitc32928c579d88acd43981b59e86900da65f40762 (patch)
treec7f89b713f1573d5b78a312869b2fa019d547222
parentc61a8416ed3db84481651270032696a4781cac17 (diff)
[PATCH] PNPACPI: support shareable interrupts
ACPI supplies a "shareable" indication, but PNPACPI ignores it. If a PNP device uses a shared interrupt, request_irq() fails because the PNP driver can't tell whether to supply SA_SHIRQ. This patch allows PNP drivers to test (pnp_irq_flags(dev, 0) & IORESOURCE_IRQ_SHAREABLE) Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Adam Belay <ambx1@neo.rr.com> Cc: Matthieu Castet <castet.matthieu@free.fr> Cc: Li Shaohua <shaohua.li@intel.com> Cc: Len Brown <len.brown@intel.com> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c11
-rw-r--r--include/linux/ioport.h1
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index 3a4a644c2686..212268881857 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -74,7 +74,7 @@ static void decode_irq_flags(int flag, int *triggering, int *polarity)
74 74
75static void 75static void
76pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, u32 gsi, 76pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, u32 gsi,
77 int triggering, int polarity) 77 int triggering, int polarity, int shareable)
78{ 78{
79 int i = 0; 79 int i = 0;
80 int irq; 80 int irq;
@@ -95,6 +95,9 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, u32 gsi,
95 return; 95 return;
96 } 96 }
97 97
98 if (shareable)
99 res->irq_resource[i].flags |= IORESOURCE_IRQ_SHAREABLE;
100
98 res->irq_resource[i].start = irq; 101 res->irq_resource[i].start = irq;
99 res->irq_resource[i].end = irq; 102 res->irq_resource[i].end = irq;
100 pcibios_penalize_isa_irq(irq, 1); 103 pcibios_penalize_isa_irq(irq, 1);
@@ -194,7 +197,8 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
194 pnpacpi_parse_allocated_irqresource(res_table, 197 pnpacpi_parse_allocated_irqresource(res_table,
195 res->data.irq.interrupts[i], 198 res->data.irq.interrupts[i],
196 res->data.irq.triggering, 199 res->data.irq.triggering,
197 res->data.irq.polarity); 200 res->data.irq.polarity,
201 res->data.irq.sharable);
198 } 202 }
199 break; 203 break;
200 204
@@ -255,7 +259,8 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
255 pnpacpi_parse_allocated_irqresource(res_table, 259 pnpacpi_parse_allocated_irqresource(res_table,
256 res->data.extended_irq.interrupts[i], 260 res->data.extended_irq.interrupts[i],
257 res->data.extended_irq.triggering, 261 res->data.extended_irq.triggering,
258 res->data.extended_irq.polarity); 262 res->data.extended_irq.polarity,
263 res->data.extended_irq.sharable);
259 } 264 }
260 break; 265 break;
261 266
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 87a9fc039b47..5612dfeeae50 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -55,6 +55,7 @@ struct resource_list {
55#define IORESOURCE_IRQ_LOWEDGE (1<<1) 55#define IORESOURCE_IRQ_LOWEDGE (1<<1)
56#define IORESOURCE_IRQ_HIGHLEVEL (1<<2) 56#define IORESOURCE_IRQ_HIGHLEVEL (1<<2)
57#define IORESOURCE_IRQ_LOWLEVEL (1<<3) 57#define IORESOURCE_IRQ_LOWLEVEL (1<<3)
58#define IORESOURCE_IRQ_SHAREABLE (1<<4)
58 59
59/* ISA PnP DMA specific bits (IORESOURCE_BITS) */ 60/* ISA PnP DMA specific bits (IORESOURCE_BITS) */
60#define IORESOURCE_DMA_TYPE_MASK (3<<0) 61#define IORESOURCE_DMA_TYPE_MASK (3<<0)