blob: 4bd9a63260eeda8c98c4f1cca66c4a9ccdf29a4c [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Platform dependent support for HP simulator.
3 *
4 * Copyright (C) 1998-2001 Hewlett-Packard Co
5 * Copyright (C) 1998-2001 David Mosberger-Tang <davidm@hpl.hp.com>
6 */
7
8#include <linux/init.h>
9#include <linux/kernel.h>
10#include <linux/sched.h>
11#include <linux/irq.h>
12
13static unsigned int
Thomas Gleixner35d75b02011-02-04 20:12:06 +010014hpsim_irq_startup(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -070015{
16 return 0;
17}
18
19static void
Thomas Gleixner35d75b02011-02-04 20:12:06 +010020hpsim_irq_noop(struct irq_data *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -070021{
22}
23
Yinghai Lud5dedd42009-04-27 17:59:21 -070024static int
Thomas Gleixner35d75b02011-02-04 20:12:06 +010025hpsim_set_affinity_noop(struct irq_data *d, const struct cpumask *b, bool f)
Linus Torvalds1da177e2005-04-16 15:20:36 -070026{
Yinghai Lud5dedd42009-04-27 17:59:21 -070027 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070028}
29
Thomas Gleixnerfb824f42009-06-10 12:45:00 -070030static struct irq_chip irq_type_hp_sim = {
Thomas Gleixner35d75b02011-02-04 20:12:06 +010031 .name = "hpsim",
32 .irq_startup = hpsim_irq_startup,
33 .irq_shutdown = hpsim_irq_noop,
34 .irq_enable = hpsim_irq_noop,
35 .irq_disable = hpsim_irq_noop,
36 .irq_ack = hpsim_irq_noop,
37 .irq_set_affinity = hpsim_set_affinity_noop,
Linus Torvalds1da177e2005-04-16 15:20:36 -070038};
39
40void __init
41hpsim_irq_init (void)
42{
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 int i;
44
Thomas Gleixner4a983ed2011-02-05 20:23:29 +010045 for_each_active_irq(i) {
Thomas Gleixner53c909c2011-03-25 21:06:09 +010046 struct irq_chip *chip = irq_get_chip(i);
Thomas Gleixner4a983ed2011-02-05 20:23:29 +010047
48 if (chip == &no_irq_chip)
Thomas Gleixner53c909c2011-03-25 21:06:09 +010049 irq_set_chip(i, &irq_type_hp_sim);
Linus Torvalds1da177e2005-04-16 15:20:36 -070050 }
51}