irq.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. /*
  14. * Qualcomm PMIC irq 8xxx driver header file
  15. *
  16. */
  17. #ifndef __MFD_PM8XXX_IRQ_H
  18. #define __MFD_PM8XXX_IRQ_H
  19. #include <linux/errno.h>
  20. #include <linux/err.h>
  21. struct pm8xxx_irq_core_data {
  22. u32 rev;
  23. int nirqs;
  24. };
  25. struct pm8xxx_irq_platform_data {
  26. int irq_base;
  27. struct pm8xxx_irq_core_data irq_cdata;
  28. int devirq;
  29. int irq_trigger_flag;
  30. };
  31. struct pm_irq_chip;
  32. #ifdef CONFIG_MFD_PM8XXX_IRQ
  33. int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq);
  34. struct pm_irq_chip *pm8xxx_irq_init(struct device *dev,
  35. const struct pm8xxx_irq_platform_data *pdata);
  36. int pm8xxx_irq_exit(struct pm_irq_chip *chip);
  37. #else
  38. static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq)
  39. {
  40. return -ENXIO;
  41. }
  42. static inline struct pm_irq_chip *pm8xxx_irq_init(
  43. const struct device *dev,
  44. const struct pm8xxx_irq_platform_data *pdata)
  45. {
  46. return ERR_PTR(-ENXIO);
  47. }
  48. static inline int pm8xxx_irq_exit(struct pm_irq_chip *chip)
  49. {
  50. return -ENXIO;
  51. }
  52. #endif /* CONFIG_MFD_PM8XXX_IRQ */
  53. #endif /* __MFD_PM8XXX_IRQ_H */