Skip to content

Commit

Permalink
[PATCH] powerpc: enable irq's for platform functions.
Browse files Browse the repository at this point in the history
Make the platform function interrupt functions actually work.  Calls
irq_enable() for the first in the list, and irq_disable() for the last.

Added *func to struct irq_client so the the user can pass just that to
pmf_unregister_irq_client().

Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Ben Collins authored and Linus Torvalds committed Feb 1, 2006
1 parent b62735d commit cc0fa84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
13 changes: 10 additions & 3 deletions arch/powerpc/platforms/powermac/pfunc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,21 +862,28 @@ int pmf_register_irq_client(struct device_node *target,
spin_unlock_irqrestore(&pmf_lock, flags);
return -ENODEV;
}
if (list_empty(&func->irq_clients))
func->dev->handlers->irq_enable(func);
list_add(&client->link, &func->irq_clients);
client->func = func;
spin_unlock_irqrestore(&pmf_lock, flags);

return 0;
}
EXPORT_SYMBOL_GPL(pmf_register_irq_client);

void pmf_unregister_irq_client(struct device_node *np,
const char *name,
struct pmf_irq_client *client)
void pmf_unregister_irq_client(struct pmf_irq_client *client)
{
struct pmf_function *func = client->func;
unsigned long flags;

BUG_ON(func == NULL);

spin_lock_irqsave(&pmf_lock, flags);
client->func = NULL;
list_del(&client->link);
if (list_empty(&func->irq_clients))
func->dev->handlers->irq_disable(func);
spin_unlock_irqrestore(&pmf_lock, flags);
}
EXPORT_SYMBOL_GPL(pmf_unregister_irq_client);
Expand Down
5 changes: 2 additions & 3 deletions include/asm-powerpc/pmac_pfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ struct pmf_irq_client {
void *data;
struct module *owner;
struct list_head link;
struct pmf_function *func;
};


Expand All @@ -187,9 +188,7 @@ extern int pmf_register_irq_client(struct device_node *np,
const char *name,
struct pmf_irq_client *client);

extern void pmf_unregister_irq_client(struct device_node *np,
const char *name,
struct pmf_irq_client *client);
extern void pmf_unregister_irq_client(struct pmf_irq_client *client);

/*
* Called by the handlers when an irq happens
Expand Down

0 comments on commit cc0fa84

Please sign in to comment.