blob: 988dc58e8847f6ebdbcd78348d9f527a9e4f2dfe [file] [log] [blame]
Thomas Gleixner3795de22010-09-22 17:09:43 +02001/*
2 * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
3 * Copyright (C) 2005-2006, Thomas Gleixner, Russell King
4 *
5 * This file contains the dummy interrupt chip implementation
6 */
7#include <linux/interrupt.h>
8#include <linux/irq.h>
Kuninori Morimoto17d83122012-07-30 22:39:20 -07009#include <linux/export.h>
Thomas Gleixner3795de22010-09-22 17:09:43 +020010
11#include "internals.h"
12
13/*
14 * What should we do if we get a hw irq event on an illegal vector?
15 * Each architecture has to answer this themself.
16 */
17static void ack_bad(struct irq_data *data)
18{
19 struct irq_desc *desc = irq_data_to_desc(data);
20
21 print_irq_desc(data->irq, desc);
22 ack_bad_irq(data->irq);
23}
24
25/*
26 * NOP functions
27 */
28static void noop(struct irq_data *data) { }
29
30static unsigned int noop_ret(struct irq_data *data)
31{
32 return 0;
33}
34
Thomas Gleixner3795de22010-09-22 17:09:43 +020035/*
36 * Generic no controller implementation
37 */
38struct irq_chip no_irq_chip = {
39 .name = "none",
40 .irq_startup = noop_ret,
41 .irq_shutdown = noop,
42 .irq_enable = noop,
43 .irq_disable = noop,
44 .irq_ack = ack_bad,
Thomas Gleixner3795de22010-09-22 17:09:43 +020045};
46
47/*
48 * Generic dummy implementation which can be used for
49 * real dumb interrupt sources
50 */
51struct irq_chip dummy_irq_chip = {
52 .name = "dummy",
53 .irq_startup = noop_ret,
54 .irq_shutdown = noop,
55 .irq_enable = noop,
56 .irq_disable = noop,
57 .irq_ack = noop,
58 .irq_mask = noop,
59 .irq_unmask = noop,
Thomas Gleixner3795de22010-09-22 17:09:43 +020060};
Kuninori Morimoto17d83122012-07-30 22:39:20 -070061EXPORT_SYMBOL_GPL(dummy_irq_chip);