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 <dt-bindings/sound/cs42l42.h> 16 #include <linux/device.h> 17 #include <linux/gpio.h> 18 #include <linux/mutex.h> 19 #include <linux/regmap.h> 20 #include <linux/regulator/consumer.h> 21 #include <sound/jack.h> 22 #include <sound/cs42l42.h> 23 24 struct cs42l42_private { 25 struct regmap *regmap; 26 struct device *dev; 27 struct regulator_bulk_data supplies[CS42L42_NUM_SUPPLIES]; 28 struct gpio_desc *reset_gpio; 29 struct completion pdn_done; 30 struct snd_soc_jack *jack; 31 struct mutex irq_lock; 32 int pll_config; 33 int bclk; 34 u32 sclk; 35 u32 srate; 36 u8 plug_state; 37 u8 hs_type; 38 u8 ts_inv; 39 u8 ts_dbnc_rise; 40 u8 ts_dbnc_fall; 41 u8 btn_det_init_dbnce; 42 u8 btn_det_event_dbnce; 43 u8 bias_thresholds[CS42L42_NUM_BIASES]; 44 u8 hs_bias_ramp_rate; 45 u8 hs_bias_ramp_time; 46 u8 hs_bias_sense_en; 47 u8 stream_use; 48 bool hp_adc_up_pending; 49 bool suspended; 50 }; 51 52 #endif /* __CS42L42_H__ */ 53