.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2014 MediaTek Inc. |
---|
3 | 4 | * Author: Flora Fu, MediaTek |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify |
---|
6 | | - * it under the terms of the GNU General Public License version 2 as |
---|
7 | | - * published by the Free Software Foundation. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope that it will be useful, |
---|
10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | | - * GNU General Public License for more details. |
---|
13 | 5 | */ |
---|
14 | 6 | |
---|
15 | 7 | #ifndef __MFD_MT6397_CORE_H__ |
---|
16 | 8 | #define __MFD_MT6397_CORE_H__ |
---|
| 9 | + |
---|
| 10 | +#include <linux/mutex.h> |
---|
| 11 | +#include <linux/notifier.h> |
---|
| 12 | + |
---|
| 13 | +enum chip_id { |
---|
| 14 | + MT6323_CHIP_ID = 0x23, |
---|
| 15 | + MT6358_CHIP_ID = 0x58, |
---|
| 16 | + MT6391_CHIP_ID = 0x91, |
---|
| 17 | + MT6397_CHIP_ID = 0x97, |
---|
| 18 | +}; |
---|
17 | 19 | |
---|
18 | 20 | enum mt6397_irq_numbers { |
---|
19 | 21 | MT6397_IRQ_SPKL_AB = 0, |
---|
.. | .. |
---|
54 | 56 | struct mt6397_chip { |
---|
55 | 57 | struct device *dev; |
---|
56 | 58 | struct regmap *regmap; |
---|
| 59 | + struct notifier_block pm_nb; |
---|
57 | 60 | int irq; |
---|
58 | 61 | struct irq_domain *irq_domain; |
---|
59 | 62 | struct mutex irqlock; |
---|
.. | .. |
---|
62 | 65 | u16 irq_masks_cache[2]; |
---|
63 | 66 | u16 int_con[2]; |
---|
64 | 67 | u16 int_status[2]; |
---|
| 68 | + u16 chip_id; |
---|
| 69 | + void *irq_data; |
---|
65 | 70 | }; |
---|
66 | 71 | |
---|
| 72 | +int mt6358_irq_init(struct mt6397_chip *chip); |
---|
| 73 | +int mt6397_irq_init(struct mt6397_chip *chip); |
---|
| 74 | + |
---|
67 | 75 | #endif /* __MFD_MT6397_CORE_H__ */ |
---|