blob: f83d6b43ecbb2bcf878cdae76c7ab0bbf4c370ac [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;
27};
28
29struct pm8xxx_irq_platform_data {
30 int irq_base;
31 struct pm8xxx_irq_core_data irq_cdata;
32 int devirq;
33 int irq_trigger_flag;
34};
35
36struct pm_irq_chip;
37
38#ifdef CONFIG_MFD_PM8XXX_IRQ
39int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq);
Bill Pembertonf791be42012-11-19 13:23:04 -050040struct pm_irq_chip *pm8xxx_irq_init(struct device *dev,
Abhijeet Dharmapurikarc013f0a2011-04-05 14:40:53 -070041 const struct pm8xxx_irq_platform_data *pdata);
Bill Pemberton4740f732012-11-19 13:26:01 -050042int pm8xxx_irq_exit(struct pm_irq_chip *chip);
Abhijeet Dharmapurikarc013f0a2011-04-05 14:40:53 -070043#else
44static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq)
45{
46 return -ENXIO;
47}
Bill Pembertonf791be42012-11-19 13:23:04 -050048static inline struct pm_irq_chip *pm8xxx_irq_init(
Abhijeet Dharmapurikarc013f0a2011-04-05 14:40:53 -070049 const struct device *dev,
50 const struct pm8xxx_irq_platform_data *pdata)
51{
52 return ERR_PTR(-ENXIO);
53}
Bill Pemberton4740f732012-11-19 13:26:01 -050054static inline int pm8xxx_irq_exit(struct pm_irq_chip *chip)
Abhijeet Dharmapurikarc013f0a2011-04-05 14:40:53 -070055{
56 return -ENXIO;
57}
58#endif /* CONFIG_MFD_PM8XXX_IRQ */
59#endif /* __MFD_PM8XXX_IRQ_H */