/* SPDX-License-Identifier: GPL-2.0-only */ /* * cs42l42.h -- CS42L42 ALSA SoC audio driver header * * Copyright 2016-2022 Cirrus Logic, Inc. * * Author: James Schulman * Author: Brian Austin * Author: Michael White */ #ifndef __CS42L42_H__ #define __CS42L42_H__ #include #include #include #include #include #include #include #include #include #include struct cs42l42_private { struct regmap *regmap; struct device *dev; struct regulator_bulk_data supplies[CS42L42_NUM_SUPPLIES]; struct gpio_desc *reset_gpio; struct completion pdn_done; struct snd_soc_jack *jack; struct mutex irq_lock; int irq; int pll_config; u32 sclk; u32 srate; u8 plug_state; u8 hs_type; u8 ts_inv; u8 ts_dbnc_rise; u8 ts_dbnc_fall; u8 btn_det_init_dbnce; u8 btn_det_event_dbnce; u8 bias_thresholds[CS42L42_NUM_BIASES]; u8 hs_bias_ramp_rate; u8 hs_bias_ramp_time; u8 hs_bias_sense_en; u8 stream_use; bool hp_adc_up_pending; bool suspended; bool init_done; }; extern const struct regmap_config cs42l42_regmap; extern const struct snd_soc_component_driver cs42l42_soc_component; extern struct snd_soc_dai_driver cs42l42_dai; int cs42l42_suspend(struct device *dev); int cs42l42_resume(struct device *dev); void cs42l42_resume_restore(struct device *dev); int cs42l42_common_probe(struct cs42l42_private *cs42l42, const struct snd_soc_component_driver *component_drv, struct snd_soc_dai_driver *dai); int cs42l42_init(struct cs42l42_private *cs42l42); void cs42l42_common_remove(struct cs42l42_private *cs42l42); #endif /* __CS42L42_H__ */