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 #ifndef CS42L43_CORE_EXT_H
10 #define CS42L43_CORE_EXT_H
12 #include <linux/completion.h>
13 #include <linux/mutex.h>
14 #include <linux/regmap.h>
15 #include <linux/regulator/consumer.h>
16 #include <linux/workqueue.h>
18 #define CS42L43_N_SUPPLIES 3
24 enum cs42l43_irq_numbers {
25 CS42L43_PLL_LOST_LOCK,
28 CS42L43_HP_STARTUP_DONE,
29 CS42L43_HP_SHUTDOWN_DONE,
31 CS42L43_TIPSENSE_UNPLUG_DB,
32 CS42L43_TIPSENSE_PLUG_DB,
33 CS42L43_RINGSENSE_UNPLUG_DB,
34 CS42L43_RINGSENSE_PLUG_DB,
35 CS42L43_TIPSENSE_UNPLUG_PDET,
36 CS42L43_TIPSENSE_PLUG_PDET,
37 CS42L43_RINGSENSE_UNPLUG_PDET,
38 CS42L43_RINGSENSE_PLUG_PDET,
40 CS42L43_HS2_BIAS_SENSE,
41 CS42L43_HS1_BIAS_SENSE,
42 CS42L43_DC_DETECT1_FALSE,
43 CS42L43_DC_DETECT1_TRUE,
44 CS42L43_HSBIAS_CLAMPED,
45 CS42L43_HS3_4_BIAS_SENSE,
47 CS42L43_AMP2_CLK_STOP_FAULT,
48 CS42L43_AMP1_CLK_STOP_FAULT,
49 CS42L43_AMP2_VDDSPK_FAULT,
50 CS42L43_AMP1_VDDSPK_FAULT,
51 CS42L43_AMP2_SHUTDOWN_DONE,
52 CS42L43_AMP1_SHUTDOWN_DONE,
53 CS42L43_AMP2_STARTUP_DONE,
54 CS42L43_AMP1_STARTUP_DONE,
55 CS42L43_AMP2_THERM_SHDN,
56 CS42L43_AMP1_THERM_SHDN,
57 CS42L43_AMP2_THERM_WARN,
58 CS42L43_AMP1_THERM_WARN,
70 CS42L43_HP_LOADDET_DONE,
75 struct regmap *regmap;
76 struct sdw_slave *sdw;
78 struct regulator *vdd_p;
79 struct regulator *vdd_d;
80 struct regulator_bulk_data core_supplies[CS42L43_N_SUPPLIES];
82 struct gpio_desc *reset;
85 struct regmap_irq_chip irq_chip;
86 struct regmap_irq_chip_data *irq_data;
88 struct work_struct boot_work;
89 struct completion device_attach;
90 struct completion device_detach;
91 struct completion firmware_download;
94 unsigned int sdw_freq;
95 /* Lock to gate control of the PLL and its sources. */
96 struct mutex pll_lock;
103 #endif /* CS42L43_CORE_EXT_H */