aboutsummaryrefslogtreecommitdiff
path: root/techpack/audio/include/asoc/wcd-irq.h
blob: 63502f828ed84280c19d0a8b6bf7f2d2ce9ce7a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 */

#ifndef __WCD_IRQ_H_
#define __WCD_IRQ_H_

#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/regmap.h>

struct wcd_irq_info {
	struct regmap_irq_chip *wcd_regmap_irq_chip;
	char *codec_name;
	struct regmap *regmap;
	struct regmap_irq_chip_data *irq_chip;
	struct device *dev;
};

#if IS_ENABLED(CONFIG_WCD9XXX_CODEC_CORE)
int wcd_irq_init(struct wcd_irq_info *irq_info, struct irq_domain **virq);
int wcd_irq_exit(struct wcd_irq_info *irq_info, struct irq_domain *virq);
int wcd_request_irq(struct wcd_irq_info *irq_info, int irq, const char *name,
			irq_handler_t handler, void *data);
void wcd_free_irq(struct wcd_irq_info *irq_info, int irq, void *data);
void wcd_enable_irq(struct wcd_irq_info *irq_info, int irq);
void wcd_disable_irq(struct wcd_irq_info *irq_info, int irq);
#else
static inline int wcd_irq_init(struct wcd_irq_info *irq_info,
			       struct irq_domain **virq)
{
	return 0;
};
static inline int wcd_irq_exit(struct wcd_irq_info *irq_info,
			       struct irq_domain *virq)
{
	return 0;
};
static inline int wcd_request_irq(struct wcd_irq_info *irq,
				  int irq, const char *name,
				  irq_handler_t handler, void *data)
{
	return 0;
};
static inline void wcd_free_irq(struct wcd_irq_info *irq, int irq, void *data);
{
};
static inline void wcd_enable_irq(struct wcd_irq_info *irq, int irq);
{
};
static inline void wcd_disable_irq(struct wcd_irq_info *irq, int irq);
{
};
#endif
#endif /* __WCD_IRQ_H_ */