Abhijeet Dharmapurikar | c013f0a | 2011-04-05 14:40:53 -0700 | [diff] [blame] | 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 | |
| 18 | #ifndef __MFD_PM8XXX_IRQ_H |
| 19 | #define __MFD_PM8XXX_IRQ_H |
| 20 | |
| 21 | #include <linux/errno.h> |
| 22 | #include <linux/err.h> |
| 23 | |
| 24 | struct pm8xxx_irq_core_data { |
| 25 | u32 rev; |
| 26 | int nirqs; |
Anirudh Ghayal | ca42c7de | 2011-11-21 10:42:07 +0530 | [diff] [blame] | 27 | unsigned int base_addr; |
Abhijeet Dharmapurikar | c013f0a | 2011-04-05 14:40:53 -0700 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | struct pm8xxx_irq_platform_data { |
| 31 | int irq_base; |
| 32 | struct pm8xxx_irq_core_data irq_cdata; |
| 33 | int devirq; |
| 34 | int irq_trigger_flag; |
Jay Chokshi | 1097519 | 2011-09-23 19:16:39 -0700 | [diff] [blame] | 35 | int dev_id; |
Abhijeet Dharmapurikar | c013f0a | 2011-04-05 14:40:53 -0700 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | struct pm_irq_chip; |
| 39 | |
| 40 | #ifdef CONFIG_MFD_PM8XXX_IRQ |
| 41 | int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq); |
Stephen Boyd | 7a05bd7 | 2012-02-21 01:18:46 -0800 | [diff] [blame] | 42 | struct pm_irq_chip *pm8xxx_irq_init(struct device *dev, |
Abhijeet Dharmapurikar | c013f0a | 2011-04-05 14:40:53 -0700 | [diff] [blame] | 43 | const struct pm8xxx_irq_platform_data *pdata); |
Stephen Boyd | 7a05bd7 | 2012-02-21 01:18:46 -0800 | [diff] [blame] | 44 | int pm8xxx_irq_exit(struct pm_irq_chip *chip); |
Abhijeet Dharmapurikar | c013f0a | 2011-04-05 14:40:53 -0700 | [diff] [blame] | 45 | #else |
| 46 | static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq) |
| 47 | { |
| 48 | return -ENXIO; |
| 49 | } |
Stephen Boyd | 7a05bd7 | 2012-02-21 01:18:46 -0800 | [diff] [blame] | 50 | static inline struct pm_irq_chip *pm8xxx_irq_init(const struct device *dev, |
Abhijeet Dharmapurikar | c013f0a | 2011-04-05 14:40:53 -0700 | [diff] [blame] | 51 | const struct pm8xxx_irq_platform_data *pdata) |
| 52 | { |
| 53 | return ERR_PTR(-ENXIO); |
| 54 | } |
Stephen Boyd | 7a05bd7 | 2012-02-21 01:18:46 -0800 | [diff] [blame] | 55 | static inline int pm8xxx_irq_exit(struct pm_irq_chip *chip) |
Abhijeet Dharmapurikar | c013f0a | 2011-04-05 14:40:53 -0700 | [diff] [blame] | 56 | { |
| 57 | return -ENXIO; |
| 58 | } |
| 59 | #endif /* CONFIG_MFD_PM8XXX_IRQ */ |
| 60 | #endif /* __MFD_PM8XXX_IRQ_H */ |