blob: 78fbed3c969de9010c559e569bfe166b32858de3 [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);
Stephen Boyd7a05bd72012-02-21 01:18:46 -080042struct pm_irq_chip *pm8xxx_irq_init(struct device *dev,
Abhijeet Dharmapurikarc013f0a2011-04-05 14:40:53 -070043 const struct pm8xxx_irq_platform_data *pdata);
Stephen Boyd7a05bd72012-02-21 01:18:46 -080044int pm8xxx_irq_exit(struct pm_irq_chip *chip);
Abhijeet Dharmapurikarc013f0a2011-04-05 14:40:53 -070045#else
46static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq)
47{
48 return -ENXIO;
49}
Stephen Boyd7a05bd72012-02-21 01:18:46 -080050static inline struct pm_irq_chip *pm8xxx_irq_init(const struct device *dev,
Abhijeet Dharmapurikarc013f0a2011-04-05 14:40:53 -070051 const struct pm8xxx_irq_platform_data *pdata)
52{
53 return ERR_PTR(-ENXIO);
54}
Stephen Boyd7a05bd72012-02-21 01:18:46 -080055static inline int pm8xxx_irq_exit(struct pm_irq_chip *chip)
Abhijeet Dharmapurikarc013f0a2011-04-05 14:40:53 -070056{
57 return -ENXIO;
58}
59#endif /* CONFIG_MFD_PM8XXX_IRQ */
60#endif /* __MFD_PM8XXX_IRQ_H */