Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95556
b: refs/heads/master
c: cd7ec92
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Apr 29, 2008
1 parent 012f759 commit 875afbb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bb84b41d1a1e3ad1ebe7f91a7c97d3b6ca242e9d
refs/heads/master: cd7ec927d9cd3d2001cbbdce872bd73f6e49c986
26 changes: 15 additions & 11 deletions trunk/drivers/pnp/pnpacpi/rsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,26 @@
/*
* Allocated Resources
*/
static int irq_flags(int triggering, int polarity)
static int irq_flags(int triggering, int polarity, int shareable)
{
int flags;

if (triggering == ACPI_LEVEL_SENSITIVE) {
if (polarity == ACPI_ACTIVE_LOW)
return IORESOURCE_IRQ_LOWLEVEL;
flags = IORESOURCE_IRQ_LOWLEVEL;
else
return IORESOURCE_IRQ_HIGHLEVEL;
flags = IORESOURCE_IRQ_HIGHLEVEL;
} else {
if (polarity == ACPI_ACTIVE_LOW)
return IORESOURCE_IRQ_LOWEDGE;
flags = IORESOURCE_IRQ_LOWEDGE;
else
return IORESOURCE_IRQ_HIGHEDGE;
flags = IORESOURCE_IRQ_HIGHEDGE;
}

if (shareable)
flags |= IORESOURCE_IRQ_SHAREABLE;

return flags;
}

static void decode_irq_flags(int flag, int *triggering, int *polarity)
Expand Down Expand Up @@ -110,16 +117,13 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
}

res->irq_resource[i].flags = IORESOURCE_IRQ; // Also clears _UNSET flag
res->irq_resource[i].flags |= irq_flags(triggering, polarity);
res->irq_resource[i].flags |= irq_flags(triggering, polarity, shareable);
irq = acpi_register_gsi(gsi, triggering, polarity);
if (irq < 0) {
res->irq_resource[i].flags |= IORESOURCE_DISABLED;
return;
}

if (shareable)
res->irq_resource[i].flags |= IORESOURCE_IRQ_SHAREABLE;

res->irq_resource[i].start = irq;
res->irq_resource[i].end = irq;
pcibios_penalize_isa_irq(irq, 1);
Expand Down Expand Up @@ -441,7 +445,7 @@ static __init void pnpacpi_parse_irq_option(struct pnp_option *option,
for (i = 0; i < p->interrupt_count; i++)
if (p->interrupts[i])
__set_bit(p->interrupts[i], irq->map);
irq->flags = irq_flags(p->triggering, p->polarity);
irq->flags = irq_flags(p->triggering, p->polarity, p->sharable);

pnp_register_irq_resource(option, irq);
}
Expand All @@ -461,7 +465,7 @@ static __init void pnpacpi_parse_ext_irq_option(struct pnp_option *option,
for (i = 0; i < p->interrupt_count; i++)
if (p->interrupts[i])
__set_bit(p->interrupts[i], irq->map);
irq->flags = irq_flags(p->triggering, p->polarity);
irq->flags = irq_flags(p->triggering, p->polarity, p->sharable);

pnp_register_irq_resource(option, irq);
}
Expand Down

0 comments on commit 875afbb

Please sign in to comment.