1 /* SPDX-License-Identifier: GPL-2.0 */
3 * CS42L43 core driver external data
5 * Copyright (C) 2022-2023 Cirrus Logic, Inc. and
6 * Cirrus Logic International Semiconductor Ltd.
9 #include <linux/completion.h>
10 #include <linux/device.h>
11 #include <linux/gpio/consumer.h>
12 #include <linux/mutex.h>
13 #include <linux/regmap.h>
14 #include <linux/regulator/consumer.h>
15 #include <linux/soundwire/sdw.h>
16 #include <linux/workqueue.h>
18 #ifndef CS42L43_CORE_EXT_H
19 #define CS42L43_CORE_EXT_H
21 #define CS42L43_N_SUPPLIES 3
23 enum cs42l43_irq_numbers {
24 CS42L43_PLL_LOST_LOCK,
27 CS42L43_HP_STARTUP_DONE,
28 CS42L43_HP_SHUTDOWN_DONE,
30 CS42L43_TIPSENSE_UNPLUG_DB,
31 CS42L43_TIPSENSE_PLUG_DB,
32 CS42L43_RINGSENSE_UNPLUG_DB,
33 CS42L43_RINGSENSE_PLUG_DB,
34 CS42L43_TIPSENSE_UNPLUG_PDET,
35 CS42L43_TIPSENSE_PLUG_PDET,
36 CS42L43_RINGSENSE_UNPLUG_PDET,
37 CS42L43_RINGSENSE_PLUG_PDET,
39 CS42L43_HS2_BIAS_SENSE,
40 CS42L43_HS1_BIAS_SENSE,
41 CS42L43_DC_DETECT1_FALSE,
42 CS42L43_DC_DETECT1_TRUE,
43 CS42L43_HSBIAS_CLAMPED,
44 CS42L43_HS3_4_BIAS_SENSE,
46 CS42L43_AMP2_CLK_STOP_FAULT,
47 CS42L43_AMP1_CLK_STOP_FAULT,
48 CS42L43_AMP2_VDDSPK_FAULT,
49 CS42L43_AMP1_VDDSPK_FAULT,
50 CS42L43_AMP2_SHUTDOWN_DONE,
51 CS42L43_AMP1_SHUTDOWN_DONE,
52 CS42L43_AMP2_STARTUP_DONE,
53 CS42L43_AMP1_STARTUP_DONE,
54 CS42L43_AMP2_THERM_SHDN,
55 CS42L43_AMP1_THERM_SHDN,
56 CS42L43_AMP2_THERM_WARN,
57 CS42L43_AMP1_THERM_WARN,
69 CS42L43_HP_LOADDET_DONE,
74 struct regmap *regmap;
75 struct sdw_slave *sdw;
77 struct regulator *vdd_p;
78 struct regulator *vdd_d;
79 struct regulator_bulk_data core_supplies[CS42L43_N_SUPPLIES];
81 struct gpio_desc *reset;
84 struct regmap_irq_chip irq_chip;
85 struct regmap_irq_chip_data *irq_data;
87 struct work_struct boot_work;
88 struct completion device_attach;
89 struct completion device_detach;
90 struct completion firmware_download;
93 unsigned int sdw_freq;
94 /* Lock to gate control of the PLL and its sources. */
95 struct mutex pll_lock;
102 #endif /* CS42L43_CORE_EXT_H */