2018-03-15 05:15:19 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2010-09-22 23:09:43 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
|
|
|
|
* Copyright (C) 2005-2006, Thomas Gleixner, Russell King
|
|
|
|
*
|
|
|
|
* This file contains the dummy interrupt chip implementation
|
|
|
|
*/
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/irq.h>
|
2012-07-31 13:39:20 +08:00
|
|
|
#include <linux/export.h>
|
2010-09-22 23:09:43 +08:00
|
|
|
|
|
|
|
#include "internals.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* What should we do if we get a hw irq event on an illegal vector?
|
2021-03-22 11:21:30 +08:00
|
|
|
* Each architecture has to answer this themselves.
|
2010-09-22 23:09:43 +08:00
|
|
|
*/
|
|
|
|
static void ack_bad(struct irq_data *data)
|
|
|
|
{
|
|
|
|
struct irq_desc *desc = irq_data_to_desc(data);
|
|
|
|
|
|
|
|
print_irq_desc(data->irq, desc);
|
|
|
|
ack_bad_irq(data->irq);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NOP functions
|
|
|
|
*/
|
|
|
|
static void noop(struct irq_data *data) { }
|
|
|
|
|
|
|
|
static unsigned int noop_ret(struct irq_data *data)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Generic no controller implementation
|
|
|
|
*/
|
|
|
|
struct irq_chip no_irq_chip = {
|
|
|
|
.name = "none",
|
|
|
|
.irq_startup = noop_ret,
|
|
|
|
.irq_shutdown = noop,
|
|
|
|
.irq_enable = noop,
|
|
|
|
.irq_disable = noop,
|
|
|
|
.irq_ack = ack_bad,
|
2015-05-22 15:58:49 +08:00
|
|
|
.flags = IRQCHIP_SKIP_SET_WAKE,
|
2010-09-22 23:09:43 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Generic dummy implementation which can be used for
|
|
|
|
* real dumb interrupt sources
|
|
|
|
*/
|
|
|
|
struct irq_chip dummy_irq_chip = {
|
|
|
|
.name = "dummy",
|
|
|
|
.irq_startup = noop_ret,
|
|
|
|
.irq_shutdown = noop,
|
|
|
|
.irq_enable = noop,
|
|
|
|
.irq_disable = noop,
|
|
|
|
.irq_ack = noop,
|
|
|
|
.irq_mask = noop,
|
|
|
|
.irq_unmask = noop,
|
2015-04-15 16:14:11 +08:00
|
|
|
.flags = IRQCHIP_SKIP_SET_WAKE,
|
2010-09-22 23:09:43 +08:00
|
|
|
};
|
2012-07-31 13:39:20 +08:00
|
|
|
EXPORT_SYMBOL_GPL(dummy_irq_chip);
|