David Keitel | 8927ee4 | 2013-03-19 17:25:19 -0700 | [diff] [blame] | 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 | |
| 13 | #ifndef __QPNP_MISC_H |
| 14 | #define __QPNP_MISC_H |
| 15 | |
| 16 | #include <linux/errno.h> |
| 17 | |
| 18 | #ifdef CONFIG_QPNP_MISC |
| 19 | /** |
| 20 | * qpnp_misc_irqs_available - check if IRQs are available |
| 21 | * |
| 22 | * @consumer_dev: device struct |
| 23 | * |
| 24 | * This function returns true if the MISC interrupts are available |
| 25 | * based on a check in the MISC peripheral revision registers. |
| 26 | * |
| 27 | * Any consumer of this function needs to reference a MISC device phandle |
| 28 | * using the qcom,misc-ref in their device tree node. |
| 29 | */ |
| 30 | |
| 31 | int qpnp_misc_irqs_available(struct device *consumer_dev); |
| 32 | #else |
| 33 | static int qpnp_misc_irq_available(struct device *consumer_dev) |
| 34 | { |
| 35 | return 0; |
| 36 | } |
| 37 | #endif |
| 38 | #endif |