shirq.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * arch/arm/plat-spear/include/plat/shirq.h
  3. *
  4. * SPEAr platform shared irq layer header file
  5. *
  6. * Copyright (C) 2009 ST Microelectronics
  7. * Viresh Kumar<viresh.kumar@st.com>
  8. *
  9. * This file is licensed under the terms of the GNU General Public
  10. * License version 2. This program is licensed "as is" without any
  11. * warranty of any kind, whether express or implied.
  12. */
  13. #ifndef __PLAT_SHIRQ_H
  14. #define __PLAT_SHIRQ_H
  15. #include <linux/irq.h>
  16. #include <linux/types.h>
  17. /*
  18. * struct shirq_dev_config: shared irq device configuration
  19. *
  20. * virq: virtual irq number of device
  21. * enb_mask: enable mask of device
  22. * status_mask: status mask of device
  23. * clear_mask: clear mask of device
  24. */
  25. struct shirq_dev_config {
  26. u32 virq;
  27. u32 enb_mask;
  28. u32 status_mask;
  29. u32 clear_mask;
  30. };
  31. /*
  32. * struct shirq_regs: shared irq register configuration
  33. *
  34. * base: base address of shared irq register
  35. * enb_reg: enable register offset
  36. * reset_to_enb: val 1 indicates, we need to clear bit for enabling interrupt
  37. * status_reg: status register offset
  38. * status_reg_mask: status register valid mask
  39. * clear_reg: clear register offset
  40. * reset_to_clear: val 1 indicates, we need to clear bit for clearing interrupt
  41. */
  42. struct shirq_regs {
  43. void __iomem *base;
  44. u32 enb_reg;
  45. u32 reset_to_enb;
  46. u32 status_reg;
  47. u32 status_reg_mask;
  48. u32 clear_reg;
  49. u32 reset_to_clear;
  50. };
  51. /*
  52. * struct spear_shirq: shared irq structure
  53. *
  54. * irq: hardware irq number
  55. * dev_config: array of device config structures which are using "irq" line
  56. * dev_count: size of dev_config array
  57. * regs: register configuration for shared irq block
  58. */
  59. struct spear_shirq {
  60. u32 irq;
  61. struct shirq_dev_config *dev_config;
  62. u32 dev_count;
  63. struct shirq_regs regs;
  64. };
  65. int spear_shirq_register(struct spear_shirq *shirq);
  66. #endif /* __PLAT_SHIRQ_H */