blob: 4a1d5fafdf9d5de970d1d9684a7e67c291fbd53e [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
14hpsim_irq_startup (unsigned int irq)
15{
16 return 0;
17}
18
19static void
20hpsim_irq_noop (unsigned int irq)
21{
22}
23
Yinghai Lud5dedd42009-04-27 17:59:21 -070024static int
Rusty Russell0de26522008-12-13 21:20:26 +103025hpsim_set_affinity_noop(unsigned int a, const struct cpumask *b)
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 = {
Ingo Molnar06344db2006-11-16 00:43:02 -080031 .name = "hpsim",
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 .startup = hpsim_irq_startup,
33 .shutdown = hpsim_irq_noop,
34 .enable = hpsim_irq_noop,
35 .disable = hpsim_irq_noop,
36 .ack = hpsim_irq_noop,
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 .set_affinity = hpsim_set_affinity_noop,
38};
39
40void __init
41hpsim_irq_init (void)
42{
Thomas Gleixner86bc3df2009-06-10 12:45:00 -070043 struct irq_desc *idesc;
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 int i;
45
46 for (i = 0; i < NR_IRQS; ++i) {
Ingo Molnara8553ac2006-06-29 02:24:38 -070047 idesc = irq_desc + i;
Thomas Gleixner8a7c3cd2009-06-10 12:44:59 -070048 if (idesc->chip == &no_irq_chip)
Ingo Molnara8553ac2006-06-29 02:24:38 -070049 idesc->chip = &irq_type_hp_sim;
Linus Torvalds1da177e2005-04-16 15:20:36 -070050 }
51}