Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 13 | static unsigned int |
Thomas Gleixner | 35d75b0 | 2011-02-04 20:12:06 +0100 | [diff] [blame] | 14 | hpsim_irq_startup(struct irq_data *data) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | { |
| 16 | return 0; |
| 17 | } |
| 18 | |
| 19 | static void |
Thomas Gleixner | 35d75b0 | 2011-02-04 20:12:06 +0100 | [diff] [blame] | 20 | hpsim_irq_noop(struct irq_data *data) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | { |
| 22 | } |
| 23 | |
Yinghai Lu | d5dedd4 | 2009-04-27 17:59:21 -0700 | [diff] [blame] | 24 | static int |
Thomas Gleixner | 35d75b0 | 2011-02-04 20:12:06 +0100 | [diff] [blame] | 25 | hpsim_set_affinity_noop(struct irq_data *d, const struct cpumask *b, bool f) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | { |
Yinghai Lu | d5dedd4 | 2009-04-27 17:59:21 -0700 | [diff] [blame] | 27 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | } |
| 29 | |
Thomas Gleixner | fb824f4 | 2009-06-10 12:45:00 -0700 | [diff] [blame] | 30 | static struct irq_chip irq_type_hp_sim = { |
Thomas Gleixner | 35d75b0 | 2011-02-04 20:12:06 +0100 | [diff] [blame] | 31 | .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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | void __init |
| 41 | hpsim_irq_init (void) |
| 42 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | int i; |
| 44 | |
Thomas Gleixner | 4a983ed | 2011-02-05 20:23:29 +0100 | [diff] [blame] | 45 | for_each_active_irq(i) { |
Thomas Gleixner | 53c909c | 2011-03-25 21:06:09 +0100 | [diff] [blame] | 46 | struct irq_chip *chip = irq_get_chip(i); |
Thomas Gleixner | 4a983ed | 2011-02-05 20:23:29 +0100 | [diff] [blame] | 47 | |
| 48 | if (chip == &no_irq_chip) |
Thomas Gleixner | 53c909c | 2011-03-25 21:06:09 +0100 | [diff] [blame] | 49 | irq_set_chip(i, &irq_type_hp_sim); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | } |
| 51 | } |