dummychip.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // SPDX-License-Identifier: GPL-2.0
  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>
  10. #include <linux/export.h>
  11. #include "internals.h"
  12. /*
  13. * What should we do if we get a hw irq event on an illegal vector?
  14. * Each architecture has to answer this themself.
  15. */
  16. static void ack_bad(struct irq_data *data)
  17. {
  18. struct irq_desc *desc = irq_data_to_desc(data);
  19. print_irq_desc(data->irq, desc);
  20. ack_bad_irq(data->irq);
  21. }
  22. /*
  23. * NOP functions
  24. */
  25. static void noop(struct irq_data *data) { }
  26. static unsigned int noop_ret(struct irq_data *data)
  27. {
  28. return 0;
  29. }
  30. /*
  31. * Generic no controller implementation
  32. */
  33. struct irq_chip no_irq_chip = {
  34. .name = "none",
  35. .irq_startup = noop_ret,
  36. .irq_shutdown = noop,
  37. .irq_enable = noop,
  38. .irq_disable = noop,
  39. .irq_ack = ack_bad,
  40. .flags = IRQCHIP_SKIP_SET_WAKE,
  41. };
  42. /*
  43. * Generic dummy implementation which can be used for
  44. * real dumb interrupt sources
  45. */
  46. struct irq_chip dummy_irq_chip = {
  47. .name = "dummy",
  48. .irq_startup = noop_ret,
  49. .irq_shutdown = noop,
  50. .irq_enable = noop,
  51. .irq_disable = noop,
  52. .irq_ack = noop,
  53. .irq_mask = noop,
  54. .irq_unmask = noop,
  55. .flags = IRQCHIP_SKIP_SET_WAKE,
  56. };
  57. EXPORT_SYMBOL_GPL(dummy_irq_chip);