/include/linux/mfd/pm8xxx/irq.h

https://github.com/airy09/android_kernel_sony_apq8064 · C Header · 60 lines · 38 code · 6 blank · 16 comment · 0 complexity · 0f748410f6ad8fad1825cd80174c22fe MD5 · raw file

  1. /*
  2. * Copyright (c) 2011, The Linux Foundation. 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. unsigned int base_addr;
  25. };
  26. struct pm8xxx_irq_platform_data {
  27. int irq_base;
  28. struct pm8xxx_irq_core_data irq_cdata;
  29. int devirq;
  30. int irq_trigger_flag;
  31. int dev_id;
  32. };
  33. struct pm_irq_chip;
  34. #ifdef CONFIG_MFD_PM8XXX_IRQ
  35. int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq);
  36. struct pm_irq_chip *pm8xxx_irq_init(struct device *dev,
  37. const struct pm8xxx_irq_platform_data *pdata);
  38. int pm8xxx_irq_exit(struct pm_irq_chip *chip);
  39. #else
  40. static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq)
  41. {
  42. return -ENXIO;
  43. }
  44. static inline struct pm_irq_chip *pm8xxx_irq_init(const struct device *dev,
  45. const struct pm8xxx_irq_platform_data *pdata)
  46. {
  47. return ERR_PTR(-ENXIO);
  48. }
  49. static inline int pm8xxx_irq_exit(struct pm_irq_chip *chip)
  50. {
  51. return -ENXIO;
  52. }
  53. #endif /* CONFIG_MFD_PM8XXX_IRQ */
  54. #endif /* __MFD_PM8XXX_IRQ_H */