.. | .. |
---|
1 | | -// SPDX-License-Identifier: GPL-2.0 |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
2 | 2 | /* |
---|
3 | 3 | * MFD internals for Cirrus Logic Madera codecs |
---|
4 | 4 | * |
---|
5 | 5 | * Copyright (C) 2015-2018 Cirrus Logic |
---|
6 | | - * |
---|
7 | | - * This program is free software; you can redistribute it and/or modify |
---|
8 | | - * it under the terms of the GNU General Public License as published by the |
---|
9 | | - * Free Software Foundation; version 2. |
---|
10 | 6 | */ |
---|
11 | 7 | |
---|
12 | 8 | #ifndef MADERA_CORE_H |
---|
13 | 9 | #define MADERA_CORE_H |
---|
14 | 10 | |
---|
| 11 | +#include <linux/clk.h> |
---|
15 | 12 | #include <linux/gpio/consumer.h> |
---|
16 | 13 | #include <linux/interrupt.h> |
---|
17 | 14 | #include <linux/mfd/madera/pdata.h> |
---|
| 15 | +#include <linux/mutex.h> |
---|
18 | 16 | #include <linux/notifier.h> |
---|
19 | 17 | #include <linux/regmap.h> |
---|
20 | 18 | #include <linux/regulator/consumer.h> |
---|
.. | .. |
---|
25 | 23 | CS47L85 = 2, |
---|
26 | 24 | CS47L90 = 3, |
---|
27 | 25 | CS47L91 = 4, |
---|
| 26 | + CS47L92 = 5, |
---|
| 27 | + CS47L93 = 6, |
---|
28 | 28 | WM1840 = 7, |
---|
| 29 | + CS47L15 = 8, |
---|
| 30 | + CS42L92 = 9, |
---|
| 31 | +}; |
---|
| 32 | + |
---|
| 33 | +enum { |
---|
| 34 | + MADERA_MCLK1, |
---|
| 35 | + MADERA_MCLK2, |
---|
| 36 | + MADERA_MCLK3, |
---|
| 37 | + MADERA_NUM_MCLK |
---|
29 | 38 | }; |
---|
30 | 39 | |
---|
31 | 40 | #define MADERA_MAX_CORE_SUPPLIES 2 |
---|
32 | 41 | #define MADERA_MAX_GPIOS 40 |
---|
33 | 42 | |
---|
| 43 | +#define CS47L15_NUM_GPIOS 15 |
---|
34 | 44 | #define CS47L35_NUM_GPIOS 16 |
---|
35 | 45 | #define CS47L85_NUM_GPIOS 40 |
---|
36 | 46 | #define CS47L90_NUM_GPIOS 38 |
---|
| 47 | +#define CS47L92_NUM_GPIOS 16 |
---|
37 | 48 | |
---|
38 | 49 | #define MADERA_MAX_MICBIAS 4 |
---|
| 50 | + |
---|
| 51 | +#define MADERA_MAX_HP_OUTPUT 3 |
---|
39 | 52 | |
---|
40 | 53 | /* Notifier events */ |
---|
41 | 54 | #define MADERA_NOTIFY_VOICE_TRIGGER 0x1 |
---|
.. | .. |
---|
148 | 161 | * @internal_dcvdd: true if DCVDD is supplied from the internal LDO1 |
---|
149 | 162 | * @pdata: our pdata |
---|
150 | 163 | * @irq_dev: the irqchip child driver device |
---|
| 164 | + * @irq_data: pointer to irqchip data for the child irqchip driver |
---|
151 | 165 | * @irq: host irq number from SPI or I2C configuration |
---|
| 166 | + * @mclk: Structure holding clock supplies |
---|
152 | 167 | * @out_clamp: indicates output clamp state for each analogue output |
---|
153 | 168 | * @out_shorted: indicates short circuit state for each analogue output |
---|
154 | 169 | * @hp_ena: bitflags of enable state for the headphone outputs |
---|
.. | .. |
---|
175 | 190 | struct madera_pdata pdata; |
---|
176 | 191 | |
---|
177 | 192 | struct device *irq_dev; |
---|
| 193 | + struct regmap_irq_chip_data *irq_data; |
---|
178 | 194 | int irq; |
---|
| 195 | + |
---|
| 196 | + struct clk_bulk_data mclk[MADERA_NUM_MCLK]; |
---|
179 | 197 | |
---|
180 | 198 | unsigned int num_micbias; |
---|
181 | 199 | unsigned int num_childbias[MADERA_MAX_MICBIAS]; |
---|
182 | 200 | |
---|
183 | 201 | struct snd_soc_dapm_context *dapm; |
---|
| 202 | + struct mutex dapm_ptr_lock; |
---|
| 203 | + unsigned int hp_ena; |
---|
| 204 | + bool out_clamp[MADERA_MAX_HP_OUTPUT]; |
---|
| 205 | + bool out_shorted[MADERA_MAX_HP_OUTPUT]; |
---|
184 | 206 | |
---|
185 | 207 | struct blocking_notifier_head notifier; |
---|
186 | 208 | }; |
---|