hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/include/linux/mfd/madera/core.h
....@@ -1,20 +1,18 @@
1
-// SPDX-License-Identifier: GPL-2.0
1
+/* SPDX-License-Identifier: GPL-2.0-only */
22 /*
33 * MFD internals for Cirrus Logic Madera codecs
44 *
55 * 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.
106 */
117
128 #ifndef MADERA_CORE_H
139 #define MADERA_CORE_H
1410
11
+#include <linux/clk.h>
1512 #include <linux/gpio/consumer.h>
1613 #include <linux/interrupt.h>
1714 #include <linux/mfd/madera/pdata.h>
15
+#include <linux/mutex.h>
1816 #include <linux/notifier.h>
1917 #include <linux/regmap.h>
2018 #include <linux/regulator/consumer.h>
....@@ -25,17 +23,32 @@
2523 CS47L85 = 2,
2624 CS47L90 = 3,
2725 CS47L91 = 4,
26
+ CS47L92 = 5,
27
+ CS47L93 = 6,
2828 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
2938 };
3039
3140 #define MADERA_MAX_CORE_SUPPLIES 2
3241 #define MADERA_MAX_GPIOS 40
3342
43
+#define CS47L15_NUM_GPIOS 15
3444 #define CS47L35_NUM_GPIOS 16
3545 #define CS47L85_NUM_GPIOS 40
3646 #define CS47L90_NUM_GPIOS 38
47
+#define CS47L92_NUM_GPIOS 16
3748
3849 #define MADERA_MAX_MICBIAS 4
50
+
51
+#define MADERA_MAX_HP_OUTPUT 3
3952
4053 /* Notifier events */
4154 #define MADERA_NOTIFY_VOICE_TRIGGER 0x1
....@@ -148,7 +161,9 @@
148161 * @internal_dcvdd: true if DCVDD is supplied from the internal LDO1
149162 * @pdata: our pdata
150163 * @irq_dev: the irqchip child driver device
164
+ * @irq_data: pointer to irqchip data for the child irqchip driver
151165 * @irq: host irq number from SPI or I2C configuration
166
+ * @mclk: Structure holding clock supplies
152167 * @out_clamp: indicates output clamp state for each analogue output
153168 * @out_shorted: indicates short circuit state for each analogue output
154169 * @hp_ena: bitflags of enable state for the headphone outputs
....@@ -175,12 +190,19 @@
175190 struct madera_pdata pdata;
176191
177192 struct device *irq_dev;
193
+ struct regmap_irq_chip_data *irq_data;
178194 int irq;
195
+
196
+ struct clk_bulk_data mclk[MADERA_NUM_MCLK];
179197
180198 unsigned int num_micbias;
181199 unsigned int num_childbias[MADERA_MAX_MICBIAS];
182200
183201 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];
184206
185207 struct blocking_notifier_head notifier;
186208 };