PageRenderTime 32ms CodeModel.GetById 28ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/include/linux/mfd/pm8xxx/irq.h

https://github.com/airy09/android_kernel_sony_apq8064
C Header | 60 lines | 38 code | 6 blank | 16 comment | 0 complexity | 0f748410f6ad8fad1825cd80174c22fe MD5 | raw file
 1/*
 2 * Copyright (c) 2011, The Linux Foundation. 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	unsigned int	base_addr;
28};
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;
35	int				dev_id;
36};
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 *pm8xxx_irq_init(struct device *dev,
43				const struct pm8xxx_irq_platform_data *pdata);
44int 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 *pm8xxx_irq_init(const struct device *dev,
51				const struct pm8xxx_irq_platform_data *pdata)
52{
53	return ERR_PTR(-ENXIO);
54}
55static inline int pm8xxx_irq_exit(struct pm_irq_chip *chip)
56{
57	return -ENXIO;
58}
59#endif /* CONFIG_MFD_PM8XXX_IRQ */
60#endif /* __MFD_PM8XXX_IRQ_H */