wm_hubs.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * wm_hubs.h -- WM899x common code
  4. *
  5. * Copyright 2009 Wolfson Microelectronics plc
  6. *
  7. * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
  8. */
  9. #ifndef _WM_HUBS_H
  10. #define _WM_HUBS_H
  11. #include <linux/completion.h>
  12. #include <linux/interrupt.h>
  13. #include <linux/list.h>
  14. #include <sound/control.h>
  15. struct snd_soc_component;
  16. extern const unsigned int wm_hubs_spkmix_tlv[];
  17. /* This *must* be the first element of the codec->private_data struct */
  18. struct wm_hubs_data {
  19. int dcs_codes_l;
  20. int dcs_codes_r;
  21. int dcs_readback_mode;
  22. int hp_startup_mode;
  23. int series_startup;
  24. int no_series_update;
  25. bool micd_scthr;
  26. bool no_cache_dac_hp_direct;
  27. struct list_head dcs_cache;
  28. bool (*check_class_w_digital)(struct snd_soc_component *);
  29. int micb1_delay;
  30. int micb2_delay;
  31. bool lineout1_se;
  32. bool lineout1n_ena;
  33. bool lineout1p_ena;
  34. bool lineout2_se;
  35. bool lineout2n_ena;
  36. bool lineout2p_ena;
  37. bool dcs_done_irq;
  38. struct completion dcs_done;
  39. struct snd_soc_component *component;
  40. };
  41. extern int wm_hubs_add_analogue_controls(struct snd_soc_component *);
  42. extern int wm_hubs_add_analogue_routes(struct snd_soc_component *, int, int);
  43. extern int wm_hubs_handle_analogue_pdata(struct snd_soc_component *,
  44. int lineout1_diff, int lineout2_diff,
  45. int lineout1fb, int lineout2fb,
  46. int jd_scthr, int jd_thr,
  47. int micbias1_dly, int micbias2_dly,
  48. int micbias1_lvl, int micbias2_lvl);
  49. extern irqreturn_t wm_hubs_dcs_done(int irq, void *data);
  50. extern void wm_hubs_vmid_ena(struct snd_soc_component *component);
  51. extern void wm_hubs_set_bias_level(struct snd_soc_component *component,
  52. enum snd_soc_bias_level level);
  53. extern void wm_hubs_update_class_w(struct snd_soc_component *component);
  54. extern const struct snd_kcontrol_new wm_hubs_hpl_mux;
  55. extern const struct snd_kcontrol_new wm_hubs_hpr_mux;
  56. #endif