xref: /openbmc/linux/sound/soc/codecs/cs42l42.h (revision d3741027)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * cs42l42.h -- CS42L42 ALSA SoC audio driver header
4  *
5  * Copyright 2016-2022 Cirrus Logic, Inc.
6  *
7  * Author: James Schulman <james.schulman@cirrus.com>
8  * Author: Brian Austin <brian.austin@cirrus.com>
9  * Author: Michael White <michael.white@cirrus.com>
10  */
11 
12 #ifndef __CS42L42_H__
13 #define __CS42L42_H__
14 
15 #include <linux/mutex.h>
16 #include <sound/jack.h>
17 #include <sound/cs42l42.h>
18 
19 static const char *const cs42l42_supply_names[CS42L42_NUM_SUPPLIES] = {
20 	"VA",
21 	"VP",
22 	"VCP",
23 	"VD_FILT",
24 	"VL",
25 };
26 
27 struct  cs42l42_private {
28 	struct regmap *regmap;
29 	struct device *dev;
30 	struct regulator_bulk_data supplies[CS42L42_NUM_SUPPLIES];
31 	struct gpio_desc *reset_gpio;
32 	struct completion pdn_done;
33 	struct snd_soc_jack *jack;
34 	struct mutex irq_lock;
35 	int pll_config;
36 	int bclk;
37 	u32 sclk;
38 	u32 srate;
39 	u8 plug_state;
40 	u8 hs_type;
41 	u8 ts_inv;
42 	u8 ts_dbnc_rise;
43 	u8 ts_dbnc_fall;
44 	u8 btn_det_init_dbnce;
45 	u8 btn_det_event_dbnce;
46 	u8 bias_thresholds[CS42L42_NUM_BIASES];
47 	u8 hs_bias_ramp_rate;
48 	u8 hs_bias_ramp_time;
49 	u8 hs_bias_sense_en;
50 	u8 stream_use;
51 	bool hp_adc_up_pending;
52 	bool suspended;
53 };
54 
55 #endif /* __CS42L42_H__ */
56