dummychip.c 1.3 KB

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