blob: 1e1fe6cad47a061fc69015a7bec0103d623a7ab6 [file] [log] [blame]
Abhijeet Dharmapurikarc013f0a2011-04-05 14:40:53 -07001/*
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
24struct pm8xxx_irq_core_data {
25 u32 rev;
26 int nirqs;
Anirudh Ghayalca42c7de2011-11-21 10:42:07 +053027 unsigned int base_addr;
Abhijeet Dharmapurikarc013f0a2011-04-05 14:40:53 -070028};
29
30struct 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 Chokshi10975192011-09-23 19:16:39 -070035 int dev_id;
Abhijeet Dharmapurikarc013f0a2011-04-05 14:40:53 -070036};
37
38struct pm_irq_chip;
39
40#ifdef CONFIG_MFD_PM8XXX_IRQ
41int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq);
42struct pm_irq_chip * __devinit pm8xxx_irq_init(struct device *dev,
43 const struct pm8xxx_irq_platform_data *pdata);
44int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip);
45#else
46static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq)
47{
48 return -ENXIO;
49}
50static inline struct pm_irq_chip * __devinit pm8xxx_irq_init(
51 const struct device *dev,
52 const struct pm8xxx_irq_platform_data *pdata)
53{
54 return ERR_PTR(-ENXIO);
55}
56static inline int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip)
57{
58 return -ENXIO;
59}
60#endif /* CONFIG_MFD_PM8XXX_IRQ */
61#endif /* __MFD_PM8XXX_IRQ_H */