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