Thomas Gleixner | 52a65ff | 2018-03-14 22:15:19 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Thomas Gleixner | 3795de2 | 2010-09-22 17:09:43 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar |
| 4 | * Copyright (C) 2005-2006, Thomas Gleixner, Russell King |
| 5 | * |
| 6 | * This file contains the dummy interrupt chip implementation |
| 7 | */ |
| 8 | #include <linux/interrupt.h> |
| 9 | #include <linux/irq.h> |
Kuninori Morimoto | 17d8312 | 2012-07-30 22:39:20 -0700 | [diff] [blame] | 10 | #include <linux/export.h> |
Thomas Gleixner | 3795de2 | 2010-09-22 17:09:43 +0200 | [diff] [blame] | 11 | |
| 12 | #include "internals.h" |
| 13 | |
| 14 | /* |
| 15 | * What should we do if we get a hw irq event on an illegal vector? |
Ingo Molnar | a359f75 | 2021-03-22 04:21:30 +0100 | [diff] [blame] | 16 | * Each architecture has to answer this themselves. |
Thomas Gleixner | 3795de2 | 2010-09-22 17:09:43 +0200 | [diff] [blame] | 17 | */ |
| 18 | static void ack_bad(struct irq_data *data) |
| 19 | { |
| 20 | struct irq_desc *desc = irq_data_to_desc(data); |
| 21 | |
| 22 | print_irq_desc(data->irq, desc); |
| 23 | ack_bad_irq(data->irq); |
| 24 | } |
| 25 | |
| 26 | /* |
| 27 | * NOP functions |
| 28 | */ |
| 29 | static void noop(struct irq_data *data) { } |
| 30 | |
| 31 | static unsigned int noop_ret(struct irq_data *data) |
| 32 | { |
| 33 | return 0; |
| 34 | } |
| 35 | |
Thomas Gleixner | 3795de2 | 2010-09-22 17:09:43 +0200 | [diff] [blame] | 36 | /* |
| 37 | * Generic no controller implementation |
| 38 | */ |
| 39 | struct irq_chip no_irq_chip = { |
| 40 | .name = "none", |
| 41 | .irq_startup = noop_ret, |
| 42 | .irq_shutdown = noop, |
| 43 | .irq_enable = noop, |
| 44 | .irq_disable = noop, |
| 45 | .irq_ack = ack_bad, |
Geert Uytterhoeven | de8d181 | 2015-05-22 09:58:49 +0200 | [diff] [blame] | 46 | .flags = IRQCHIP_SKIP_SET_WAKE, |
Thomas Gleixner | 3795de2 | 2010-09-22 17:09:43 +0200 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | /* |
| 50 | * Generic dummy implementation which can be used for |
| 51 | * real dumb interrupt sources |
| 52 | */ |
| 53 | struct irq_chip dummy_irq_chip = { |
| 54 | .name = "dummy", |
| 55 | .irq_startup = noop_ret, |
| 56 | .irq_shutdown = noop, |
| 57 | .irq_enable = noop, |
| 58 | .irq_disable = noop, |
| 59 | .irq_ack = noop, |
| 60 | .irq_mask = noop, |
| 61 | .irq_unmask = noop, |
Roger Quadros | 10a50f1 | 2015-04-15 11:14:11 +0300 | [diff] [blame] | 62 | .flags = IRQCHIP_SKIP_SET_WAKE, |
Thomas Gleixner | 3795de2 | 2010-09-22 17:09:43 +0200 | [diff] [blame] | 63 | }; |
Kuninori Morimoto | 17d8312 | 2012-07-30 22:39:20 -0700 | [diff] [blame] | 64 | EXPORT_SYMBOL_GPL(dummy_irq_chip); |