qpnp-misc.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* Copyright (c) 2013, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef __QPNP_MISC_H
  13. #define __QPNP_MISC_H
  14. #include <linux/errno.h>
  15. #ifdef CONFIG_QPNP_MISC
  16. /**
  17. * qpnp_misc_irqs_available - check if IRQs are available
  18. *
  19. * @consumer_dev: device struct
  20. *
  21. * This function returns true if the MISC interrupts are available
  22. * based on a check in the MISC peripheral revision registers.
  23. *
  24. * Any consumer of this function needs to reference a MISC device phandle
  25. * using the qcom,misc-ref in their device tree node.
  26. */
  27. int qpnp_misc_irqs_available(struct device *consumer_dev);
  28. #else
  29. static int qpnp_misc_irqs_available(struct device *consumer_dev)
  30. {
  31. return 0;
  32. }
  33. #endif
  34. #endif