diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pnp/pnpacpi/rsparser.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 2a47e977d8a8..a5f5e2130e75 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c | |||
@@ -32,19 +32,26 @@ | |||
32 | /* | 32 | /* |
33 | * Allocated Resources | 33 | * Allocated Resources |
34 | */ | 34 | */ |
35 | static int irq_flags(int triggering, int polarity) | 35 | static int irq_flags(int triggering, int polarity, int shareable) |
36 | { | 36 | { |
37 | int flags; | ||
38 | |||
37 | if (triggering == ACPI_LEVEL_SENSITIVE) { | 39 | if (triggering == ACPI_LEVEL_SENSITIVE) { |
38 | if (polarity == ACPI_ACTIVE_LOW) | 40 | if (polarity == ACPI_ACTIVE_LOW) |
39 | return IORESOURCE_IRQ_LOWLEVEL; | 41 | flags = IORESOURCE_IRQ_LOWLEVEL; |
40 | else | 42 | else |
41 | return IORESOURCE_IRQ_HIGHLEVEL; | 43 | flags = IORESOURCE_IRQ_HIGHLEVEL; |
42 | } else { | 44 | } else { |
43 | if (polarity == ACPI_ACTIVE_LOW) | 45 | if (polarity == ACPI_ACTIVE_LOW) |
44 | return IORESOURCE_IRQ_LOWEDGE; | 46 | flags = IORESOURCE_IRQ_LOWEDGE; |
45 | else | 47 | else |
46 | return IORESOURCE_IRQ_HIGHEDGE; | 48 | flags = IORESOURCE_IRQ_HIGHEDGE; |
47 | } | 49 | } |
50 | |||
51 | if (shareable) | ||
52 | flags |= IORESOURCE_IRQ_SHAREABLE; | ||
53 | |||
54 | return flags; | ||
48 | } | 55 | } |
49 | 56 | ||
50 | static void decode_irq_flags(int flag, int *triggering, int *polarity) | 57 | static void decode_irq_flags(int flag, int *triggering, int *polarity) |
@@ -110,16 +117,13 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, | |||
110 | } | 117 | } |
111 | 118 | ||
112 | res->irq_resource[i].flags = IORESOURCE_IRQ; // Also clears _UNSET flag | 119 | res->irq_resource[i].flags = IORESOURCE_IRQ; // Also clears _UNSET flag |
113 | res->irq_resource[i].flags |= irq_flags(triggering, polarity); | 120 | res->irq_resource[i].flags |= irq_flags(triggering, polarity, shareable); |
114 | irq = acpi_register_gsi(gsi, triggering, polarity); | 121 | irq = acpi_register_gsi(gsi, triggering, polarity); |
115 | if (irq < 0) { | 122 | if (irq < 0) { |
116 | res->irq_resource[i].flags |= IORESOURCE_DISABLED; | 123 | res->irq_resource[i].flags |= IORESOURCE_DISABLED; |
117 | return; | 124 | return; |
118 | } | 125 | } |
119 | 126 | ||
120 | if (shareable) | ||
121 | res->irq_resource[i].flags |= IORESOURCE_IRQ_SHAREABLE; | ||
122 | |||
123 | res->irq_resource[i].start = irq; | 127 | res->irq_resource[i].start = irq; |
124 | res->irq_resource[i].end = irq; | 128 | res->irq_resource[i].end = irq; |
125 | pcibios_penalize_isa_irq(irq, 1); | 129 | pcibios_penalize_isa_irq(irq, 1); |
@@ -441,7 +445,7 @@ static __init void pnpacpi_parse_irq_option(struct pnp_option *option, | |||
441 | for (i = 0; i < p->interrupt_count; i++) | 445 | for (i = 0; i < p->interrupt_count; i++) |
442 | if (p->interrupts[i]) | 446 | if (p->interrupts[i]) |
443 | __set_bit(p->interrupts[i], irq->map); | 447 | __set_bit(p->interrupts[i], irq->map); |
444 | irq->flags = irq_flags(p->triggering, p->polarity); | 448 | irq->flags = irq_flags(p->triggering, p->polarity, p->sharable); |
445 | 449 | ||
446 | pnp_register_irq_resource(option, irq); | 450 | pnp_register_irq_resource(option, irq); |
447 | } | 451 | } |
@@ -461,7 +465,7 @@ static __init void pnpacpi_parse_ext_irq_option(struct pnp_option *option, | |||
461 | for (i = 0; i < p->interrupt_count; i++) | 465 | for (i = 0; i < p->interrupt_count; i++) |
462 | if (p->interrupts[i]) | 466 | if (p->interrupts[i]) |
463 | __set_bit(p->interrupts[i], irq->map); | 467 | __set_bit(p->interrupts[i], irq->map); |
464 | irq->flags = irq_flags(p->triggering, p->polarity); | 468 | irq->flags = irq_flags(p->triggering, p->polarity, p->sharable); |
465 | 469 | ||
466 | pnp_register_irq_resource(option, irq); | 470 | pnp_register_irq_resource(option, irq); |
467 | } | 471 | } |